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&
Can you help please? Php file
I have to write this php file to allow users to register their nicknames on nickservFor an IRC server, however it worked fine for a couple of years, I then upgraded from Php4 to Php5 and suddenly
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back
need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you manage your code snippets?please list some good snippet managers.i tried snippely but it does not have
Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..Code: echo "<td><strong>MP:</strong></td>"; echo
a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complcated the password can be several words. "Today is Sunday"However I want to exclude certain
How to set pass login name from htaccess to php
When the user logs into my members page via htaccess, I'd like to retain the username so that I can call upon his account info later. Is there a way to save his user name in a cookie (or some other
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause i am posting in the wrong area. I am starting from scratch with a new registration form for a
problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of pointers. Following is the code:
Post PHP form to non-existing page
The company that I work for host their PHP code on IIS on a Windows server, no Apache, so no mod_rewrite. I recently wrote a custom framewok that is loosely based on Codeigniter. To get SEF URL's 'n
php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from the sql. However when I click delete nothing happens.Code: