ok Posted September 3, 2008 Share Posted September 3, 2008 Hi guys i'm trying to attached a variable value into an url. I have 2 files, the first file will send an email with a link and with variable value and the 2nd file will catch the variable value. When i open the email and press the link it did show the url with the right variable value as an url, but the 2nd page that should catch those variables didn't display the variable value, meaning it's not working. here is the codes that attach the variable value. $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br> Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br> <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufname={$ufname} \"><h4>Please Click here to join!</h4></a> {$_POST['ufull_name']} Join now and be a candidate to win the $50 dollar gas card every week.<br> For more details please visit the link.<br><br> <h4>Thank you!</h4> </body> </html>"; This is the full codes, that will email and attach the variable value. <?php echo "ufull_name: ". $ufull_name; $_POST['ufull_name'] = $ufull_name; $recepient = $femail; $subject = "Tell a Friend Contest!"; $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br> Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br> <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufname={$ufname} \"><h4>Please Click here to join!</h4></a> {$_POST['ufull_name']} Join now and be a candidate to win the $50 dollar gas card every week.<br> For more details please visit the link.<br><br> <h4>Thank you!</h4> </body> </html>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: lexingtonssuddenvalues.com <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // multiple recipients $to = $femail; mail($to, $subject, $message, $headers); ?> by the way this is the 2nd page that suppose to catch the variable value. <?php $ufull_name = $_POST['ufull_name']; echo "ufull_name: ". $ufull_name; echo "<br>ureferer: ". $ureferer; echo "<br>ufname: ". $ufname; echo "<br>ulname: ". $ulname; ?> Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/122472-url-variable-value-dont-work-why/ Share on other sites More sharing options...
pocobueno1388 Posted September 3, 2008 Share Posted September 3, 2008 You are using POST...if you want to get a value from the URL, you need to use GET. So change <?php $ufull_name = $_POST['ufull_name']; echo "ufull_name: ". $ufull_name; echo "<br>ureferer: ". $ureferer; echo "<br>ufname: ". $ufname; echo "<br>ulname: ". $ulname; ?> To <?php $ufull_name = $_GET['ufname']; echo "ufull_name: ". $ufull_name; echo "<br>ureferer: ". $ureferer; echo "<br>ufname: ". $ufname; echo "<br>ulname: ". $ulname; ?> Quote Link to comment https://forums.phpfreaks.com/topic/122472-url-variable-value-dont-work-why/#findComment-632395 Share on other sites More sharing options...
ok Posted September 3, 2008 Author Share Posted September 3, 2008 @pocobueno1388 Thank you very much! Quote Link to comment https://forums.phpfreaks.com/topic/122472-url-variable-value-dont-work-why/#findComment-632411 Share on other sites More sharing options...
pocobueno1388 Posted September 3, 2008 Share Posted September 3, 2008 @pocobueno1388 Thank you very much! Your Welcome Don't forget to press solved. Quote Link to comment https://forums.phpfreaks.com/topic/122472-url-variable-value-dont-work-why/#findComment-632418 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.