[PHP] Re: Executebale code from a databse

2002-05-22 Thread Peter

The security shouldn't be a problem. The user will be taken to
www.whatever.com/index.php?page=thispage
index.php then searches for a record with name = thispage and then evaluates
the code stored in a different column of the database.
If the name isn't found, "This page cannot be found" is displayed and if
nothing is entered it goes to the homepage.

Thanks for your help guys!



"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi.
> I'm changing my website to one based on My-SQL which will help with
> organization and searching etc. Hopefully, the code for all the pages will
> be stored in the database too.
> However, I cannot get PHP to parse / execute the code stored in the
> database. The script
>
> $query = mysql_query("SELECT * FROM pages", $link);
> $result = mysql_fetch_array($query);
> print $result['4'];
>
> gets the content of the page (column 4 of the database) but displays
>
> include("common/counter.php"); include("common/navbar.php");
>
> to the screen instead of opening and including these two files in the
> output.
>
> Is there something I need to do to the result to make it executable? Might
I
> need a \n between the two lines of code?
>
> I'm using Win 98, Apache 1.3.19, PHP 4.2.0 and MySQL but I'm not sure
which
> version! (fairly recent though)
>
>



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




[PHP] Re: Executebale code from a databse

2002-05-22 Thread Michael Virnstein

eval ('?>'.$var.' then comes the content of the php script which also can
contain
 html and then we reopen 

and you say
$var = "";

you'll result in

...
eval("?> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi.
> I'm changing my website to one based on My-SQL which will help with
> organization and searching etc. Hopefully, the code for all the pages will
> be stored in the database too.
> However, I cannot get PHP to parse / execute the code stored in the
> database. The script
>
> $query = mysql_query("SELECT * FROM pages", $link);
> $result = mysql_fetch_array($query);
> print $result['4'];
>
> gets the content of the page (column 4 of the database) but displays
>
> include("common/counter.php"); include("common/navbar.php");
>
> to the screen instead of opening and including these two files in the
> output.
>
> Is there something I need to do to the result to make it executable? Might
I
> need a \n between the two lines of code?
>
> I'm using Win 98, Apache 1.3.19, PHP 4.2.0 and MySQL but I'm not sure
which
> version! (fairly recent though)
>
>



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