I want to have a link to another page, with particular subject, How can I pass the id ?
&
-
You need to enclose your variable in a PHP tag:
subject;?>
Add Topic
There is also a short form echo tag enabled on most PHP servers = $variable ?>
On the subsequent page you retrieve the parameter from the GET array:
$subject = $_GET['id'];
If you're passing this value to the database you should do some validation:
if ($_GET['id']) { // check parameter was passed
$subject = int_val($_GET['id']) // cast whatever was passed to integer
} else {
// handle no subject case
}
- 热议问题