stoneycurtis
asked on
PHP syntax error: unexpected end of file
I modified a module on one of my OpenCart (v1.5.5.1) sites and it works fine, I copied those changes to another site and in one template file I have the following code line:
I don't understand why I have the error, I'd appreciate any help.
<?php if ($i == 0 && !$customer_logged && $simple_customer_action_register == Simple::REGISTER_USER_CHOICE) { ?>
Which generates a "syntax error: unexpected end of file on line 162" which is the end of the template file
<?php } ?>
.I don't understand why I have the error, I'd appreciate any help.
You have a { starting a block, with no matching } ending it.
ASKER
Hello ozo,
Adding the closing bracket:
Deleting the opening bracket:
How would I add the closing bracket?
Adding the closing bracket:
<?php if ($i == 0 && !$customer_logged && $simple_customer_action_register == Simple::REGISTER_USER_CHOICE) { } ?>
Breaks the page.Deleting the opening bracket:
<?php if ($i == 0 && !$customer_logged && $simple_customer_action_register == Simple::REGISTER_USER_CHOICE) ?>
Breaks the page.How would I add the closing bracket?
In what way does the page break?
What if you remove the entire line?
What if you remove the entire line?
ASKER
Ozo,
By page break I mean the page returns a blank white screen.
Here is the entire code snippet:
What if I placed
By page break I mean the page returns a blank white screen.
Here is the entire code snippet:
<?php $i = 0; ?>
<?php if ($i == 0 && !$customer_logged && $simple_customer_action_register == Simple::REGISTER_USER_CHOICE) { ?>
<tr>
<td class="simplecheckout-customer-left">
</td>
<td class="simplecheckout-customer-right">
<label><input type="radio" name="register" id="myRadio" value="1" <?php echo $register == 1 ? 'checked="checked"' : ''; ?>reload="customer_register" /><b><?php echo $text_yes ?></b> <b><?php echo $text_register; ?></b> </label></br>
<p><?php echo $text_register_account; ?></p>
<label><input type="radio" name="register" id="myRadio2" value="0" <?php echo $register == 0 ? 'checked="checked"' : ''; ?>reload="customer_not_register" /><b><?php echo $text_no ?> <?php echo $text_guest; ?></b></label>
</td>
</tr>
<?php $user_choice = true; ?>
<?php $i++ ?>
The code determines if a user is already logged in to his account.What if I placed
<?php ?>
after
<?php $i++ ?>
If the entire code is
<?php $i = 0; ?>
<?php if ($i == 0 && !$customer_logged && $simple_customer_action_register == Simple::REGISTER_USER_CHOICE) { ?>
<tr>
<td class="simplecheckout-customer-left">
</td>
<td class="simplecheckout-customer-right">
<label><input type="radio" name="register" id="myRadio" value="1" <?php echo $register == 1 ? 'checked="checked"' : ''; ?>reload="customer_register" /><b><?php echo $text_yes ?></b> <b><?php echo $text_register; ?></b> </label></br>
<p><?php echo $text_register_account; ?></p>
<label><input type="radio" name="register" id="myRadio2" value="0" <?php echo $register == 0 ? 'checked="checked"' : ''; ?>reload="customer_not_register" /><b><?php echo $text_no ?> <?php echo $text_guest; ?></b></label>
</td>
</tr>
<?php $user_choice = true; ?>
<?php $i++ ?>
<?php } ?>
Then I get no syntax error, just a "Class 'Simple' not found" error
ASKER
The code is part of a larger file, I've attached it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't see an attachment