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
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.".

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.