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