Hi .. I'm really new to PHP but I've done a ton of research and I can't seem to find the answer to WHY the _POST is NOT working?? It keeps returning empty values.
The HTML for the form is as follows:
--register.php--
<html><body>
<form id="signup" method="post" action="signup.php">
<p>Name:
<input type="text" name="name" id="name">
</p>
<p><br>
Email:
<input type="text" name="mail" id="mail">
<br>
</p>
<p> Click here for Enzyme Replacement Therapy
<input type="checkbox" name="ert" value="checked">
</p>
<p> Click here for Clinical Endurance Measures
<input type="checkbox" name="cem" value="checked">
<br>
</p>
<p>
<input type="submit" name="Submit" value="Sign Up">
</p>
</form>
</body></html>
This is the signup.php file
<?php
$username = $_POST['name'];
$email = $_POST['mail'];
$choice1 = $_POST['ert'];
//the data
$data = "$username , $email , $experience, $choice1 \r\n";
//$data = file_get_contents('php://input');
//open the file and choose the mode
$fh = fopen("users.txt", "a");
fwrite($fh, $data);
//close the file
fclose($fh);
print "User Submitted";
print $data;
?>
My data.txt file looks like this:
, , ,
, , ,
YET, the
$data = file_get_contents('php://input');
Will return :
name=Chrissy&mail=chrissy@abc.com&ert=checked&cem=checked&Submit=Sign+Up
So I know that the info is available .. but the _POST is not assigning it to the variables ... so I can't parse it out with commas..
ANY suggestions? My thought is that perhaps something is not right in the php.ini file ... but I'm not sure what to look for?
I'm running this client side using TinyWeb and php version 5.2.1 on Windows 7.
thanks in advance .. I've been banging my head against the wall for a week and can't seem to figure it out!