encrypt url for edit page or view data etc.

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
lissa
User
Posts: 73

encrypt url for edit page or view data etc.

Post by lissa »

Hi master,
how to encrypt url for edit page or view data etc in PHPMaker v2024.14?
Thanks


mobhar
User
Posts: 11905

Post by mobhar »

Currently, there is no such feature.


lissa
User
Posts: 73

Post by lissa »

is there another way?
because user can easily change ID 4 to 5 at the end of the url like this example http://localhost/cust/productsedit/4


mobhar
User
Posts: 11905

Post by mobhar »

You may protect the certain record based on your own business-logic by using Row_Selected server event.


lissa
User
Posts: 73

Post by lissa »

I tried with the following code,

$my_id = $rs["id_brand"];
if ($rs["id_brand"] != $my_id && CurrentPageID() == "edit") {
$this->terminate("brandlist");
}

how to make $rs["id_brand"] with $my_id value detected as manually changed in url by user?
is there a way that I don't know?

if I change the value of $my_id and specify the value manually the code runs well:

if ($rs["id_brand"] != "1" && CurrentPageID() == "edit") {
$this->terminate("brandlist");
}

mobhar
User
Posts: 11905

Post by mobhar »

That Row_Selected server event is not for that. As its name said, this event will be fired after a row is selected, and not when a row is updating.

If you want to prevent the record to be updated based on your own business logic, then you should use Row_Updating server event.


Post Reply