DB and eval. HELP !!!

DB and eval. HELP !!!

am 20.05.2002 14:16:36 von Bogdan ROMAN

------=_NextPart_000_014D_01C20008.F33B18B0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hello

I busted my a$$ out to figure it out but i had to ask for help.

Considering you have this line in a DB (TEXT field):

You can go here: and =
find information

That needs to be output in a html webpage between two

tags.

How can you eval the to the contents =
of $website['originalDomain'] ?????

I've tried this:

print '

'.preg_replace( "'<\?=3D(.*?)\?>'esi", '\\1', $row['title'] =
).'

'

Where $row is the result from mysql_fetch_assoc() function and 'title' =
is the field containing the above line. If i use the above line of code =
(with preg_replace) or if i simply try to eval the code i get errors =
like:

Warning: Unexpected character in input: '\' (ASCII=3D92) state=3D1 in =
h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1

Parse error: parse error, unexpected $ in =
h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1

Fatal error: Failed evaluating code: $website[\'originalDomain\'] in =
h:\wwwroot\work\site\website_gen.php on line 41

As you note, it automatiaclly adds slashes to the ['originalDomain']. I =
tried to remove them with stripslashes() or even again preg_replace() =
but doesnt work.

Please help !!!
Thank you,

Bogdan


Bogdan Roman


email:bogdan.roman@gmx.net
msn:mastabog@hotmail.com
yahoo:bogdanbog
website:http://bog.ath.cx

------=_NextPart_000_014D_01C20008.F33B18B0--

Re: DB and eval. HELP !!!

am 20.05.2002 20:11:58 von szii

foreach($website = mysql_fetch_array($result))
{
$text = "You can go here: and find information";
eval($text);
}

You get the idea...

'Luck

-Szii

----- Original Message -----
From: "Bogdan ROMAN"
To:
Sent: Monday, May 20, 2002 5:16 AM
Subject: [PHP-DB] DB and eval. HELP !!!


Hello

I busted my a$$ out to figure it out but i had to ask for help.

Considering you have this line in a DB (TEXT field):

You can go here: and find information

That needs to be output in a html webpage between two

tags.

How can you eval the to the contents of $website['originalDomain'] ?????

I've tried this:

print '

'.preg_replace( "'<\?=(.*?)\?>'esi", '\\1', $row['title'] ).'

'

Where $row is the result from mysql_fetch_assoc() function and 'title' is the field containing the above line. If i use the above
line of code (with preg_replace) or if i simply try to eval the code i get errors like:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1

Parse error: parse error, unexpected $ in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1

Fatal error: Failed evaluating code: $website[\'originalDomain\'] in h:\wwwroot\work\site\website_gen.php on line 41

As you note, it automatiaclly adds slashes to the ['originalDomain']. I tried to remove them with stripslashes() or even again
preg_replace() but doesnt work.

Please help !!!
Thank you,

Bogdan


Bogdan Roman


email:bogdan.roman@gmx.net
msn:mastabog@hotmail.com
yahoo:bogdanbog
website:http://bog.ath.cx



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DB and eval. HELP !!!

am 20.05.2002 20:21:34 von szii

Oops, minor oversights on my part.

If you're calling eval() in the context of a PHP script, you
don't have to the eval'd code...

> foreach($website = mysql_fetch_array($result))
> {
> $text = "You can go here: $website['originalDomain'] and find information";
> }

The above code doesn't even require an eval() call.

Apologies for the confusion..

-Szii

----- Original Message -----
From:
To: "Bogdan ROMAN"
Cc:
Sent: Monday, May 20, 2002 11:11 AM
Subject: Re: [PHP-DB] DB and eval. HELP !!!


> foreach($website = mysql_fetch_array($result))
> {
> $text = "You can go here: and find information";
> eval($text);
> }
>
> You get the idea...
>
> 'Luck
>
> -Szii
>
> ----- Original Message -----
> From: "Bogdan ROMAN"
> To:
> Sent: Monday, May 20, 2002 5:16 AM
> Subject: [PHP-DB] DB and eval. HELP !!!
>
>
> Hello
>
> I busted my a$$ out to figure it out but i had to ask for help.
>
> Considering you have this line in a DB (TEXT field):
>
> You can go here: and find information
>
> That needs to be output in a html webpage between two

tags.
>
> How can you eval the to the contents of $website['originalDomain'] ?????
>
> I've tried this:
>
> print '

'.preg_replace( "'<\?=(.*?)\?>'esi", '\\1', $row['title'] ).'

'
>
> Where $row is the result from mysql_fetch_assoc() function and 'title' is the field containing the above line. If i use the above
> line of code (with preg_replace) or if i simply try to eval the code i get errors like:
>
> Warning: Unexpected character in input: '\' (ASCII=92) state=1 in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1
>
> Parse error: parse error, unexpected $ in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1
>
> Fatal error: Failed evaluating code: $website[\'originalDomain\'] in h:\wwwroot\work\site\website_gen.php on line 41
>
> As you note, it automatiaclly adds slashes to the ['originalDomain']. I tried to remove them with stripslashes() or even again
> preg_replace() but doesnt work.
>
> Please help !!!
> Thank you,
>
> Bogdan
>
>
> Bogdan Roman
>
>
> email:bogdan.roman@gmx.net
> msn:mastabog@hotmail.com
> yahoo:bogdanbog
> website:http://bog.ath.cx
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DB and eval. HELP !!!

am 20.05.2002 20:37:42 von szii

I'm sorry, I'm having an "off day." This'll be my last post on the
subject. *sigh* Apologies up front...

while($website = mysql_fetch_array($result))
{
$text = "You can go here: " . $website['originalDomain'] . " and find information";
echo $text;
}

I'll shut up now... :)

-Szii


----- Original Message -----
From:
To: "Bogdan ROMAN"
Cc:
Sent: Monday, May 20, 2002 11:21 AM
Subject: Re: [PHP-DB] DB and eval. HELP !!!


> Oops, minor oversights on my part.
>
> If you're calling eval() in the context of a PHP script, you
> don't have to the eval'd code...
>
> > foreach($website = mysql_fetch_array($result))
> > {
> > $text = "You can go here: $website['originalDomain'] and find information";
> > }
>
> The above code doesn't even require an eval() call.
>
> Apologies for the confusion..
>
> -Szii
>
> ----- Original Message -----
> From:
> To: "Bogdan ROMAN"
> Cc:
> Sent: Monday, May 20, 2002 11:11 AM
> Subject: Re: [PHP-DB] DB and eval. HELP !!!
>
>
> > foreach($website = mysql_fetch_array($result))
> > {
> > $text = "You can go here: and find information";
> > eval($text);
> > }
> >
> > You get the idea...
> >
> > 'Luck
> >
> > -Szii
> >
> > ----- Original Message -----
> > From: "Bogdan ROMAN"
> > To:
> > Sent: Monday, May 20, 2002 5:16 AM
> > Subject: [PHP-DB] DB and eval. HELP !!!
> >
> >
> > Hello
> >
> > I busted my a$$ out to figure it out but i had to ask for help.
> >
> > Considering you have this line in a DB (TEXT field):
> >
> > You can go here: and find information
> >
> > That needs to be output in a html webpage between two

tags.
> >
> > How can you eval the to the contents of $website['originalDomain'] ?????
> >
> > I've tried this:
> >
> > print '

'.preg_replace( "'<\?=(.*?)\?>'esi", '\\1', $row['title'] ).'

'
> >
> > Where $row is the result from mysql_fetch_assoc() function and 'title' is the field containing the above line. If i use the
above
> > line of code (with preg_replace) or if i simply try to eval the code i get errors like:
> >
> > Warning: Unexpected character in input: '\' (ASCII=92) state=1 in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line
1
> >
> > Parse error: parse error, unexpected $ in h:\wwwroot\work\site\website_gen.php(41) : regexp code on line 1
> >
> > Fatal error: Failed evaluating code: $website[\'originalDomain\'] in h:\wwwroot\work\site\website_gen.php on line 41
> >
> > As you note, it automatiaclly adds slashes to the ['originalDomain']. I tried to remove them with stripslashes() or even again
> > preg_replace() but doesnt work.
> >
> > Please help !!!
> > Thank you,
> >
> > Bogdan
> >
> >
> > Bogdan Roman
> >
> >
> > email:bogdan.roman@gmx.net
> > msn:mastabog@hotmail.com
> > yahoo:bogdanbog
> > website:http://bog.ath.cx
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php