Re: problem about ereg function
| From: | Richard Lynch | Date: | Wed, 03 Oct 2001 03:42:43 +0000 |
| Subject: | Re: problem about ereg function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69705@lists.php.net to get a copy of this message | ||
You really shouldn't be storing a PHP variable in your database...
Too easy for a hacker to get some bad PHP into it.
You could mess with http://php.net/eval maybe.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Mydata <muyuan11@sian.com>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Sunday, September 30, 2001 3:15 AM
Subject: problem about ereg function
> hi,
> I am using ereg funtion to deal with data submmited by form
> detail shown below:
>
> I am using a form to submit some html code include image path code
> In submitted php page, I want to replace image path code in html code
> (submitted by last page' form), unfortunately the image path code include
> some php variable (eg "imag src ='$phpvaribe'"),I want to use ereg
function
> to replace image path code by the value I need. but when I use
eregi_replace
> fuction try to replace it . but browser show me parsing error . I don't
know
> how to use eregi_replace() when php varible in string which needed to be
> replaced. Could someone help me. My error code show below:
>
> MY ERROR CODE:
>
> eregi_replace("^\"(.)*{$img1_name}\"$","$replacestring",$content)
>
>
> remark:the $img1_name is the php variable in the string which needed to be
> replaced
>
>