Im just about at wits end here Im trying to verify that a users ID and Password exist in the MySQL Database and then if it does display certain content and if it does not display login form content.

###At present here is the error I'm recieving:
Warning: Missing argument 3 for verifylogin() in /home/www/websitename/admin/include/adminclass.inc on line 78
This stupid thing STILL Does NOT WORK!

####Here is my class FILE
<?
class ADMINPAGE
{
//class adminpage's attributes
var $title = "75";
var $content;
var $buttons = array("[ admin ]" => "admin_root.php",
"[ orders ]" => "orders_root.php",
"[ customers ]" => "customers_root.php",
"[ products ]" => "products_root.php",
"[ categories ]" => "categories_root.php",
"[ manufacturers ]" => "manufacturers_root.php",
"[ vehicles ]" => "vehicles_root.php");
var $count;


function SetTitle($newTitle)
{
$this->title = $newTitle;
}

function SetContent($newContent)
{
$this->content = $newContent;
}

function SetButtons($newbuttons)
{
$this->buttons = $newbuttons;
}

function Display($employeeid,$password,$title,$count)
{
session_start();
session_register("employeeid");
$this -> VerifyLogin($employeeid,$password);
switch($count)
{
case "1":
$this -> DisplayHeader($title,$employeeid);
echo "<center><br>";
$this -> DisplayMenu($this->buttons);
echo "</center><br>";
$this -> DisplayFooter();
break;
default:
echo "This stupid thing STILL Does NOT WORK!";
break;
}
}

function DisplayHeader($title,$employeeid)
{

echo "<html>\n<head>\n<title>$title</title>";
echo "<link href='/aistyles.css' rel='stylesheet' type='text/css'>";
echo "</head>\n<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' >\n";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td bgcolor='#FF6600'> <div align='left'><img src='/images/designelements/logo.gif' width='348' height='35'></div></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor='#000000'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td><img src='/images/designelements/spacer.gif' width='5' height='15'></span></td>";
echo "<td><span class='admin_header'>ADMINISTRATOR LOGGED IN:&nbsp;&nbsp;";
echo $employeeid;
echo "</span></div>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
}

function VerifyLogin($employeeid,$password,$count)
{
include('dbconnection.php');
$employeequery = "Select count(*) from employees where employeeid = '$employeeid' and password='$password'";
$employeeresult = mysql_query($employeequery);
if(!$employeeresult)
{
echo 'Please Try Again Later.';
exit();
}
$count = mysql_result($employeeresult,0,0);
if($count>0)
{
$count = "1";
}
else
{
$count = "0";
}
}

function DisplayMenu($buttons)
{
echo "<table width = \"500\" bgcolor=\"#000000\" cellpadding=\"1\" cellspacing=\"0\"><tr><td>";
echo "<table width=\"100%\" bgcolor=\"#ff6600\" cellpadding=\"1\" cellspacing=\"0\"><tr><td>";
echo"<div align=center><table width=\"100%\" bgcolor=\"#ffffff\" cellpadding=\"5\" cellspacing=\"0\"><tr><td>";
$width = 100/count($buttons);
while(list($name,$url) = each ($buttons))
{
$this ->DisplayButton($width,$name,$url);
}
echo "</td></tr></table></div>";
echo "</td></tr></table>";
echo "</td></tr></table>";
}

function DisplayButton($width,$name,$url)
{
echo "<td width =\"$width%\"><a href = \"$url\"><span class = small>$name</span></a></td>";
}


function DisplayFooter()
{
?>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="#000000"><img src="/images/spacer.gif" width="1" height="300"></td>
</tr>
</table>
</body></html>
<?
}
}
?>




####Here is sample page usage of class file

<?
require ("include/adminclass.inc");
$test = new adminpage();
$title = "This is a Nice Page";
$content = "Some Temporary Content";
$test ->SetContent($content);
$test ->Display($employeeid,$password,$title,$count);

?>




_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to