alexiek Posted February 3, 2007 Share Posted February 3, 2007 Hello everybody, I'm new to PHP. My issue is, I can't seem to figure out how I can take data I received, put it into a variable and resend the data. Example: I have a site and when a link is clicked it goes link.php?data=hello. Now, how I can I use the data and then resend it. link.php then refreshes itself and sends the data to the next site. So then it would go data.php?data=hello&referrer=link. And in following this, how can I make var $data have data that was sent using link.php. Get it? Thanks much. Link to comment https://forums.phpfreaks.com/topic/36852-solved-using-variables/ Share on other sites More sharing options...
pocobueno1388 Posted February 3, 2007 Share Posted February 3, 2007 <?php $data = $_GET['data']; echo "<a href='link.php?data=$data&referrer=4512'>link</a>"; ?> Then it just keeps continuing from there. To put "referrer into a variable you would just go $referrer = $_GET['referrer']...which would hold the value "4512" in this case. $_GET is the method you use to grab values out of the URL. Link to comment https://forums.phpfreaks.com/topic/36852-solved-using-variables/#findComment-175824 Share on other sites More sharing options...
alexiek Posted February 3, 2007 Author Share Posted February 3, 2007 Thank you so much. Here is the next line of script that won't work for some reason. <?php $data = $_GET['LN']; include ('detail.php?LN=$data'); ?> It just sends $data as the text $data and when I try to move around the colon, i get a parse error. Link to comment https://forums.phpfreaks.com/topic/36852-solved-using-variables/#findComment-175838 Share on other sites More sharing options...
JasonLewis Posted February 3, 2007 Share Posted February 3, 2007 you cant include files like that. try this: <?php $LN = $_GET['LN']; include('detail.php'); ?> Link to comment https://forums.phpfreaks.com/topic/36852-solved-using-variables/#findComment-175847 Share on other sites More sharing options...
Attilitus Posted February 3, 2007 Share Posted February 3, 2007 Use double quotes to parse variables inside an include function. include("includedfile.php?something=$var") Link to comment https://forums.phpfreaks.com/topic/36852-solved-using-variables/#findComment-175848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.