Tech Support Guy banner
Status
Not open for further replies.
1 - 4 of 4 Posts

· Registered
Joined
·
510 Posts
Discussion Starter · #1 ·
hey --

I'm trying to detect whether or not the page was just submitted to, and if it was, display something, and if it wasn't display a form to submit to it. Here's the code I have so far:
Code:
<html><body>
<br><center>
<table style="border: 2px red;" cellpadding="5"><tr><td>
<font face="tahoma" size="1">

<?php
if ($submit) {
  echo "You just submited the form!";
} else {
?>
  <form method="post" action="<?php echo $PHP_SELF ?>">
  First Field:&nbsp;<input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="text" name="first"><br>
  Second Field:&nbsp;&nbsp;&nbsp;<input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="text" name="second"><br><br>
  <center><input style="font-family: verdana, arial, "ms sans serif", sans-serif; font-size: 8pt; color: #000000; background-color: #ffffff; border: 1 solid #000000;" type="Submit" name="submit" value="Do it!"><center>
  </form>
<?php } ?>

</td></tr></table></center>
</body></html>
I'm really new to PHP; can someone tell me what I'm doing wrong, and possibly point me to a good beginners tutorial as well?

Thanks,
asbo
 

· Registered
Joined
·
510 Posts
Discussion Starter · #4 ·
hey --

That's a lot simplier than I found; I used a hidden form element that was called submitted or something, and then just checked whether it equaled the right thing or not.


Thanks!
asbo
 
1 - 4 of 4 Posts
Status
Not open for further replies.
Top