Forum Moderators: coopster

Message Too Old, No Replies

Another Parse error, unexpected T string

Checkout page with parse error

         

Debugdesign

4:21 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



Parse error: parse error, unexpected T_STRING in /home/sites/example.co.uk/public_html/checkout.php on line 47

Hello,

I new to PHP and i'm using WA Ecart and DW MX2004 to create a very simple shop. For learning purposes.

The checkout page seems to have a error on line 47 which is the submit button. My code is below:

<?php
//WA eCart Include
require_once("WA_eCart/WA_eCart1_PHP.php");
?>
<?php
$WA_eCart1->GetContent();
?>
<?php
// WA eCart Redirect
if ($WA_eCart1->redirStr!= "") {
header("Location: ".$WA_eCart1->redirStr);
}
?>
<html>
<head>
<title>The Checkout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body>
<p><img src="quicklogo.jpg" width="225" height="102"> <span class="style1">The Checkout
</span></p>
<form name="checkout_ians_WorldPay_Basic" method="POST" action="https://select.worldpay.com/wcc/purchase">
<input type="hidden" name="instId" value="#####">
<input type="hidden" name="cartId" value="<?php echo session_id()?>">
<table>
<tr>
<td align="right"> Amount&nbsp;of&nbsp;purchase:</td>
<td>
<input type="text" name="amount" value="<?php echo $WA_eCart1->GrandTotal()?>">
<input type="hidden" name="currency" value="GBP"></td>
</tr>
<tr>
<td align="right"> Order&nbsp;description:</td>
<td>
<input type="text" name="desc" value="<?php echo $WA_eCart1->TotalColumn(">;
</td>
</tr>
<tr>
<td></td>;
*47* <td><input type="submit" name="Checkout" value="Checkout"></td>;
</tr>
</table>
</form>
<p></p>
</body>
</html>

Any help is greatly appreciated. I have tried to use as little code as possible in order to understand how it works but I can't see any errors for looking.

I have tried <td> <input type=\"submit" etc but then it says error on line 53 which is the final line with nothing on.

Also I have hashed out the Id

cheers in advance

Ian

[edited by: jatar_k at 4:33 pm (utc) on July 11, 2005]
[edit reason] removed personal url [/edit]

sned

4:29 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



Hi Ian, welcome to WebmasterWorld

On this line:

<input type="text" name="desc" value="<?php echo $WA_eCart1->TotalColumn(">;

It looks like your missing a '?' at the end, as well as the rest of the function call? ... try something like :

<input type="text" name="desc" value="<?php echo $WA_eCart1->TotalColumn(?>" />

I don't know if 'TotalColumn' is a variable, or a function, so the lone '(' at the end of it is mystifying to me .... maybe it should be '()'?

-sned

mogenshoj

4:30 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



There's an error here:

<input type="text" name="desc" value="<?php echo $WA_eCart1->TotalColumn(">;

should be:
<input type="text" name="desc" value="<?php echo $WA_eCart1->TotalColumn;?>">

Debugdesign

12:09 pm on Jul 12, 2005 (gmt 0)

10+ Year Member



Thanks for the warm welcome,

Mogenshoj, your code worked and the checkout page appeared... looks like its back to my 'programming php' book.

I'm sure you won't have heard the last of me.

Thanks again

Ian