PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm a newbie trying to get the following code to work, and the POST handling works the way I expects (it echoes that one line), but when it's just a GET, it doesn't output the form anymore. How do I write this properly in PHP? My hosting company is using 4.3.10, I think. Thanks...
your form doesn't have an action attribute.
<form action="page" method="get/post">
And the reason it's not showing your form is:
you have said
IF there is NOT $_GET['os']
{
THEN print this line
}
ELSE
{
show form
}
so if you're not receiving the $_GET['os'] data, your form will be shown. Since you're not seeing the form, you're receiving that data and your if statement is satisfied.
I can't believe I overlooked that, I saw the "post" in the form and immediately assumed that was the problem, not paying any attention to the remainder of the code, good eye.