I am trying to use PHP and HTML Forms from a node that is a static page, with PHP enabled.
The node displays the text fields and the button fine, but does not process them when I click on the button. It redirects to the http://mysite.com/node page for some unknown reason.
How can I get this working?
Here is some sample code I am using:
$this_script=$_SERVER["REQUEST_URI"];
print "fname=$edit['fname'] $fname lname=$edit['lname'] $lname";
if ($edit["fname"] || $edit["lname"])
{
// Capitalize the name
$full_name = ucwords ($edit["fname"] . " " . $edit["lname"]);
print "Hello! Nice to meet you $full_name...";
print "Glad to see that you are using my form!";
}
$form = form_textfield (t("First Name"), "fname", "", 30, 64);
$form .= form_textfield (t("Last Name"), "lname", "", 30, 64);
$form .= form_submit (t("Process"));
print form($form, "post", $this_script);
Any help appreciated.