Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. <form method="post" action="member.php">
    <?
                    echo "<select name=\"NickName\">";
                    echo "<option size =30 selected>Select</option>";
                 if(mysql_num_rows($approvalQuery))
                 {
                    while($myrow = mysql_fetch_assoc($approvalQuery))
                 {
                    echo "<option>$myrow[NickName]</option>";
                 }
                 }
                 else {
                    echo "<option>No Names Present</option>"; 
                 }   
    ?>
              </td>
       </tr>
       </td>
       <td valign="top" align="left" class="control_panel_td_2">
             <input type="submit" value="Approve" name="Approve">
             <input type="submit" value="Deny" name="Deny">
             </form>
       </td>
    <?
          }else{
             echo "No Pending Students";
          }
    ?>
       </tr>   
    <?
       //Approves user account activation
       if(isset($_POST['Approve']))
         {
        mysql_query("UPDATE Profiles SET Status = 'Active' WHERE Status='Approval' AND NickName = '{$_POST['NickName']}'") or die (mysql_error());
       }

     

    You have to set the $_POST[] array, not the $myrow[] array.

  2. Could i also advise something,

     

    by simply doing this:

     

    $page=$_GET['page'].'.php';

    include('connect.php');

     

    Your are really leavaing yourself open, I'd advise setting a file_exists() function in there..

     

    <?php
    if ( !isset($_GET['page']) ) {
    
      header("location: index.php?page=home");
    
    } else {
      $page = $_GET['page'].'.php';
    
      if(file_exists($page) {
    
        include('connect.php');
    
        } else {
    
        echo "404";
    
        }
    }
    ?>

  3. are you connecting to your db; because I do see where your connecting

    Then it should show an error

    Same result.. :(

     

     

    SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < 3

     

     

    Do you think queries would know what C is or should it be $C ? :S

    No, make sure you check your cases, 'c' is completely different too 'C'.

  4. You probably should check whether "register_globals" is disabled. If it is enabled, you will have problems when there is a local variable that is named the same as a session variable. For example, with register_globals enabled

    <?php
    session_start();
    $user = 'xyz';
    $_SESSION['user'] = 'abc';
    ?>

     

    You will find that the value of the $user variable will clobbered by the value of the $_SESSION['user'] variable.

     

    Ken

    Thanks, they actually aren't globaled but that worked.  :D

  5. Ok, Ill rewrite your code then:

    <?php
    //generates a list box to display the rows of available business
    $findbusinessresult = mysql_query("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < 3") or die(mysql_error());
    
    while($row = mysql_fetch_array($findbusinessresult))
    {
            $option .= "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>";
    }
    
    ?>
    
    <form name="" method="POST" action="businesslondonstage2.php" enctype="text/plain" id="Form1">
    </br></br><center><select name="businesslist" size=10>"></center>
    <option value =""><b><u>Business Types</b></u></option>
    <?="$option"; ?>
    </select>
    <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:358px;top:215px;width:75px;height:45px;z-index:1">
    <input type="checkbox" id="Checkbox1" name="Checkbox1" value="" style="position:absolute;left:466px;top:232px;z-index:2">
    </form>
    

  6. And your center codes..

    echo '<br /><br /><center><select name="businesslist" size=10>"';
    echo'<option value =""><b><u>Business Types</b></u></option>';
    while($row = mysql_fetch_array($findbusinessresult)) {
            echo "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>";
    	}
    echo '</select></center>';
    

  7. Right, but it isn't possible that that issue is the problem.  Because if it is not set, the session doesn't get set, but it should!

     

    The session does get set, but it only gets set for 2 pages, on the second it begins too fade, and by the third you are logged out again.

  8. Just run two mysql queries.

     

    mysql_query("INSERT INTO `fmodels` (`member_id`, `make_id`, `model`, `model_date`, `description`) VALUES ('$memid', '$fm', '$fmod','$today', '$fdes')");

    mysql_query("INSERT INTO `table2` (`member_id`, `make_id`, `model`, `model_date`, `description`) VALUES ('$memid', '$fm', '$fmod','$today', '$fdes')");

×
×
  • 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.