I'm not sure whether to put this under the php forum or ajax forum but because I tink it's more of an issue wit the php code itself I decided to put it here. I came across this file from a friend that said this file will work for me. Okay now basically I have the list of characters and when someone clicks on Add New it will load the addcharacter function. That's what I want it to do. However with all of this it will not load the function. Am I missing something somewhere?
Code: var loadedobjects=""
var rootdomain="http://"+window.location.hostname
function ajaxpage(url, containerid)
{
   var page_request = false
   if (window.XMLHttpRequest) // if Mozilla, Safari etc
   page_request = new XMLHttpRequest()
   else if (window.ActiveXObject)
   {
      // if IE
      try
      {
         page_request = new ActiveXObject("Msxml2.XMLHTTP")
      } 
      catch (e)
      {
         try
         {
            page_request = new ActiveXObject("Microsoft.XMLHTTP")
         }
         catch (e)
         {
         }
      }
   }
   else
   {
      return false
   }
   page_request.onreadystatechange=function()
   {
      loadpage(page_request, containerid)
   }
   page_request.open('GET', url, true)
   page_request.send(null)
}
function loadpage(page_request, containerid)
{
   if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
   document.getElementById(containerid).innerHTML=page_request.responseText
}
function loadobjs()
{
   if (!document.getElementById)
   return
   for (i=0; i<arguments.length; i++)
   {
      var file=arguments[i]
      var fileref=""
      if (loadedobjects.indexOf(file)==-1)
      { 
         //Check to see if this object has not already been added to page before proceeding
         if (file.indexOf(".js")!=-1)
         {
            //If object is a js file
            fileref=document.createElement('script')
            fileref.setAttribute("type","text/javascript");
            fileref.setAttribute("src", file);
         }
         else if (file.indexOf(".css")!=-1)
         {
            //If object is a css file
            fileref=document.createElement("link")
            fileref.setAttribute("rel", "stylesheet");
            fileref.setAttribute("type", "text/css");
            fileref.setAttribute("href", file);
         }
      }
      if (fileref!="")
      {
         document.getElementsByTagName("head").item(0).appendChild(fileref)
         loadedobjects+=file+" " //Remember this object as being already added to page
      }
   }
}
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>Character Management</h1><br />';
    print "<h2 class=backstage>Characters :: <a href="#" onclick="ajaxpage('addcharacter', 'content'); return false;">Add New</a></h2><br />";
      $query = "SELECT 
            bio.charactername,
            bio.style_id,
            style.id,
            style.name
        FROM
            efed_bio as bio
        INNER JOIN
            efed_list_styles as style
        ON
            style.id = bio.style_id";            
     $result = mysql_query ( $query ); // Run The Query
     $rows = mysql_num_rows($result);
     if ($rows > 0)
     {
    
    print '<table width="100%" class="table1">';
    print '<tr class="rowheading">';
    print '<td> </td>';
    print '<td> </td>';
    print '<td>Character Name</td>';
    print '<td align=center width=100>Poser Name</td>';
    print '<td align=center width=60>Style</td>';
    print '<td align=center width=60>Alignment</td>';
    print '<td align=center width=60>Status</td>';
    print '</tr>';
        // Fetch and print all records.
        $i = 0;
        $current_row = 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=35><a href="#" onclick="ajaxpage('editcharacter', 'content'); return false;">Edit</a></td>";
            print "<td valign="top" align=center width=25><a href="#" onclick="ajaxpage('bio', 'content'); return false;">Bio</a></td>";
            printf ( "<td valign="top">%s</td>", $row ['charactername'] );
            printf ( "<td align="center" valign="top">%s</td>", $row ['posername'] );
            printf ( "<td align="center" valign="top">%s</td>", $row ['style_id'] );
            printf ( "<td align="center" valign="top">%s</td>", $row ['alignment_id'] );
            printf ( "<td align="center" valign="top">%s</td>", $row ['status_id'] );
            print '</tr>';
        }
         print '</table>';
     }
     else
     {
     print '<span>There are no characters.</span><br />';
     }
     print '<br />';
