I am making a tutorial script and I cannot get my function to work.. heres the error on tutorial.php
heres tutorial.php so farFatal error: Cannot instantiate non-existent class: phphighlight in C:\apache2triad\htdocs\jcartonline.com\html\tutorial.php on line 2
Code: Select all
<?php
$tutorials = new phphighlight;
$result = @mysql_query("SELECT * FROM tutorials_php") or die('Error performing query: '. mysql_error());
$row = mysql_fetch_array($result);
$code = $row["code"];
$tutorials->phphighlight($code);
?>Code: Select all
<?php
class tutorials {
function phphighlight($code)
{
$code = "<?php\n".$code."\n?>";
$code = stripslashes($code);
$code = highlight_string($code, true);
$code = explode('<br />', $code);
echo $code;
}
}
?>