# Send Link PHP Code Problem

**URL:** <https://forum.kirupa.com/t/send-link-php-code-problem/60672>\
**Category:** programming\
**Created:** [August 11, 2004, 2:55pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672 "2004-08-11T14:55:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw06](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jw06](https://forum.kirupa.com/u/jw06)\
**Post date:** [August 11, 2004, 2:55pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672/1 "2004-08-11T14:55:02Z")

</div>

Ok, A client wants a Send link section on his website. heres my code.

Form:

```php

<form action="refer.php" method="post">
<?php $fullurl = "{$HTTP_REFERER}";
 echo "$fullurl<br> " ;
 echo"<input type=hidden name=link value=$fullurl>";
?>
Friend E-mail: <input type="text" name="email"><br>
Friend Name: <input type="text" name="name"><br>
Your Name: <input type="text" name="sendername"><br>
Your E-mail: <input type="text" name="senderemail"><br>
<input type="submit" value="Go!"> <input type="reset" value="reset">
</form>

```

Heres my processing page:

```php

<?php
mail("$email", "Your website","Hi $name !, $sendername at $senderemail wanted you to take a look at this link: $link.", "from: $mailheaders\"$sendername\" $senderemail
");
echo "<div align=\"center\"><table width=\"96%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ";
echo "style=\"font-size:11pt;font-color:black;\">";
echo "<tr height=\"40\" align=center><td><p>&nbsp;</p></td></tr>";

echo "<tr><td >An e-mail with the link was sent to <font color=#ED1820 >$name</font> at <a href=\"mailto:$email\">$email</a> from <font color=#ED1820 >$sendername</font> at <a href=\"mailto:$senderemail\">$senderemail</a>, now also <font color=#ED1820 >$name</font> your friend ";
echo " will know about the link <a href=$link target=_blank>$link </a></td></tr>";
echo "</table></div>";
?>

```

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 12, 2004, 2:25pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672/2 "2004-08-12T14:25:30Z")

</div>

^^ Anybody

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 12, 2004, 3:46pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672/3 "2004-08-12T15:46:27Z")

</div>

Maybe you’ll have better luck if you describe what you’re trying to do and what symptoms you get when it goes wrong…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2004, 2:40pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672/4 "2004-08-16T14:40:01Z")

</div>

Im trying to have a send this link to a friend form. When I put all the info in and emails and hit send. I never get the emails.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2004, 3:40pm UTC](https://forum.kirupa.com/t/send-link-php-code-problem/60672/5 "2004-08-16T15:40:06Z")

</div>

$\_SERVER[‘HTTP\_REFERER’];

\<?php  
mail($email, “Your website”,“Hi $name !, $sendername at $senderemail wanted you to take a look at this link: $link.”, “from: $mailheaders”$sendername" $senderemail  
");  
echo "\<div align=“center”\>\<table width=“96%” border=“0” cellspacing=“0” cellpadding=“0” ";  
echo “style=“font-size:11pt;font-color:black;”\>”;  
echo “\<tr height=“40” align=center\>\<td\>\<p\>&nbsp;\</p\>\</td\>\</tr\>”;

echo "\<tr\>\<td \>An e-mail with the link was sent to \<font color=#ED1820 \>$name\</font\> at \<a href=“mailto:$email”\>$email\</a\> from \<font color=#ED1820 \>$sendername\</font\> at \<a href=“mailto:$senderemail”\>$senderemail\</a\>, now also \<font color=#ED1820 \>$name\</font\> your friend “;  
echo " will know about the link \<a href=$link target=\_blank\>$link \</a\>\</td\>\</tr\>”;  
echo “\</table\>\</div\>”;  
?\>

Try using $email not in quotes…
