Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 11-14-2005, 06:25 PM Parse Error Problem
SpottyDog's Avatar
Skilled Talker

Posts: 82
Trades: 0
Hi,

Small problem here :P

I am using a string in the address of a page. eg page.php?game=106

I am using an if statement to make sure the game ID entered is valid but i am getting a rather odd error!

Code:
Parse error: parse error, unexpected '!' in /home/college/public_html/web/test.php on line 7
here is my code
PHP Code:
$gamenumber "033"//gamenumber is the highest value valid game

if($game !> '000' and $game !< $gamenumber){
$name="Not A Valid Game ID";
$source="error.swf";
$height="300";
$width="300"

I dont know if i need the '$game !> '000' ' part but its there anyway.
Please help me with a valid if statement! :P
SpottyDog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-14-2005, 06:48 PM
Village Idiot's Avatar
Webmaster Talker

Posts: 535
Trades: 0
is that all of the php code?

there is no "not greater" or "not lesser" operator. make it
if($game <= '000' and $game >= $gamenumber)

edit: here is a rundown of the error
unexpected '!' doesnt know what the '!' is there for
in /home/college/public_html/web/test.php the file
on line 7 what line
__________________
I have the heart of a child, I keep it in a jar on my desk.

Last edited by Village Idiot; 11-14-2005 at 06:52 PM..
Village Idiot is offline
Reply With Quote
View Public Profile
 
Old 11-14-2005, 07:47 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Move the ! to infront of the $game variable and think of it like this...

if not $game is greater than 000 and not $game is less than $gamenumber (I like to think of things as a translation to english to help me remember.)

Also, did you notice that your title is not very descriptive at all?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 11-15-2005, 10:53 AM
SpottyDog's Avatar
Skilled Talker

Posts: 82
Trades: 0
yeah, thanks for the help guys.

Yes i did notice it was very undescriptive but didnt give me the option to change the title asfter it was posted :P
SpottyDog is offline
Reply With Quote
View Public Profile
 
Old 11-15-2005, 01:51 PM
Village Idiot's Avatar
Webmaster Talker

Posts: 535
Trades: 0
in this case it is a lie, a undiscriptive title got us over quick
__________________
I have the heart of a child, I keep it in a jar on my desk.
Village Idiot is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Parse Error Problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31763 seconds with 12 queries