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&
Problems generating word documents on server side for security reasons
I have a problem with word documentation generation when generating a word document (docx) with PHP. I am doing this for security reasons, as I do not want people to be able to directly access a file
displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folders in a table which is 6 columns of results across by how ever may rows, here is the code I am using
MySQL Does not UPDATE- SQLString Problem
vb Syntax (Toggle Plain Text)
Function to extract email attachments using PHP IMAP
function extract_attachments($connection, $message_number) { $attachments = array(); $structure = imap_fetchstructure($connection, $message_number); if(isset($structure->parts)
Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaWiki on my site and I'm trying to install some extensions. In order to install the Search
How do I give a developer access to a specific directory and nothing else?
I want to give a develop access to a specific directory and nothing elseI can give them an FTP account with access to a sub directory, but this doesn't exactly solve the problem!1. They can write PHP
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
close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can view the siteCode: [Select]RewriteEngine OnRewriteBase /RewriteCond %{REMOTE_ADDR}
How to add advertisment on top of videos
Hello,I was told that i should find the answer for this problem in this forums.I searched a lot but i couldnt find the solution .What i need to do is to add ads on top of the videos i have
Web Application Recipe
Hi Guys! I am working with the Web Application recipes. I am currently working on the send password page. The page is working, but I sends the same password and username regardless of the email