I'm sure I'm doing something wrong but I can't seem to put my finger on it. Let me give you the situation. I have a "sign-up" page where a user can put in his/her desired username and then their realemail address. (error check is the next step, I just want to get this base working first).
Anyway, there is a two line text input form that submits to PHP_SELF (yes I am using the dollar sign). It then displays a page that prints the info they just entered and asks whether it is correct or not. This is also part of a form, their info is stored in a hidden field type. At this point they can submit "Yes, my info is correct" or they can submit "No, let me re-enter it."
There are two submit buttons for this (I just listed both of them) and I also have this second form within PHP_SELF...POSTing to PHP_SELF. One submit button is named "yes." I have if statements that say:
if (isset($yes)) { print("This Info Is Correct.") }
if (isset($no)) { print("This Is NOT Correct.") }
Now I can get these "answers" to display just fine, my problem is that it shows the original table/form and then next to the table it displays the answer. What I want is for the answer to have its own (third?) page within PHP_SELF. If I try moving these parameters within the page, it then tends to display no "answers" and just shows the original form. But it kept the variables/values, because if I hit 'Reload' it asks if I want to "Repost Form Data."
Here's some code for sample, if anyone can help 😐
------[begin code]------
<?php
if (!$signup) {
print ("
<form method=\"POST\" action=\"$PHP_SELF\">
<table bgcolor=\"#2c0e36\" border=5 cellpadding=5 cellspacing=5 align=left>
<caption align=top>Sign Up Form</caption>
<tr>
<td>Username:</td>
<td><input type=\"text\" name=\"username\" length=15 maxlength=30></td>
</tr>
<tr>
<td>Real E-Mail Address:</td>
<td><input type=\"text\" name=\"realemail\" length=15 maxlength=80></td>
</tr>
<tr>
<td><input type=\"submit\" name=\"signup\" value=\"Sign Up!\"></td>
<td><input type=\"reset\" value=\"Clear Form\"></td>
</tr>
</table>
</form>
"); // end print() statement
} else {
print ("
<form method=\"POST\" action=\"$PHP_SELF\">
<table border=0 cellpadding=5 cellspacing=5>
<caption align=top><u>Is This Information Correct?</u></caption>
<tr>
<td>Username:</td>
<td>$username</td>
<td><input type=\"hidden\" name=\"username\" value=\"$username\"></td>
</tr>
<tr>
<td>E-Mail Address:</td>
<td>$realemail</td>
<td><input type=\"hidden\" name=\"realemail\" value=\"$realemail\"></td>
</tr>
<tr>
<td><input type=\"submit\" name=\"yes\" value=\"Yes, This Is Correct\"></t
d>
<td><input type=\"submit\" name=\"no\" value=\"No, Let Me Try Again.\"></t
d>
</tr>
</table>
</form> "); // end print() statement
}
if (isset($yes)) { printf("Your Information Was Correct. Yay!"); }
if (isset($no)) { printf("You Entered Incorrect Information!!"); }
}
?>
------[end code]------
Thanks for any info. I've tried a few things but am left scratching my head still.