i am trying to get this content management system working and i get the same error every time
Fatal error: Cannot instantiate non-existent class: dbconnector in SYS:/Apache2/htdocs/riot/contentman/cmsadmin/newArticle2.php on line 14
here is my code for the 2 scripts
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php
// Get the PHP file containing the DbConnector class
require('http://rps_nw11.rockford.k12.mi.us/riot/contentman/includes/DbConnector.php');
// Check whether a form has been submitted. If so, carry on
if ($HTTP_POST_VARS){
// Create an instance of DbConnector
$connector = new dbconnector();
// IMPORTANT!! ADD FORM VALIDATION CODE HERE - SEE THE NEXT ARTICLE
// Create an SQL query (MySQL version)
$insertQuery = "INSERT INTO cmsarticles (title,tagline,section,thearticle) VALUES (".
"'".$HTTP_POST_VARS['title']."', ".
"'".$HTTP_POST_VARS['tagline']."', ".
$HTTP_POST_VARS['section'].", ".
"'".$HTTP_POST_VARS['thearticle']."')";
// Save the form data into the database
if ($result = $connector->query($insertQuery)){
// It worked, give confirmation
echo '<center><b>Article added to the database</b></center><br>';
}else{
// It hasn't worked so stop. Better error handling code would be good here!
exit('<center>Sorry, there was an error saving to the database</center>');
}
}
?>
<body>
<form name="form1" method="post" action="http://rps_nw11.rockford.k12.mi.us/riot/contentman/cmsadmin/newArticle2.php">
<p> Title:
<input name="title" type="text" id="title">
</p>
<p> Tagline:
<input name="tagline" type="text" id="tagline">
</p>
<p> Section:
<input name="section" type="text" id="section">
</p>
<p> Article:
<textarea name="thearticle" cols="50" rows="6" id="thearticle"></textarea>
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
script 2 DbConnector.php
<?php
////////////////////////////////////////////////////////////////////////////////////////
// Class: DbConnector
// Purpose: Connect to a database, MySQL version
///////////////////////////////////////////////////////////////////////////////////////
require_once 'SystemComponent.php';
class DbConnector extends SystemComponent {
var $theQuery;
var $link;
// Function: DbConnector, Purpose: Connect to the database
function DbConnector(){
// Load settings from parent class
$settings = SystemComponent::getSettings();
// Get the main settings from the array we just loaded
$host = $settings['dbhost'];
$db = $settings['dbname'];
$user = $settings['dbusername'];
$pass = $settings['dbpassword'];
// Connect to the database
$this->link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));
}
// Function: query, Purpose: Execute a database query
function query($query) {
$this->theQuery = $query;
return mysql_query($query, $this->link);
}
// Function: fetchArray, Purpose: Get array of query results
function fetchArray($result) {
return mysql_fetch_array($result);
}
// Function: close, Purpose: Close the connection
function close() {
mysql_close($this->link);
}
}
?>
if you want the systemcomponent file i have that too help me out Please!