unexpected T_VARIABLE

Hi all,

I am having this common error and I don’t see why it is happening.

Here is my code:
[php]

<?php

session_start();

//CONNECT TO DATABASE//

$hostname = “abc”;
$username = “abc”;
$password = “abc”;
$db_name = “abc”;
$tbl_name = “accounts”;

$connect = mysql_connect($hostname,$username,$password);
if (!$connect)
{
die(“Connection to database failed.
” . " Please contact an Administrator and show them the code above.
");
}

//SELECT CORRECT DATABASE//
mysql_select_db("$db_name", $connect)or die(“Cannot select database.”);

////////////////////////

$currentusr = $_SESSION[‘usr’];
$currentema = $_SESSION[‘ema’];

$newbio = $_POST[‘changebio’];

$updatebio = mysql_query(“UPDATE accounts SET bio=’$newbio’ WHERE usr=’$currentusr’ AND ema=’$currentema’”);

if($updatebio)
{
header(Location:“http://www.blu-byte.co.cc/members/profile/edit.php”);
}
else
{
echo “Sorry about this but we have unsuccessfully changed your biography.”;
}

?>

[/php]

What’s wrong with it?

 header("Location: http://www.blu-byte.co.cc/members/profile/edit.php"); 

Nah that’s not it.

Anyway I found the problem, it’s really annoying.
Go ahead and highlight the line with the variable hostname on, notice the space.
He was the little gremlin in the works.

Thanks anyway for your time. :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue:

Why would that be anything to do with it, it is not in the quotes ?

The only Syntax error i found was the header needed to be enclosed in quotaion just like Noodles said

Sponsor our Newsletter | Privacy Policy | Terms of Service