Hi Larry,

Try replacing the first echo with

echo "$Quantity added to your cart. Continue shopping or <a href='cart.php?FromScreen=$ScreenToRedisplay'> go to cart.</a> ";

In PHP, when you use "double quotes" (actually just a quote), variables such as $Quantity within them are replaced with the value of the variable. If you use "single quotes" (apostrophes), they are not. To me it is easier to read than all the concatenation.

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx>

On 5/7/2014 7:59 AM, Larry Kleinman wrote:
Hi all - I am having something odd happen with two PHP pages. On the
first page, I have the following code:

<input type="hidden"
value=" <?php
If ($ErrorMsg == '')
echo $Quantity. " added to your cart. Continue shopping or <a
href=&quot;cart.php?FromScreen=" . $ScreenToRedisplay ."&quot;> go to
cart.</a> ";
echo $ErrorMsg; ?> ">

This page POSTs to a second page, which contains this code.

$ItemMessageText = $_POST["ItemMessageText"];

When $ErrorMsg is blank, the value of ItemMessageText on the second page

3 added to your cart. Continue shopping or <a href
=\"cart.php?FromScreen=/1dev/adult.php\"> go to cart.</a>

Notice that the quotes surrounding the name of the hyperlnk have been
escaped - there is a \ prior to the quotes. I have no idea why this is
happening and it causes the link to fail

To make it more odd, the problem happens when the script is run on a
GoDaddy server, but works fine (quotes are not escaped) when run on
ZendServer on an IBM i box

Larry Kleinman
Kleinman Associates, Inc.

This email is free from viruses and malware because avast! Antivirus protection is active.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.