Dear people,
A while ago I installed a script. It all worked just fine untill my host upgraded the servers. Since that moment I have an error message when I try to do a search.
This is the error:
Warning: include(usr/local/lib/php/index.php) [function.include]: failed to open stream: No such file or directory in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13
Warning: include() [function.include]: Failed opening 'usr/local/lib/php/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13
Below I have added the first part of the script that causes of the problem (the complete script is to large to post in one part).
Please keep in mind that I am not a php programmer and I don't understand anything about it. I am just looking for a part of code that can solve the problem.
Thanks a lot already!
Ozzy
<?
include("paramlink.inc.php");
if (($action) OR ($cat) OR ($search))
{
$cat = $cat;
$action = $action;
$search = $search;
}
else
{
include ("usr/local/lib/php/index.php");
exit;
}
function showaddlink() {
require( './paramlink.inc.php');
?>
<font class='standard'><b><? echo $sitename ?> : How to add a links</b></font><br><br>
<font class='text10'>
<ul type="square">
<li>Find the appropriate category in the Directory.<br>
<li>Suggest your site from the category you think most appropriate. Do this by clicking on the "Add Link" link.<br>
<li>We update our database on average every day so you can expect to be added in this time.
<br><br><br><br>
<b><? echo $sitename ?></b><br>
Links Manager
</font>
</ul>
</td></tr></table></td></tr></table></center>
<? include "footer.inc.php"; ?>
<?
}
function showvote() {
require( './paramlink.inc.php');
?>
<center><table width='<? echo "$tablewidth"; ?>' border='<? echo "$tableborder"; ?>' cellpadding=10 cellspacing=0 bordercolor='#000000'><tr>
<td class='standard'>
<font class='standard'><b><? echo $sitename ?> : You Are Rated</b></font><br><br>
<font class='text10'>
<ul type="square">
<li>Sorry, our record shows you've already rated this link recently.. <br>
<li>Please contact the site administrator if you have any questions.<br>
<br><br><br>
<b><? echo $sitename ?></b><br>
Links Manager
</font>
</ul>
</td></tr></table></td></tr></table></center>
<? include "footer.inc.php"; ?>
<?
}
function showrate() {
require( './paramlink.inc.php');
?>
<center><table width='<? echo "$tablewidth"; ?>' border='<? echo "$tableborder"; ?>' cellpadding=10 cellspacing=0 bordercolor='#000000'><tr>
<td class='standard'>
<font class='standard'><b><? echo $sitename ?> : Error Rating Link</b></font><br><br>
<font class='text10'>
<ul type="square">
<li>Please select a rate <br>
<br><br><br>
<b><? echo $sitename ?></b><br>
Links Manager
</font>
</ul>
</td></tr></table></td></tr></table></center>
<? include "footer.inc.php"; ?>
<?
}
function showthankyou() {
require( './paramlink.inc.php');
?>
<center><table width='<? echo "$tablewidth"; ?>' border='<? echo "$tableborder"; ?>' cellpadding=10 cellspacing=0 bordercolor='#000000'><tr>
<td class='standard'>
<font class='standard'><b><? echo $sitename ?> : Thank You</b></font><br><br>
<font class='text10'>
<ul type="square">
<li>Thank You for Rating <? echo $link_id ?><br>
<li>You have rated <? echo $link_id ?> as <? echo $rating ?>. <br>
<li>Your rating will be included in our database shortly.<br>
</font>
</ul>
</td></tr></table></td></tr></table></center>
<? include "footer.inc.php"; ?>
<?
}
if ($cat)
{
$sitenames = "$sitename - $lcat_name";
include('header.inc.php');
}
?>
<?
//Number of records to show per page
$limit = $nolinks;
//Set the default offset = 0
$offset = ($offset) ? $offset : 0;
//Encoded query string that needs to be passed to each page
$query = "&cat=".urlencode($cat);
$mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
or die ("Cannot make the connection");
mysql_select_db($mysql_db, $mysql_mylink)
or die ("Cannot connect to the database");
$rime1 = mysql_query("SELECT COUNT(*) from links WHERE link_val LIKE 'yes' AND cat_id LIKE '$cat'") or die(mysql_error());
$totalnum = mysql_result($rime1, 0, 0);
$rime2 = mysql_query("SELECT * from category WHERE lcat_id='$cat'")
or die(mysql_error());
while($row = mysql_fetch_array($rime2)) {
extract($row);
$id = $row["lcat_id"];
$name = $row["lcat_name"];
$sub_cat = $row["sub_cat"];
$navigator = $name . "" ;
$rime5= mysql_query("SELECT * FROM category WHERE lcat_id='$sub_cat'");
$lista = mysql_num_rows($rime5);
$rowa = mysql_fetch_array($rime5);
$ida = $rowa["lcat_id"];
$namea = $rowa["lcat_name"];
$sub_cat = $rowa["sub_cat"];
$linnk1 = "<a href=\"$PHP_SELF?cat=$ida\">$namea</a> >";
$navigator = $linnk1 . " " .$navigator;
while ($sub_cat > 0) {
$rime3= mysql_query("SELECT * FROM category WHERE lcat_id='$sub_cat'");
$lista = mysql_num_rows($rime3);
$rowa = mysql_fetch_array($rime3);
$ida = $rowa["lcat_id"];
$namea = $rowa["lcat_name"];
$sub_cat = $rowa["sub_cat"];
$linnk = "<a href=\"$PHP_SELF?cat=$ida\">$namea</a> >";
}
$navigator = $linnk . " " . $navigator;
?>
<center>
<table width='<? echo "$tablewidth"; ?>' border='<? echo "$tableborder"; ?>' cellpadding=10 cellspacing=0 bordercolor='#000000'><tr>
<td class='standard'>
<?
echo "<a href='links.php'>Home</a> > $navigator <hr size=1 noshade>";
$resulta = mysql_query("SELECT * FROM category WHERE sub_cat='$lcat_id'");
$lista = mysql_num_rows($resulta);
if ($lista != 'NULL') {
echo "<table width='100%' border='0'>";
echo "<tr>";
$na=1;
while ($ia < $lista) {
$rowa = mysql_fetch_array($resulta);
$ida = $rowa["lcat_id"];
$namea = $rowa["lcat_name"];
$sub_cat = $rowa["sub_cat"];
if ($na==4) {
echo "<td width=\"20%\" valign=\"top\" class='midd'>";
echo "<a href=\"$PHP_SELF?cat=$ida\">$namea</a>";
echo "</td>";
echo "</tr><tr>";
$ia++;
$na=1;
}
else {
echo "<td width=\"20%\" valign=\"top\" class='midd'>";
echo "<a href=\"$PHP_SELF?cat=$ida\">$namea</a>";
echo "</td>";
$na++;
$ia++;
}
}
echo "</tr></table>";
}
echo "<hr size=1 noshade><font class='small'><b>$totalnum</b> links will be displayed in category $lcat_name</font><br><br>";
}
$rime = mysql_query("SELECT * from links WHERE link_val like 'yes' AND cat_id LIKE '$cat' ORDER BY hits DESC, link_pop DESC, rate DESC LIMIT $offset, $limit") or die(mysql_error());
while($row = mysql_fetch_array($rime)) {
extract($row);
if ($rate > 0)
{
$arate = sprintf ("%.2f", ($rating / $rate));
}
else
{
$arate = '0';
}
echo " <font class=text10><b><a href='http://$siteurl/links.php?action=rated&link_id=$link_id' target='_blank'>$link_name</b></a></font><br>";
echo " <font class=text9>$link_desc</font><br>";
}
freddyShowNav($totalnum, $query, $offset, $limit);
function freddyShowNav($totalnum, $query, $offset, $limit) {
global $PHP_SELF;
if ($totalnum > $limit) {
// calculate number of pages needing links
$pages = intval($totalnum/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($totalnum%$limit) $pages++;
if (($offset + $limit) > $totalnum) {
$lastnum = $totalnum;
}
else {
$lastnum = ($offset + $limit);
}
?>
<table cellpadding="4"><tr><td class="standard">Page </td>
<?
for ($i=1; $i <= $pages; $i++) { // loop thru
$newoffset=$limit*($i-1);
if ($newoffset != $offset) {
?>
<td class="standard"><a href="links.php?<?=$query?>&offset=<?=$newoffset?>"><b><?=$i?></b></a></td>
<?
}
else {
?>
<td class="standard"><?=$i?></td>
<?
}
}
?>
</tr></table>
<?
echo "</td></tr></table>";
}
return;
}
echo ""
?>
<?
{
function ShowNav($totalnum, $query, $offset, $limit, $query1) {
global $PHP_SELF;
if ($totalnum > $limit) {
// calculate number of pages needing links
$pages = intval($totalnum/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($totalnum%$limit) $pages++;
if (($offset + $limit) > $totalnum) {
$lastnum = $totalnum;
}
else {
$lastnum = ($offset + $limit);
}