File size: 2.14Kb
<?php
include("head.php");
////////////////////////////////////////MAIN PAGE
if($action=="send")
{
addvisitor();
addonline(getuid_sid($sid),"Main Page","");
echo "<card id=\"main\" title=\"Email\">";
echo "<p align=\"center\">";
$who=$_GET["who"];
$user = getnick_uid($who);
$email = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
Echo "<b>Send $user Email</b><br/>$email[0]<br/>";
echo "<img src=\"/smilies/har.gif\" alt=\"*\"/><br/>";
echo "Message: <input name=\"message\"/><br/>";
echo "<anchor>[SEND]";
echo "<go href=\"mail.php?action=sendto&who=$who\" method=\"post\">";
echo "<postfield name=\"message\" value=\"$(message)\"/>";
echo "</go></anchor>";
echo "<br/><a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="sendto")
{
addonline(getuid_sid($sid),"Main Page","");
echo "<card id=\"main\" title=\"wapirate\">";
echo "<p align=\"center\">";
$who=$_GET["who"];
$message = $_POST["message"];
$email = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
$from_head = "From: noreply@wapirate.net";
$subject = "Message From ".getnick_uid($uid)." (wapirate.net)";
$content = "Date: ".date("l d/m/y H:i:s", $pminfo[2])."\n\n";
$content .= $message."\n------------------------\n";
$content .= "wapirate.net \n The best wap community!";
$res = mail($email[0], $subject, $content, $from_head);
if($res){
$user = getnick_uid($who);
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Email Sent To $email[0] ($user)";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error!";
}
echo "<br/>";
echo "</p><p align=\"center\">";
echo "<a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "</card>";
}
else{
addonline(getuid_sid($sid),"Main Page","");
echo "<card id=\"main\" title=\"wapirate\">";
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "</card>";
}
?>
</wml>