hello coderz, I have a problem in my inbox.php file. I would like to type in the recipient's nickname and not the number of the uid. This is piece of my code:
PHP Code:
if(isset($_POST["submit"])){
if(valid(getuid_hits($hits)))
{
echo "<div class=\"error\">Error this account isn't active</div>";
}else if(istrashed(getuid_hits($hits)))
{
echo " <b>You Has Been Mute!!</b>";
}else{
$whoid = $_POST["whoid"];
if($whoid==0)
{
echo "<div class=\"error\">Error this user doesn't exist</div>";
}else{
$whonick = getnick_uid($whoid);
$byuid = getuid_hits($hits);
$tm = time();
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM mx_private WHERE byuid='".$byuid."'"));
$pmfl = $lastpm[0]+27;
if($pmfl<$tm)
{
if(!isblocked($pmtext,$byuid))
{
if((!isignored($byuid, $whoid))&&(!istrashed($byuid)))
{
$res = mysql_query("INSERT INTO mx_private SET text='".$pmtext."', sub='".$pmsub."', byuid='".$byuid."', touid='".$whoid."', timesent='".$tm."'");
}else{
$res = true;
}
if($res)
{
echo "<div class=\"ok\">Pm posted to $whonick . </div>";
}else{
echo "<div class=\"error\">Error pm doesn't posted to$whonick .</div>";
}
}else{
echo "<div class=\"error\">Error pm doesn't posted to$whonick .</div>";
}
}else{
$rema = $pmfl - $tm;
echo "<div class=\"info\">Flood control: $rema seconds</div>";
}
}
}
}
echo "<form action=\"inbox.php?show=wiaddo&hits=$hits\" method=\"post\">";
echo "Nick:<br/><input name=\"whoid\" format=\"*N\" maxlength=\"5\"/><br/>";
echo "Subject:<br/><input name=\"pmsub\" maxlength=\"20\"/><br/>";
echo "text:<br/><input name=\"pmtext\" maxlength=\"500\"/><br/>";
echo "<input type=\"submit\" name=\"submit\" value=\"send\"/></form></div></div>";
echo "</body>";
Comment