I never figured out how to send queries. I need to know how so I disable eval and figure out a buncha errors in my log.
Thanks!
Run this query in phpMyAdmin:
REPLACE INTO smf_settings (variable, value) VALUES ('disableTemplateEval', 1);
Does it have to be from phpMyAdmin? $#!tz!
My phpMyAdmin is broken and I cannot get the stupid thing to work not matter what I try and do to fix it.
Anyone ever have an error like this before?
Error
MySQL said:
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin was unable to read your configuration file!
This might happen if PHP finds a parse error in it or PHP cannot find the file.
Please call the configuration file directly using the link below and read the PHP error message(s) that you receive. In most cases a quote or a semicolon is missing somewhere.
If you receive a blank page, everything is fine.
./config.inc.php
Then save the code below into a file and name it eval.php
Upload it to your forum directory. Its important.
Run it from the browser, it will do the query for you.
<?php
if (!@include_once('Settings.php')) die ('Put this file to where SMF is.');
mysql_connect($db_server, $db_user, $db_passwd);
if (!@mysql_select_db($db_name)) die ('Cant get the database information.');
$request = mysql_query("REPLACE INTO {$db_prefix}settings (variable, value) VALUES ('disableTemplateEval', '1');");
if ($request) echo 'Using eval in templates is now disabled.';
else echo 'Something wrong. Debug info:', mysql_error();
mysql_close();
?>
Edit: Your phpMyAdmin is not broken actually. It doesnt know the MySQL password. Quickly contact your host and ask them to configure phpMyAdmin correctly to know the valid MySQL password.
How will I know if it worked? I don't see anything different happening.
After you point your browser to that code elmacik posted, you should see a message saying something like ''Using eval in templates is now disabled''
Quote from: babjusi on September 03, 2007, 02:38:32 PM
After you point your browser to that code elmacik posted, you should see a message saying something like ''Using eval in templates is now disabled''
Edit: NM
How do I swtich it back to eval?
<?php
if (!@include_once('Settings.php')) die ('Put this file to where SMF is.');
mysql_connect($db_server, $db_user, $db_passwd);
if (!@mysql_select_db($db_name)) die ('Cant get the database information.');
$request = mysql_query("REPLACE INTO {$db_prefix}settings (variable, value) VALUES ('disableTemplateEval', '0');");
if ($request) echo 'Using eval in templates is now enabled.';
else echo 'Something wrong. Debug info:', mysql_error();
mysql_close();
?>
K, I got it...fixed all my errors in my log I think...so far anyway.
Many thanks to Elmacik for the quick response and for the resolution.
Actually, it doesn't fix any errors, it justs disables them.
Kind of like sticking your head in the sand ;)
Quote from: Webrunner on September 05, 2007, 02:14:13 AM
Actually, it doesn't fix any errors, it justs disables them.
Kind of like sticking your head in the sand ;)
Um, no what I mean was... I was able to fix the errors by locating them after disabling eval. It was nearly impossible to see where the errors were coming from until it was disabled.
I never meant to imply that disabling eval alone solved the errors.
Just wanted to clear that up.
Ahh.. OK, that was a misunderstanding then :)
No biggie, just making sure no one else gets confused. ;)