Page 1 of 1

[SOLVED] Parse error: parse error, unexpected $

Posted: Thu Dec 11, 2003 11:37 am
by fariquzeli
I keep getting this error and it tells me it is at line 92 of my code except that line 92 of my code is the end of my script? I have no idea what that means. Register_globals is set to on and as far as I know I have no typos or anything wrong with this page:


Parse error: parse error, unexpected $ in /home/ttoomey/plaksmacker.com/catalog/ctadmin/imprint_agreement.php on line 92


Here is the page code

Code: Select all

<?php require_once('../../Connections/PlaksmackerConnect.php'); ?>
<?php
$colname_imprint_info = "1";
if (isset($HTTP_GET_VARS['oID'])) {
  $colname_imprint_info = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['oID'] : addslashes($HTTP_GET_VARS['oID']);
}
mysql_select_db($database_PlaksmackerConnect, $PlaksmackerConnect);
$query_imprint_info = sprintf("SELECT * FROM orders WHERE orders_id = %s", $colname_imprint_info);
$imprint_info = mysql_query($query_imprint_info, $PlaksmackerConnect) or die("not good");
$row_imprint_info = mysql_fetch_assoc($imprint_info);
$totalRows_imprint_info = mysql_num_rows($imprint_info);

$colname_price_info = "1";
if (isset($HTTP_GET_VARS['oID'])) {
  $colname_price_info = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['oID'] : addslashes($HTTP_GET_VARS['oID']);
}
mysql_select_db($database_PlaksmackerConnect, $PlaksmackerConnect);
$query_price_info = sprintf("SELECT * FROM orders_products WHERE orders_id = %s", $colname_price_info);
$price_info = mysql_query($query_price_info, $PlaksmackerConnect) or die("no good");
$row_price_info = mysql_fetch_assoc($price_info);
$totalRows_price_info = mysql_num_rows($price_info);

if ((isset($_GET['action'])) && ($_GET['action'] == "sendMe")) {
$from = "From: spatton@plaksmacker.com";
$subject = "Imprint Order Verification";
$body = $_POST['Agreement'];
$customer = $row_imprint_info['customers_email_address'];

mail($customer, $subject, $body, $from);
echo "Your email has been sent.";
exit();
}
else {
?>
<html>
<head>
<title>Imprint Agreement</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="634" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000">
  <tr>
    <td width="628"><p><font size="2"face="Verdana, Arial, Helvetica, sans-serif">Please read 
        the entire agreement. This is how you will be billed on this order.</font></p>
      <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
      <?php
  if ($row_imprint_info['payment_method'] == "Credit Card") { ?>
      </font> <p><font size="2"face="Verdana, Arial, Helvetica, sans-serif"> The 
        credit card containing the numbers <strong><?php echo $row_imprint_info['cc_number']; ?></strong> 
        that expires in <strong><?php echo $row_imprint_info['cc_expires']; ?></strong> 
        is going to be billed <b>$<?php echo $row_price_info['final_price']; ?></b> 
        for the products imprinted with:</font> </p></td>
  </tr>
  <tr>
    <td><br>
      <br>
      <br>
    </td>
  </tr>
  <tr>
    <td><p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Please 
        note that all printing on <strong>waterbottles</strong> is done vertically 
        with the bottle standing upright and all artwork or lettering will be 
        scaled to fit 3x8 cm. Also note that all printing done on <strong>bags</strong> 
        is done horizantally and all artwork or lettering will be scaled to fit 
        12x2 cm. </font><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Final 
        font/character size and readability can be affected by the number of characters 
        printed on the product.</font></p>
      <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>In 
        order to process your order we need a reply sent to us from this email 
        address with the words.</strong></font></p>
      <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">"I verify 
        the above imprint is correct and I agree to be billed the amount shown" 
        </font></p>
      <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">followed 
        by your typed full legal name.</font></p>
		<p><font size="2"face="verdana, arial, helvetica">Please reply to this email in a timely matter so that we may process your order.</font></p>
</td>
  </tr>
</table>
<p>&nbsp;</p>
<form name="form1" method="post" action="<?php $PHP_SELF; ?>?action=sendMe"enctype="multipart/form-data">
  <p>
    <textarea name="Agreement" cols="100" rows="20"></textarea>
  </p>
  <p>
    <input type="submit" value="Submit">
  </p>
</form>
</body>
</html>
<?php } ?>
This error occurs when accessing the page the first time through, I am not even able to just view the page without submitting any information.

Posted: Thu Dec 11, 2003 11:43 am
by microthick
Dunno if this is the cause of the error, but it looks like you are missing the closing brace for the portion about credit cards.

Posted: Thu Dec 11, 2003 12:06 pm
by m3mn0n
Yeah, I use to do that a lot when I was a beginner.

I hated that it didn't tell you where you were missing a brace.

When you see something like this, just doublecheck all the if statements and also anything else with a brace.

Posted: Thu Dec 11, 2003 12:14 pm
by fariquzeli
Well that was a start, thanks I figured it out, had to close that bracket up and for some reason my Get vars weren't posting from the previous page, but all is well now!