I am currently just messing around with a basic shopping cart, but have
stumbled onto a problem.
Bascially there is three input boxes all name DVD, VIDEO, CD and these are
also variables. Once the user has said they wanted 15 cd's for example,
the form then takes them onto the shop.php. Which
?php print( You have asked to purchase $dvd $video $cd 's -
Thank you) ?
This prints out, You have bought 16 - Thank you for example, see the
problem? How do I get it to print the variable name not just it's value?
Try with replacing your print with the following one:
print( You have
Hello Tarrant,
Wednesday, May 16, 2001, 12:12:43 PM, you wrote:
TC ?php print( You have asked to purchase $dvd $video $cd 's - Thank you) ?
TC This prints out, You have bought 16 - Thank you for example, see the
TC problem? How do I get it to print the variable name not just it's value?
Use
Thanks Gabriele :) Whilst waiting for your e-mail I figured out another
way...Thought I would show you it just in case you ever find the
need to use
this alternative:
?php print( You have asked to purchase .
($dvd ? DVD: $dvd :'').
($video ? Video: $video :'').
($cd
Costelloe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:13 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Shopping with variables
I am currently just messing around with a basic shopping cart, but have
stumbled onto a problem.
Bascially there is three input boxes all name DVD, VIDEO, CD
since it will
require that you continue adding if(isset($variable)) statements, if you
ever decide to add more item types.
-Original Message-
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:13 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Shopping
:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 9:02 AM
To: Ralph Guzman
Cc: Tarrant Costelloe; [EMAIL PROTECTED]
Subject: RE: [PHP] Shopping with variables
That will work, assuming the user is not allowed to purchase multiple
items...
-John
On Wed, 16 May 2001, Ralph Guzman
7 matches
Mail list logo