is it possible to use GET or something like this to load a record into a form ?.
E.g I have for formA where it has a foreach list of all the clients in the DB , at the end of each row I have a link which is called ‘edit’ , this link goes to formB.php and is set out like this >>
sitename.com/FormB.php?token=<?php echo $ID ?>
This gives you an url that looks like the following :
http://www.sitename.com/formB.php?token=25
The link above would for example load the record with ID 25 into the second form.
I am not sure how to handle the link in the second form though, can you echo GET ID in the second form, or would it have to be GET token ?.
In PHP, there’s the predefined
$_GETvariable. This is basically an array holding allGETparemeters:So, considering your url and query:
To avoid security exploits, we need to use the function
mysql_real_escape_stringaround the user-defined parameter when using strings. When using other types such as numbers you can just parse it to a number.