Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member DavidJColbran's Avatar
    Join Date
    Feb 2006
    Posts
    2
    Member #
    12619
    I implemented a guestbook type PHP script for this site a while back http://www.dfah.org/ and it is broken.

    The original script GBLite I altered to fit into the look of the site and it worked fine for about 12 months - it is a one page PHP file and the information is stored in txt files, rather than a SQL database.

    I've changed nothing recently and now it gives the following error message.

    Parse error: syntax error, unexpected '.' in /home/dfah1f6/public_html/gblite/guestbook.php on line 102

    What has caused this and any ideas how I can fix it please? PHP file attached.

    David
    ...........


  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    You use "echo" a lot when outputting HTML.

    It's better to seperate the code like in the example below. It makes for easier bug tracking and cleans up your code.

    PHP Code:
    <body>
    <?php
    if (some_condition)
    {
    ?>

    This prints if <i> some_condition</i> is true.

    <?php 
    }
    elseif(
    another_condition)
    {
    ?>

    This prints if <i>another_condition</i> is true.

    <?php
    }
    ?>
    ...
    </body>
    If you echo out all your basic HTML, you're prone to make errors.

    On line 103 in my editor(Part of an echo statement, enclosed in double quotes) you forgot to escape the double quotes (or use single quotes) in source/width/height etc.
    That breaks the string.
    PHP Code:
    echo("...<!--<img src="../images/top_banner_petition.jpg " width="243" height="55" border="0" >--!>..." 
    S. Rosland

  4. #3
    Junior Member DavidJColbran's Avatar
    Join Date
    Feb 2006
    Posts
    2
    Member #
    12619
    thanks for your help - i'm a PHP newbie, so the vast majority of the script came as part of the guestbook download for GBLite

    managed to get part of the script working - it displays now - so seeing as the campaign has ended it is fine

    thanks


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:43 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com