I am currently using a programm to send newsletters, in every newsletter I am sending a link so the customer can look at his own data and sub/unsub from newsletters. The link I am using now is this: http://localhost/Mail/subscriptionseditklant.php?ID=77
and is made with this code:
<a href="subscriptionsedit.php?page=1&ID=<?=$objResult["ID"];?>">subscriptions</a>
For security reasons I dont want to show the customer ID=77
part so he can't modify it to look at other customers info. My idea was to hide the ID inside random numbers (4 in front and 4 behind the ID) which I have done using this:
<a href="subscriptionsedit.php?page=1&ID=<? echo rand(1000,9999); ?><?=$objResult["ID"];?><? echo rand(1000,9999); ?>">subscriptions</a>
This will display a link like this one: http://localhost/Mail/subscriptionsedit.php?page=1&ID=9755774430
On the subscriptionsedit.php I am using $_GET
to get the ID from the url.
My question:
Is there any way I can get $_GET
to ignore the first 4 and last 4 numbers from the ID so it will capture the right ID?
I have tried to google for something like this but since I dont know how it is called (if it even exists) I was not able to find anything. I hope my question is clear but if you have any question just ask them! (Also if anyone knows a better title for this question feel free to edit it because I have no idea how to name this question)