hey there!
New here but it looks like a nice forum.
I currently have a Send to friend form, and it works great.
But, one complaint - (and I think it's a big one)... Whenever someone sends a script, it sends from "anonymous@st22.startlogic.com" (my webhost).
In the send to friend, it asks for the users name '$yourname'
How can have it send from '$yourname'?
This code might help a bit:
if (!empty($sendsubmit)) {
$db->addsendnum($newsid);
$title = $db->getname($newsid);
$showtable = false;
$message = "Hi $friendname, \n";
$message .= "Look at this great article that I found \n";
$message .= $baseurl."/news.php?newsid=".$newsid." \n";
$message .= "$comment \n";
$message .= "From, \n";
$message .= "$yourname \n";
mail("$friendemail","I wanted to show you something","$message");
}
?>
Or this:
<?php
if ($showtable){
print "
<form action=\"$PHP_SELF\" method=\"POST\">
<input type=\"hidden\" name=\"newsid\" value=\"$newsid\">";
print "<table border=0 cellpadding=2 cellspacing=2>\n";
print "<tr><td align=\"right\">$front_friendname :</td><td><input type=text name=\"friendname\" value=\"\"> <font color=\"#FF0000\">*</font> </td></tr>\n";
print "<tr><td align=\"right\">$front_friendemail :</td><td><input type=text name=\"friendemail\" value=\"\"> <font color=\"#FF0000\">*</font> </td></tr>\n";
print "<tr><td align=\"right\">$front_yourname :</td><td><input type=text name=\"yourname\" value=\"\"> <font color=\"#FF0000\">*</font> </td></tr>\n";
print "<tr><td align=\"right\">$front_comment :</td><td><textarea name=\"comment\" cols=\"30\" rows=\"10\"></textarea></td></tr>\n";
print "<tr><td></td><td><input type=\"submit\" name=\"sendsubmit\" value=\"$front_sendsubmit\"></p>
</table>\n";
print "</form>";
}
else{
print "$front_newssent";
}
?>