php problem with guestbook program?

commuter47

New member
I have an error on line 16 of my code, and don't know how to fix it please help.

The code is:
if (empty (guestbook_name) || empty (guestbook_email) || empty (guestbook_message)) {
$errors [ ] = 'all fields are required';

}

<?php
if my sql_connect ('localhost', 'root' , '') && my sql_select _DB ('guessbook') ) {
echo 'connected.';
}else{ 'could not connect.';
}

$time = time ();
$errors = Array ();

if (isset($_post ['guestbook_name'], $_post ['guestbook_email'], $_post ['guestbook_message'] )) {

$guessbook_name = mysql_real_escape_string htmlentities $_post ['guestbook_name']));
$guessbook_email = mysql_real_escape_string htmlentities $_post ['guessbook_email']));
$guessbook_message = mysql_real_escape_string htmlentities $_post ['guessbook_message']));

if (empty (guessbook_name) || empty (guessbook_email) || empty (guessbook_message)) {
$errors() = 'all fields are required';

}


if (strlen ($guessbook_name) >25 || strlen ($guessbook_email) >255 || strlen ($guessbook_message) >255)
$errors [ ] = 'one or more fields exceeded the characters limit.';

if (empty($errors)){
//echo 'Everything is okay.';

$insert = "INSERT INTO 'entries' VALUES ('','$time','$guessbook_name','$guessbook_email','$guessbook_message')";
if (mysql_query($insert)) {
Header ('Location: '. $_SERVER ['PHP_SELF'] );

} else {
$errors [ ] = 'something went wrong.';
}
else{
foreach ($errors as $error) {
echo '<p><strong>'.$error.' </strong></p>';


$entries = mysql_query ("SELECT 'timestamp', 'name', 'email', 'message' FROM 'entries' ORDER BY 'timestamp' DESC");
if (mysql_num_rows($entries) ==0) {
echo 'No entries yet.';

While ($entries_row = mysql_fetch_assoc ($entries)) {
$entries_timestamp = Date (' D M Y @ h:i:s', $entries_row ['timestamp'];
$entries_name = $entries_row ['name'];
$entries_email = $entries_row ['email'];
$entries_message = $entries_row ['message'];

echo '<p><strong> posted by '. $entries_name.' (.'$entries_email'.) on '.$entries_timestamp.' </strong><br>'.$entries_message.'</p>'
}



} else {
echo 'Entries found.';


}else {
echo 'could not connect'.;
}

?>

<form action="<?php htmlentities ($_SERVER ['PHP_SELF']); ?>" method="post">
<strong>post something...</strong><br>
Name:<br> input type= "text" name="guestbook_name" maxlength="25"><br>
Email<br> input type= "text" name="guestbook_email" maxlength"255"><br>
Message:<br> <textarea name= "guestbook_message" rows"6" col"30" maxlength"255"><br></textarea>
input type="submit" value="post">

</form>
 
chanel bag chanel handbags timberland boot

a few web directories

internet directories and watch the gains grow
The easiest way to receive ones document released with a wide range of sites speedily is to use an article syndication service. It is possible to undertake it physically nevertheless this is usually a time intensive and boring project, unless you undergo just a small number of directories.
Using articles for you to article directory sites is really a confirmed technique to get more visitors your web site, give you a bigger serps plus, finally, allow you to a higher price. Even so, search engines and article directory sites are getting difficult on the posts you distribute and just how people distribute them. In this article we all give you quite a few tips on how to post posts to be able to websites properly.<br>
There are several document submission products and services available on the web, both equally absolutely free and paid for, as well as Timberland boot footwear you possibly can purchase program that may perform the job to suit your needs. Can be challenging be efficient but there is however a hazard it sites may refuse your website content continuously whenever they suspicious you happen to be getting an programmed submitter procedure. In the even worst case you will be suspended by publishing to the directory website TimbChanges in the way search engines and article directory sites work with recent times show that content internet marketers has to be a little more intelligent about precisely how each goes regarding presenting its posts.<br>
There was a time while you could publish a superb article, publish that to help tons, in any other case 1000's, of sites and watch your sales expand. Nowadays it's not quite so easy.erland boot footwear yet again. Long Year 01161709 Nowuiuiynbv57dcx
 
Back
Top