Jump to content

paddyhaig

Members
  • Posts

    131
  • Joined

  • Last visited

    Never

Posts posted by paddyhaig

  1. Admin:Thorpe

    Is trying to mess with me! I am getting fed up of the constant petty meaningless attacks he is making on my posts. I am looking for help and solutions, not petty attacks on my posts. I try to offer all the information I can and am looking for some help from someone hopefully more knowledgeable than me. Thorpe needs his status revoked! I am so pissed off with this character. He's an idiot!

  2. Who made you an administrator Thorpe? I don't have anything pertaining to alternating colored rows on a form posted. Your such a time waster Thorpe and your ruining my posts. Who do I complain to? Your not helping me a bit, your just being a bitch. Do you even know how to offer solutions? Have you ever actually helped anyone? Why not offer a solution instead of criticizing peoples posts. I am making a copy of this dialog and sending a copy with a complaint to the person registered behind phpfreaks. You are totally pissing me off. You had the audacity to call me a Princess! I came here for help not to mix it with some idiot on a control trip!

  3. Well let me see. I am aware that css and html are used together, maybe I should rephrase, I am interested in css style tables. I am also interested in alternating slightly transparent table row colors. Here's my present code, how would I implement the above interests? All and any help greatly appreciated.

     

    Here's my present style sheet.

    /* The below ruleset applies to the Admin Index*/
    /* This first container applies to the center slightly transparent box */
    #container_3col
    {
    position:absolute;
    width:686px;
    height:310px;
    z-index:1;
    left:50%;
    top:10px;
    margin-left:-343px;
    border:solid white 1px;
    color: #FFF;
    background-color:#C1AA24;
    /* for IE */
      filter:alpha(opacity=85);
    /* CSS3 standard */
      opacity:0.89;
    }
    #container_2col
    {
    position:absolute;
    width:462px;
    height:310px;
    z-index:1;
    left:50%;
    top:10px;
    margin-left:-231px;
    border:solid white 1px;
    color: #FFF;
    background-color:#C1AA24;
    /* for IE */
      filter:alpha(opacity=85);
    /* CSS3 standard */
      opacity:0.89;
    }
    /* End of container */
    /* This second container applies to the buttons used in the above box */
    #container_3col a
    {
    float:left;
    display:block;
    height:50px;
    width:200px;
    z-index:2;
    margin-left:20px;
    margin-top:20px;
    text-align:center;
    line-height:50px;
    border:solid white 1px;
    font-weight: bolder;
    color: #FFF;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: large;
    cursor: auto;
    background-color:#F00;
    /* for IE */
      filter:alpha(opacity=90);
    /* CSS3 standard */
      opacity:0.9;
    }
    #container_2col a
    {
    float:left;
    display:block;
    height:50px;
    width:200px;
    z-index:2;
    margin-left:20px;
    margin-top:20px;
    text-align:center;
    line-height:50px;
    border:solid white 1px;
    font-weight: bolder;
    color: #FFF;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: large;
    cursor: auto;
    background-color:#F00;
    /* for IE */
      filter:alpha(opacity=90);
    /* CSS3 standard */
      opacity:0.9;
    }
    /* End of container */
    /* This third container is the background for the Admin Index page */
    body {
    background-image: url(../graphics/backpackers.png);
    background-repeat: no-repeat;
    }
    /* End of container */
    /* End of css rulesets for the Admin Index page */ 
    
    

     

    Here's the html (With just a little php)

    <?php
    // Start time variable.
    $time= strftime("%Y-%m-%d   %H:%M");
    // End time variable.
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Check in/out</title>
    <link href="../../css/general.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body> 
    <div id="container_3col">
    
    <form action="<?php echo $editFormAction; ?>" id="check_in" name="check_in" method="POST">
          
          <table width="655" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th width="136">ID type:</th>
            <td width="192"><input type="text" name="idtype" id="idtype" /></td>
            <th width="167">Key Deposit:</th>
            <td width="160"><input name="keydeposit" type="text" id="keydeposit" value="$5.00" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th>ID Number:</th>
            <td><input type="text" name="idnumber" id="idnumber" /></td>
            <th>Rent:</th>
            <td><input type="text" name="rent" id="rent" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th>First Name:</th>
            <td><input type="text" name="forename" id="forename" /></td>
            <th>Date and Time:</th>
            <td><input name="arrivaldate" type="text" id="arrivaldate" value="<?php echo $time ?>" readonly="readonly" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th>Second Name:</th>
            <td><input type="text" name="surname" id="surname" /></td>
            <th>Emergency Contact#</th>
            <td><input type="text" name="departdate" id="departdate" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th>Nationality:</th>
            <td><input type="text" name="nationality" id="nationality" /></td>
            <th>Room number:</th>
            <td><input type="text" name="roomnumber" id="roomnumber" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
            <th>Email Address:</th>
            <td><input type="text" name="emailaddress" id="emailaddress" /></td>
            <th>Total:</th>
            <td><input type="text" name="total" id="total" /></td>
          </tr>
          <tr>
            <th> </th>
            <td> </td>
            <th> </th>
            <td> </td>
          </tr>
          <tr>
           
            <th><input type="hidden" name="id" id="id" /></th>
    <td><input type="submit" name="button" id="button" value="Submit" /></td>
    
            <th>Notes:</th>
            <td><input type="text" name="notes" id="notes" /></td>
          </tr>
        </table>
          <input type="hidden" name="MM_insert" value="check_in" />
    </form>
    </div> 
    </body>
    </html>
    

  4. I am looking to make a cool looking even sexy looking form (No, nude men or woman)

    I made this using tables (See graphic), but I want it to look a little cooler, I figured if I used alternating slightly transparent table row colors or something like that and maybe made the table using css as opposed to html. I might be able to do some cooler stuff (Like fine 1px borders). I have been getting some great ideas from PhPfreaks so far for other aspects of my project. Any idea or suggestions greatly appreciated.

     

    form.jpg

  5. I thought you were my savior. ;-)

    It kinda looks a little funky. Please see included graphic:

    The are two rather distinct large containers and four columns instead of three with four rows.

    I am trying to figure this out as I can see it's certainly heading in the right direction.

    Why are the two distinct containers? Thanks for the help, you are rocking so far. 

    boxes.jpg

  6. I have a number of divs that I wish to use as buttons on an interface and I would like to center the text in each one of them.

     

    Here is the code so far:

     

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    
    #bodyDiv {
    position:relative;
    width:550px;
    height:325px;
    z-index:1;
    left: 50%;
    top: 10px;
    margin-left: -275px;
    background-color: #CCC;
    border: 1px solid #000;
    text-align: center;
    font-family: "Arial Black", Gadget, sans-serif;
    font-weight: bold;
    color: #F00;
    }
    
    /*This is the table*/
    table
    {
    border-collapse:collapse;
    }
    table, td
    {
    border: 1px solid black;
    }
    
    td
    {
    height:30px;
    vertical-align:middle;
    }
    
    td
    {
    text-align:center;
    font-weight: bold;
    color: #FFF;
    }
    
    /*This is the end of the table*/
    
    /*This is the beggining of the left column*/
    #apDiv1 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 25px;
    top: 25px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv2 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 25px;
    top: 100px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv3 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 25px;
    top: 175px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv4 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 25px;
    top: 250px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    /*This is the end of the left column*/
    
    /*This is the beggining of the middle column*/
    #apDiv5 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 200px;
    top: 25px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv6 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 200px;
    top: 100px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv7 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 200px;
    top: 175px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv8 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 200px;
    top: 250px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    /*This is the end of the middle column*/
    
    /*This is the beggining of the right column*/
    #apDiv9 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 375px;
    top: 25px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv10 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    top: 100px;
    left: 375px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv11 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 375px;
    top: 175px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv12 {
    position:absolute;
    width:150px;
    height:50px;
    z-index:2;
    left: 375px;
    top: 250px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    
    /*This is the end of the right column*/
    
    -->
    </style>
    </head>
    
    <body>
    <div id="bodyDiv">
      <div id="apDiv1">Test1</br></div>
      <div id="apDiv2">Test2</div>
      <div id="apDiv3">Test3</div>
      <div id="apDiv4">Test4</div>
      <!-This is the end of the left row-->
      <!-This is the begging of the middle row-->
      <div id="apDiv5">Test5</div>
      <div id="apDiv6">Test6</div>
      <div id="apDiv7">Test7</div>
      <div id="apDiv8">Test8</div>
      <!-This is the end of the middle row-->
      <!-This is the begging of the right row-->
      <div id="apDiv9">Test9</div>
      <div id="apDiv10">Test10</div>
      <div id="apDiv11">Test11</div>
      <div id="apDiv12">Test12</div>
      <!-This is the end of the right row-->
    </div>
    </body>
    </html>
    

  7. Here is the code being used at present:

     

    For the main form and table:

     

    <?php require_once('../Connections/Concierge.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_Concierge, $Concierge);
    $query_rsAuth = "SELECT * FROM auth ORDER BY id ASC";
    $rsAuth = mysql_query($query_rsAuth, $Concierge) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <?php
    $id = "id";
    $forename = "forename";
    $surname = "surname";
    $username = "username";
    $password = "password";
    $privilege = "privilege";
    $administrator = "administrator";
    $manager = "manager";
    $receptionist = "receptionist";
    ?>
    <?php include("cookie_security.inc"); ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Concierge Edit staff member</title>
    
    <link href="../includes/primary_layout.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
    #center_box {
    height: 223px;
    width: 626px;
    overflow:auto;
    padding: 0px;
    left: 139px;
    top: 110px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    </style>
    </head>
    <body>
    <div id="wrapper">
    <div id="large-blue-box">
    <div id="center_box">
        
    <div id="form">
      <div align="center">
        <table width="98%" border="1" cellpadding="0" cellspacing="0">
          <tr>
            <th colspan="7">* Indicates required field. Please delete  * and fill form field with appropriate information.</th>
            </tr>
          <tr>
            <th width="16%">Add/Remove</th>
            <th colspan="2">First/Last Names</th>
            <th colspan="2">Login/Password</th>
            <th width="20%">Privilege</th>
            <th width="6%">Submit/Edit</th>
            </tr>
          <tr>
          
                <!--  This is hidden -->          
    <input type="hidden" name="<?php $id ?>" id="id_number"/>
                <!--  End of hidden -->
          
            <td><div align="center"><a href="create_staff_member.php">(AddUser)</a></div></td>
            
    <!--  <th>id</th> --> 
    
            <td width="10%"><div align="center">
              <input name="<?php $forename ?>" type="text" id="forename" value="*" size="9" maxlength="15" />
            </div></td>
            <td width="15%"><input name="<?php $surname ?>" type="text" id="surname" value="*" size="9" maxlength="15" /></td>
            <td width="16%"><div align="center">
              <input name="<?php $login ?>" type="text" id="username" value="*" size="9" maxlength="15" />
            </div></td>
            <td width="17%"><input name="<?php $password ?>" type="password" id="password" value="*" size="9" maxlength="15" /></td>
    <!--    <th>password</th> -->
            <td><div align="center">
              <select name="privilege" id="privilege">
                <option value="<?php $privilege ?>">*Privilege</option>
                <option value="<?php $administrator ?>">Administrator</option>
                <option value="<?php $manager ?>">Manager</option>
                <option value="<?php $receptionist ?>">Receptionist</option>
              </select>
            </div></td>
    <!--    <th>login_time</th> -->
    <!--    <th>logout_time</th> -->
            <td><div align="center"><a href="nowhere.php">(Submit)</a></div></td>
          </tr>
          <?php do { ?>
            <tr>
              <td><div align="center"><a href="delete_user.php?id=<?php echo $row_rsAuth['id']; ?>">(Remove)</a></div></td>
    <!--      <td><?php $row_rsAuth['id']; ?></td> -->
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['first_name']; ?> <?php echo $row_rsAuth['last_name']; ?></div>            <div align="center"></div></td>
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['login']; ?></div></td>
    <!--      <td><?php $row_rsAuth['password']; ?></td> -->
              <td><div align="center"><?php echo $row_rsAuth['privilege']; ?></div></td>
    <!--      <td><?php $row_rsAuth['login_time']; ?></td> -->
    <!--      <td><?php $row_rsAuth['logout_time']; ?></td> -->
              <td><div align="center"><a href="form_update.php?id=<?php echo $row_rsAuth['id']; ?>">(Edit)</a></div></td>
            </tr>
            <?php } while ($row_rsAuth = mysql_fetch_assoc($rsAuth)); ?>
        </table>
      </div>
    </div>
    <p align="center"> </p>
      </div>
      <div id="form11"><a href="staff_management.php"><img src="../graphics/general/index_button.gif" width="180" height="28" /></a>
        
    </div>  
    </div>
    
    <?php include("../includes/footer.inc"); ?>
      
    </div>
    </body>
    </html>
    
    
    
    <?php
    mysql_free_result($rsAuth);
    ?>
    

     

    For the (Edit/User)

     

    <?php require_once('../Connections/Concierge.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO auth (first_name, last_name, login, password, privilege) VALUES (%s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['forename'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['privilege'], "text"));
    
      mysql_select_db($database_Concierge, $Concierge);
      $Result1 = mysql_query($insertSQL, $Concierge) or die(mysql_error());
    
      $insertGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    mysql_select_db($database_Concierge, $Concierge);
    $query_rsAuth = "SELECT * FROM auth ORDER BY id ASC";
    $rsAuth = mysql_query($query_rsAuth, $Concierge) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Create Staff Member</title>
    <link href="../includes/primary_layout.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
    #center_box {
    height: 184px;
    width: 145px;
    padding: 0px;
    left: 156px;
    top: 121px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    #input_form {
    height: 315px;
    width: 261px;
    padding: 0px;
    left: 141px;
    top: 140px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    </style>
    </head>
    <body>
    <div id="wrapper">
    <div id="small-blue-box">
    
      <form id="input_form" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      
        <table width="234" border="0" cellpadding="0" cellspacing="0">
          <tr bgcolor="#283a86">
            <th width="95" scope="row">First Name </th>
            <td width="133"><input name="forename" type="text" id="forename" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Last Name</th>
            <td><input name="surname" type="text" id="surname" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">User Name</th>
            <td><input name="login" type="text" id="login" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Password</th>
            <td><input name="password" type="password" id="password" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Privilege</th>
            <td><select name="privilege" id="privilege">
              <option value="receptionist">Receptionist</option>
              <option value="manager">Manager</option>
              <option value="administrator">Administrator</option>
              <option value="suspended">Suspended</option>
            </select></td>
          </tr>
        </table>
        <div align="">
          <input type="submit" name="submit" id="submit" value="Submit" />
          <input type="hidden" name="MM_insert" value="form1" />
        </div>
      </form>
    
    
    </div>
    
    </body>
    </html>
    <?php
    mysql_free_result($rsAuth);
    ?>
    

     

    For the (Submit/Edit)

     

    <?php require_once('../Connections/Concierge.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE auth SET first_name=%s, last_name=%s, login=%s, password=%s, privilege=%s, login_time=%s, logout_time=%s WHERE id=%s",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['privilege'], "text"),
                           GetSQLValueString($_POST['login_time'], "date"),
                           GetSQLValueString($_POST['logout_time'], "date"),
                           GetSQLValueString($_POST['id'], "int"));
    
      mysql_select_db($database_Concierge, $Concierge);
      $Result1 = mysql_query($updateSQL, $Concierge) or die(mysql_error());
    
      $updateGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $updateGoTo));
    }
    
    $colname_rsAuth = "-1";
    if (isset($_GET['id'])) {
      $colname_rsAuth = $_GET['id'];
    }
    mysql_select_db($database_Concierge, $Concierge);
    $query_rsAuth = sprintf("SELECT * FROM auth WHERE id = %s", GetSQLValueString($colname_rsAuth, "int"));
    $rsAuth = mysql_query($query_rsAuth, $Concierge) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Form Update</title>
    
    <link href="../includes/primary_layout.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
    #center_box {
    height: 199px;
    width: 183px;
    padding: 0px;
    left: 131px;
    top: 47px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }	
    </style>
    </head>
    <body>
    
    <div id="wrapper">
      <div id="small-blue-box">
             <form id="center_box" name="form1" method="post" action="">
            <p> </p>
            <table width="264" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="114"> </th>
                <td width="144"> </td>
              </tr>
              <tr>
                <th>First Name</th>
                <td><input name="first_name" type="text" id="first_name" value="<?php echo $row_rsAuth['first_name']; ?>" size="20" /></td>
              </tr>
              <tr>
                <th> </th>
                <td> </td>
              </tr>
              <tr>
                <th>Last Name</th>
                <td><input name="last_name" type="text" id="last_name" value="<?php echo $row_rsAuth['last_name']; ?>" size="20" /></td>
              </tr>
              <tr>
                <th> </th>
                <td> </td>
              </tr>
              <tr>
                <th>Login</th>
                <td><input name="login" type="text" id="login" value="<?php echo $row_rsAuth['login']; ?>" size="20" /></td>
              </tr>
              <tr>
                <th> </th>
                <td> </td>
              </tr>
              <tr>
                <th>Password</th>
                <td><input name="password" type="password" id="password" value="<?php echo $row_rsAuth['password']; ?>" size="20" /></td>
              </tr>
              <tr>
                <th> </th>
                <td> </td>
              </tr>
              <tr>
                <th>Privilage</th>
                <td><select name="privilege" id="privilege">
                  <option value="receptionist" <?php if (!(strcmp("receptionist", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Receptionist</option>
                  <option value="suspended" <?php if (!(strcmp("suspended", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Suspended</option>
                  <option value="manager" <?php if (!(strcmp("manager", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Manager</option>
                  <option value="administrator" <?php if (!(strcmp("administrator", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Administrator</option>
                  <?php
    do {  
    ?>
                  <option value="<?php echo $row_rsAuth['privilege']?>"<?php if (!(strcmp($row_rsAuth['privilege'], $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAuth['privilege']?></option>
                  <?php
    } while ($row_rsAuth = mysql_fetch_assoc($rsAuth));
      $rows = mysql_num_rows($rsAuth);
      if($rows > 0) {
          mysql_data_seek($rsAuth, 0);
      $row_rsAuth = mysql_fetch_assoc($rsAuth);
      }
    ?>
                </select></td>
              </tr>
              <tr>
                <th> </th>
                <td> </td>
              </tr>
              <tr>
                <th><input name="id" type="hidden" id="id" value="<?php echo $row_rsAuth['id']; ?>" />
                  <input name="login_time" type="hidden" id="login_time" value="<?php echo $row_rsAuth['login_time']; ?>" />
                  <input name="logout_time" type="hidden" id="logout_time" value="<?php echo $row_rsAuth['logout_time']; ?>" />
                  <input type="hidden" name="MM_update" value="form1" /></th>
                <td><input type="submit" name="submit" id="submit" value="Submit" /></td>
              </tr>
            </table>
            <p> </p>
            <p> </p>
            <p align="center"> </p>
          </form>
      </div>
    </div>
      <?php include("../includes/footer.inc"); ?>
    </div>
    </body>
    </html>
    

     

    And the require being used simply introduces the database connect info:

    require_once ../Connections/Concierge.php =

     

    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_Concierge = "localhost";
    $database_Concierge = "database";
    $username_Concierge = "username";
    $password_Concierge = "password";
    $Concierge = mysql_pconnect($hostname_Concierge, $username_Concierge, $password_Concierge) or trigger_error(mysql_error(),E_USER_ERROR); 
    ?>
    

     

    Any and all help with this is greatly appreciated. I am trying to get it all to run from the same interface rather than different pages.

     

     

  8. I have a form/mySQL data table that I am trying to delete data from, add data too and edit the data via fields on the same page. I will try to be a little clearer.

    Here is a graphic of the table/form populated with some user data:

     

    form_table.jpg

     

    Here is a graphic of the same form populated with some more user data:

     

    form_data_more_data.jpg

     

    Here is what comes up when I click on the (Add/User) link:

     

    add-user.jpg

     

    Here's what comes up when I click on the (Edit) row

     

    edit.jpg

     

    What I am trying to do, is combine all the procedures onto the same page.

    The actual form fields on the table do nothing at present.

     

    As it is, everything works, only I think it could be a little neater if it were all done via the same interface. Does anyone have any realistic ideas that might help.

    I have all the present code if anyone can help.

  9. I am trying to make a box that will remain in the middle of my screen and inside that box will be 12 smaller boxes that will act as buttons. I would like for the box and buttons to be the same in all browsers and maintain balance in all resolutions (That is for the box to stay in the middle of the screen and for the smaller button/boxes to stay relative to the outer box).

    Is the some formula that will help me layout the smaller boxes in a geometrically balanced layout, kinda like in a table only using AP Divs.

    I have included my code and a photo.

     

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    
    #bodyDiv {
    position:absolute;
    width:597px;
    height:304px;
    z-index:1;
    left: 130px;
    top: 65px;
    background-color: #CCC;
    border: 1px solid #000;
    }
    
    /*This is the table*/
    table
    {
    border-collapse:collapse;
    }
    table, td
    {
    border: 1px solid black;
    }
    
    td
    {
    height:30px;
    vertical-align:middle;
    }
    
    td
    {
    text-align:center;
    font-weight: bold;
    color: #FFF;
    }
    
    /*This is the end of the table*/
    
    /*This is the beggining of the left column*/
    #apDiv1 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 49px;
    top: 32px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv2 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 50px;
    top: 95px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv3 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 48px;
    top: 157px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv4 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 48px;
    top: 219px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    /*This is the end of the left column*/
    
    /*This is the beggining of the middle column*/
    #apDiv5 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 230px;
    top: 31px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv6 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 230px;
    top: 94px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv7 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 229px;
    top: 155px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv8 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 229px;
    top: 216px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    /*This is the end of the middle column*/
    
    /*This is the beggining of the right column*/
    #apDiv9 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 414px;
    top: 31px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv10 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    top: 91px;
    left: 416px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv11 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 417px;
    top: 153px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv12 {
    position:absolute;
    width:150px;
    height:45px;
    z-index:2;
    left: 417px;
    top: 216px;
    background-color: #D6D6D6;
    border: 1px solid #000;
    }
    #apDiv13 {
    position:absolute;
    width:150px;
    height:233px;
    z-index:3;
    left: 50px;
    top: 32px;
    }
    /*This is the end of the right column*/
    
    -->
    </style>
    </head>
    
    <body>
    
    <div align="center"></div>
    <div id="bodyDiv">
      <!-This is the begging of the left row-->
      <div id="apDiv1"></div>
      <div id="apDiv2"></div>
      <div id="apDiv3"></div>
      <div id="apDiv4"></div>
      <!-This is the end of the left row-->
      <!-This is the begging of the middle row-->
      <div id="apDiv5"></div>
      <div id="apDiv6"></div>
      <div id="apDiv7"></div>
      <div id="apDiv8"></div>
      <!-This is the end of the middle row-->
      <!-This is the begging of the right row-->
      <div id="apDiv9"></div>
      <div id="apDiv10"></div>
      <div id="apDiv11"></div>
      <div id="apDiv12"></div>
      <!-This is the end of the right row-->
    </div>
    </body>
    </html>
    

     

    [attachment deleted by admin]

  10. What's going on here. I have a local mySQL database and a remote mySQL database both use to sync just fine, but now I am getting this error. Can antone tell me why and how I can stop it? I have been syncing this db for weeks without any problems. 

     

     

    Error

     

    SQL query: Documentation

     

    /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`oninacom_onina`@`localhost` SQL SECURITY DEFINER VIEW `test` AS (select `auth`.`id` AS `id`,`auth`.`first_name` AS `first_name`,`auth`.`last_name` AS `last_name`,`auth`.`login` AS `login`,`auth`.`password` AS `password`,`auth`.`privilege` AS `privilege` from `auth`) */;

     

    MySQL said: Documentation

    #1227 - Access denied; you need the SUPER privilege for this operation

  11. I almost forgot. This page is used to submit to the same db list.

     

    create_staff_member.php

    <?php require_once('../Connections/Example.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form6")) {
      $insertSQL = sprintf("INSERT INTO auth (first_name, last_name, login, password, privilege) VALUES (%s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['forename'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['priviege'], "text"));
    
      mysql_select_db($database_Example, $Example);
      $Result1 = mysql_query($insertSQL, $Example) or die(mysql_error());
    
      $insertGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    mysql_select_db($database_Example, $Example);
    $query_Recordset1 = "SELECT * FROM auth";
    $Recordset1 = mysql_query($query_Recordset1, $Example) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit User Details</title>
    
    
    <style type="text/css">
    th {
    color: #FFF;
    }
    
    
    </style>
    </head>
    
    <body>
    <div align="center">
      <p> </p>
      <form id="form6" name="form6" method="POST" action="<?php echo $editFormAction; ?>">
        <table width="234" border="1" cellpadding="0" cellspacing="0">
          <tr bgcolor="#283a86">
            <th width="95" scope="row">First Name </th>
            <td width="133"><input name="forename" type="text" id="forename" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Last Name</th>
            <td><input name="surname" type="text" id="surname" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">User Name</th>
            <td><input name="login" type="text" id="login" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Password</th>
            <td><input name="password" type="password" id="password" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Privilege</th>
            <td><select name="priviege" id="priviege">
              <option value="receptionist">Receptionist</option>
              <option value="manager">Manager</option>
              <option value="administrator">Administrator</option>
              <option value="suspended">Suspended</option>
            </select></td>
          </tr>
        </table>
        <p>
        <input type="submit" name="submit" id="submit" value="Submit" />
        <input type="hidden" name="MM_insert" value="form6" />
      </form>
      
        
      </p>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    

  12. Can this be done? I would like all the actions to take place on the same page?

     

    edit_staff_member.php

    <?php require_once('../Connections/Example.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_Example, $Example);
    $query_rsAuth = "SELECT * FROM auth ORDER BY id ASC";
    $rsAuth = mysql_query($query_rsAuth, $Example) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <?php include("admin_header.inc"); ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Example Edit staff member</title>
    <!-- This is both the external style sheet link and the internal style container -->
    <link href="../includes/primary_layout.css" rel="stylesheet" type="text/css" />
    <!-- Begining of internal style container -->
    <style type="text/css">
    #center_box {
    height: 223px;
    width: 626px;
    overflow:auto;
    padding: 0px;
    left: 139px;
    top: 110px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    </style>
    <!-- End of internal style container -->
    </head>
    
    <body>
    <div id="wrapper">
    <div id="large-blue-box">
    <div id="center_box">
        
    <div id="form">
      <div align="center">
        <table width="90%" border="1" cellpadding="0" cellspacing="0">
          <tr>
            <th colspan="7">* Indicates required field. Please delete  and fill with appropriate info.</th>
            </tr>
          <tr>
            <th width="16%">Add/Remove</th>
            <th colspan="2">First/Last Names</th>
            <th colspan="2">Login/Password</th>
            <th width="20%">Privilege</th>
            <th width="6%">Edit</th>
            </tr>
          <tr>
            <td><div align="center"><a href="create_staff_member.php">(AddUser)</a></div></td>
    <!--    <th>id</th> -->
            <td width="10%"><div align="center">
              <input name="forename" type="text" id="forename" value="*First " size="9" maxlength="15" />
            </div></td>
            <td width="15%"><input name="surname" type="text" id="surname" value="*Last" size="9" maxlength="15" /></td>
            <td width="16%"><div align="center">
              <input name="username" type="text" id="username" value="*Login" size="9" maxlength="15" />
            </div></td>
            <td width="17%"><input name="password" type="text" id="password" value="*Pass" size="9" maxlength="15" /></td>
    <!--    <th>password</th> -->
            <td><div align="center">
              <select name="priv" id="priv">
                <option value="privilege">*Privilege</option>
                <option value="administrator">Administrator</option>
                <option value="manager">Manager</option>
                <option value="receptionist">Receptionist</option>
              </select>
            </div></td>
    <!--    <th>login_time</th> -->
    <!--    <th>logout_time</th> -->
            <td><div align="center">(Submit)</div></td>
          </tr>
          <?php do { ?>
            <tr>
              <td><div align="center"><a href="delete_user.php?id=<?php echo $row_rsAuth['id']; ?>">(Remove)</a></div></td>
    <!--      <td><?php $row_rsAuth['id']; ?></td> -->
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['first_name']; ?> <?php echo $row_rsAuth['last_name']; ?></div>            <div align="center"></div></td>
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['login']; ?></div></td>
    <!--      <td><?php $row_rsAuth['password']; ?></td> -->
              <td><div align="center"><?php echo $row_rsAuth['privilege']; ?></div></td>
    <!--      <td><?php $row_rsAuth['login_time']; ?></td> -->
    <!--      <td><?php $row_rsAuth['logout_time']; ?></td> -->
              <td><div align="center"><a href="form_update.php?id=<?php echo $row_rsAuth['id']; ?>">(Edit)</a>*</div></td>
            </tr>
            <?php } while ($row_rsAuth = mysql_fetch_assoc($rsAuth)); ?>
        </table>
      </div>
    </div>
    <p align="center"> </p>
      </div>
      <div id="form11"><a href="staff_management.php"><img src="../graphics/general/index_button.gif" width="180" height="28" /></a>
        
    </div>  
    </div>
    
    <?php include("../includes/footer.inc"); ?>
      
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($rsAuth);
    ?>
    

     

    When you click on (Edit) it goes to this page: form_update.php

    <?php require_once('../Connections/Example.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE auth SET first_name=%s, last_name=%s, login=%s, password=%s, privilege=%s, login_time=%s, logout_time=%s WHERE id=%s",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['privilege'], "text"),
                           GetSQLValueString($_POST['login_time'], "date"),
                           GetSQLValueString($_POST['logout_time'], "date"),
                           GetSQLValueString($_POST['id'], "int"));
    
      mysql_select_db($database_Example, $Example);
      $Result1 = mysql_query($updateSQL, $Example) or die(mysql_error());
    
      $updateGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $updateGoTo));
    }
    
    $colname_rsAuth = "-1";
    if (isset($_GET['id'])) {
      $colname_rsAuth = $_GET['id'];
    }
    mysql_select_db($database_Example, $Example);
    $query_rsAuth = sprintf("SELECT * FROM auth WHERE id = %s", GetSQLValueString($colname_rsAuth, "int"));
    $rsAuth = mysql_query($query_rsAuth, $Example) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit User</title>
    </head>
    
    <body>
    <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      <p>
        <input name="id" type="hidden" id="id" value="<?php echo $row_rsAuth['id']; ?>" />
      </p>
      <p>first_name
        <input name="first_name" type="text" id="first_name" value="<?php echo $row_rsAuth['first_name']; ?>" />
      </p>
      <p>last_name
        <input name="last_name" type="text" id="last_name" value="<?php echo $row_rsAuth['last_name']; ?>" />
      </p>
      <p>login
        <input name="login" type="text" id="login" value="<?php echo $row_rsAuth['login']; ?>" />
      </p>
      <p> password
        <input name="password" type="password" id="password" value="<?php echo $row_rsAuth['password']; ?>" />
      </p>
      <p> privilege
        <select name="privilege" id="privilege">
          <option value="receptionist" <?php if (!(strcmp("receptionist", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Receptionist</option>
          <option value="suspended" <?php if (!(strcmp("suspended", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Suspended</option>
          <option value="manager" <?php if (!(strcmp("manager", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Manager</option>
          <option value="administrator" <?php if (!(strcmp("administrator", $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>>Administrator</option>
          <?php
    do {  
    ?>
          <option value="<?php echo $row_rsAuth['privilege']?>"<?php if (!(strcmp($row_rsAuth['privilege'], $row_rsAuth['privilege']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAuth['privilege']?></option>
          <?php
    } while ($row_rsAuth = mysql_fetch_assoc($rsAuth));
      $rows = mysql_num_rows($rsAuth);
      if($rows > 0) {
          mysql_data_seek($rsAuth, 0);
      $row_rsAuth = mysql_fetch_assoc($rsAuth);
      }
    ?>
        </select>
      </p>
      <p>
        <input name="login_time" type="hidden" id="login_time" value="<?php echo $row_rsAuth['login_time']; ?>" />
      </p>
      <p>
        <input name="logout_time" type="hidden" id="logout_time" value="<?php echo $row_rsAuth['logout_time']; ?>" />
      </p>
      <p align="center">
        <input type="submit" name="submit" id="submit" value="Submit" />
      </p>
      <input type="hidden" name="MM_update" value="form1" />
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($rsAuth);
    ?>
    

     

    When you click on the (Remove) link it removes the specified row and brings you right back to the original list/form page minus the row you just deleted. Here is the script it uses below: delete_user.php

    <?php require_once('../Connections/Example.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    if ((isset($_GET['id'])) && ($_GET['id'] != "")) {
      $deleteSQL = sprintf("DELETE FROM auth WHERE id=%s",
                           GetSQLValueString($_GET['id'], "int"));
    
      mysql_select_db($database_Example, $Example);
      $Result1 = mysql_query($deleteSQL, $Example) or die(mysql_error());
    
      $deleteGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $deleteGoTo));
    }
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Delete User</title>
    </head>
    
    <body>
    <p>No User to delete!
    </p>
    <p><a href="edit_staff_member.php">Go Back?</a></p>
    <p> </p>
    </body>
    </html>

     

    What I am trying to do is compact all the above onto one page coded in a logical and efficient way. Please help if you can?  :confused:

  13. I have a form that I would like to use to submit details to my database. Presently the form creates a list page with a couple of hyper links to other pages that allow me to edit and delete rows from the list. I would like it if it could all be done in the same page. I have created some form input fields in the header of the table. I would like it if the (AddUser) link where to submit the data in the fields to the database.

    Also if the (Edit) link is clicked the information would populate the same table header form fields as used above, and then when the (Submit) link is clicked the submitted data will be submitted to the database.

     

    Here is the page so far:

    <?php require_once('../Connections/Example.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_Example, $Example);
    $query_rsAuth = "SELECT * FROM auth ORDER BY id ASC";
    $rsAuth = mysql_query($query_rsAuth, $Example) or die(mysql_error());
    $row_rsAuth = mysql_fetch_assoc($rsAuth);
    $totalRows_rsAuth = mysql_num_rows($rsAuth);
    ?>
    <?php include("admin_header.inc"); ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Example Edit staff member</title>
    <!-- This is both the external style sheet link and the internal style container -->
    <link href="../includes/primary_layout.css" rel="stylesheet" type="text/css" />
    <!-- Begining of internal style container -->
    <style type="text/css">
    #center_box {
    height: 223px;
    width: 626px;
    overflow:auto;
    padding: 0px;
    left: 139px;
    top: 110px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    </style>
    <!-- End of internal style container -->
    </head>
    
    <body>
    <div id="wrapper">
    <div id="large-blue-box">
    <div id="center_box">
        
    <div id="form">
      <div align="center">
        <table width="90%" border="1" cellpadding="0" cellspacing="0">
          <tr>
            <th colspan="7">* Indicates required field. Please delete  and fill with appropriate info.</th>
            </tr>
          <tr>
            <th width="16%">Add/Remove</th>
            <th colspan="2">First/Last Names</th>
            <th colspan="2">Login/Password</th>
            <th width="20%">Privilege</th>
            <th width="6%">Edit</th>
            </tr>
          <tr>
            <td><div align="center"><a href="create_staff_member.php">(AddUser)</a></div></td>
    <!--    <th>id</th> -->
            <td width="10%"><div align="center">
              <input name="forename" type="text" id="forename" value="*First " size="9" maxlength="15" />
            </div></td>
            <td width="15%"><input name="surname" type="text" id="surname" value="*Last" size="9" maxlength="15" /></td>
            <td width="16%"><div align="center">
              <input name="username" type="text" id="username" value="*Login" size="9" maxlength="15" />
            </div></td>
            <td width="17%"><input name="password" type="text" id="password" value="*Pass" size="9" maxlength="15" /></td>
    <!--    <th>password</th> -->
            <td><div align="center">
              <select name="priv" id="priv">
                <option value="privilege">*Privilege</option>
                <option value="administrator">Administrator</option>
                <option value="manager">Manager</option>
                <option value="receptionist">Receptionist</option>
              </select>
            </div></td>
    <!--    <th>login_time</th> -->
    <!--    <th>logout_time</th> -->
            <td><div align="center">(Submit)</div></td>
          </tr>
          <?php do { ?>
            <tr>
              <td><div align="center"><a href="delete_user.php?id=<?php echo $row_rsAuth['id']; ?>">(Remove)</a></div></td>
    <!--      <td><?php $row_rsAuth['id']; ?></td> -->
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['first_name']; ?> <?php echo $row_rsAuth['last_name']; ?></div>            <div align="center"></div></td>
              <td colspan="2"><div align="center"><?php echo $row_rsAuth['login']; ?></div></td>
    <!--      <td><?php $row_rsAuth['password']; ?></td> -->
              <td><div align="center"><?php echo $row_rsAuth['privilege']; ?></div></td>
    <!--      <td><?php $row_rsAuth['login_time']; ?></td> -->
    <!--      <td><?php $row_rsAuth['logout_time']; ?></td> -->
              <td><div align="center"><a href="form_update.php?id=<?php echo $row_rsAuth['id']; ?>">(Edit)</a>*</div></td>
            </tr>
            <?php } while ($row_rsAuth = mysql_fetch_assoc($rsAuth)); ?>
        </table>
      </div>
    </div>
    <p align="center"> </p>
      </div>
      <div id="form11"><a href="staff_management.php"><img src="../graphics/general/index_button.gif" width="180" height="28" /></a>
        
    </div>  
    </div>
    
    <?php include("../includes/footer.inc"); ?>
      
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($rsAuth);
    ?>

     

  14. Thank you for your answer. What I want is for all the pages to share a single style css sheet for their backdrop and text, so that the backdrop and text through-out the site is consistent. But the table placement in the pages is unique, so I want the div's and css rules for the table placement to internal. I don't want a huge and difficult to understand external css sheet. Is the below valid? I guess unlike the first example I should put the link to the external style sheet first (Before the internal style sheet's styles)? Is this the correct way to do this???

     

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>example/title>
    
    <!-- This is an experiment using an external style sheet -->
    <link href="css/text_test.css" rel="stylesheet" type="text/css" />
    
    <!-- This is an experiment using also an internal style -->
    <style type="text/css">
    
    #center_box {
    height: 184px;
    width: 145px;
    padding: 0px;
    left: 160px;
    top: 120px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }
    </style>
    <!-- I would like for the styles to be pulled from both the style rule containers -->
    
    </head>
    
    <body>
    <div id="wrapper">
    <div id="small-blue-box">
    <div id="center_box">
    
    </body>
    </html>

     

     

  15. Would this be the correct way of doing it in my example below? Or is the a more acceptable standardized way? Thanks in advance for your help.

     

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>example/title>
    
    <!-- This is an experiment using an inpage style -->
    <style type="text/css">
    
    #box_a {
    height: 184px;
    width: 145px;
    padding: 0px;
    left: 160px;
    top: 120px;
    position: absolute;
    margin-top: -55px;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: -65px;
    }	
    </style>
    
    <!-- This is an experiment using also an external style sheet -->
    <link href="css/text_test.css" rel="stylesheet" type="text/css" />
    
    </head>
    <body>
    </body>
    </html>
    

  16. This first bit of code generates a html table parsed from the fields of my 'auth.user' mySQL database.

    What I would like is for the the first column (id) to be represented by an (edit) graphic button/link. This to appear on every row dynamically created by the script.

    So by clicking on the button all the data in the row can then be sent by the POST method to another form and can then be edited. (A copy of that form I am including below.)

    My problem is, I cannot figure out how to add a dynamic <a href> and the ability to post the data to the next form?

     

    <?php require_once('../Connections/Concierge.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_Concierge, $Concierge);
    $query_Recordset1 = "SELECT id, first_name, last_name, login, privilege FROM auth ORDER BY id ASC";
    $Recordset1 = mysql_query($query_Recordset1, $Concierge) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit Staff Member</title>
    </head>
    
    <body>
    <table width="439" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td width="41"><div align="center">Edit:</div></td>
        <td width="151"><div align="center">Name:</div></td>
        <td width="98"><div align="center">Login:</div></td>
        <td width="96"><div align="center">Privilege:</div></td>
      </tr>
      <?php do { ?>
        <tr>
              <td><div align="center"><a href> <?php echo $row_Recordset1['id']; ?> </a></div></td>
          <td><div align="center"><?php echo $row_Recordset1['first_name']; ?> <?php echo $row_Recordset1['last_name']; ?></div></td>
          <td><div align="center"><?php echo $row_Recordset1['login']; ?></div></td>
          <td><div align="center"><?php echo $row_Recordset1['privilege']; ?></div></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

     

    This is the form that should receive the row of data from the POST method and then allow for editing and then send back to the database.

     

    <?php require_once('../Connections/Concierge.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form6")) {
      $insertSQL = sprintf("INSERT INTO auth (first_name, last_name, login, password, privilege) VALUES (%s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['forename'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['priviege'], "text"));
    
      mysql_select_db($database_Concierge, $Concierge);
      $Result1 = mysql_query($insertSQL, $Concierge) or die(mysql_error());
    
      $insertGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    mysql_select_db($database_Concierge, $Concierge);
    $query_Recordset1 = "SELECT * FROM auth";
    $Recordset1 = mysql_query($query_Recordset1, $Concierge) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    
    
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit User Details</title>
    
    
    <style type="text/css">
    th {
    color: #FFF;
    }
    
    
    </style>
    </head>
    
    <body>
    <div align="center">
      <p> </p>
      <form id="form6" name="form6" method="POST" action="<?php echo $editFormAction; ?>">
        <table width="234" border="1" cellpadding="0" cellspacing="0">
          <tr bgcolor="#283a86">
            <th width="95" scope="row">First Name </th>
            <td width="133"><input name="forename" type="text" id="forename" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Last Name</th>
            <td><input name="surname" type="text" id="surname" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">User Name</th>
            <td><input name="login" type="text" id="login" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Password</th>
            <td><input name="password" type="password" id="password" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Privilege</th>
            <td><select name="priviege" id="priviege">
              <option value="receptionist">Receptionist</option>
              <option value="manager">Manager</option>
              <option value="administrator">Administrator</option>
              <option value="suspended">Suspended</option>
            </select></td>
          </tr>
        </table>
        <p>
        <input type="submit" name="submit" id="submit" value="Submit" />
        <input type="hidden" name="MM_insert" value="form6" />
      </form>
      
        
      </p>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    

  17. Why am I getting this error when I post to my production server?

     

    Warning: Cannot modify header information - headers already sent by (output started at create_staff_member.php:3) in create_staff_member.php  on line 56

     

    I am developing on WinXP with WAMP/PHP 5.2.9-2 and my production server is running CentOS with the latest PHP.

     

    <?php require_once('../Connections/Concierge.php'); ?>
    
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form6")) {
      $insertSQL = sprintf("INSERT INTO auth (first_name, last_name, login, password, privilege) VALUES (%s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['forename'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['login'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['priviege'], "text"));
    
      mysql_select_db($database_Concierge, $Concierge);
      $Result1 = mysql_query($insertSQL, $Concierge) or die(mysql_error());
    
      $insertGoTo = "edit_staff_member.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    mysql_select_db($database_Concierge, $Concierge);
    $query_Recordset1 = "SELECT * FROM auth";
    $Recordset1 = mysql_query($query_Recordset1, $Concierge) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    
    
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Edit User Details</title>
    
    
    <style type="text/css">
    th {
    color: #FFF;
    }
    
    
    </style>
    </head>
    
    <body>
    <div align="center">
      <p> </p>
      <form id="form6" name="form6" method="POST" action="<?php echo $editFormAction; ?>">
        <table width="234" border="1" cellpadding="0" cellspacing="0">
          <tr bgcolor="#283a86">
            <th width="95" scope="row">First Name </th>
            <td width="133"><input name="forename" type="text" id="forename" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Last Name</th>
            <td><input name="surname" type="text" id="surname" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">User Name</th>
            <td><input name="login" type="text" id="login" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Password</th>
            <td><input name="password" type="password" id="password" size="19" /></td>
          </tr>
          <tr bgcolor="#283a86">
            <th scope="row">Privilege</th>
            <td><select name="priviege" id="priviege">
              <option value="receptionist">Receptionist</option>
              <option value="manager">Manager</option>
              <option value="administrator">Administrator</option>
              <option value="suspended">Suspended</option>
            </select></td>
          </tr>
        </table>
        <p>
        <input type="submit" name="submit" id="submit" value="Submit" />
        <input type="hidden" name="MM_insert" value="form6" />
      </form>
      
        
      </p>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.