On Tue, Nov 11, 2003 at 07:44:58PM -0800, Mark wrote: > I am following the tutorial at > http://www.freewebmasterhelp.com/tutorials/phpmysql/ > The source code is on the website on the left hand side > http://www.freewebmasterhelp.com/static/tutorials/phpmysql/example.zip > > > My software: > PHP version 4.3.4 on Windows 2000 > MYSQL version 4.0.16 on Windows 2000 > Apache version 1.3.29 on Windows 2000 > > The problem is I cannot get the database to add a new records aside from > the auto-increment field. All the other fields are left blank when the > add.html is subitted. > > I have the add.html with the following code exactly the same as the > source code. > > <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> > > > The insert.php > <? > 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')";
http://ru3.php.net/manual/en/security.registerglobals.php try $query = "insert into contacts values ('',".$_POST['first'].",".$_POST['last'].",".$_POST['phone'].",".$_POST['mobile'],",".$_POST['fax'].",".$_POST['email'].",".$_POST['web'].")"; and so on ... > mysql_query($query); > > mysql_close(); > ?> > > > > Any help would be much appreciated. > > Regards, > Mark > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- zhuravlev alexander u l s t u n o c ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php