For some strange reason, The echo wont Echo when $respecta = "2" however, when $respect == "1" it works Anyone know why? Here is the code i'm using: if (strip_tags($_POST['rbutton']) && strip_tags($_POST['ruser']) && strip_tags($_POST['ramount'])){ $ramount=strip_tags($_POST['ramount']); $ruser=strip_tags($_POST['ruser']); $respecta=$_POST['respecta']; if ($ramount == 0 || !$ramount || ereg('[^0-9]',$ramount)){ print "<font color=white>Invalid amount."; }elseif ($ramount != 0 || $ramount || !ereg('[^0-9]',$ramount)){ if (strtolower($username) == strtolower($ruser)){ echo "<font color=white>You cannot send points to yourself."; }elseif (strtolower($username) != strtolower($ruser)){ $check=mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='$ruser'")); if ($check == "0"){ echo "<font color=white>No such user."; }elseif ($check != "0"){ $respect_left = $user->respect - $ramount; mysql_query("UPDATE users SET respect=respect+$ramount WHERE username='$ruser'"); mysql_query("UPDATE user_info SET respect='$respect_left' WHERE username='$username'"); if ($respecta == "1"){ mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` , `witness` , `witness_per` ) VALUES ( '', '$ruser', '$ruser', 'Someone sent you $ramount respect points!', '$date', '0', '0', '0', '0', '' )"); }elseif ($respecta == "2"){ mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` , `witness` , `witness_per` ) VALUES ( '', '$ruser', '$ruser', '$username sent you $ramount respect points!', '$date', '0', '0', '0', '0', '' )"); echo "Respect Points Sent!"; }}}}} PHP: Any Help will be greatly appreciated! Thanks, NateJ
<?php if ($respecta == "1") { mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` , `witness` , `witness_per` ) VALUES ( '', '$ruser', '$ruser', 'Someone sent you $ramount respect points!', '$date', '0', '0', '0', '0', '')"); } if ($respecta == "2") { mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` , `witness` , `witness_per` ) VALUES ( '', '$ruser', '$ruser', '$username sent you $ramount respect points!', '$date', '0', '0', '0', '0', '')"); echo "Respect Points Sent!"; } ?> PHP: Is it even going to that area of the code when $respecta == 2 ? I see nothing that would stop it from going that far unless something else is stopping it. Unless something changed from one form submit to the next form submit.
I've Sorted the Problem, For some strange reason, it only worked when i put the echo before the queries