Jump to content

[SOLVED] Parse error: syntax error, unexpected T_STRING ....


nathanmaxsonadil

Recommended Posts

What's wrong with this if statment?

if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
$system_folder = str_replace("", "/", realpath(dirname(__FILE__))).'/classes/';
}

It gives me this error

Parse error: syntax error, unexpected T_STRING in my_dir/install.php on line 8

ok here's my code from line 1 to 11

1 <?php
2 ob_start(); 
3 session_start(); 
4 $dbuser = 'my_user'; 
5 $dbpass = 'mypass'; 
6 $dbhost = 'localhost'; 
7 $db = 'my_db; 
8 if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
9 {
10 $system_folder = str_replace("", "/", realpath(dirname(__FILE__))).'/classes/';
11 }

P.S: sorry for not replying back soon I was reading something else

you're missing a closing single quote on the line before it.. honestly, a little bit of syntax highlighting or even two minutes of hard searching could have shown that.

 

EDIT:  you beat me to it.  seriously, spend a little bit of time trying to find the error on your own before defaulting to us to find the parse error.  parse errors should be fairly easy to resolve, since they're usually a symptom of some careless or inattentive programming.

EDIT:  you beat me to it.  seriously, spend a little bit of time trying to find the error on your own before defaulting to us to find the parse error.  parse errors should be fairly easy to resolve, since they're usually a symptom of some careless or inattentive programming.

 

Syntax highlighting would also point a such error out quite easily.

Archived

This topic is now archived and is closed to further replies.

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