eregi

Replacing deprecated eregi() with stristr(). Is this php mail script secure from header injections?

岁酱吖の 提交于 2019-12-11 01:36:44
问题 I've been using the same php script to send emails from contact forms for years. But when my web server upgraded to php 5.3 the call to eregi was causing deprecated errors to display. After a Google search I learned that I could use stristr instead of eregi. When I make this simple switch everything works just fine, but I'm no php wizard so I want to know if my script is still secure from header injections. Can someone please put my mind at ease and confirm that this script is safe (or at

Deprecated: Function ereg() is deprecated [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-10 17:35:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I convert ereg expressions to preg in PHP? My contact form is othervise working but I keep getting the following error: Deprecated: Function ereg() is deprecated in/home/..... I'm really lost here but I figure this is the part that needs some adjusting. if ( empty($_REQUEST['name']) ) { $pass = 1; $alert .= $emptyname; } elseif ( ereg( "[][{}()*+?.\\^$|]", $_REQUEST['name'] ) ) { $pass = 1; $alert .=

Deprecated: Function eregi() is deprecated in [duplicate]

走远了吗. 提交于 2019-12-10 12:34:20
问题 This question already has answers here : How can I convert ereg expressions to preg in PHP? (4 answers) Closed 6 years ago . I'm trying to submit values to the database but i get an error message Deprecated: Function eregi() is deprecated in C:\wamp\www\OB\admin_add_acc.php on line 20 and 27 Here is the code: <?php include 'db_connect.php'; if(isset($_POST['Submit'])) { $acc_type=ucwords($_POST['acc_type']); $minbalance=ucwords($_POST['minbalance']); if (!eregi ("^[a-zA-Z ]+$", stripslashes

Alternative to eregi() in php [duplicate]

不问归期 提交于 2019-12-04 13:11:00
This question already has answers here : How can I convert ereg expressions to preg in PHP? (4 answers) Closed 6 years ago . So, i was using eregi in my mail script, but as of lately, i get the error that the function is deprecated. So, what is the easiest way to replace the following bit of code: if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email'])))? Any help is appreciated :) if (!preg_match("/^[A-Z0-9.%-]+@[A-Z0-9.%-]+.[A-Z]{2,4}$/", trim($_POST['email']))) Using preg_match. Because ereg_* functions is deprecated in PHP >= 5.3 Also for email validation better used

Deprecated: Function eregi_replace() [duplicate]

百般思念 提交于 2019-11-28 14:27:23
This question already has an answer here: How can I convert ereg expressions to preg in PHP? 4 answers I am getting the following error when running on PHP 5.3.8 Deprecated: Function eregi_replace() is deprecated in /home/XXXXXX/public_html/admin/modifypoll.php on line 49 This is the line of code, can anyone help please $question = eregi_replace('</?[a-z][a-z0-9]*[^<>]*>', '', $question ); I am not sure what to change it to. Can anyone help please the entire ereg family of functions are deprecated in PHP and will at some point be removed from the language. The replacement is the preg family.

ereg/eregi replacement for PHP 5.3 [duplicate]

走远了吗. 提交于 2019-11-27 20:39:54
This question already has an answer here: How can I convert ereg expressions to preg in PHP? 4 answers I'm sorry to ask a question but I am useless when it comes to understanding regex code. In a php module that I didn't write is the following function function isURL($url = NULL) { if($url==NULL) return false; $protocol = '(http://|https://)'; $allowed = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; $regex = "^". $protocol . // must include the protocol '(' . $allowed . '{1,63}\.)+'. // 1 or several sub domains with a max of 63 chars '[a-z]' . '{2,6}'; // followed by a TLD if(eregi($regex, $url)==true)

Function eregi() is deprecated [duplicate]

我们两清 提交于 2019-11-26 09:57:38
问题 This question already has an answer here: How can I convert ereg expressions to preg in PHP? 4 answers Function eregi() is deprecated. How can i replace eregi(). I try with preg_match but then stop working. i us ethis help: http://takien.com/513/how-to-fix-function-eregi-is-deprecated-in-php-5-3-0.php CODE BEFORE: if ( ! eregi(\"convert$\", $this->library_path)) { if ( ! eregi(\"/$\", $this->library_path)) $this->library_path .= \"/\"; $this->library_path .= \'convert\'; } if (eregi(\"gd2$\",

工具导航Map