In short I want to get the ID from an URL, save it into a variable and represent it in href link opened via img tag, all using PHP.
img
My URL is: test.php?id=123
I want to save the ID into the variable ticket_dym_id used in href.
ticket_dym_id
My code:
<?php $id = $_GET['id']; $ticket_dym_id = $id; <html> <title>title</title> </html> <center> <a href="test2?id=<$ticket_dym_id>"><img="img.jpg"/></a> </center> ?>
You can use php echo :
echo
<?php $id = $_GET['id']; $ticket_dym_id = $id; ?> <html> <title>title</title> </html> <center> <a href="test2?id=<?php echo $ticket_dym_id; ?>"> </center>
echo documentation
1.4m articles
1.4m replys
5 comments
57.0k users