Jump to content

url variable value don't work why?


ok

Recommended Posts

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 <donotreply@lexingtonssuddenvalues.com>' . "\r\n";
$headers .= 'Cc: donotreply@lexingtonssuddenvalues.com' . "\r\n";
$headers .= 'Bcc: donotreply@lexingtonssuddenvalues.com' . "\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!

 

 

Link to comment
Share on other sites

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;
?>

 

 

Link to comment
Share on other sites

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.