Results 1 to 14 of 14
Thread: help to solve it
-
05-01-2011, 09:01 AM #1New Member
- Join Date
- Mar 2011
- Posts
- 4
help to solve it
that message are appear at my web site i am not now how to
fix it so please help me
Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469
Deprecated: Function eregi() is deprecated in /home/xxx/public_html/xxx/xxx/functions.php on line 469
and the line 469 are that
if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {
-
05-01-2011, 09:05 AM #2Web Hosting Master
- Join Date
- May 2008
- Location
- Melbourne, Australia
- Posts
- 10,629
What script are you using, Wordpress?
██ l Dedigeeks • Shared • Wordpress • Dedicated • Established 2006
██ l Leading AUSTRALIAN Hosting Provider • Sydney & Melbourne Datacentres
██ l cPanel/WHM • R1Soft Backups • 24/7/365 Support • SMS Hosting Alerts*
██ l www.dedigeeks.com • Managing Director • Service Superstars
-
05-01-2011, 09:06 AM #3Web Hosting Master
- Join Date
- Mar 2004
- Posts
- 551
If you google for "eregi php" you'll come up with helpful links like this which answer your question:
http://devthought.com/2009/06/09/fix...ors-in-php-53/
-
05-01-2011, 11:24 AM #4
You can use a host using php 5.2.17 (latest stable version of 5.2). Lots of scripts do not work with 5.3.xx.
HostXNow - Shared Web Hosting | Semi Dedicated Hosting | Enterprise Reseller Hosting | VPS Hosting
-
05-02-2011, 10:16 AM #5Web Hosting Guru
- Join Date
- Apr 2011
- Location
- Philippines
- Posts
- 301
As what I learned your host has upgraded it's php version or has very sensitive error reporting. Those messages are NOT errors, just notices and one thing you have to know is that everything still works as it should. Just Google the exact message appears and you'll immediately see a solution for it.
-
05-02-2011, 11:07 AM #6Web Hosting Master
- Join Date
- Jun 2003
- Location
- California
- Posts
- 2,786
If you can, contact the script author to get the newest version, or advise him that he needs to update his deprecated functions. For this one, there is no exact replacement for eregi using preg_match, but there are workarounds (see this page for more info).
PHP recommends not having these messages write to the screen in a production server, but shared hosts often leave them so the customers know when a script needs updating. Your host may be able to suppress the warnings for you, either by complying with the PHP recommendation or installing a local php.ini file for you.
If you are on a limited disk space plan, look for an "error_log" file in the directory where the errors are happening. It is easy for these log files to grow quickly to hundreds of megabytes. Logging can be turned off in php.ini also.
-
05-02-2011, 12:02 PM #7Junior Guru Wannabe
- Join Date
- Jul 2003
- Location
- US
- Posts
- 61
you can also place display_errors=Off into your php.ini file and those warning will not be displayed.
Rotmax - Advanced Hosting Solutions
| Providing premium hosting since 2001.
| http://www.rotmax.com
| Follow us on Facebook: Rotmax-Facebook
-
05-02-2011, 12:06 PM #8WHT Addict
- Join Date
- Sep 2005
- Posts
- 170
█ StableHost.com - Home to over 23,000 websites.
█ Contact us: 866.945.6952
█ Offering: 24/7/365 Support, Web Builder and Softaculous.
█ Read over 100+ reviews about us at RateLobby!
-
05-02-2011, 01:27 PM #9Web Hosting Master
- Join Date
- Jun 2003
- Location
- California
- Posts
- 2,786
The functions deprecated with the latest version still work ... for now. They will stop working (i.e., be removed) as of PHP 6. On a production server, you aren't even supposed to have them print to the screen (here's a quote from PHP.INI):
; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = Off
There is nothing wrong with using "display_errors = Off", as PHP.net recommends, while you work on fixing the errors. You don't have to panic; PHP 6 is quite a ways off still.
-
05-02-2011, 03:35 PM #10WHT Addict
- Join Date
- Apr 2011
- Posts
- 107
display_errors = Off should be used on a productions server. The only time it should be turned on is in a development server.
However, there is not any reason to switch to a host that uses an older version of php just so you can run your script. PHP 5.3 is actually faster if the script is upgraded. If you like your host, then keep them. The errors will show up even if you turn off display_errors and it will fill your error log. You just won't be able to see them on the screen.
To fix your issue this would be the most likely fix. However, depending on the script you may actually be able to use strstr instead of preg_match. Because they are regular expressions you might need to simply try both and make sure they work. strstr is faster than preg_match in some cases while it is the reverse in others.
if (!(eregi('^[1-9]{1}[0-9]{0,2}$',$num)) && (!(eregi('^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$',$num)))) {
Change to:
if (!(preg_match('/^[1-9]{1}[0-9]{0,2}$/i',$num)) && (!(preg_match(/'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$/i',$num)))) {
I personally like this better.
if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match(#'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {
I haven't seen the rest of the script so it maybe need a little tweaking. But the error is just a depreciated error and shouldn't cause any errors with the way the script runs. These errors only show up because the function is no longer supported in php 5.3+. The function will be removed from php 6.
Note: The fixes above are examples that should work but i only posted them so you can see what your script should look like with the changes. Because I don't know what the script is I can't exactly tell you the correct fix for it. On the plus side, it will tell you if it is wrong. If you do try it, just make a backup first.
-
05-03-2011, 01:18 PM #11New Member
- Join Date
- Mar 2011
- Posts
- 4
Thanks to all of you and specially killigan for helping me
to fix that problem now it is solved that one works
if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match(#'^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {
only one error in the red Single Quote are before the hash.
again thanks to all of you for helping me.
-
05-03-2011, 02:17 PM #12WHT Addict
- Join Date
- Apr 2011
- Posts
- 107
That was a typo. Sorry about that. This is the correct edit.
if (!(preg_match('#^[1-9]{1}[0-9]{0,2}$#i',$num)) && (!(preg_match('#^[0-9]{1}[0-9]{0,2}[.]{1}[0-9]{2}$#i',$num)))) {
-
05-03-2011, 02:21 PM #13New Member
- Join Date
- Mar 2011
- Posts
- 4
-
05-03-2011, 02:26 PM #14WHT Addict
- Join Date
- Apr 2011
- Posts
- 107
Anytime. Glad I could help.
Similar Threads
-
Can you solve this?
By incubus898 in forum Web Design and ContentReplies: 7Last Post: 03-31-2011, 11:56 PM -
solve this
By Soskel34 in forum Web Hosting LoungeReplies: 7Last Post: 04-27-2008, 12:47 AM -
how i can solve this ???
By soonhelp in forum Dedicated ServerReplies: 2Last Post: 08-31-2004, 04:45 PM -
How Do I Solve This?
By [inx]Olly in forum Hosting Security and TechnologyReplies: 0Last Post: 10-08-2003, 04:35 AM -
can you solve this one
By Arabiahosts in forum Programming DiscussionReplies: 3Last Post: 01-05-2003, 03:53 PM