Search found 4 matches

by alexmila
Sun Feb 01, 2009 1:54 pm
Forum: PHP - Code
Topic: Including files with possible syntax errors...
Replies: 4
Views: 184

Re: Including files with possible syntax errors...

Randwulf! great idea now it works!      $str = file_get_contents($file);                              if (eval($str)){              $arr=eval($str);                 print_r($arr);         }               I get the string from file_get_contents then I evaluate it as php code, if it doesn't return fal...
by alexmila
Sun Feb 01, 2009 1:31 pm
Forum: PHP - Code
Topic: Uncheck check box if already checked
Replies: 4
Views: 412

Re: Uncheck check box if already checked

Do this in the first condition_    if (isset($_POST[Nick]) && $_POST[Nick]=='on') {    mysql_query ("UPDATE users SET privacy='yes' WHERE uID='Nick'");      }      else     {      mysql_query ("UPDATE users SET privacy='no' WHERE uID='Nick'");     }   If I remember and I'...
by alexmila
Sun Feb 01, 2009 1:19 pm
Forum: PHP - Code
Topic: Including files with possible syntax errors...
Replies: 4
Views: 184

Re: Including files with possible syntax errors...

I tried that already and didn't work, I keep getting the same warning.

Code: Select all

 
<?php
 
if(file_get_contents($file))
    {
        include_once $file; 
        }else{
               echo "failure";
        }
 
?>
 

Error:

Code: Select all

 
Parse error: parse error, expecting `')'' in....line 8
 
by alexmila
Sun Feb 01, 2009 12:53 pm
Forum: PHP - Code
Topic: Including files with possible syntax errors...
Replies: 4
Views: 184

Including files with possible syntax errors...

Hi Guys, I'm working on script that includes others scripts in another folder which they could have a syntax error. I'm reading php arrays in those scripts. What I want to do it's to catch that error when before opening or while opening the script so I can prevent the script from stopping. For examp...