Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/34291-continuing-query-string-problem/
Share on other sites

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?
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.
Ahh ookay

Don'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]
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 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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.