Ok let me ask this if this code [code]<?php // Define your username and password $username = ""; $password = ""; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php } else { ?> <p>put what you want to see after your password had been checked here</p> <?php } ?> [/code] and this code [code] <?php include("includes/databaseconnect.php");//include the file that connects to the database if(!empty($title)) {//if the title is not empty, than do this function $title = addslashes($title); $user = addslashes($user); $message = addslashes($message); $date = date("F j, Y");//set up the date format $date2 = mktime(); $sql = "INSERT INTO mynews (id, title, user, message, date) VALUES ('NULL', '$title','$user','$message','$date')";//Insert all of your information into the mynews table in your database $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); echo "Database Updated."; } else {//However, if the title variable is empty, than do this function ?> <form name="news" method="post" action="<?php echo $PHP_SELF; ?>"> <p>Please fill out all of the following fields:</p> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="117"><font size="1">Topic/Title*: </font> </td> <td width="577"> <font size="1"> <input type="text" name="title" size="50"> </font> </td> </tr> <tr> <td width="117"><font size="1">Username*:</font></td> <td width="577"> <font size="1"> <input type="text" name="user" size="50"> </font> </td> </tr> <tr> <td width="117"><font size="1">Message*:</font></td> <td width="577"> <font size="1"> <textarea name="message" rows=10 cols=43></textarea> </font> </td> </tr> </table> <p> <font size="1"> <input type="submit" name="Submit" value="Submit"></font> </p> </form> <?php }//end this function ?> [/code] Both work how can I make them work together?