Advertisement:

Author Topic: How do I disable EVAL with query? (RESOLVED) Thanks!  (Read 6779 times)

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
How do I disable EVAL with query? (RESOLVED) Thanks!
« on: September 03, 2007, 02:00:29 PM »
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!
« Last Edit: September 04, 2007, 10:44:28 AM by goitalone »

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,276
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: How do I disable EVAL with query?
« Reply #1 on: September 03, 2007, 02:04:38 PM »
Run this query in phpMyAdmin:
Code: [Select]
REPLACE INTO smf_settings (variable, value) VALUES ('disableTemplateEval', 1);
Home of Elmacik

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #2 on: September 03, 2007, 02:07:01 PM »
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.
« Last Edit: September 03, 2007, 02:15:07 PM by goitalone »

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #3 on: September 03, 2007, 02:12:26 PM »
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

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,276
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: How do I disable EVAL with query?
« Reply #4 on: September 03, 2007, 02:14:55 PM »
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.

Code: [Select]
<?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.
« Last Edit: September 03, 2007, 02:16:56 PM by Elmacik »
Home of Elmacik

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #5 on: September 03, 2007, 02:34:16 PM »
How will I know if it worked? I don't see anything different happening.

babjusi

  • Guest
Re: How do I disable EVAL with query?
« Reply #6 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''

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #7 on: September 03, 2007, 02:42:54 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
« Last Edit: September 03, 2007, 02:45:31 PM by goitalone »

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #8 on: September 03, 2007, 05:19:16 PM »
How do I swtich it back to eval?
« Last Edit: September 03, 2007, 06:06:22 PM by goitalone »

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,276
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: How do I disable EVAL with query?
« Reply #9 on: September 03, 2007, 06:18:09 PM »
Code: [Select]
<?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();
?>

Home of Elmacik

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query?
« Reply #10 on: September 04, 2007, 10:44:06 AM »
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.

Offline Webrunner

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
    • Vrouwenpower
Re: How do I disable EVAL with query? (RESOLVED) Thanks!
« Reply #11 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 ;)
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query? (RESOLVED) Thanks!
« Reply #12 on: September 05, 2007, 07:29:27 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.

Offline Webrunner

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
    • Vrouwenpower
Re: How do I disable EVAL with query? (RESOLVED) Thanks!
« Reply #13 on: September 05, 2007, 05:37:06 PM »
Ahh.. OK, that was a misunderstanding then :)
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Offline goitalone

  • Full Member
  • ***
  • Posts: 490
    • SDA-N-Friends Christian Answers Forum
Re: How do I disable EVAL with query? (RESOLVED) Thanks!
« Reply #14 on: September 05, 2007, 05:50:38 PM »
No biggie, just making sure no one else gets confused. ;)