display problem
Posted: Sun Aug 15, 2004 10:37 pm
hello.I have a question.
I have something like this :
after the form is submitted the page reloads and it tels me if the input is allready in the $db or not. If it is, or not the execution stops and the problem is that the text that is after the script it doesn't appear anymore. The script has to be in that position because the message it prints out belongs to some fields I have there.
Question :
How can I make that the info the script prints out appear in the position I want, and in the same time the info after the script appear where I want it on the page (after the info the script prints)?
This is how I want it to be
Short version
input 1
input 2
submit button
message script prints out
information after the script. a picture or whatever
I have something like this :
Code: Select all
<?php
<table>
<tr>
<td>
<form name="test" action="<? $PHP_SELF; ?>" method="post">
test1<br>
<input type="text" name="test1"><br>
test2<br>
<input type="text" name="test2"><br>
<input type="submit" name="add">
</form>
</td>
</tr>
<tr>
<td>
<?php
bla bla bla
if(isset($_POST['add'])) {
$sql = "select.....
...
if (mysql_num_rows($result) != 0) {
print "This allready exists";
exit;
}
$sql = "INSERT ...
.....
print "Added succesfully";
exit;
}
?>
</td>
</tr>
<tr>
<td>Some thext very important </td>
</tr>
</table>
?>Question :
How can I make that the info the script prints out appear in the position I want, and in the same time the info after the script appear where I want it on the page (after the info the script prints)?
This is how I want it to be
Short version
input 1
input 2
submit button
message script prints out
information after the script. a picture or whatever