I keep getting
Server error
The website encountered an error while retrieving https://www.website.com/update.php?FName=asdd&PHONE=4444444444. It may be down for maintenance or configured incorrectly.
<?php
$FName = $_POST['FName'];
$LName = $_POST['LName'];
$PHON = $_POST['PHON'];
//connect
$dbh=mysql_connect ("localhost", "username", "password") or die ('ERROR!');
mysql_select_db ("user_Client");
$query = "INSERT INTO ClientTable (ID, FName, LName, PHON) VALUES
('NULL','".$FName."','".$LName."','".$PHON."')";
mysql_query($query) or die ('Error updating Daatabase');
echo "Database Update with:" .$FName. " " .$LName. " " .$PHON. ;
?>
I don’t know what’s the problem here. I followed instructions from here http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#.UEiSQY3iajk
If it helps – I’m using cPanel from Josthost.
Here is the form:
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="update.php">
First Name:<br/>
<input type="text" name="FName" size="30" /><br/>
Last Name:<br/>
<input type="text" name="LName" size="30" /><br/>
Phone:<br/>
<input type="text" name="PHON" size="12" /><br/>
<input type="submit" value="Update Database"/>
</form>
</body>
</html>
Your last statement is wrong:
Should be (without the last dot):
If you look in the error log of your webserver, you’ll be able to see the error. Another idea could be to turn on errors in PHP in either
php.inior withini_set("display_errors", 1);. Make sure you only do that on your development system though.