Results 1 to 3 of 3
  1. #1
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Red face Help unexpected T_STRING In PHP Script
    Ok I need some one else to look at this. I am developing a store for someone. Their server is running IIS so I am using PHP to pull records from their MS Access database.


    I figured out how to create a DNS on the server and made a script that will query the DB ad display products. Now I need to add pagination. I found this script on a PHP site. It is supposed to be a tutorial but I keey getting an unexpected T_STRING error on line 58. Can someone PLEASE HELP!

    What is the error? Here are the lines

    L55 /*check if we are at page 1. if true, PREV will not be a link. if false, $page will be a link minus 1 page. */
    L56 if($page != 1){
    L57 $pageprev = $page -1;
    L58 echo("&nbsp;<b><a href="$PHP_SELF?page=$pageprev">PREV</a></b>&nbsp;");
    L59 }else{
    L60 echo("&nbsp;PREV&nbsp;");
    L61 }


    Please...What am I missing.

    Thanks,
    Doug

  2. #2
    Affiliate Manager
    Join Date
    January 18th, 2005
    Posts
    1,056
    Anytime you have quotes within PHP code you need to have a forward slash in front of the quote mark...

    Example:

    Code:
    <?
    echo "This php code has a "quote" in it";
    ?>
    Should Be:

    Code:
    <?
    echo "This php code has a \"quote\" in it";
    ?>
    So Your Code should be: (Line 58)

    Code:
    L58 echo("&nbsp;<b><a href=\"$PHP_SELF?page=$pageprev\">PREV</a></b>&nbsp;");

  3. #3
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    That was it thanks!

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Need Someone to Customize a PHP Script for Me
    By bandi in forum Midnight Cafe'
    Replies: 1
    Last Post: July 30th, 2010, 07:09 PM
  2. PHP Menu Script
    By John Powell in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: January 4th, 2006, 03:39 PM
  3. Need help with PHP Script..
    By triumph in forum Midnight Cafe'
    Replies: 6
    Last Post: August 25th, 2005, 08:58 AM
  4. need help with php script
    By oscar in forum Programming / Datafeeds / Tools
    Replies: 15
    Last Post: June 29th, 2004, 05:15 PM

Posting Permissions

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