February 2, 200917 yr Hi am wondering if anyone can help me I know next to nothing about php but need to make a spam proof form I have tryed to use a securimage captcha but keep getting errors. Here is my form Link Here is php & Error message Link code for formprocessl.php <?php session_start(); ?> <?php /* Variables */ $emailSubject = 'Website Message!!'; $webMaster = 'howlomogo@hotmail.com'; include_once $_SERVER['DOCUMENT_ROOT'] . 'securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // handle the error accordingly with your other error checking // or you can do something really basic like this die('The code you entered was incorrect. Go back and try again.'); } /* Gathering dta variables */ $firstnameField = $_POST['firstname']; $lastnameField = $_POST['lastname']; $address1Field = $_POST['address1']; $address2Field = $_POST['address2']; $countyField = $_POST['county']; $postcodeField = $_POST['postcode']; $telephoneField = $_POST['telephone']; $mobileField = $_POST['mobile']; $emailField = $_POST['email']; $maxrentField = $_POST['maxrent']; $descField = $_POST['desc']; $desc1Field = $_POST['desc1']; /* this EOP is what will be displayed in the email */ $body = <<<EOD <br /><br /> <h1>Landlord Enquiry</h1> Name:$firstnameField $lastnameField<br /><br /> Address:<br /> $address1Field<br /> $address2Field<br /> $countyField<br /> $postcodeField<br /><br /> Telephone:$telephoneField<br /><br /> Mobile:$mobileField<br /><br /> Email:$emailField<br /><br /> Service they want: $desc1Field EOD; if(!$spam) { $headers = "From: $emailField\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); } else { // Do somthing here to warn about spam } /*results rendered as html */ $theResults = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>ABBA,lettings,Portsmouth,Southsea,Rentals,Properties,To,Let</title> <style type="text/css"> <!-- --> </style> <link rel="stylesheet" type="text/css" href="abba_style.css" /> </head> <body> <div class="container"> <div class="header"> <div class="header-left"> </div> </div> <div class="main"> <div id="nav"> <ul> <li><a href="index.html">Home</a></li> <li><a href="property_search.html">Property Search</a></li> <li><a href="tenant_info.html">Tenant Info</a></li> <li><a href="landlord_info.html">Landlord Info</a></li> <li><a href="property_wanted.html">Property Wanted List</a></li> <li><a href="contact_us.html">Contact Us</a></li> </ul> </div> <div class="toptest"></div> <div class="landlord"> <p class="center">Thank you for your enquiry we will get back to you within 48 hours if you do not hear from us please try phoning or e-mailing us directly</p> </div> <div id="footerlinks" class="footer"> <a href="index.html">Home</a> | <a href="property_search.html">Property Search</a> | <a href="tenant_info.html">Tenant Info</a> | <a href="tenant_form.html">Tenant Form</a> | <a href="landlord_info.html">Landlord Info</a> | <a href="landlord_form.html">Landlord Form</a> | <a href="advertise.html">Advertising</a> | <a href="property_wanted.html">Property Wanted List</a> | <a href="contact_us.html">Contact Us</a> <p class="center"><a href="http://www.mdpdesigns.co.uk">Web Design</a> by MDPdesigns</p> </div> </div> </div> </body> </html> EOD; echo "$theResults"; ?> Error code Warning: include_once(/web/guide/abbaplus/public_html/securimage/securimage.php) [function.include-once]: failed to open stream: No such file or directory in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 11 Warning: include_once() [function.include]: Failed opening '/web/guide/abbaplus/public_html/securimage/securimage.php' for inclusion (include_path='.:/usr/local/lib/php') in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 11 Fatal error: Class 'Securimage' not found in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 13 I would greatly appreciate it if anyone can have a look or help me as I am totally lost Thanks
February 2, 200917 yr Try this instead: include_once $_SERVER['DOCUMENT_ROOT'] . 'abba_lettings/securimage/securimage.php'; on line 11
Create an account or sign in to comment