Page 1 of 1
Help Unexecpted TString/T Variable
Posted: Tue Nov 28, 2006 10:46 am
by darkfreaks
it says unexcpected t string or variable. on line 18 ill post the codes in and around that line. hopefully someone here can point out my syntax mistake.
$qty = 0;
$totalamount = 0.00;
$totalqty = $NNSQTY+$CBFNQTY+$AKNQTY+$CFNQTY+$CVNQTY
$totalamount = $NNSQTY* Necklace of the Night Sky
+$CBFNQTY* Chainmaile Beaded Fancy Necklace
+$AKNQTY* Antique Key Necklace
+$CFNQTY* Chainmaile Fancy Necklace
+$CVNQTY* Chainmaile V Necklace
Posted: Tue Nov 28, 2006 10:49 am
by GeertDD
Check the semicolons.
Note that you should use
Posted: Tue Nov 28, 2006 10:53 am
by darkfreaks
i did use php tags and i think it wants a semicolon somewhere before or after where it adds up everything. just not sure where.
Posted: Tue Nov 28, 2006 11:02 am
by darkfreaks
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i edited it abit
Code: Select all
< ?PHP
$qty = 0;
$totalamount = 0.00;
$totalqty = $NNSQTY+$CBFNQTY+$AKNQTY+$CFNQTY+$CVNQTY ;
$totalamount = $NNSQTY* Necklace of the Night Sky
+$CBFNQTY* Chainmaile Beaded Fancy Necklace
+$AKNQTY* Antique Key Necklace
+$CFNQTY* Chainmaile Fancy Necklace
+$CVNQTY* Chainmaile V Necklace;
?>
now it gives me unexected t string on line 18.
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Posted: Tue Nov 28, 2006 11:12 am
by GeertDD
Is the text at the end of the last lines (e.g. "Necklace of the Night Sky") supposed to be comments?
Posted: Tue Nov 28, 2006 11:34 am
by infolock
The code you have posted is not even close to being valid..
For instance, here is your code:
Code: Select all
<?PHP
$qty = 0;
$totalamount = 0.00;
$totalqty = $NNSQTY+$CBFNQTY+$AKNQTY+$CFNQTY+$CVNQTY ;
$totalamount = $NNSQTY* Necklace of the Night Sky
+$CBFNQTY* Chainmaile Beaded Fancy Necklace
+$AKNQTY* Antique Key Necklace
+$CFNQTY* Chainmaile Fancy Necklace
+$CVNQTY* Chainmaile V Necklace;
?>
#1, $totalamount is being set to a bunch of multiplication statments and text, all bunched into one.
Code: Select all
$totalamount = $NNSQTY* Necklace of the Night Sky
+$CBFNQTY* Chainmaile Beaded Fancy Necklace
+$AKNQTY* Antique Key Necklace
+$CFNQTY* Chainmaile Fancy Necklace
+$CVNQTY* Chainmaile V Necklace;
There is no way that is valid unless you are using the DEFINE statement that you aren't showing us.
instead, $totalamount is only valid if it looks like this
Code: Select all
<?php
$Necklace_of_the_Night_Sky = 123123123;
$Chainmaile_Beaded_Fancy_Necklace = 123123123123;
$Antique_Key_Necklace = 123123123123;
$Chainmaile_Fancy_Necklace = 123123123123;
$Chainmaile_V_Necklace = 123123123123;
$totalamount = $NNSQTY * $Necklace_of_the_Night_Sky + $CBFNQTY * $Chainmaile_Beaded_Fancy_Necklace + $AKNQTY * $Antique_Key_Necklace + $CFNQTY * $Chainmaile_Fancy_Necklace + $CVNQTY * $Chainmaile_V_Necklace;
?>
or this :
Code: Select all
<?php
DEFINE(Necklace_of_the_Night_Sky, 123123123);
DEFINE(Chainmaile_Beaded_Fancy_Necklace, 123123123123);
DEFINE(Antique_Key_Necklace,123123123123);
DEFINE(Chainmaile_Fancy_Necklace, 123123123123);
DEFINE(Chainmaile_V_Necklace, 123123123123);
$totalamount = $NNSQTY * Necklace_of_the_Night_Sky + $CBFNQTY * Chainmaile_Beaded_Fancy_Necklace + $AKNQTY * Antique_Key_Necklace + $CFNQTY * Chainmaile_Fancy_Necklace + $CVNQTY * Chainmaile_V_Necklace;
?>
That's it.
Posted: Tue Nov 28, 2006 12:19 pm
by darkfreaks
everything was defined in the code above it with the price. so i just have to redo it with everything added up under total amount instead of having it at 0.
Posted: Tue Nov 28, 2006 12:31 pm
by darkfreaks
it works now that i put the underscores for spaces

now im missing a opening ( somewhere in the following line
<?PHP
if mail('
mowtripleh@hotmail.com',"From: $name <$email>","Total Amount:$totalamount","Quantity Ordered:$qty") ?>
Posted: Tue Nov 28, 2006 1:04 pm
by darkfreaks
nvm found it there needs to be an extra ) after ) and an extra ( before mail.