Page 1 of 1

Whats wrong with this?

Posted: Sat Aug 17, 2002 8:29 am
by DynamiteHost
When I run the code below, I get this error

"Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/site/public_html/default.inc.php on line 26"

Code: Select all

$7daysago = date(YmdHis,time()-604800);

Any ideas?

Posted: Sat Aug 17, 2002 8:44 am
by fatalcure

Code: Select all

$7daysago = date("YmdHis",time()-604800);

Posted: Sat Aug 17, 2002 8:48 am
by DynamiteHost
I still get the same error :?

Posted: Sat Aug 17, 2002 8:52 am
by fatalcure
oh, hehe

i dont think you can have a variable start with a number, thats why :)

Posted: Sat Aug 17, 2002 8:56 am
by DynamiteHost
why not? :x :( 8O

Posted: Sat Aug 17, 2002 8:58 am
by fatalcure
i have no idea, i tried that $7daysago on my server and got the same error, so i took the 7 out and it worked. Its a php thing that requires you to start your variables with a character.

Posted: Sat Aug 17, 2002 8:58 am
by DynamiteHost
oh, now I get it :)

Thanks for you help :D