Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Deprecated: Function eregi_replace() is deprecated. Help!
Old 09-17-2009, 08:04 PM Deprecated: Function eregi_replace() is deprecated. Help!
Novice Talker

Posts: 5
Trades: 0
Hello,

I have been stuck with this error for ages now well since my host updated the php anyways i have been getting this error.

Code:
Deprecated:  Function eregi_replace() is deprecated in C:\wamp\www\index.php on line 7

Deprecated:  Function eregi_replace() is deprecated in C:\wamp\www\index.php on line 8
I was wondering if you could help me. this is the code.

PHP Code:
$q stripslashes$q );
$q eregi_replace"\""" "$q );
$q eregi_replace"\\'"" "$q );
$q trim$q );
$ddl = new ddl( );
$le = new linker( );
$ddl->open( );
$ddl->get$q$types );
if ( 
$_POST['q'] )
{
    
$searchtitle $_POST['q'];
    
$Fix = array( "<"">""#""{""}""//" );
    
$searchtitle str_replace$Fix""$searchtitle );
    
$insertSQL "insert into search (title) values ('{$searchtitle}')";
    
mysql_query$insertSQL );

Thanks in advanced Memory
memory is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-17-2009, 08:12 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
the ereg family of functions is deprecated in PHP 5.3 and will be removed completely in PHP6. Use the perl compatible regular expression functions instead:
http://us2.php.net/manual/en/function.preg-replace.php
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 09-17-2009, 08:13 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
Novice Talker

Posts: 5
Trades: 0
could you help me as i have no idea on what to do.
memory is offline
Reply With Quote
View Public Profile
 
Old 09-17-2009, 08:42 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
You can use a simpler string replace function instead:

$q = str_replace( '"', " ", $q );
$q = str_replace( "'", " ", $q
);
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 09-17-2009, 08:46 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
Novice Talker

Posts: 5
Trades: 0
Now im getting this
Code:
Notice:  Undefined variable: q in C:\wamp\www\index.php on line 7
memory is offline
Reply With Quote
View Public Profile
 
Old 09-17-2009, 08:48 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
Novice Talker

Posts: 5
Trades: 0
also i was told to use preg_replace

so i done this
PHP Code:
$q stripslashes$q );
$q preg_replace"\""" "$q );
$q preg_replace"\\'"" "$q );
$q trim$q );
$ddl = new ddl( );
$le = new linker( );
$ddl->open( );
$ddl->get$q$types );
if ( 
$_POST['q'] )
{
    
$searchtitle $_POST['q'];
    
$Fix = array( "<"">""#""{""}""//" );
    
$searchtitle str_replace$Fix""$searchtitle );
    
$insertSQL "insert into search (title) values ('{$searchtitle}')";
    
mysql_query$insertSQL );


and i gives me this
Code:
Warning: preg_replace() [function.preg-replace]: No ending delimiter '"' found in C:\wamp\www\index.php on line 7

Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in C:\wamp\www\index.php on line 8
memory is offline
Reply With Quote
View Public Profile
 
Old 09-22-2009, 12:27 PM Re: Deprecated: Function eregi_replace() is deprecated. Help!
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
is variable "$types" defined?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Deprecated: Function eregi_replace() is deprecated. Help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35308 seconds with 12 queries