soma56 Posted July 3, 2010 Share Posted July 3, 2010 I have a page that contains html and php. When the php is called everything beneath it (all the html) disappears. Here's an example: <html> <body> <form action="" method="post"> <table width="500"> <tr><td>What's your name?<input name="name" type="text" /></td></tr> <tr><td><input type=Submit value="Enter Name" name="Submit"></td></tr> <?PHP if (isset($_POST['Submit'])) { echo $name; unset($targetkeyword); } ?> </table></form> <table width="500"> <tr><td>This text is not displayed when and after PHP function is set</td></tr> </table> </body> </html> When the page initially loads I can see everything however once the submit button is clicked everything after the php code is gone - even after the PHP has completed doing it's thing. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 3, 2010 Share Posted July 3, 2010 I think it's because you're trying to echo something within the table's structure, but not echoing the proper <tr><td></td></tr> structure with it, thereby breaking the table structure. if (isset($_POST['Submit'])) { echo "<tr><td>{$_POST['name']}</td></tr>"; unset($targetkeyword); } Quote Link to comment Share on other sites More sharing options...
soma56 Posted July 3, 2010 Author Share Posted July 3, 2010 Thanks, removing the table solved it. CSS will work better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.