Derleek Posted July 24, 2008 Share Posted July 24, 2008 So I am creating a page that displays titles of messages that are stored in a DB. I would like to make each title a hyperlink to each message. Is there a way to send the title of a given article to a page called 'msgHandler.php' when a message title is clicked? I was thinking of using some kind of onClick command, but i'm not proficient in JavaScript. So is there any way to send a variable through a hyperlink so i don't have to create an individual file for each message that is submitted to the DB? Link to comment https://forums.phpfreaks.com/topic/116443-solved-passing-a-variable-through-a-hyperlink/ Share on other sites More sharing options...
tarlejh Posted July 24, 2008 Share Posted July 24, 2008 So I am creating a page that displays titles of messages that are stored in a DB. I would like to make each title a hyperlink to each message. Is there a way to send the title of a given article to a page called 'msgHandler.php' when a message title is clicked? I was thinking of using some kind of onClick command, but i'm not proficient in JavaScript. So is there any way to send a variable through a hyperlink so i don't have to create an individual file for each message that is submitted to the DB? While looping through your result: <?php $var='titleofarticle'; echo "<a href=\"msgHandler.php?var=$var\">Title of message</a>'; ?> and to retrieve it: <?php $var=$_GET['var']; ?> Link to comment https://forums.phpfreaks.com/topic/116443-solved-passing-a-variable-through-a-hyperlink/#findComment-598787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.