AcidReignX
Programmer
Hi,
I've been searching for a better method of having my form events handled when I press a form button, but it has been of relatively little success. All my searches turn up a javascript solution (onClick) or something that doesn't help me. I was under the impression that something like:
$showform = "<form action=\"$PHP_SELF\">Name: <input type=\"text\" name=\"fusername\"><br>";
$showform .= "Password: <input type=\"text\" name=\"fpassword\"><br>";
$showform .= "<input type=\"button\" name=\"fsubmit\" value=\"Submit\"></form>";
echo $showform;
if($fsubmit) { *CODE FOLLOWS* }
would work, but it doesn't - or, if it does, something is drasticaly wrong with my current setup. Is there an alternative if statement that would ideally work like the "if($fsubmut)" that I have posted where I can just have it check if the button has been pressed?
Or if not, is there a way I can have a particular script run (such as having the form action not change pages, but run a specific function)?
I've been searching for a better method of having my form events handled when I press a form button, but it has been of relatively little success. All my searches turn up a javascript solution (onClick) or something that doesn't help me. I was under the impression that something like:
$showform = "<form action=\"$PHP_SELF\">Name: <input type=\"text\" name=\"fusername\"><br>";
$showform .= "Password: <input type=\"text\" name=\"fpassword\"><br>";
$showform .= "<input type=\"button\" name=\"fsubmit\" value=\"Submit\"></form>";
echo $showform;
if($fsubmit) { *CODE FOLLOWS* }
would work, but it doesn't - or, if it does, something is drasticaly wrong with my current setup. Is there an alternative if statement that would ideally work like the "if($fsubmut)" that I have posted where I can just have it check if the button has been pressed?
Or if not, is there a way I can have a particular script run (such as having the form action not change pages, but run a specific function)?