Whats wrong with this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Whats wrong with this?

Post 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?
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post by fatalcure »

Code: Select all

$7daysago = date("YmdHis",time()-604800);
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Post by DynamiteHost »

I still get the same error :?
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post by fatalcure »

oh, hehe

i dont think you can have a variable start with a number, thats why :)
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Post by DynamiteHost »

why not? :x :( 8O
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post 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.
Last edited by fatalcure on Sat Aug 17, 2002 8:58 am, edited 1 time in total.
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Post by DynamiteHost »

oh, now I get it :)

Thanks for you help :D
Post Reply