Forum Moderators: coopster

Message Too Old, No Replies

Password Access parse error

         

vidmarc

7:51 pm on Apr 14, 2005 (gmt 0)



Hi All,

I must admit to knowing little (actually nothing) about .php, but this seemed to me to be the simplest way to password protect a competition page we need up and running in the next few days.

I get the following error message: Parse error: unexpected T_STRING on line 4

Can anybody explain what this means? Here are the first few lines of validate.php:

<?
header("Pragma: ");
header("Cache-Control: ");
header("Expires: Mon, 26 Jul 2006 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
//set global variables
global $username,$password;

Many thanks for your help.

Marc

[edited by: coopster at 1:29 am (utc) on April 15, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

sned

9:34 pm on Apr 14, 2005 (gmt 0)

10+ Year Member



Most of the time, an error like that means you are missing a " or a ; somewhere. The code you gave seems to work fine for me -- is there more to go with it?

mcibor

9:42 pm on Apr 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you leave the code as such (with no additional change), then it's working correctly.

You should leave:

header("Expires: Mon, 26 Jul 1980 05:00:00 GMT");

And it should work correctly (I didn't get your error)

I think this could be some 2k problem.

Michal Cibor

ironik

10:23 pm on Apr 14, 2005 (gmt 0)

10+ Year Member



If you are uploading these files to a server be aware of the method you are using to upload (binary or ascii).

My PC recently gave up the ghost and I had to restort to uploading files through windows explorer. If the ftp program you are using is not intelligent enough to upload ascii as ascii and binary as binary then it will corrupt the files on the server. I uploaded perfectly working scripts and they failed because they had corrupted on upload and the parser could no longer recognise the code.

It may not be what's wrong with the code, but since it works fine for other people it might be an idea to check it out.