Hi,
Monday, December 9, 2002, 2:24:47 AM, you wrote:
SM> Im just about at wits end here Im trying to verify that a users ID and
SM> Password exist in the MySQL Database and then if it does display certain
SM> content and if it does not display login form content.
SM> ###At present here is the error I'm recieving:
SM> Warning: Missing argument 3 for verifylogin() in
SM> /home/www/websitename/admin/include/adminclass.inc on line 78
SM> This stupid thing STILL Does NOT WORK!
SM> ####Here is my class FILE
SM> <?
SM> class ADMINPAGE
SM> {
SM> //class adminpage's attributes
SM> var $title = "75";
SM> var $content;
SM> var $buttons = array("[ admin ]" => "admin_root.php",
SM> "[ orders ]" => "orders_root.php",
SM> "[ customers ]" => "customers_root.php",
SM> "[ products ]" => "products_root.php",
SM> "[ categories ]" => "categories_root.php",
SM> "[ manufacturers ]" => "manufacturers_root.php",
SM> "[ vehicles ]" => "vehicles_root.php");
SM> var $count;
SM> function SetTitle($newTitle)
SM> {
SM> $this->title = $newTitle;
SM> }
SM> function SetContent($newContent)
SM> {
SM> $this->content = $newContent;
SM> }
SM> function SetButtons($newbuttons)
SM> {
SM> $this->buttons = $newbuttons;
SM> }
SM> function Display($employeeid,$password,$title,$count)
SM> {
SM> session_start();
SM> session_register("employeeid");
SM> $this -> VerifyLogin($employeeid,$password);
SM> switch($count)
SM> {
SM> case "1":
SM> $this -> DisplayHeader($title,$employeeid);
SM> echo "<center><br>";
SM> $this -> DisplayMenu($this->buttons);
SM> echo "</center><br>";
SM> $this -> DisplayFooter();
SM> break;
SM> default:
SM> echo "This stupid thing STILL Does NOT WORK!";
SM> break;
SM> }
SM> }
SM> function DisplayHeader($title,$employeeid)
SM> {
SM> echo "<html>\n<head>\n<title>$title</title>";
SM> echo "<link href='/aistyles.css' rel='stylesheet' type='text/css'>";
SM> echo "</head>\n<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0' >>\n";
SM> echo "<table width='100%' border='0' cellspacing='0'
cellpadding='0'>>";
SM> echo "<tr>";
SM> echo "<td bgcolor='#FF6600'> <div align='left'><img
SM> src='/images/designelements/logo.gif' width='348' height='35'></div></td>";
SM> echo "</tr>";
SM> echo "<tr>";
SM> echo "<td bgcolor='#000000'>";
SM> echo "<table width='100%' border='0' cellspacing='0'
cellpadding='0'>>";
SM> echo "<tr>";
SM> echo "<td><img src='/images/designelements/spacer.gif' width='5'
height='15'>></span></td>";
SM> echo "<td><span class='admin_header'>ADMINISTRATOR LOGGED
SM> IN: ";
SM> echo $employeeid;
SM> echo "</span></div>";
SM> echo "</td>";
SM> echo "</tr>";
SM> echo "</table>";
SM> echo "</td>";
SM> echo "</tr>";
SM> echo "</table>";
SM> }
SM> function VerifyLogin($employeeid,$password,$count)
SM> {
SM> include('dbconnection.php');
SM> $employeequery = "Select count(*) from employees where employeeid =
SM> '$employeeid' and password='$password'";
SM> $employeeresult = mysql_query($employeequery);
SM> if(!$employeeresult)
SM> {
SM> echo 'Please Try Again Later.';
SM> exit();
SM> }
SM> $count = mysql_result($employeeresult,0,0);
SM> if($count>0)
SM> {
SM> $count = "1";
SM> }
SM> else
SM> {
SM> $count = "0";
SM> }
SM> }
SM> function DisplayMenu($buttons)
SM> {
SM> echo "<table width = \"500\" bgcolor=\"#000000\" cellpadding=\"1\"
cellspacing=\"0\">><tr><td>";
SM> echo "<table width=\"100%\" bgcolor=\"#ff6600\" cellpadding=\"1\"
cellspacing=\"0\">><tr><td>";
SM> echo"<div align=center><table width=\"100%\" bgcolor=\"#ffffff\"
SM> cellpadding=\"5\" cellspacing=\"0\"><tr><td>";
SM> $width = 100/count($buttons);
SM> while(list($name,$url) = each ($buttons))
SM> {
SM> $this ->DisplayButton($width,$name,$url);
SM> }
SM> echo "</td></tr></table></div>";
SM> echo "</td></tr></table>";
SM> echo "</td></tr></table>";
SM> }
SM> function DisplayButton($width,$name,$url)
SM> {
SM> echo "<td width =\"$width%\"><a href = \"$url\"><span class =
small>>$name</span></a></td>";
SM> }
SM> function DisplayFooter()
SM> {
SM> ?>
SM> <table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">>
SM> <tr>
SM> <td valign="top" bgcolor="#000000"><img src="/images/spacer.gif"
SM> width="1" height="300"></td>
SM> </tr>
SM> </table>
SM> </body></html>
SM> <?
SM> }
SM> }
?>>
SM> ####Here is sample page usage of class file
SM> <?
SM> require ("include/adminclass.inc");
SM> $test = new adminpage();
SM> $title = "This is a Nice Page";
SM> $content = "Some Temporary Content";
$test ->>SetContent($content);
$test ->>Display($employeeid,$password,$title,$count);
?>>
SM> _________________________________________________________________
SM> MSN 8 with e-mail virus protection service: 2 months FREE*
SM> http://join.msn.com/?page=features/virus
Well it is telling you that
$this -> VerifyLogin($employeeid,$password);
Does not match your declaration of
function VerifyLogin($employeeid,$password,$count)
You are missing the count bit
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php