Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
LinkBack Thread Tools
  #1  
Old 05-21-2007, 03:37 PM
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();
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 05-21-2007, 03:51 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,346
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 05-21-2007, 03:57 PM
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 05-21-2007, 04:03 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,346
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 05-21-2007, 06:59 PM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old 05-21-2007, 07:01 PM
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old 05-21-2007, 07:07 PM
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old 05-21-2007, 07:16 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,346
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old 05-21-2007, 07:35 PM
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old 05-21-2007, 07:39 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,346
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old 05-21-2007, 09:33 PM
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';
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old 05-21-2007, 09:35 PM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 03:50 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176