Page 1 of 1

$_GET isn't working for me

Posted: Fri Jun 16, 2006 1:18 pm
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!

Posted: Fri Jun 16, 2006 1:23 pm
by RobertGonzalez
Check just above line 30. That error usually results from something missing (semicolon, quote-mismatch, parenthesis, etc) on the line above.

Posted: Fri Jun 16, 2006 1:25 pm
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'];

Posted: Fri Jun 16, 2006 1:25 pm
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...

Posted: Fri Jun 16, 2006 1:35 pm
by snowrhythm
well, i changed it to what you said (that's embarrassing mistake) ...but it's still giving the error.

Posted: Fri Jun 16, 2006 1:35 pm
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.

Posted: Fri Jun 16, 2006 1:37 pm
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.

Posted: Fri Jun 16, 2006 1:38 pm
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

Posted: Fri Jun 16, 2006 1:43 pm
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: .

Posted: Fri Jun 16, 2006 2:16 pm
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 :-)