Alright, Im sorry to ask such a simple question. But I have been set back a few days playing with this stupid form... So I'm going to keep it short.
So Ive tried all types of forms, all with the same problem.
This one I pulled straight from W3Schools and its not working either...
They all cause a new page with: NO DATA RECEIVED, ERR_EMPTY_RESPONSE
EDIT: Tables, User, pass etc... removed for security.
<?php
if(isset($_POST['submit']))
{
$dbhost = 'localhost';
$dbuser = '';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
if(! get_magic_quotes_gpc() )
{
$emp_name = addslashes ($_POST['firstname']);
$emp_address = addslashes ($_POST['lastname']);
}
else
{
$emp_name = $_POST['firstname'];
$emp_address = $_POST['lastname'];
}
$sql = "INSERT INTO `` . `` ".
"(name,img-path) ".
"VALUES('$emp_name','$emp_address')";
mysql_select_db('');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
}
else
{
?>
<form action="add-nexts.php" method="post">
First name:
<br>
<input type="text" name="firstname" value="Mickey">
<br> Last name:
<br>
<input type="text" name="lastname" value="Mouse">
<br>
<br>
<input type="submit" name="submit" id ="submit" value="Submit">
</form>
<?php
}
?>
I have no idea what I am doing wrong. Hoping maybe you guys do. Thanks alot guys!
EDIT: Well Ive got my script working with GET. But POSTing is what is causing the problem. If this helps narrow it down for anyone... I will need to use POST when my site goes live. But for now at least I can move forward.
EDIT: Confirmed not my hosting provider.... Can anyone at least tell me what I should do next lol??? Im stumped, and cannot move forward with image uploads and other things!! Very tired of wasting time!!