0

I have just transferred my site over to a dedicated server and all was working fine before but since moving to the new server, all pages seem to be fine except for 1 thats giving me a white screen. A check on the error log says PHP Parse error:

syntax error, unexpected '}' in /home/ftp1/www/yp_admin/products.php on line 112

This is line 112

} while ($row_subcategories = mysql_fetch_assoc($subcategories));

and the complete section of the code is

<? if (isset($_GET['catid'])) {

            $scatid1 = $_GET['scatid'];

            do { ?>
                <div class="div"><a <?php if ($row_subcategories['id'] == $scatid1) { echo('style="color:orange;"'); } ?> href="?view&catid=<?php echo($catid) ?>&scatid=<?php echo($row_subcategories['id']); ?>"><?php echo($row_subcategories['sub_category']); ?></a><span><a href="?new&catid=<?php echo($catid); ?>&scatid=<?php echo($row_subcategories['id']); ?>"> New Product</a></span> </div>
                <?php } while ($row_subcategories = mysql_fetch_assoc($subcategories));


                } else { 

                do { ?>
            <a href="?catid=<?php echo($row_categories['id']); ?>">
                <div class="div"><?php echo($row_categories['category']); ?></div>
            </a>
                <?php } while ($row_categories = mysql_fetch_assoc($categories));}

                ?>

It was working completely fine before an I cannot find any errors, Have any of you come across this before?

Thanks in advance for your help.

FYI I am running CentOS with Apache server

3 Answers 3

5

Try to start your opening tag in the very first line with <?php instead of <?. Short tags are now disallowed.

EDIT More reading in the manual

Sign up to request clarification or add additional context in comments.

Comments

2

Probably on your old server you had default settings for short_open_tag.

You need to enable short_open_tag = 1 on your php ini file. Because your new server has this setting turned off.

Comments

1

Replace:-

<? if (isset($_GET['catid'])) {

with

<?php if (isset($_GET['catid'])) {

In your old server php.ini file must have been configured in such a way so as to allow short tags.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.