returnmain();
}
function addcharacter() {
print '<h1 class="backstage">Character Management</h1><br />';
print '<h2 class="backstage">Add New Character</h2><br />';
print '<form name="addcharacter" method="post" action="backstage.php" id="addcharacter">';
print '<table width="100%" class="table2">';
print '<tr>';
print '<td class="rowheading">Character Name:</td><td class="row3">';
print '<input type="text" name="charactername" class="fieldtext490" value=""></td>';
print '</tr>';
print '<tr>';
print '<td width="120" class="rowheading">Username:</td><td class="row3"><input type="text" name="username" class="fieldtext160"></td>';
print '</tr>';
print '<tr>';
print '<td width="120" class="rowheading">Poser name:</td><td class="row3"><input type="text" name="posername" class="fieldtext160" value=""></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Style:</td>';
print '<td class="row3"><select name="style" class="selection"><option value="0">- Select -</option>';
print '<option value="Singles">Singles</option><option value="Tag Team">Tag Team</option><option value="Stable">Stable</option><option value="Manager">Manager</option><option value="Referee">Referee</option><option value="Staff">Staff</option>';
print '</select></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Gender:</td>';
print '<td class="row3"><select name="gender" class="selection"><option value="0">- Select -</option>';
print '<option value="Male">Male</option><option value="Female">Female</option>';
print '</select></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Status:</td>';
print '<td class="row3"><select name="status" 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>Division:</td>';
print '<td class=row3><select name=division class="selection"><option value=0>- Select -</option>';
print '</select></td>';
print '</tr>';
print '<tr>';
print '<td class=rowheading>Alignment:</td>';
print '<td class="row3"><select name="alignment" class="selection"><option value="0">- Select -</option>';
print '<option value="Face">Face</option><option value="Heel">Heel</option><option value="Neutral">Neutral</option>';
print '</select></td>';
print '</tr>';
print '<tr>';
print '<td class="rowheading">Sort:</td>';
print '<td class="row3"><select name="sort" class="selection"><option value=0>- Select -<option value="A">A<option value="B">B<option value="C">C<option value="D">D<option value="E">E<option value="F">F<option value="G">G<option value="H">H<option value="I">I<option value="J">J<option value="K">K<option value="L">L<option value="M">M<option value="N">N<option value="O">O<option value="P">P<option value="Q">Q<option value="R">R<option value="S">S<option value="T">T<option value="U">U<option value="V">V<option value="W">W<option value="X">X<option value="Y">Y<option value="Z">Z<option value="0-9">0-9</select></td>';
print '</tr>';
print '</table><br />';
print '<input type="submit" value="Save Character" class="button" name="addcharacter"><br /><br />';
print '<input type="button" value="Return to Character List" class="button200"><br /><br />';
print '<h2 class="backstage"><input type="button" value="Return to Main Menu" class="button200"></form></h2>';
}
?>
</body>
</html>
Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on deciding where would be best to begin or which is the best way to approach the problem.The company I work
this code is not working????
it says this error.. Warning: Division by zero in ..the variables are correct, so why is the variable $max zero??/Code: $sw = $_GET['w']; $sh = $_GET['h'];
How can i use [] tags instead of <> tags for profiles??
On my site im making ive made it so u can register, login and u have a profile which u can update..http://90.202.46.253thats the site, if u go on there, regsiter and login u will see that u can then
Send current URL in URL with a $_GET variable problem.
Hello community,I have created a function that gets the current variable of a page, example:current page URL: Code: [Select] http://example.com/activate.php?token=123&code=321Now, I want to
IIS & NW MII on the same server
Hi,
Empty text file when there is over XXXX lines of text.
define("RANDOM_FILE","/public_html/random.txt"); $randomEntry = "This goes in text file.\n"; { $randomFile = fopen(RANDOM_FILE,"a"); }
Recording popularity by day, week.. all time?
Hey everyone, I'm creating a site designed around users uploading music. How can I implement a system that would effectively record information such as view count so that a user could find the most
Adding Different Numbers From MySQL
Basically I have a mysql database with a couple prices as the following:9.999.999.9949.9924.5024.50How can I add these numbers and display the total from a mysql database?
getting most records by count
Code: [Select]<?php $connect = mysql_connect("localhost","damgears_evil","damgears"); mysql_select_db("damgears_evil"); $queryreg =
database design
Hi,I got a page which allow candidate to type in their previous working experience,I let user to choose the start date and end date and then system will automatically calculate the total experience in