Don Diego Posted April 5, 2007 Share Posted April 5, 2007 I want to pass the varying value of "subid" in this url: http://abcwebsite.php?subid=xxxxxx into "source" in this url: http://xyzwebsite.htm?source=xxxxxx The latter page opens using: <?php header ("location:http://xyzwebsite.htm?login=apin&source=xxxxxx"); ?> Howwever, the value of xxxxxx changes unpredictably (not generated by me) so I need to specify it in general terms. Any suggestions as to where to look or what function to use? Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/ Share on other sites More sharing options...
PC Nerd Posted April 5, 2007 Share Posted April 5, 2007 ok, well if your getting the value from a form, use $_REQUEST array. then you need to send from the _GET array in the first value variable, then pass it to the second page eg on page with header $URL = $_GET['subid'] header("location:http://xyzwebsite.htm?$URL"); goo dluc, if you need more help just post Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222533 Share on other sites More sharing options...
kenrbnsn Posted April 5, 2007 Share Posted April 5, 2007 Write it as: <?php header ("location:http://xyzwebsite.htm?login=apin&source=" . $_GET['subid']); ?> Ken Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222534 Share on other sites More sharing options...
PC Nerd Posted April 5, 2007 Share Posted April 5, 2007 good point, its much simpler than mine. if confused, always ask the expert!!!!! Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222536 Share on other sites More sharing options...
Don Diego Posted April 6, 2007 Author Share Posted April 6, 2007 Thank you kenrbnsn and PC nerd for your suggestions, but I cannot get that to work. The page opens, but there is no value for source=. By contrast, when I include: <input type="hidden" name="subid" value="<?php echo htmlentities($_GET['subid']); ?>" /> in the form, the subid value is included in the email. Since it works in emailing from a form, I am baffled as to why ($_GET['subid'] does not also work to transfer the value from url to url. The value for subid is generated upon clicking the link that goes to the form, not by anything in the form itself. Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222721 Share on other sites More sharing options...
joquius Posted April 6, 2007 Share Posted April 6, 2007 Can you post more of the code? Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222723 Share on other sites More sharing options...
Don Diego Posted April 6, 2007 Author Share Posted April 6, 2007 There is no more code. This is the only code in the php file that exists for this issue: <?php header ("location:http://xyzwebsite.htm?login=apin&source=" . $_GET['subid']); ?> What else could be needed? Should a different function be used? Link to comment https://forums.phpfreaks.com/topic/45807-pass-data-from-url-to-url/#findComment-222739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.