nclemale
11-08-2010, 11:25 PM
hi . i need help with this small code i have made .
its basically the final page to a code that after users click a link that votes wether another user is hot or not . i have managed to get the message sent an inbox on the site but its adding the email sending am having trouble with .
else if($action=="hot")
{
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM dave_users WHERE id='".$uid."'"));
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/$theme[0]\">";
$uid = getuid_sid($sid);
$who = $_GET["who"];
addonline(getuid_sid($sid),"Online list ","");
$hot = getnick_uid($uid);
$usl = "<br/><a href=\"index.php?action=viewuser\"></a>";
if(arebuds($uid, $who)==2)
{
$sub = "Hot Alert";
$msg = " You have been Voted Hot $hot Click hereTo view profile of $hot to say thanks ";
autopm($msg, $who, $sub);
$hot = mysql_fetch_array(mysql_query("SELECT hot FROM dave_users WHERE id='".$who."'"));
$res=mysql_query("UPDATE dave_users SET hot='".($hot[0]+1)."' WHERE id='".$who."'");
//////////////
$sql = mysql_fetch_array(mysql_query("SELECT id, name, addy FROM dave_users WHERE id='".$who."'"));
$ppl = mysql_query($sql);
while($mem = mysql_fetch_array($ppl))
{
$msg = "\n Username: ".$mem[1]." You have been voted hot on http://mysite.com. ";
$subj = "Voted hot ".$sitename."";
$headers = 'From: host@mysite.com' . "\r\n" .
'Reply-To: host@mysite.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($mem[2], $subj, $msg, $headers);
}
/////////////////////
echo "<img src=\"images/ok.gif\" alt=\"O\"/>User Voted Hot";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Voting";
}
echo "</div>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "<br/><br/><small>(c)>Nclemale</small>";
echo"</body>";
echo "</html>";
exit();
}
anyone fix this or point me in right direction. thanks
its basically the final page to a code that after users click a link that votes wether another user is hot or not . i have managed to get the message sent an inbox on the site but its adding the email sending am having trouble with .
else if($action=="hot")
{
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM dave_users WHERE id='".$uid."'"));
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/$theme[0]\">";
$uid = getuid_sid($sid);
$who = $_GET["who"];
addonline(getuid_sid($sid),"Online list ","");
$hot = getnick_uid($uid);
$usl = "<br/><a href=\"index.php?action=viewuser\"></a>";
if(arebuds($uid, $who)==2)
{
$sub = "Hot Alert";
$msg = " You have been Voted Hot $hot Click hereTo view profile of $hot to say thanks ";
autopm($msg, $who, $sub);
$hot = mysql_fetch_array(mysql_query("SELECT hot FROM dave_users WHERE id='".$who."'"));
$res=mysql_query("UPDATE dave_users SET hot='".($hot[0]+1)."' WHERE id='".$who."'");
//////////////
$sql = mysql_fetch_array(mysql_query("SELECT id, name, addy FROM dave_users WHERE id='".$who."'"));
$ppl = mysql_query($sql);
while($mem = mysql_fetch_array($ppl))
{
$msg = "\n Username: ".$mem[1]." You have been voted hot on http://mysite.com. ";
$subj = "Voted hot ".$sitename."";
$headers = 'From: host@mysite.com' . "\r\n" .
'Reply-To: host@mysite.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($mem[2], $subj, $msg, $headers);
}
/////////////////////
echo "<img src=\"images/ok.gif\" alt=\"O\"/>User Voted Hot";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Voting";
}
echo "</div>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "<br/><br/><small>(c)>Nclemale</small>";
echo"</body>";
echo "</html>";
exit();
}
anyone fix this or point me in right direction. thanks