tqla Posted March 9, 2010 Share Posted March 9, 2010 Here's how my url looks: mailscript.php?url=http://www.mysite.com/ci/comparison.php?s1=ALABAMA&s2=ALASKA&s3=ARIZONA&s4=ARKANSAS&s5=COLORADO&s6=FLORIDA When I use the $_GET['url'] function it only gets the url up to ALABAMA http://www.mysite.com/ci/comparison.php?s1=ALABAMA I need to get the entire url, all the way to florida in this case. Any ideas how to do this? Thanks Quote Link to comment Share on other sites More sharing options...
schilly Posted March 9, 2010 Share Posted March 9, 2010 you will need to encode the "&" signs. mailscript thinks it's a separate variable. print_r($_GET); on mailscript.php and you'll see what I'm talking about. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 9, 2010 Share Posted March 9, 2010 How are you generating the url. You need to use urlencode when you add http://www.mysite.com/ci/comparison.php?s1=ALABAMA&s2=ALASKA&s3=ARIZONA&s4=ARKANSAS&s5=COLORADO&s6=FLORIDA to your url. Eg $refURL = 'http://www.mysite.com/ci/comparison.php?s1=ALABAMA&s2=ALASKA&s3=ARIZONA&s4=ARKANSAS&s5=COLORADO&s6=FLORIDA'; echo '<a href="mailscript.php?url='.urlencode($refURL).'">SOME LINK</a>'; In mailscript.php when you use $_GET['url'] you'll need to decode the url using urldecode. EG $refURL = urldecode($_GET['url']); echo $refURL; Quote Link to comment Share on other sites More sharing options...
tqla Posted March 9, 2010 Author Share Posted March 9, 2010 Perfect! Thanks shilly and WT88. urlencode() worked like a charm! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.