$_GET isn't working for me

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
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

$_GET isn't working for me

Post by snowrhythm »

Does anyone why the code below is giving me this error?

Error: "Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\wamp\www\orderFormMailer.php on line 30"


Code:

Code: Select all

//================================================
//Get the Customer information from the order form
//================================================

$companyName = $GET_['companyName'];

$contactName = $GET_['contactName'];

$phoneNumber = $GET_['phoneNumber'];

//================================================
//Get the Part Quantity Values from the Order Form
//================================================

$0NS1553 = $_GET['0NS1553'];    //this is line 30, btw
	
$0NS1553G = $_GET['0NS1553G'];

$0NS1560G = $_GET['0NS1560G'];

$0NS26721G = $_GET['0NS26721G'];
the value that line 30 is supposed to get is a number, if that helps....

thanks in advance!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Check just above line 30. That error usually results from something missing (semicolon, quote-mismatch, parenthesis, etc) on the line above.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

easy peasy

Code: Select all

$companyName = $GET_['companyName']; 

$contactName = $GET_['contactName']; 

$phoneNumber = $GET_['phoneNumber'];
should be

Code: Select all

$companyName = $_GET['companyName']; 

$contactName = $_GET['contactName']; 

$phoneNumber = $_GET['phoneNumber'];
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Actually, this is coming from your get vars.

Code: Select all

$companyName = $GET_['companyName'];

$contactName = $GET_['contactName'];

$phoneNumber = $GET_['phoneNumber'];
Should be ...

Code: Select all

$companyName = $_GET['companyName'];

$contactName = $_GET['contactName'];

$phoneNumber = $_GET['phoneNumber'];
EDIT | Dadgummit pimp, you beat my second post...
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Post by snowrhythm »

well, i changed it to what you said (that's embarrassing mistake) ...but it's still giving the error.
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

Code: Select all

$0NS1553 = $_GET['0NS1553'];
If that's a zero leading off the variable name, it's incorrect. A variable can not start with a number.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You might be getting an error because you are starting a variable name with a number. I thought that variables and array indeces needed to start with either an alpha character or an underscore.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Everah wrote:You might be getting an error because you are starting a variable name with a number. I thought that variables and array indeces needed to start with either an alpha character or an underscore.
hehe, too late again
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I know... stupid fat fingers... If I didn't spend twice as much time correcting my spelling mistakes I might actually stand a chance at coming in first :wink: .
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Post by snowrhythm »

Thanks dudes! I totally forgot about not being able to start off variables with numbers...i'll get that fixed pronto and keep my job for another week :-)
Post Reply