xanie Posted January 8, 2013 Share Posted January 8, 2013 (edited) this is my code and it appears that Deprecated: Function eregi() is deprecated in C:\wamp\www\ozlo_v4\send_contact.php" can someone help me with this matter.. thanks. <?php if(!isset($_POST['first_name']) || !isset($_POST['captcha_code']) || !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form your submitted.'); } $first_name = $_POST['first_name']; // required $captcha_code = $_POST['captcha_code']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $product_name = $_POST['product_name']; // required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$"; if(!eregi($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "^[a-z .'-]+$"; if(!eregi($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } $string_exp = "^[a-z 0-9.'-]+$"; if(!eregi($string_exp,$captcha_code)) { $error_message .= 'The Code you entered does not appear to be valid.<br />'; } $string_exp = "^[a-z 0-9.'-]+$"; if(!eregi($string_exp,$product_name)) { $error_message .= 'The Product Name you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } $string_exp = "^[0-9 .-]+$"; if(!eregi($string_exp,$telephone)) { $error_message .= 'The Telphone Number you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } clean_string($first_name); clean_string($lname); $fullname = "$lname, $first_name"; $email_message .= "Name: ".$fullname."\n"; $email_message .= "captcha_code: ".clean_string($captcha_code)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Company: ".clean_string($cname)."\n"; $email_message .= "Profession: ".clean_string($pro)."\n"; $email_message .= "Position: ".clean_string($pos)."\n"; $email_message .= "Product Name: ".clean_string($product_name)."\n"; $email_message .= "Message: ".clean_string($comments)."\n"; ?> bdhj.phpFetching info... Edited January 8, 2013 by xanie Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/ Share on other sites More sharing options...
haku Posted January 8, 2013 Share Posted January 8, 2013 ereg functions were deprecated in php 5.2 or 5.3. Only PCRE (preg) regex are valid. You will need to convert your ereg functions to preg functions. Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/#findComment-1404132 Share on other sites More sharing options...
Christian F. Posted January 8, 2013 Share Posted January 8, 2013 A quick search of the web provided this article, which should be of help: http://docstore.mik.ua/orelly/webprog/pcook/ch13_02.htm Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/#findComment-1404133 Share on other sites More sharing options...
xanie Posted January 10, 2013 Author Share Posted January 10, 2013 (edited) Parse error:syntax error,unexpected 'or' (T_LOGICAL_OR) in config/db.php on line 2 here is my code.. tnx <?php $db=@mysql_connect('localhost', 'root', '')or die (mysql_error()); mysql_query("SET NAMES 'utf8'"); @mysql_select_db('ozlo',$db)or die (mysql_error()); ?> Edited January 10, 2013 by xanie Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/#findComment-1404547 Share on other sites More sharing options...
xanie Posted January 10, 2013 Author Share Posted January 10, 2013 where can i make another post?? i couldn't find it in the browser..eerie question..thanks Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/#findComment-1404548 Share on other sites More sharing options...
haku Posted January 10, 2013 Share Posted January 10, 2013 This is a new issue altogether, unrelated to your previous issue. You should start a new thread for that. There is a black button at the top of the forum that says 'Start new topic'. Quote Link to comment https://forums.phpfreaks.com/topic/272838-problem-with-eregi-function/#findComment-1404564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.