but if the form is not submitted yet, then you won't see that. And the form won't be printed because you have it inside the same if() block. look over your code carefully (and I'd recommend indenting it properly to make it easier to read, and catch these kinds of mistakes):PHP Code:?php //<--- you didn't start with <?php
// that's another possible cause of your blank page
require "database.php";
$userfinal=$_COOKIE['ID_my_site'];
$user=$userfinal;
echo $user; //<-- if there is no cookie, then $user will be empty
// and you won't see any output.
// if this is the case, and you also don't see any errors,
// (probably something like "Warning: undefined index 'ID_my_site'")
// then you need to turn on error reporting
if (isset($_POST['submit'])) {
echo "Thanks";
$title=$_POST['message_title'];
$to=$_POST['message_to'];
$content=$_POST['message_content'];
$from=$_POST['message_from'];
$time=$_POST['message_date'];
$ck_reciever = "SELECT username FROM users WHERE username = '".$to."'";
if( mysql_num_rows( mysql_query( $ck_reciever ) ) == 0 ){
die("The user you are trying to contact don\'t excist. Please go back and try again.<br> ");
$insert = "INSERT INTO pmsys (to, from, title, message, date, ifread)
VALUES ('".$to."', '".$from."', '".$title."', '".$content."', '".$date."', '".$ifread."')";
$add_member = mysql_query($insert);
} else //<-- this "else" closes "if mysql_num_rows([...]) === 0"
// but we're _still_inside_ "if isset($_POST['submit'])"
{
?>
<form name="message" action="new_message.php" method="post">
Title: <input type="text" name="message_title"> <br>
To: <input type="text" name="message_to"> <br>
Message: <br>
<textarea rows="20" cols="50" name="message_content">
</textarea>
<?php
echo '<input type="hidden" name="message_from" value="'.$user.'"><br>';
?>
<input type="submit" name="submit" value="Submit">
</form>
<?php
} //<-- this is where the else for "mysql_num_rows([....]) === 0" ends
} //<-- this is where "isset($_POST['submit'])" ends
// as you can see, _nothing_happens_ if the form is not submitted,
// and you'll get a blank page.
?>

