Fatal error: Class ‘HttpRequest’ not found in /home/patricka/public_html/index/adminswaper.php on line 49
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Admin</title>
<link rel="stylesheet" type="text/css" href="/css/main.css?a=<%=now%>" />
</head>
<body>
<img src="background.jpg" alt="background image" id="fixed" />
<div id="content">
<div id="admin">
<?php
// redifine variables for different server
require_once "mysqlconfig.php";
// connect to database
$connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS);
if (!$connection)
{
die("Database connection failed: " . mysql_error());
}
// select database
$db_select = mysql_select_db(DB_NAME,$connection);
if (!$db_select)
{
die("Database selection failed: " . mysql_error());
}
// get table
$result = mysql_query("SELECT * FROM th3rrc", $connection);
if (!$result)
{
die("Database query failed: " . mysql_error());
}
$i=0;
// display table
while ($row = mysql_fetch_array($result))
{
$rank[$i]=$row["rank"];
$name[$i]=$row["name"];
$i++;
}
$pieces = explode("\
", $_POST[text]);
$count=count($pieces);
if($count>$i)
{
$toomany = new HttpRequest('toomany.php', HttpRequest::METH_GET);
try
{
$toomany->send();
if ($toomany->getResponseCode() == 200)
{
file_put_contents('local.rss', $toomany->getResponseBody());
}
}
catch (HttpException $ex)
{
echo $ex;
}
}
for($j=0;$j<$count;$j++)
{
$check[j]=0;
}
for($j=0;$j<$count;$j++)
{
$fieces = explode(" ", $pieces[j], 2);
$dbmember[j]=$fieces[1];
for($k=0;$k<=$i;$k++)
{
if($fieces[1]==$name[$k])
{
if($check[j]==0)
{
$check[j]=1;
}
else
{
$doubleentry = new HttpRequest('doubleentry.php', HttpRequest::METH_GET);
try
{
$doubleentry->send();
if ($doubleentry->getResponseCode() == 200)
{
file_put_contents('local.rss', $doubleentry->getResponseBody());
}
}
catch (HttpException $ex)
{
echo $ex;
}
}
}
}
}
for($j=0;$j<$count;$j++)
{
if($check[j]==0)
{
$deletemember = new HttpRequest('deletemember.php', HttpRequest::METH_POST);
$deletemember->addPostFields(array('member' => $dbmember[j]));
try
{
echo $deletemember->send()->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
}
}
for($j=0;$j<$count;$j++)
{
$fieces = explode(" ", $pieces[j], 2);
for($k=0;$k<=$i;$k++)
{
if($fieces[1]==$name[$k])
{
if($fieces[0]!=$rank[$k])
{
$query="UPDATE th3rrc SET rank=".$fieces[0]." WHERE name=".$fieces[1];
$result = mysql_query($query, $connection);
if (!$result)
{
die("Database INSERT failed: " . mysql_error());
}
$rank[$k]=$fieces[0];
}
}
}
}
for($k=0;$k<=$i;$k++)
{
}
?>
</div>
</div>
</body>
</html>
not quite sure why im getting this error, i thought the httprequest class was in the standard library, im copying the code right from php.net! http://www.php.net/manual/en/httprequest.send.php