Jump to content

Execute PHP stored in MySQL Database?


moshina786

Recommended Posts

Hi Guys,

 

I have a webpage which has subsequent pages stored in a database e.g. index.php?id=1

 

The problem being, is that id=1 has it's data pulled from a database. This was fine & dandy until I started to insert PHP...I am trying to get the below to executre

 

<?php

$rater_id=1;

$rater_item_name='Rate This';

include("rater.php");?>

 

However nothing shows & nothing happens, I know eval can be used but have not been succesfull in implementing this, can someone  please help!

Link to comment
https://forums.phpfreaks.com/topic/235267-execute-php-stored-in-mysql-database/
Share on other sites

Pages stored in a database? Usually specific data are stored in a database, each one with it's own, unique ID. That "id" url variable can be retrieved with $_GET and be used to fetch the correct row from the database. Simple enough, at least from what your request looks like.

 

PS: eval() should be renamed to evil(). As Rasmus Lerdorf [is thought] to say, "If eval() is the answer, you're almost certainly asking the wrong question.".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.