A2xA Posted August 23, 2008 Share Posted August 23, 2008 I'm trying to pass a variable in my linked image that says "Join Battle" <a href="http://site.com/battle/index.php?id=' . stripslashes($row['linksLink']) . '" target="_blank"><img src="'.$site_url.'/templates/default/images/visit.png" /></a> What will be the best way to pass the ' . stripslashes($row['linksLink']) . ' in the code to the next page? Link to comment https://forums.phpfreaks.com/topic/121042-solved-how-to-pass-or-get-a-variable-in-the-id-of-my-link/ Share on other sites More sharing options...
Fadion Posted August 23, 2008 Share Posted August 23, 2008 In the next page you should do: <?php $id = $_GET['id']; //consider using mysql_real_escape_string() if $id is going to be used for a query ?> Link to comment https://forums.phpfreaks.com/topic/121042-solved-how-to-pass-or-get-a-variable-in-the-id-of-my-link/#findComment-623962 Share on other sites More sharing options...
A2xA Posted August 23, 2008 Author Share Posted August 23, 2008 I'm not posting any variables it's just in the link itself. That's why I'm not sure how to $GET the generated id?= code. Link to comment https://forums.phpfreaks.com/topic/121042-solved-how-to-pass-or-get-a-variable-in-the-id-of-my-link/#findComment-623973 Share on other sites More sharing options...
Fadion Posted August 23, 2008 Share Posted August 23, 2008 Maybe it's me, but i don't get this. Your link looks alright and you can $_GET the variable. Can you explain it a bit better? Link to comment https://forums.phpfreaks.com/topic/121042-solved-how-to-pass-or-get-a-variable-in-the-id-of-my-link/#findComment-623977 Share on other sites More sharing options...
A2xA Posted August 24, 2008 Author Share Posted August 24, 2008 my bad this works Thanks! Link to comment https://forums.phpfreaks.com/topic/121042-solved-how-to-pass-or-get-a-variable-in-the-id-of-my-link/#findComment-623999 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.