Cant figure this out the fact long text should be able to hold an extreme amount of data from what i hold so i figure there is something else wrong. never the less my code is very basic and i cant see why this would pull an error.. if i put a short peice of text in it works fine, inserts in in to the mysql data base and displays it on the website but if i put a long peice on there it will just pull out the next error and do nothing... here is my code for inserting.
name comment and usermail is user input but user e mail is not used in the db just purly for sending thank you message and the comment in the mysql data base is set to long text so im really stuck and need an answer.
The first error is the one i am getting that says "OoOoOoPpPpPsSsSsS there was an error! please contact the webmaster and notify him on this! <a href="mailto:welsh-kurtuss@hotmail.com">welsh-kurtuss@hotmail.com</a> Thanks!"
PHP Code:$host="host"; // Host name
$username="user"; // Mysql username
$password="pass"; // Mysql password
$db_name="DB"; // Database name
$tbl_name="guestbook"; // Table name
$name = $_POST['name'];
$comment = $_POST['comment'];
$useremail = $_POST['email'];
if (!empty($_POST['name']) || (!empty($_POST['comment']))) {
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect server ");
mysql_select_db("$db_name")or die("cannot select DB");
$datetime=date("d-m-y H:i:s"); //date time ... this is not submitted by the user!
$sql="INSERT INTO $tbl_name(name, comment, datetime)VALUES('$name', '$comment', '$datetime')";
$result=mysql_query($sql);
//check if query successful
if($result){
echo "Thank you for your comment! You will automaticly be redirected...";
header('Refresh: 5; URL=../');
}
else {
echo 'OoOoOoPpPpPsSsSsS there was an error! please contact the webmaster and notify him on this! <a href="mailto:welsh-kurtuss@hotmail.com">welsh-kurtuss@hotmail.com</a> Thanks!';
}
mysql_close();
header('Refresh: 4; URL=../');
} else {
// empty variable
die('Please go back and fill out all information<br />Alternativly if you are having problems you can submit your review to <a href="mailto:cerris@chulse.co.uk">cerris@chulse.co.uk</a> or contact the webmaster <a href="mailto:welsh-kurtuss@hotmail.com">welsh-kurtuss@hotmail.com</a><br /><br />You can copy the message below if you would like to submit via e mail:<br />' . $comment);
}



Reply With Quote


Bookmarks