Page 1 of 1

"Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Fri Feb 20, 2009 12:24 am
by Timpano
I keep on getting this error and am not able to rectify it. It always comes up on line 22.

Re: "Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Fri Feb 20, 2009 7:54 am
by susrisha
to be frank i dont find any errors in the code that has been presented. Can you post us some more code please

Re: "Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Sun Feb 22, 2009 4:38 pm
by Timpano
This is all the code for the page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Queen of Hearts - Viewing Options</title>


<link href="trailers/queen/basic.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
body {
background-color: #FEFEFE;
}
-->
</style>
<!-- Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->
</head>

<body><?php    
$key='jack'; //the bold is your password/code needed to download
    $pw=$_POST['password']; //this takes the content from the password field and stores it as a variable called 'pw'

//The following sets up a condition which compares the field to your set password and displays the relevant content

    if($pw=$key) { ?>
<div align="center"><br />
</div>
<table width="1024" height="684" border="0" align="center" cellpadding="0" cellspacing="0" background="trailers/queen/images/queen_index_bkgd.jpg">
<tr>
<td background="trailers/queen/images/queen_view_bkgd.jpg" scope="col"><table width="1024" border="0" cellpadding="0" cellspacing="0" background="images/queen_view_bkgd.jpg">
<tr>
<td width="81" height="264" scope="row">&nbsp;</td>
<td width="385" height="264">&nbsp;</td>
<td width="76" height="264">&nbsp;</td>
<td width="391" height="264">&nbsp;</td>
<td width="91" height="264">&nbsp;</td>
</tr>
<tr>
<td width="81" scope="row">&nbsp;</td>
<td width="385" height="130"><img src="images/spacer.gif" width="384" height="129" border="0" usemap="#Map" /></td>
<td width="76" height="130">&nbsp;</td>
<td width="391" height="130"><img src="images/spacer.gif" width="390" height="129" border="0" usemap="#Map2" /></td>
<td width="91" height="130">&nbsp;</td>
</tr>
<tr>
<td width="81" height="290" scope="row">&nbsp;</td>
<td width="385" height="290">&nbsp;</td>
<td width="76" height="290">&nbsp;</td>
<td width="391" height="290">&nbsp;</td>
<td width="91" height="290">&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
<br />

<map name="Map" id="Map"><area shape="rect" coords="3,4,380,125" href="#" /></map>
<map name="Map2" id="Map2"><area shape="rect" coords="3,2,387,126" href="#" /></map></body>
</html>
       
    <?php }else{ ?>

    <?php } ?>

Re: "Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Sun Feb 22, 2009 4:57 pm
by Mark Baker
Can't see the error in question but

Code: Select all

if($pw=$key)
should be

Code: Select all

if($pw==$key)

Re: "Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Sun Feb 22, 2009 5:05 pm
by Eran
what version of php are you running?

Re: "Parse error: syntax error, unexpected T_VARIABLE" Error

Posted: Sun Feb 22, 2009 7:13 pm
by Timpano
I'm quite new at this. I am using Dreamweaver cs3 on a mac osx 10.5.6. I think it is PHP5