PHP forms
Posted: Sat Nov 26, 2005 10:19 am
I was wondering if there was any way to do and IF/ELSE statement that, if true would print a form for the viewer? An Example would be great
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
if(1)
{
echo '<form><input type="text"></form>';
}
else
{
echo 'no form for you';
}Code: Select all
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST') { //<-- modify condition as you see fit
//do some fancy stuff...
exit; //<-- kills the script so that the form isn't shown
}
?>
<form action="" method=""><!----></form>