Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: php parse error

  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    php parse error

    This is the error I am getting:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/surreal/public_html/index.php on line 51

    This is what line 51 contains:

    Code:
    <table border="1" width="100%" style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;">
    Here is the page of code that I am trying to get to work from start to finish:


    Code:
    <?php
    ini_set('display_errors','on');
    error_reporting(E_ALL);
    ?>
    <html>
    <head>
    
    <script language="javascript" type="text/javascript">
    
    
    function rollOn(obj){
    obj.src=obj.src.replace(/.png/,"blue.png");
    }
    function rollOff(obj){
    obj.src=obj.src.replace(/blue.png/,".png");
    }
    
    
    
    var currentSpan = 1;
    function showMe(n) {
    document.getElementById("ex_"+currentSpan).style.display = "none";
    document.getElementById("ex_"+n).style.display = "block";
    currentSpan = n;
    }
    
    var currentDiv = 1;
    
    function showcontent(n) {
    
    // Hide the current side content that is being shown
    document.getElementById("SC_"+currentDiv).style.display = "none";
    
    // Show the new side content
    document.getElementById("SC_"+n).style.display = "block";
    
    // Set the current open side content
    currentDiv = n;
    }
    /*this css code is to be entered into the first table tag just underneath the echo' function
    style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;"*/
    
    </script>
    
    
    
    
    </head>
    <?php
    echo'
    <table border="1" width="100%" style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;">
    <tr>
    <td>
    <table width="100%" border="1">
    <tr>
    <td>
    //header logo
    </td>
    </tr>
    <tr>
    <td>
    //horizontal ad banner
    </td>
    </tr>
    </table>';
    
    require "renavbar.php";
    
    
    require "rollcontent.php";
    
    echo '
    </td>
    <td>
    </td>
    //vertical banner ad
    </td>
    </tr>
    </table>
    <table>
    <tr>
    <td>
    //bottom navigation
    <a href=" ">advertise</a>
    <a href=" ">support</a>
    <a href=" ">submit content</a>
    <a href=" "></a>
    <a href=" "></a>
    </td>
    </tr>
    </table>';
    ?>
    I took some html that has nothing to do with the problem to make it less cumbersome.

    Thanks a lot for the help

  • #2
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    posting half code is not useful.

  • #3
    New Coder
    Join Date
    Jul 2008
    Posts
    99
    Thanks
    0
    Thanked 4 Times in 4 Posts
    you duplicated this thread... your problem is here:

    Code:
    url('http://i95.photobucket.com/albums/l136/surreal5335/RE&#37;20site/Fotolia_2695889_XS.jpg');
    Replace it with this:

    Code:
    url(\'http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg\');

  • Users who have thanked ramm19 for this post:

    surreal5335 (07-22-2008)

  • #4
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    well that fixed it, I have no idea why the backslash was never mentioned in any other tutorial, but it worked.
    Thanks a lot

  • #5
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,300
    Thanks
    4
    Thanked 203 Times in 200 Posts
    The 4th example in the PHP manual on echo shows how escaping is used.
    Dave .... HostMonster for all of your hosting needs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •