View Full Version : Unexpected t_string!

07-24-2007, 12:34 PM

unset($config) ;
$config[1] = ("");
$config[2] = ("root");
$config[3] = ("removed") ;
$config[4] = ("invision") ;
$con = @mysql_connect($config[1],$config[2],$config[3]) or die(mysql_error()) ;
mysql_select_db($config[4],$con) or exit('Database dosen't exist') ;

It says 'unexpected T_STRING on line 9', and I'm not sure what's rong! I've checked and it works on anohter script, but this dosen't!

Ah, I see. It dosen't like apostrophes. How can I add one without it messing it all up?

07-24-2007, 01:14 PM
mysql_select_db($config[4],$con) or exit('Database dosen\'t exist') ;


mysql_select_db($config[4],$con) or exit("Database dosen't exist") ;

07-24-2007, 03:48 PM
Now it's making even more fuss
include ("config.php");
$givenname = $_POST['name'];
$givenpass = $_POST['pass'];
$tmppass = mysql_query("SELECT password FROM users WHERE username='$givenname'") or die ("User $givenname dosen't exist!");
echo $tmppass;
if ($givenpass == $tmppass)
echo "login successful generating sso ticket for you now";
$ticket="ST-".$rand1."-".$rand2.$rand3.$rand4.$rand5."-es-fe".$rand6 ;
mysql_query("UPDATE users SET ssoticket='$ticket' WHERE username='$username'");
echo "bad pass or w/e";


It always sayd that I entered bad pass. The pass that it echoes is 'Resource id #3'
Why oh why can't I get any peace from php.

07-24-2007, 04:27 PM
You'll need to use something like http://www.php.net/mysql_result :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum