+ Reply to Thread
Results 1 to 12 of 12

Thread: Parse Error
      
   

  1. #1
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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();
    ?>

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  3. #3
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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.

  4. #4
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  5. #5
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default Re: Parse Error

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

  6. #6
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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?

  7. #7
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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!

  8. #8
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  9. #9
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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?

  10. #10
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,060

    Default 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!


  11. #11
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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';

  12. #12
    deerhide is offline Private First Class
    Join Date
    May 2007
    Posts
    8

    Default 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49