Hi,
I just started coding a new php/mysql driven website and encountered a problem with the following code: (my index.php)
<?
session_start();
include "/php/includes/mysql.php";
include "/php/includes/error.php";
connect_database();
include "/php/includes/functions.php";
set_referer($_GET['ref']);
$referer = (!empty($_SESSION["ref"])) ? $_SESSION["ref"] : "-";
$input = $_GET['page'];
$page = get_content($input);
?>
<br>very demo html:
<br>
<title><?=$referer;?></title>
<br>Referer: <?=$referer;?>
<br>--------------------------
<br>Page: <?=$page[title];?>
<br>--------------------------
<br>Content: <?=$page[body];?>
<br>--------------------------
Basicly the code retrieves the id,title, id and body of each page from the sql-database, puts it in a array and displays it to the user. The problem is only that $page[boby] contains php-code which is not being parsed but just showed to the user dus to the 'echo' command.
How can I rewrite my script so all php-code stored in my database is processed and not showed? (I assume this is something very basic and simple, but due to the fact this is my first php-script I have to clue how to solve this problem....)
Thanks in advance,
cK
I just started coding a new php/mysql driven website and encountered a problem with the following code: (my index.php)
Code:
<?
session_start();
include "/php/includes/mysql.php";
include "/php/includes/error.php";
connect_database();
include "/php/includes/functions.php";
set_referer($_GET['ref']);
$referer = (!empty($_SESSION["ref"])) ? $_SESSION["ref"] : "-";
$input = $_GET['page'];
$page = get_content($input);
?>
<br>very demo html:
<br>
<title><?=$referer;?></title>
<br>Referer: <?=$referer;?>
<br>--------------------------
<br>Page: <?=$page[title];?>
<br>--------------------------
<br>Content: <?=$page[body];?>
<br>--------------------------
Basicly the code retrieves the id,title, id and body of each page from the sql-database, puts it in a array and displays it to the user. The problem is only that $page[boby] contains php-code which is not being parsed but just showed to the user dus to the 'echo' command.
How can I rewrite my script so all php-code stored in my database is processed and not showed? (I assume this is something very basic and simple, but due to the fact this is my first php-script I have to clue how to solve this problem....)
Thanks in advance,
cK