When i submit my FORM, I've read that the variables (like name, email, etc.) should automatically be passed to PHP (to create $name, $email, etc.). Instead, I get PHP errors saying the variables are undefined, and it then passes blank values into my table (so at least I know that part's working!)
So, what is it with PHP that won't let it accept incoming variables?
I'm running with Xitami on WinXP Home with PHP 4.3.4 and MySQL 4.0.18, but again i stress that MySQL, Xitami and everything is working just great, but PHP just won't take its variables. I am actually running an example script until I get the concept down, so someone's proven this to work.... anyways here it is:
in add.html:
Code: Select all
<form action="insert.php" method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
Phone: <input type="text" name="phone"><br>
Mobile: <input type="text" name="mobile"><br>
Fax: <input type="text" name="fax"><br>
E-mail: <input type="text" name="email"><br>
Web: <input type="text" name="web"><br>
<input type="Submit">
</form>Code: Select all
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query);
mysql_close();
?>so, it's supposed to pass the values, correct? Is there some parameter in my php.ini that I need to change? PHP will accept no variables, even in my most simple scripts.... even if i hand write them into the URL.... nothing....
Please someone help the newbie