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&
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignored, rejected, or misunderstood in this forum. I'm surprised there isn't already any
Help on query replacing the date
Hi Pals,
Dynamic Data + Sql Server 2005 Enterprise?
Hi! I have just started to learn ASP.NET, and it looks like it is quite a lot to learn. Im not really sure where I should begin, but I have watched the Dynamic Data
Little problem with form insertion in MySQL, Please help!!!
Hi!,I'm a little bit new with php and I have a little issue here. I created a webform to insert some infos into a MySQL database. The weird thing is that some of the infos is correctly inserted and
how to remove in php string display
My code is$message="We're looking at developing our website.";$body= "My message is,\n\n\n\n\t\t\t".$message";echo $body;I get result We\'re looking at developing our
Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this Hope that anyone could give me a simple .htaccess tutorialthanks
Table control is disappearing from Screen
Hi Experts,
jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are auto incremented according to count.i need to add validation for a selected fields onlymy code is
Code doesn't print what i wanted it too. Please help!
Hi there,I wrote this code to mae it so that in the form before it that the user said their username and then on this page it matches up the username with the username on the database and then uses
Custom Container in module pool program
Hello everyone,