I am kind of new to PHP, learning through books and online resources but I am having difficulties with what seems like an easy problem.

if($pageid == 1){
		echo "";	
		} else {
		echo '<form action="delete_ad.php" method="post">';
		echo '<input name="deleteid" type="text" value="" id="deleteid"  hspace="10"/>';
		echo '<input name="delete" type="submit" value="Delete Ad" id="deletebtn"/>';
		echo '<br /><br />';
		echo '<table id="emailform" class="signup">
		<th colspan="2" align="center">Email Form</th>
		<form method="post" action="send.php">
		<tr><td>Name</td><td><input type="text" maxlength="32"
		name="name" /></td>
		</tr><tr><td>Email</td><td><input type="text" maxlength="32"
		name="senderemail" /></td>
		</tr><tr><td>Message</td><td><textarea name="message"></textarea></td>
		</tr><tr><td colspan="2" align="center">
		<input type="submit" value="Send" /></td>

The green part works, while the form in the red part does not want to work, when ever I click on Send it brings me back to the homepage instead of going to send.php. I know its better to use html and then send it to php, and when I do that everything works fine, but in this particular case I need it to be echoed. I tried to put the html in a mysql table and echo it, but that did not work. I tried to use =\"...\" syntax, but it also did not work. I don't know what else to do.

Thanks for the help

6 Years
Discussion Span
Last Post by Borzoi

you forgot to close form tag for this

echo '<form action="delete_ad.php" method="post">';

close it before <table>

it will work.

Edited by shubforall: n/a


What everyone else has said plus you need the first line of your table in a row. You've got the <th> but it's not within a <tr> and since it's the only one in the row, you need to use colspan="2" too.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.