Parse Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • deerhide
    Private First Class

    • May 2007
    • 8

    Parse Error

    Hi, I get this message while trying to go to minibiketrader.com/index.php

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/m/i/n/minibiketrader/html/index.php on line 2

    Parse error: parse error, unexpected T_REQUIRE_ONCE in /home/content/m/i/n/minibiketrader/html/index.php on line 3


    This is the coding for my index.php file, any help is Greatly appreciated, :

    <?
    require_once 'common.php';
    require_once 'config.php'; // Configuration information
    require_once 'include/mysql.php';
    // Access to all the database functions
    // Open the database
    $db = new MySQL;
    if(!$db->init()) {
    echo '<div>Cannot open database</div>';
    exit;
    }
    $cat = (int)$_REQUEST['cat'];
    $db->AUTOAPPROVE = false;
    $ADMIN_MODE = false;
    $msg = '';
    $title = 'Links ';
    $linkcats = array();
    $links = array();
    $newlinks = array();
    $i = 0;
    if ($_REQUEST['KeyWords'])
    {
    $links = $db->search($_REQUEST['KeyWords']);
    //print '<pre>'; print_r($links);
    if(!is_array($links))
    {
    $title = "Search Results";
    $msg = "No Matches";
    // start_page($junk,$title,$msg);
    }
    else
    {
    $total = count($links);
    $title = "Search Results";
    $msg = "Search returned $total matches";
    $lnks = array();
    foreach($links as $lnk)
    {
    if (!in_array($lnk['CatID'], $lnks))
    {
    $lnks[] = $lnk['CatID'];
    $linkcats[$i]['CatId'] = $lnk['CatID'];
    $linkcats[$i]['CatName'] = $lnk['CatName'];
    $i++;
    }
    }
    //print '<pre>'; print_r($linkcats);
    }
    }
    else
    {
    $linkcats = $db->get_Cats($cat);
    //links
    $hotlinks = array();
    if ((int)$cat == 0)
    {
    $hotlinks = $db->get_HotLinks();
    $newlinks = $db->get_NewLinks();
    }
    $links = array_merge($hotlinks, $db->get_Links($cat));
    }

    $t->setRoot('../templates');
    $t->loadTemplatefile('link.htm');
    $t->setCurrentblock('__global__');
    $t->setVariable('pagedesc', 'New and used pocketbikes, pocketbide racing, event calendar, forum and links');
    $t->setVariable('pagedkeywords', 'pocket bike minimoto minibike used pocketbikes for sale');
    $t->setVariable('msg', $msg);
    $t->setVariable('trail', breadcrumbs($cat));
    $t->setVariable('CatID', $cat);
    // categories
    for ($i=0; $i < round(count($linkcats)/2); $i++)
    {
    $t->setCurrentBlock('link_categories_left');
    $t->setVariable('CatID', $linkcats[$i]['CatID']);
    $t->setVariable('CatName', stripslashes($linkcats[$i]['CatName']));
    $t->parseCurrentBlock('link_categories_left');
    }
    for ($i; $i < round(count($linkcats)); $i++)
    {
    $t->setCurrentBlock('link_categories_right');
    $t->setVariable('CatID', $linkcats[$i]['CatID']);
    $t->setVariable('CatName', stripslashes($linkcats[$i]['CatName']));
    $t->parseCurrentBlock('link_categories_right');
    }
    //print '<pre>';print_r($links);print '</pre>';
    for ($i=0; $i < count($links); $i++)
    {
    if ((int)$links[$i]['SortWeight'] < 6)
    {
    $t->setVariable('LinkStyle', 'featlink');
    }
    else
    {
    $t->setVariable('LinkStyle', 'normlnk');
    }
    $t->setCurrentBlock('links');
    $t->setVariable('Url', stripslashes($links[$i]['Url']));
    $t->setVariable('LinkName', stripslashes($links[$i]['LinkName']));
    $t->setVariable('Description', stripslashes($links[$i]['Description']));
    $t->parseCurrentBlock('links');
    }
    if (!count($newlinks))
    {
    $t->hideBlock('newlinks');
    }
    else
    {
    for ($i=0; $i < count($newlinks); $i++)
    {
    $t->setCurrentBlock('newlinks');
    $t->setVariable('Url', $newlinks[$i]['Url']);
    $t->setVariable('LinkName', stripslashes($newlinks[$i]['LinkName']));
    $t->setVariable('Description', stripslashes($newlinks[$i]['Description']));
    $t->parseCurrentBlock('newlinks');
    }
    }
    parseHeader($t, $title);
    parseFooter($t);
    $t->show();
    ?>
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Parse Error

    Ok, i only can talk about the specific error you get.

    The function "require" syntax is "require()". In other words, change these lines :

    require_once ("common.php");
    require_once ("config.php"); // Configuration information
    require_once ("include/mysql.php");

    Please note that i have NOT checked anything else, i just limited myself to the error you are getting.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • deerhide
      Private First Class

      • May 2007
      • 8

      #3
      Re: Parse Error

      Thing is, when I was changing it, I didn't change it from (") to ' '

      But, I tried what you said and it still gives me the same error.
      I have not a clue of what to do.

      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: Parse Error

        Post again the first lines of the changed code.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment

        • deerhide
          Private First Class

          • May 2007
          • 8

          #5
          Re: Parse Error

          <?
          require_once ("common.php");
          require_once ("config.php"); // Configuration information
          require_once ("include/mysql.php");
          // Access to all the database functions

          Comment

          • deerhide
            Private First Class

            • May 2007
            • 8

            #6
            Re: Parse Error

            Since it says, Parse error: parse error, unexpected T_REQUIRE_ONCE in /home/content/m/i/n/minibiketrader/html/index.php on line 3,
            the error has to be in index.php right? Or can it be in another one of my files like config.php?

            Comment

            • deerhide
              Private First Class

              • May 2007
              • 8

              #7
              Re: Parse Error

              Also, if I open index.php in the txt form of .*RST <?
              require_once ("common.php");
              require_once ("config.php"); // Configuration information
              require_once ("include/mysql.php");
              // Access to all the database functions

              But if I open it in the txt form of All documents *.* it gives me this
              <?
              require_once 'common.php';
              require_once 'config.php';
              '../include/hoo.php';
              // Configuration information
              require_once 'include/mysql.php';
              // Access to all the database functions

              So it adds '../include/hoo.php'; to it, which I don't know if this has anything to do with the problem or not.

              Thanks so much for your help!

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: Parse Error

                No, it can only be in index.php. The message is clear, though i don't understand why it happens.

                The second code you have posted is wrong.
                require_once 'config.php';'../include/hoo.php';

                What would the part in red be ?

                I don't know if the file hoo.php is necessary or not (i don't know your script) but you can try these two versions:

                <?
                require_once ("common.php");
                require_once ("config.php"); // Configuration information
                require_once ("include/mysql.php");
                // Access to all the database functions
                Rest of the script.....


                and

                <?
                require_once ("common.php");
                require_once ("config.php"); // Configuration information
                require_once ("common.php");
                require_once ("../include/hoo.php");
                require_once ("include/mysql.php");
                // Access to all the database functions
                rest of the script........
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • deerhide
                  Private First Class

                  • May 2007
                  • 8

                  #9
                  Re: Parse Error

                  As much as I would like to say its working, its not... and when I open the index.php file in the All Documents *.* its not showing the '../include/hoo.php';
                  I tried using the other index.php2 file put that one also failed. Do you know what:
                  Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/m/i/n/minibiketrader/html/index.php on line 2
                  means?

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: Parse Error

                    Download the php file directly from your server. Open it with Notepad and see if the code has some difference from what you have posted here.
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • deerhide
                      Private First Class

                      • May 2007
                      • 8

                      #11
                      Re: Parse Error

                      Hey hey hey! I got rid of the old parse error, a haha. but I received 2 new ones.. but, I got rid of one. The new error is
                      Parse error: parse error, unexpected '=' in /home/content/m/i/n/minibiketrader/html/index.php on line 3

                      I think I needed the require_once '../include/hoo.php'; in my file because in my config.php file it says
                      // To improve security, chmod 600 this include file - and keep it outside the web-tree:
                      require_once '../include/hoo.php';

                      Comment

                      • deerhide
                        Private First Class

                        • May 2007
                        • 8

                        #12
                        Re: Parse Error

                        Parse error: parse error, unexpected '=' in /home/content/m/i/n/minibiketrader/html/index.php on line 3


                        <?
                        require_once 'common.php';
                        require_once '../include/hoo.php';
                        (include_path='.:/usr/local/lib/php')
                        require_once 'config.php'; // Configuration information
                        require_once 'include/mysql.php';
                        // Access to all the database functions

                        Comment

                        Working...
                        X