Ok you lot, im gonna post some code here. I just cant think of what to do.
include_once("../interface.inc.php");
show_page_header();
anytime();
show_page_footer();
index.php
include_once ("anytime/admin/userauth.php");
include_once ("anytime/admin/admininterface.inc.php");
include_once ("anytime/dbincludes/dbdetails.php");
include_once ("anytime/admin/adminmenu.php");
function getglobals(){
GLOBAL $HTTP_SERVER_VARS, $HTTP_POST_VARS, $_HTTP_GET_VARS, $HTTP_POST_FILES;
$self = basename('PHP_SELF');
}
function getcss(){
$stylesheet = "template.css";
$location = $_SERVER['PHP_SELF'];
$split = explode("/", $location);
$i = 0;
foreach ($split as $key => $val){
if ($val == 'anytime'){
$i++;
}
}
if ($i > 0){
$css = "../" . $stylesheet;
}else{
$css = $stylesheet;
}
return($css);
}
function show_page_header($pagename){
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
print "<html>\n";
print "<head>\n";
print "<title>" . $pagename . "</title>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
print "<link href=\"" . getcss() . "\" rel=\"stylesheet\" type=\"text/css\">\n";
print "</head>\n";
print "<body>\n";
}
function show_page_footer(){
print "</body>\n";
print "</html>\n";
}
Functions
function show_login(){
getglobals();
if (isset($_POST['login']) && $_POST['login'] == 'Login'){
menu();
}
print "<form name=\"login\" method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n";
print "<table class=\"login\" width=\"200\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
print "<tr>\n";
print "<td colspan=\"2\">\n";
print "<img src=\"images/v2.jpg\" width=\"357\" height=\"145\">\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td align=\"center\" colspan=\"2\">\n";
print $_SERVER['HTTP_HOST'];
print "<p> </p>\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td align=\"right\" width=\"40%\">\n";
print "Username:";
print "</td>\n";
print "<td width=\"60%\">\n";
print "<input type=\"text\" name=\"username\">\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td align=\"right\" >\n";
print "Password:";
print "</td>\n";
print "<td>\n";
print "<input type=\"password\" name=\"password\">\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td colspan=\"2\" align=\"center\">\n";
print "<input type=\"Submit\" name=\"login\" value=\"Login\">\n";
print "</td>\n";
print "</tr>\n";
print "</table>\n";
print "</form>\n";
}
function menu(){
print "menu";
}
function connect(){
getglobals();
$dbh = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database_localhost, $dbh);
return $dbh;
}
function disconnect($dbh) {
$dbh = mysql_close($dbh);
}
Functions
Just it to go to another function and not show the previous one, is that too much to ask? :/
Thanks for any help.