Page 1 of 1

Fatal Error eval()'d code

Posted: Sat Nov 09, 2013 12:14 pm
by ojoc88
Hi all,

I'm run a script on xampp server.
After login , i get this error:

Fatal error: Call to undefined function session_register() in D:\xampp\htdocs\DSM\loader.php(22) : eval()'d code on line 25

php code as per below

Code: Select all

<?php require_once('Connections/drsa.php'); 

mysql_select_db($database_drsa, $drsa);
$query_test = "SELECT * FROM backups WHERE backups_id = 

10";
$test = @(mysql_query($query_test, $drsa));
if(@($test)) {


if(isset($_GET['load'])) {
$searchwords = $_GET['load']; 
$searchwords = stripslashes($searchwords);
$searchwords = strip_tags($searchwords);
$searchwords = trim($searchwords, "'");
$load = $_GET['load'];
mysql_select_db($database_drsa, $drsa);
$query_file = "SELECT * FROM system WHERE system_name = 

'$searchwords'";
$file = mysql_query($query_file, $drsa);
$row_file = mysql_fetch_assoc($file);
$totalRows_file = mysql_num_rows($file);

$str = $row_file['system_value'];
echo eval ( $str). "\n";
 
 } } else {  header("Location: install.php"); } 
?>

please help to fix this

tq

Re: Fatal Error eval()'d code

Posted: Sat Nov 09, 2013 6:00 pm
by requinix
session_register() is not available in PHP 5.4+. Also, eval() is a horrible function - I'm sure there's a better way to do what you need without storing PHP code in a database.

Re: Fatal Error eval()'d code

Posted: Sun Nov 10, 2013 5:08 pm
by Eric!
I can't even think of a single reason to run code with eval from a database. Wow.

I took a google around and found this is an old xamp package C:\xampp\htdocs\DSM1.0\loader.php for xampp. This might work better if you delete XAMPP and install WAMP. And use v7.0.6 phpfusion or newer.