auto fill form fields from mysql
Posted: Wed Oct 10, 2007 6:16 pm
Hi
*PHP rookie*
ive got a login form barely just working
once the user is logged in they are presented with a form to fill out.
I want the telephone and email fields to be autofilled from the mysql database (customer table).
obviously this must depend on the user thats logged in.
am i on the right lines with this code:
then have this code placed in the fields
but how do i get it to autofill the details of the user who has just logged in.
would appreciate any help, have been trying this for hours with no luck
here is the url: http://www.kumar.adsl24.co.uk/Storm%20B ... ccount.php
user: testuser
pass: test
*PHP rookie*
ive got a login form barely just working
once the user is logged in they are presented with a form to fill out.
I want the telephone and email fields to be autofilled from the mysql database (customer table).
obviously this must depend on the user thats logged in.
am i on the right lines with this code:
Code: Select all
<?php
// SQL connection goes here
$query = "SELECT * FROM customers";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
?>Code: Select all
value="<?php echo $row['email'] ?>"would appreciate any help, have been trying this for hours with no luck
here is the url: http://www.kumar.adsl24.co.uk/Storm%20B ... ccount.php
user: testuser
pass: test