Strict Standards: Non-static method DB::connect() should not be called statically in /home/accessib/public_html/blog/2011/05/Prezi.php on line 10

Strict Standards: Non-static method DB::parseDSN() should not be called statically in /home/accessib/php/DB.php on line 520

Strict Standards: Non-static method DB::isError() should not be called statically in /home/accessib/php/DB.php on line 551

Strict Standards: Non-static method DB::isError() should not be called statically in /home/accessib/php/DB.php on line 557

Strict Standards: Non-static method DB::isError() should not be called statically in /home/accessib/public_html/blog/2011/05/Prezi.php on line 11
Accessible Website Design | Accessible Web Studio | Prezi
Content

Accessible Web Studio Blog Post

Prezi

View information as a webpage.


Posted by Jadwiga [ 05/11/2011 at 13:58:06 ]

Post a Comment

$form = <<
[Fields marked with * are required.
We reserve the right to edit/remove posts.
]
[ At most 256 characters ]
Error found You must provide post comment Comment is invalid, missing or longer than 256 characters.

Error found You must provide your name Name contains invalid characters.
[ Will be kept private ]
Error found You must provide your email Email address is invalid.
EOD; $processor =& new FormValidator($form); if ($processor->validate()) { // Specify the email recipient first // $to = WEBSITE_TOBLOGEMAIL; $email = isset($_POST["email"]) ? $_POST["email"] : ""; $name = isset($_POST["name"]) ? $_POST["name"] : ""; $post = isset($_POST["post"]) ? $_POST["post"] : ""; $post = substr($post, 0, 255); $name = substr($name, 0, 49); $email = substr($email, 0, 49); $email = preg_replace( "/[\n\r]+/", " ", $email); $name = preg_replace( "/[\n\r]+/", " ", $name); $post = preg_replace( "/[\n\r]+/", " ", $post); $email = addslashes(htmlspecialchars($email)); $name = addslashes(htmlspecialchars($name)); $post = addslashes(htmlspecialchars($post)); $noslashespost = $post; $post = addslashes(htmlspecialchars($post)); // subject // $subject = "Email From ". WEBSITE_NAME ." Website - New Post"; // To send HTML mail, the Content-type header must be set // $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; // Additional headers // $fromemail = WEBSITE_FROMEMAIL; $headers .= "From: " . $fromemail . "\r\n" . "Reply-To: " . $email . "\r\n"; // Mail it // $message = " Name: ".$name."
Email: ".$email."
Your comment: ".$noslashespost."
"; $message .= ""; mail($to, $subject, $message, $headers); // Create comment entry // $date = date("Y-m-d H:i:s"); $query = "INSERT INTO comments SET cpID = '{$pid}', ccomment = '{$post}', cauthor = '{$name}', cauthemail = '{$email}', cdateposted = '{$date}', crevdate = '{$date}'"; $result = $connection->query($query); if (DB::isError($result)) trigger_error($result->getMessage(), E_USER_ERROR); echo "

"; echo "Name: ".$name."
"; echo "Email: ".$email." [ Will be kept private ]
"; echo "Comment: ".$noslashespost."
"; echo "


"; echo "

[ Thank you for taking the time to add your comment to our blog. Your post will be reviewed and/or edited and will appear on the website shortly. ]

"; unset($name); unset($email); unset($post); } else { $processor->display(); } echo C_BOTTOMSKIPLINK; ?>