0

Safari can’t open the page because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

When I try to post the form with Firefox i just get a black page. This problems started when i changed my table to innoDB. Now ive changed it back to MyIsam and is still not working.

this is the php code. any ideas to why i cant post

include ("connect.php");

if (isset($_POST['submit'])){

 
$sql= "INSERT INTO flats (date_posted, type, location, rent, title, image, image1, image2, image3, image4, description, contactEmail, number)
  VALUES 
  (NOW(),'$_POST[type]', '$_POST[location]','$_POST[rent]', '$_POST[title]', '$_POST[image]', '$_POST[image1]', '$_POST[image2]', 
 '$_POST[image3]', '$_POST[image4]', '$_POST[description]','$_POST[contactEmail]','$_POST[number]')";


$sql2 .= "INSERT INTO user (email, password, conpass) VALUES
('$_POST[email]','$_POST[password]','$_POST[confirmPassword]')";

if (mysql_query($sql,$con)) {
echo "Data inserted";
} else {
echo "Error inserting data: " . mysql_error();
}

if (mysql_query($sql2,$con)) {
echo ", thanks";
} else {
echo "Error inserting data: " . mysql_error();
}
mysql_close($con);
}

echo "<br>";
echo "<br>";

echo "<a href='londonfc_flats.php'>Click Here To Return To The Main Page</a>";
echo "<br>";
echo "<br>";
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by balam
0
$sql= "INSERT INTO flats (date_posted, type, location, rent, title, image, image1, image2, image3, image4, description, contactEmail, number)   VALUES   (NOW(),'$_POST[type]', '$_POST[location]','$_POST[rent]', '$_POST[title]', '$_POST[image]', '$_POST[image1]', '$_POST[image2]', 
 '$_POST[image3]', '$_POST[image4]', $_POST[description]','$_POST[contactEmail]','$_POST[number]')";

$sql2 .= "INSERT INTO user (email, password, conpass) VALUES ('$_POST[email]','$_POST[password]','$_POST[confirmPassword]')";

Insert an echo $sql."\n"; on line 3 in the above code to see if the query is correct and insert an echo $sql2."\n"; after line 4, for the same reason.
Maybe the .= after $sql2 gives a strange result. Don't see $sql2 before this line, so I think you should change it to $sql2 = (without the dot).

Edited by colweb: n/a

0

Insert an echo $sql."\n"; on line 3 in the above code to see if the query is correct and insert an echo $sql2."\n"; after line 4, for the same reason.
Maybe the .= after $sql2 gives a strange result. Don't see $sql2 before this line, so I think you should change it to $sql2 = (without the dot).

still getting this.
because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

this is strange. before i changed my table engine it was working fine. ive created a new database and i still get this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.