For this example I want to use the Handlers option which is under Fed Admin and all the related coding to the handlers option is found on the handlers.php page which includes a list of handlers with a hyperlink to a form to add a new handler and also hyperlinks next to each handlers name to where you can edit the handler's information. I'll include the handlers.php page at the bottom so you can see what I'm talking about. I want to know how to follow this same coding so that since you can see that the list of handlers is on handers.php file and it's option 0 then tell the handlers.php file that above the coding that that whole thing is option 0 because there's going to be other options for the handlers.php file. Like the add handler form is going to be option 1 and then edit handler is going to be option 2.
Code: <?php
print "<script type="text/javascript" language="javascript">n";
print "function executeform(action,option) {n";
print "document.mainmenu.action.value = action;n";
print "document.mainmenu.option.value = option;n";
print "document.mainmenu.submit();n";
print "}n";
print "</script>n";
if ((isset($userid)) && ($userid > "0") && ($defaultcharacterid > "0"))
{
print "<h1>Character</h1>n";
print "<ul>n";
print "<li";
if (($action == "character") && ((isset($option)) && ($option == "2"))) { print " class=active"; }
print "><a href="#" onClick="executeform('character','2');">Bio</a></li>n";
print "<li";
if (($action == "alliesrivals") && ((isset($option)) && ($option == "0"))) { print " class=active"; }
print "><a href="#" onClick="executeform('alliesrivals','0');">Allies</a></li>n";
print "<li";
if (($action == "alliesrivals") && ((isset($option)) && ($option == "1"))) { print " class=active"; }
print "><a href="#" onClick="executeform('alliesrivals','1');">Rivals</a></li>n";
print "<li";
if ($action == "quotes") { print " class=active"; }
print "><a href="#" onClick="executeform('quotes','0');">Quotes</a></li>n";
print "</ul>n";
print "<h1>Submit</h1>n";
print "<ul>n";
print "<li";
if ($action == "roleplay") { print " class=active"; }
print "><a href="#" onClick="executeform('roleplay','0');">Roleplay</a></li>n";
print "<li";
if ($action == "news") { print " class=active"; }
print "><a href="#" onClick="executeform('news','0');">News</a></li>n";
print "<li";
if ($action == "submitmatch") { print " class=active"; }
print "><a href="#" onClick="executeform('submitmatch','0');">Match</a></li>n";
print "<li";
if ($action == "submitseg") { print " class=active"; }
print "><a href="#" onClick="executeform('submitseg','0');">Seg</a></li>n";
print "</ul>n";
}
if ((isset($isadmin)) && ($isadmin == "1"))
{
print "<h1>Fed Head</h1>n";
print "<ul>n";
print "<li";
if ($action == "directory") { print " class=active"; }
print "><a href="#" onClick="executeform('directory','0');">Directory</a></li>n";
}
if ((isset($isadmin)) && ($isadmin == "1"))
{
print "<h1>Booking</h1>n";
print "<ul>n";
print "<li";
if ($action == "champions") { print " class=active"; }
print "><a href="#" onClick="executeform('champions','0');">Champions</a></li>n";
print "<li";
if ($action == "eventbooker") { print " class=active"; }
print "><a href="#" onClick="executeform('eventbooker','0');">Booker</a></li>n";
print "<li";
if (($action == "resultscompilation") && ((isset($option)) && ($option == "0"))) { print " class=active"; }
print "><a href="#" onClick="executeform('resultscompilation','0');">Compiler</a></li>n";
print "<li";
if (($action == "resultscompilation") && ((isset($option)) && ($option == "1"))) { print " class=active"; }
print "><a href="#" onClick="executeform('resultscompilation','1');">Archives</a></li>n";
print "</ul>n";
print "<h1>Fed Admin</h1>n";
print "<ul>n";
print "<li";
if ($action == "handler") { print " class=active"; }
print "><a href="#" onClick="executeform('handler','0');">Handlers</a></li>n";
print "<li";
if (($action == "character") && ((isset($option)) && ($option == "1"))) { print " class=active"; }
print "><a href="#" onClick="executeform('character','1');">Characters</a></li>n";
print "<li";
if ($action == "manageapplications") { print " class=active"; }
print "><a href="#" onClick="executeform('manageapplications','0');">Applications</a></li>n";
print "<li";
if ($action == "eventname") { print " class=active"; }
print "><a href="#" onClick="executeform('eventname','0');">Event Names</a></li>n";
print "<li";
if ($action == "title") { print " class=active"; }
print "><a href="#" onClick="executeform('title','0');">Title Names</a></li>n";
print "<li";
if ($action == "division") { print " class=active"; }
print "><a href="#" onClick="executeform('division','0');">Divisions</a></li>n";
print "<li";
if ($action == "arenas") { print " class=active"; }
print "><a href="#" onClick="executeform('arenas','0');">Arenas</a></li>n";
print "</ul>n";
print "<h1>Site Admin</h1>n";
print "<ul>n";
print "<li";
if ($action == "template") { print " class=active"; }
print "><a href="#" onClick="executeform('template','0');">Templates</a></li>n";
print "<li";
if ($action == "content") { print " class=active"; }
print "><a href="#" onClick="executeform('content','0');">Content</a></li>n";
print "<li";
if ($action == "biolayout") { print " class=active"; }
print "><a href="#" onClick="executeform('biolayout','0');">Bio Configuration</a></li>n";
print "<li";
if ($action == "newscategory") { print " class=active"; }
print "><a href="#" onClick="executeform('newscategory','0');">News Categories</a></li>n";
print "<li";
if ($action == "menustructures") { print " class=active"; }
print "><a href="#" onClick="executeform('menustructures','0');">Menus</a></li>n";
print "</ul>n";
?>
}
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="" />
<title>Untitled 1</title>
</head>
<body>
<?php {
print '<h1 class=backstage>Handler Management</h1><br />';
print "<h2 class="backstage">Handlers :: <a href="#" onclick="ajaxpage('addhandler', 'content'); return false;">Add New</a></h2><br />";
print '<table width="100%" class="table1">';
print '<tr class="rowheading">';
print '<td width="30"> </td>';
print '<td align="center">Username</td>';
print '<td align="center">Surname</td>';
print '<td align="center">First Name</td>';
print '<td align="center">E-Mail</td>';
print '</tr>';
$query = "SELECT * FROM efed_handler ORDER BY `login`";
$result = mysql_query ( $query ); // Run The Query
if ($result) {
// Fetch and print all records.
$i = 0;
while ( $row = mysql_fetch_array ( $result, MYSQL_ASSOC ) ) {
$sClass = 'row2';
if ($i ++ & 1) {
$sClass = 'row1';
}
printf ( "<tr class="%s">", $sClass );
print "<td valign="top" align="center" width="30"><a href="#" onclick="ajaxpage('edithandler', 'content'); return false;">Edit</a></td>";
printf ( "<td valign="top" align="center">%s</td>", $row [login] );
printf ( "<td valign="top" align="center">%s</td>", $row [surname] );
printf ( "<td valign="top" align="center">%s</td>", $row [firstname] );
printf ( "<td valign="top" align="center">%s</td>", $row [email] );
print '</tr>';
}
}
print '</table><br />';
print '<h2 class=backstage><form method=POST><input type=hidden name=action value=mainmenu><input type=submit value="Return to Main Menu" class=button200></form></h2>';
}
?>
</body>
</html>
?>
<?php
print '<h1 class="backstage">Handler Management</h1><br />';
print '<h2 class="backstage">Add New Handler Account</h2><br />';
print '<form name="addhandler" method="post" action="backstage.php" id="addhandler">';
print '<table width="100%" class="table2">';
print '<tr>';
print '<td width="120" class="rowheading">Username:</td><td class="row3"><input type="text" name="login" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Password:</td><td class="row3"><input type="password" name="password" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Surname:</td><td class="row3">';
print '<input type="text" name="surname" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Firstname:</td>';
print '<td class="row3"><input type="text" name="firstname" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Email:</td>';
print '<td class="row3"><input type="text" name="email" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">AIM:</td>';
print '<td class="row3"><input type="text" name="aim" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">MSN:</td>';
print '<td class="row3"><input type="text" name="msn" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Forum ID:</td>';
print '<td class="row3"><input type="text" name="forumid" class="fieldtext490"></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Account:</td>';
print '<td class="row3"><select name="account" class="selection"><option value="0">- Select -</option>';
print '<option value="Active">Active</option><option value="Inactive">Inactive</option>';
print '</select></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Administrator:</td>';
print '<td class="row3"><select name="admin" class="selection"><option value="0">- Select -</option>';
print '<option value="2">No</option><option value="1">Yes</option>';
print '</select></td>';
print '</tr>';
print '</table><br />';
print '<input type="submit" value="Save Handler" class="button" name="addhandler"><br /><br />';
print '<input type="submit" value="Return to Handler List" class="button200"><br /><br />';
print '<script type="text/javascript" src="ajax.js"></script>';
print '<h2 class="backstage">Characters<br /><br />';
print '<select name="characterid" class="dropdown" id="character_selection">';
print '<option value="">- Select -</option>';
$query = 'SELECT charactername FROM characters';
$result = mysql_query ( $query );
while ( $row = mysql_fetch_assoc ( $result ) ) {
print "<option value="".$row['charactername']."">".$row['charactername']."</option>r";
}
print '</select> <input type="hidden" id="chars" name="chars" value=""><input type="button" value="Add" onclick="WrestlerList()" class="button"></h2><br />';
print '<ul id="characterlist"></ul><br /></form&
webpage with (simple) login & mysql-db
Hi all,What I was looking for before was a multi-user password manager, web-based! The offer of free or cheap tools of this kind is very pover. Or they are too complex (or too expensive)I'm not
This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the data from the (and only that one) last record for every single day in the log file. Each record as
Grids not displaying decimals, and behaving differently on different PCs?
Hello,
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I
Unexpected T_Variable ?
Hi all,I dont really know what I am doing!! I know I'm doing something wrong, and I know its on line 42 "$sql="select pname, award, aw_year" but I dont know why its a problem?? Can
Execure stored procedure on a timer
Can someone tell me an easier way to execute a stored procedure on a timer? I am using Oracle 10g R2 DB on windows 2003 server. I have a batch file that calls an SQL file, which runs fine when I
Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, whitepages.com, etc..) and collect the information on the people found there and throw it into a
Procedure with variable number of columns
Hi, I have a procedure that looks like this:
Count Session and Trigger Events
I am New in PHP, seeking a method to count logged users by counting the sessions or any …, is there any way to do it without using a database, and also eager to know a method to make to throw an
AutoChoosing a CSS file based on URL
Hey everyone,I have a site that has multiple URLs and CSS files.Based on the URL that the user goes to I want that CSS file to load.This is what I have thus far in the <head> of my