Lassie Posted January 15, 2007 Share Posted January 15, 2007 I have an email with the following code in it[code]."<p><a href='http://www.xxxxxx.com/e_cart8/pick_up.php?pur_id=<?php'$hash';?>'>Download Your Purchase<?php echo'$hash'?></a></p>\n"[/code]I am trying to send an email that will dispay a download link with the folder hash and then retrieve that hash for checking when the link is clicked using the GET method.At present the link doesnt display the hash and the hash is not show in the recieved url.Can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/ Share on other sites More sharing options...
Philip Posted January 15, 2007 Share Posted January 15, 2007 You don't need the single quotes and you need you have echo<?php echo $hash;?> <- replace that into both php statements you have in your link. Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161299 Share on other sites More sharing options...
Lassie Posted January 15, 2007 Author Share Posted January 15, 2007 Thanks for that. i tried it and I now have no download link.This is the full code for the email.[code]$to = "$email"; $subj = "test"; $mess = "<html>\n" ."<head>\n" ."<title>Test Mail</title>\n" ."</head>\n" ."<body>\n" ."This is an html email test<br />\n" ."<p><b>Your order has been processed. Please click on the link to download your purchase</b></p>\n" ."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=<?php echo $hash;?>Download Your Purchase<?php echo $hash;?></a></p>\n" ."</body>\n</html>\n"; $mess = wordwrap($mess,70);[/code]Have I missed something? Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161342 Share on other sites More sharing options...
shoz Posted January 15, 2007 Share Posted January 15, 2007 You haven't broken out of php using ?> so you do not need to use <?php.[code]."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=$hash'>Download Your Purchase</a></p>\n"[/code]You should also preferably put $hash through urlencode() before adding it to the url. Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161358 Share on other sites More sharing options...
Philip Posted January 15, 2007 Share Posted January 15, 2007 Ahh ookayDon't use <?php echo $hash;?> because you're already running PHP, and you are nestling php tags inside another one.try:[code]<?php$to = "$email"; $subj = "test"; $mess = "<html>\n" ."<head>\n" ."<title>Test Mail</title>\n" ."</head>\n" ."<body>\n" ."This is an html email test<br />\n" ."<p><b>Your order has been processed. Please click on the link to download your purchase</b></p>\n" ."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=". $hash."'Download Your Purchase ".$hash."</a></p>\n" ."</body>\n</html>\n"; $mess = wordwrap($mess,70);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161360 Share on other sites More sharing options...
Lassie Posted January 15, 2007 Author Share Posted January 15, 2007 Shoz,Many thanks that worked as required. How is the urlencode applied? As follows?[code]."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=urlencode('$hash')>Download Your Purchase</a></p>\n"[/code]KingPhillip, thanks for your suggestion. It did not give a download link. Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161506 Share on other sites More sharing options...
shoz Posted January 15, 2007 Share Posted January 15, 2007 [quote author=Lassie link=topic=122515.msg505569#msg505569 date=1168900345]Shoz,Many thanks that worked as required. How is the urlencode applied? As follows?[code]."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=urlencode('$hash')>Download Your Purchase</a></p>\n"[/code][/quote][code]."<p><a href='http://www.xxxx.com/e_cart8/pick_up.php?pur_id=".urlencode($hash)."'>Download Your Purchase</a></p>\n"[/code] Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161519 Share on other sites More sharing options...
Lassie Posted January 16, 2007 Author Share Posted January 16, 2007 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/#findComment-161888 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.