Jump to content

topflight

Members
  • Posts

    402
  • Joined

  • Last visited

    Never

Posts posted by topflight

  1. Now my code looks like this:

     

    <?
    include 'db.php';
    session_start();
    if(isset($_SESSION['LOGGEDIN'])==TRUE){
    echo'You are already a member ';}
    
    if(isset($_POST['apply'])){
    
    
    
    
    if (!$_POST['fname']){ $error .='No First name<br>'; }
    if (!$_POST['lname']){ $error .='No Last  name<br>'; }
    if (!$_POST['email']){ $error .='No Email Address<br>'; }
    if (!$_POST['vatsimid']){ $error .='No VATSIM ID<br>'; }
    if (!$_POST['hub']){ $error .='No Hub<br>'; }
    if (!$_POST['pwd']){ $error .='No Password<br>'; }
    if (!$_POST['pwdc']){ $error .='No Password Conformation<br>'; }
    if (!$_POST['emailc']){ $error .='No Conformation Email Address<br>'; }
    if ($_POST['thours']){ if (!$_POST['thoursc']){ $error .='No comments<br>'; }}
    if ($_POST['email'] != $_POST['emailc']){ $error .='Email mismatch'; }
    if ($_POST['pwd'] != $_POST['pwdc']){ $error .='Password mismatch'; }
    
    if ($error)
      { echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" 
    ONCLICK="history.go(-1)"></FORM> <? 
       
       } else {
    
             $cerror = count($error);
             $fpwd= $_POST['pwd'];
             $pwd = md5($fpwd);
             $fname = $_POST['fname'];
             $lname = $_POST['lname'];
             $email = $_POST['email'];
             $pilotl= mysql_query("SELECT * FROM `pilots` WHERE hub='$_POST[hub]' ORDER BY login DESC LIMIT 1") or die(mysql_error());
    
             $plrows = mysql_num_rows($pilotl);
    if ($plrows=="0"){ 
    if ($_POST['hub']=="KPDX"){ 
        $login = "1000"; }
    if ($_POST['hub']=="KLAX"){ 
        $login = "2000"; }
    if ($_POST['hub']=="PANC"){ 
        $login = "3000"; }
    if ($_POST['hub']=="KSEA"){ 
        $login = "4000"; }
    } else {
           if($cerror =='0'){
    
      while($plr = mysql_fetch_array($pilotl)){ $login = $plr[login]; } $login = $login + 1;  
    
    $update = mysql_query("INSERT INTO `pilots` (login,pwd,fname,lname,email,hub,thours,thoursc,rating,vatsimid,date,ip,status,hm,ed,bm,active) VALUES ('$login','$pwd','$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[hub]','$_POST[thours]','$_POST[thoursc]','First Officer','$_POST[vatsimid]','$now','$ip','0','0','0',0,0)") or die(mysql_error());
    
    
    $jto = "jobs@simulatedasa.org";
    $jsubject = "A new pilot has signed up";
    $jjmessae = "
    A new pilot ($fname $laname) with the pending ID of ($login) has submitted an Applications with Simulated Alaska. Please activate their test. ";
    $from = "jobs@simulatedasa.org";
    $jheaders = "From: $from";
    
    mail($jto, $jsubject, $jmessage, $jheaders);
    
    $jto = "email";
    $jsubject = "A new pilot has signed up";
    $jjmessae = "
    A new pilot ($fname $laname) with the pending ID of ($login) has submitted an Applications with --------. Please activate their test. ";
    $from = "email";
    $jheaders = "From: $from";
    
    mail($jto, $jsubject, $jmessage, $jheaders);
    
    $to = "$email";
    $subject = "RE:------ Application ($fname $lname)";
    $messae = "
    Dear ($fname $lname),
    
    We have reccevied your application for membership with -----. You will reccevie another email within 24-48 hours regarding your entry exam. It is really importaint that you complete this exam ASAP. In order to have a membership account with Simulated Alaska you MUST pass this exam with an 80%. So in the meantime please look at the SOP's, explore the site, and study basic aircraft Maneuvers. The exam will cover(Simulated Alaska Operations, Basic Aircraft Maneuvers, and Basic Flying Skills. Once you have pass this test you will then recceive another email saying you have been accepted.
    
    
    
    
    Sincerly,
    --------
    ";
    
    $from = "email";
    $headers = "From: $from";
    mail($to, $subject, $message, $headers);
    
    
    echo'<b>Application Sent ------- Staff</b>';
    
    } } } }
    
    ?>
    
    

  2. This code it suppose to show errors if the fileds are empty and also if everyihng is ok it is suppose to insert the information in the database and shoot an email to the new member. Well it is not working and it is saying $error is an undefined vaiable on line 12 which is if (!$_POST['fname']){ $error .='No First name<br>';  please help. Thanks in advanced!

     

     

    <?
    include 'db.php';
    session_start();
    if(isset($_SESSION['LOGGEDIN'])==TRUE){
    echo'You are already a member';}
    
    if(isset($_POST['apply'])){
    
    
    
    
    if (!$_POST['fname']){ $error .='No First name<br>'; }
    if (!$_POST['lname']){ $error .='No Last  name<br>'; }
    if (!$_POST['email']){ $error .='No Email Address<br>'; }
    if (!$_POST['vatsimid']){ $error .='No VATSIM ID<br>'; }
    if (!$_POST['hub']){ $error .='No Hub<br>'; }
    if (!$_POST['pwd']){ $error .='No Password<br>'; }
    if (!$_POST['pwdc']){ $error .='No Password Conformation<br>'; }
    if (!$_POST['emailc']){ $error .='No Conformation Email Address<br>'; }
    if ($_POST['thours']){ if (!$_POST['thoursc']){ $error .='No comments<br>'; }}
    if ($_POST['email'] != $_POST['emailc']){ $error .='Email mismatch'; }
    if ($_POST['pwd'] != $_POST['pwdc']){ $error .='Password mismatch'; }
    
    if ($error){ echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" 
    ONCLICK="history.go(-1)"></FORM> <? } else {
    
    $cerror = count($error);
    $fpwd= $_POST['pwd'];
    $pwd = md5($fpwd);
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $email = $_POST['email'];
    $pilotl= mysql_query("SELECT * FROM `pilots` WHERE hub='$_POST[hub]' ORDER BY login DESC LIMIT 1") or die(mysql_error());
    
    $plrows = mysql_num_rows($pilotl);
    if ($plrows=="0"){ 
    if ($_POST['hub']=="KPDX"){ $login = "1000"; }
    if ($_POST['hub']=="KLAX"){ $login = "2000"; }
    if ($_POST['hub']=="PANC"){ $login = "3000"; }
    if ($_POST['hub']=="KSEA"){ $login = "4000"; }} else {
    if($cerror =='0'){
    while($plr = mysql_fetch_array($pilotl)){ $login = $plr[login]; } $login = $login + 1;  
    
    $update = mysql_query("INSERT INTO pilots (login,pwd,fname,lname,email,hub,thours,thoursc,rating,vatsimid,date,ip,status,hm,ed,bm,active) VALUES ('$login','$pwd','$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[hub]','$_POST[thours]','$_POST[thoursc]','First Officer','$_POST[vatsimid]','$now','$ip','0','0','0',0,0)") or die(mysql_error());
    
    
    $jto = "email";
    $jsubject = "A new pilot has signed up";
    $jjmessae = "
    A new pilot ($fname $laname) with the pending ID of ($login) has submitted an Applications with --------. Please activate their test. ";
    $from = "email";
    $jheaders = "From: $from";
    
    mail($jto, $jsubject, $jmessage, $jheaders);
    
    $to = "$email";
    $subject = "RE:------ Application ($fname $lname)";
    $messae = "
    Dear ($fname $lname),
    
    We have reccevied your application for membership with -----. You will reccevie another email within 24-48 hours regarding your entry exam. It is really importaint that you complete this exam ASAP. In order to have a membership account with Simulated Alaska you MUST pass this exam with an 80%. So in the meantime please look at the SOP's, explore the site, and study basic aircraft Maneuvers. The exam will cover(Simulated Alaska Operations, Basic Aircraft Maneuvers, and Basic Flying Skills. Once you have pass this test you will then recceive another email saying you have been accepted.
    
    
    
    
    Sincerly,
    --------
    ";
    
    $from = "email";
    $headers = "From: $from";
    mail($to, $subject, $message, $headers);
    
    
    echo'<b>Application Sent ------- Staff</b>';
    
    } } } }
    
    ?>

  3. This is my code:

     

     

     

     

    <?php

     

     

    include 'db.php';

    session_start();

    if(isset($_SESSION['LOGGEDIN'])==TRUE){

    echo'You are already a member of Simulated Alaska';}

     

    if(isset($_POST['apply'])){

    $error = array();

    if (!$_POST['lname']){ $error[] ='No Last  name'; }

    if (!$_POST['email']){ $error[]='No Email Address'; }

    if (!$_POST['vatsimid']){ $error[] ='No VATSIM ID'; }

    if (!$_POST['hub']){ $error[] ='No Hub'; }

    if (!$_POST['pwd']){ $error[] ='No Password'; }

    if (!$_POST['pwdc']){ $error[] ='No Password Conformation'; }

    if (!$_POST['emailc']){ $error[] ='No Conformation Email Address'; }

    if ($_POST['thours']){ if (!$_POST['thoursc']){ $error[] ='No comments'; }}

    if ($_POST['email'] != $_POST['emailc']){ $error[] ='Email mismatch'; }

    if ($_POST['pwd'] != $_POST['pwdc']){ $error[] ='Password mismatch'; }

    if (!empty($error))

        echo implode('<br>',$error);

    else {

     

     

    if ($error){ echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors"

    ONCLICK="history.go(-1)"></FORM> <? } else {

     

    $cerror = count($error);

    $fpwd= $_POST['pwd'];

    $pwd = md5($fpwd);

    $fname = $_POST['fname'];

    $lname = $_POST['lname'];

    $email = $_POST['email'];

    $pilotl= mysql_query("SELECT * FROM `pilots` WHERE hub='$_POST[hub]' ORDER BY login DESC LIMIT 1") or die(mysql_error());

     

    $plrows = mysql_num_rows($pilotl);

    if ($plrows=="0"){

    if ($_POST['hub']=="KPDX"){ $login = "1000"; }

    if ($_POST['hub']=="KLAX"){ $login = "2000"; }

    if ($_POST['hub']=="PANC"){ $login = "3000"; }

    if ($_POST['hub']=="KSEA"){ $login = "4000"; }} else {

    if($cerror =='0'){

    while($plr = mysql_fetch_array($pilotl)){ $login = $plr[login]; } $login = $login + 1; 

     

    $update = mysql_query("INSERT INTO pilots (login,pwd,fname,lname,email,hub,thours,thoursc,rating,vatsimid,date,ip,status,hm,ed,bm,active) VALUES ('$login','$pwd','$_POST[fname]','$_POST[lname]','$_POST','$_POST[hub]','$_POST[thours]','$_POST[thoursc]','First Officer','$_POST[vatsimid]','$now','$ip','0','0','0',0,0)") or die(mysql_error());

     

     

    $jto = "<email_goes_here>";

    $jsubject = "A new member has signed up";

    $jjmessae = "

    message_here ";

    $from = "emailaddress_here";

    $jheaders = "From: $from";

     

    mail($jto, $jsubject, $jmessage, $jheaders);

     

    $to = "$email";

    $subject = "RE:Application ($fname $lname)";

    $messae = "

    Dear ($fname $lname),

     

    <Welcome email here>

     

     

     

     

    Sincerly,

    Staff

    ";

     

    $from = "email_will_go_here;

    $headers = "From: $from";

    mail($to, $subject, $message, $headers);

     

     

    echo'<b>Application Sent </b>';

     

    } } } }

     

     

  4. that didn't work all I receive is just a white page when I typed everything in. If everything is correct is it suppose to shoot an email and also insert that information into the database which it did not do.

  5. I am getting an undefined variable error on line 27 for $error. Here is the portion of my code:

    <?php
    if (!$_POST['lname']){ $error ='No Last  name<br>'; }
    if (!$_POST['email']){ $error ='No Email Address<br>'; }
    if (!$_POST['vatsimid']){ $error ='No VATSIM ID<br>'; }
    if (!$_POST['hub']){ $error ='No Hub<br>'; }
    if (!$_POST['pwd']){ $error ='No Password<br>'; }
    if (!$_POST['pwdc']){ $error ='No Password Conformation<br>'; }
    if (!$_POST['emailc']){ $error ='No Conformation Email Address<br>'; }
    if ($_POST['thours']){ if (!$_POST['thoursc']){ $error ='No comments<br>'; }}
    if ($_POST['email'] != $_POST['emailc']){ $error ='Email mismatch'; }
    if ($_POST['pwd'] != $_POST['pwdc']){ $error ='Password mismatch'; }
    
    
    
    if ($error){ echo $error; } else {
    ?>
    

     

    Line 27:

    <?php 
    if ($error){ echo $error; } else { ?>

     

    I don't know what happen one day it was working the next it wasn't and I haven't done anything to it.

     

  6. Is their anyway I can use the login information from the members table of the database  with my current vb.net project?

    Yup if you have php installed on the server you can ever run both PHP and asp.net

     

     

    Well may you please tell me the steps to do that. I really need to transfer information form vb.net to phpmyadmin and viseversa that would be must appreciated.

  7. I am currently in the process of creating a vb.net (Visual Basics 2008) login system. But I want to use the login information stored in my members table in mysql database. Is their anyway I can use the login information from the members table of the database  with my current vb.net project?

  8. Well you could do:

     

    if(!$_SESSION['SESS_LOGGEDIN'] {

    \\DO SOMETHING

    }

     

     

    OR you can do:

     

    if($_SESSION['SESS_LOGGEDIN'] != "TRUE") {

    \\DO SOMETHING

    }

     

    Also I tried to do that and nothing happens still recceving the same error message

     

    Notice: Undefined index: login in C:\xampp\htdocs\blogin.php on line 14

    Your Account Is Not Active.

     

     

    this is line 14

     

    $slogin = $_SESSION['login'];

     

  9. You're assigning rather than comparing:

     

    if($_SESSION['SESS_LOGGEDIN'] = TRUE){

     

    should be:

     

    if($_SESSION['SESS_LOGGEDIN'] == TRUE){

     

    I did that and I am installing receiving the same error also the login in form is not showing up.

  10. I have re did my login script and now I am getting this error message:

     

    Notice: Undefined index: login in C:\xampp\htdocs\blogin.php on line 14

     

    Also instead of showing the login form for some reason it says my account is not active. How can it says that if the session is not registered becuase it get the id from the session. It should show the login form. Here is my code. Please help.

     

    Thanks in advanced.

     

    <?
    session_start();
    echo '<pre>'; print_r($_SESSION); echo '</pre>';
    ?>
    <?
    if($_SESSION['SESS_LOGGEDIN'] = TRUE){
    include'db.php';
    $connect = mysql_connect($db_host,$db_username,$db_password)
      or die("MySQL Said:".mysql_error());
    
    $database = mysql_select_db($db_database,$connect)
      or die("MySQl Said:".mysql_error());
    
    $slogin = $_SESSION['login'];
    $elink = mysql_query("SELECT * FROM `pilots` where login='$slogin'")
      or die("MySQL Said:".mysql_error());
    
    $edata = mysql_fetch_assoc($elink);
    $lname = $edata["lname"];
    $hub = $edata["hub"];
    $pwd = $edata["pwd"];
    $fname = $edata["fname"];
    $login= $edata["login"];
    $status= $edata["status"];
    $enewp = mysql_query("SELECT * FROM `pilots` where status ='0'")
      or die("MySQL Said:".mysql_error());
    
      $enewprow = mysql_num_rows($enewp);
      $eresult = count($enewp);
    
    
    
    
    
    
      if($edata['status'] == 0)
       {
        echo '<center>Your Account Is Not Active.</center>';
       }
      elseif($edata['status'] == 2)
        {
        echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
        <center><a href="logout.php">Log Out</a></br></center>
       
    <? }
       elseif($edata['status'] == 3)
        {
        echo '<center>You Are Currently On L.O.A</center>';?>
         <a href="rfileloa.php?login=<? echo "{$edata["login"]}"?>">Return From L.O.A</a></br><?
       }
       else
       {
       
       
    ?>
       <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
       <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
       <center>
       <h7><i><b>Pilots Panel</b></i></h7></br>
       <a href="?page=pirepform&lname=<? echo "{$edata["lname"]}"?>">File Pirep</a></br>
       <a href="?page=fileloa&login=<? echo "{$edata["login"]}"?>">File LOA</a></br>
       <a href="#">Signatures</a></br>
       <A HREF="?page=profile&login=<? echo "{$edata["login"]}"?> ">My Profile</a></br>
       <a href="?page=editp&login=<? echo "{$edata["login"]}"?>">Edit My Profile</a></br>
       <a href="?page=events">Events</a></br>
       <a href="?page=rosterphp">VIew Roster</a></br>
       <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
       <a href="logout.php">Log Out</a></br>
       
       <br>
       <h7><i><b>Pilots Tools</b></i></h7></br>
       <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
       </center>
    
        <?php
       if($edata['hm'] == 1)
        {?>
         <center>
        <h7><i><b>Hub Manager Panel</b></i></h7></br>
         <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        </center>
        <?php
       }
       if($edata['fm'] == 1)
        {?>
         <center>
        <h7><i><b>Fleet Manager Panel</b></i></h7></br>
         <a href="addaircraft.php">Add Aircraft</a></br>
         <a href="manageaircraft.php">Manage Aircraft</a>
         </center>
        <?php
       }
       if($edata['ed'] == 1)
        {?>
       <center>
        <h7><i><b>Events Director Panel</b></i></h7></br>
        <a href="?page=addevent">Add Event</a></br>
        <a href="?page=manageevents">Manage Events</a></br>
        <a href="postnews.php">Post News</a></br>
       
       
    </center>
        <?php
       }
       if($edata['hr'] == 1)
        { ?>
        <center>
        <h7><i><b>Human Rescources Panel</b></i></h7></br>
        <a href="?page=newpilots">New Pilots</a></br>
        <a href="?page=editpilots">Edit Pilots</a></br>
        <a href="viewcomments.php">View Comments</a></br>
        <a href="viewsitecomments.php">View Site Comments</a></br>
       <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
    
    
       <?php
       }
       if($edata['bm'] == 1)
        {?>
        <center>
         <h7><i><b>Executive Staff Panel</b></i></h7></br>
         <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        <a href="addevent">Add Event</a></br>
         <a href="manageevents.php">Manage Events</a></br>
          <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
        <a href="pilotrec.php">Pilot Records</a></br>
        <a href="?page=newpilots&staffid=<? echo "{$edata["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$enewprow"; ?></font></b></br>
         <a href="?page=editpilots">Edit Pilots</a></br>
         <a href="viewcomments.php">View Comments</a></br>
         <a href="viewsitecomments.php">View Site Comments</a></br>
       
       <?php
       }
      }
       }elseif($_SESSION['SESS_LOGGEDIN'] =FALSE){
      
          if(isset($_POST['user'])){
        //Include Config File For DB info..
    include 'db.php';
    //Connect TO The MySQL Server
    $connect = mysql_connect($db_host,$db_username,$db_password)
      or die("MySQL Said:".mysql_error());
      
    $database = mysql_select_db($db_database,$connect)
      or die("MySQl Said:".mysql_error());
      
    $login = mysql_real_escape_string($_POST['user']);
    $pwd = mysql_real_escape_string($_POST['pwd']);
    
    $link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'")
      or die("MySQL Said:".mysql_error());
      
    $count = mysql_num_rows($link);
    $data = mysql_fetch_assoc($link);
    $lname = $data["lname"];
    $hub = $data["hub"];
    $pwd = $data["pwd"];
    $fname = $data["fname"];
    $login= $data["login"];
    $status= $data["status"];
    
    $newp = mysql_query("SELECT * FROM `pilots` where status ='0'")
      or die("MySQL Said:".mysql_error());
      
      $newprow = mysql_num_rows($newp);
      $result = count($newp);
      
    
    
    if($count == 1)
    {
    
    
    
    
      if($data['status'] == 0)
       {
        echo '<center>Your Account Is Not Active.</center>';
       }
      else
      {
       if($data['status'] == 2)
        {
        echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
        <center><a href="logout.php">Log Out</a></br></center>
       
    <?  }
       else
       {
         if($data['status'] == 3)
        {
        echo '<center>You Are Currently On L.O.A</center>';?>
         <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><?
       }
       else
       {
       
       
    
    $_SESSION['SESS_LOGGEDIN'] = TRUE;
    $_SESSION['SESS_LNAME'] = $lname;
    $_SESSION['SESS_HUB'] = $hub;
    $_SESSION['SESS_FNAME'] = $fname;
    $_SESSION['login'] = $login;
    $_SESSION['status'] = $status;
    
    
    ?>
       <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
       <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
       <center>
       <h7><i><b>Pilots Panel</b></i></h7></br>
       <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>
       <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br>
       <a href="#">Signatures</a></br>
       <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br>
       <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br>
       <a href="?page=events">Events</a></br>
       <a href="?page=rosterphp">VIew Roster</a></br>
       <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
       <a href="logout.php">Log Out</a></br>
       
       <br>
       <h7><i><b>Pilots Tools</b></i></h7></br>
       <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
       </center>
    
        <?php
       if($data['hm'] == 1)
        {?>
         <center>
        <h7><i><b>Hub Manager Panel</b></i></h7></br>
         <a href="?page=addnews_hub">Add News</a></br>
        <a href="?page=edithub">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        </center>
        <?php
       }
       if($data['fm'] == 1)
        {?>
         <center>
        <h7><i><b>Fleet Manager Panel</b></i></h7></br>
         <a href="addaircraft.php">Add Aircraft</a></br>
         <a href="manageaircraft.php">Manage Aircraft</a>
         </center>
        <?php
       }
       if($data['ed'] == 1)
        {?>
       <center>
        <h7><i><b>Events Director Panel</b></i></h7></br>
        <a href="?page=addevent">Add Event</a></br>
        <a href="?page=manageevents">Manage Events</a></br>
        <a href="postnews.php">Post News</a></br>
       
       
    </center>
        <?php
       }
       if($data['hr'] == 1)
        { ?>
        <center>
        <h7><i><b>Human Rescources Panel</b></i></h7></br>
        <a href="?page=newpilots">New Pilots</a></br>
        <a href="?page=editpilots">Edit Pilots</a></br>
        <a href="viewcomments.php">View Comments</a></br>
        <a href="viewsitecomments.php">View Site Comments</a></br>
       <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
    
       <?php
       }
       if($data['bm'] == 1)
        {?>
        <center>
         <h7><i><b>Executive Staff Panel</b></i></h7></br>
         <a href="?page=edithub">Edit Hub Page</a></br>
          <a href="?page=addnews_hub">Add News For Hubs</a></br>
        <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        <a href="addevent">Add Event</a></br>
         <a href="manageevents.php">Manage Events</a></br>
          <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
        <a href="pilotrec.php">Pilot Records</a></br>
        <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br>
         <a href="?page=editpilots">Edit Pilots</a></br>
         <a href="viewcomments.php">View Comments</a></br>
         <a href="viewsitecomments.php">View Site Comments</a></br>
       
       <?php
       }
      }
      } }
    }
       
    } else
    {
      echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?>
    
    
    <style type="text/css">
    .idBox {
    width:50px;
    }
    .passwordBox {
    width:80px;
    }
    </style>
    
    <table border="0" align="center">
    <form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
      <tr>
        <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
      </tr>
      <tr>
        <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
      </tr>
      <tr>
        <td></td><td align="center"><p align="center">
          <input type="submit" name="login" value="Login">
        </p>
          <p align="center">        <a href="#">Forgot Password</a></p></td>
      </tr>
    </table>
    
    <?
    }
    
    }
    
    ?>
    

  11. If you look towards the if(isset$_Post[user])... you will see it.

    <?
    session_start();
    echo '<pre>'; print_r($_SESSION); echo '</pre>';
    ?>
    <?
    if($_SESSION['SESS_LOGGEDIN'] = TRUE){
    include'db.php';
    $connect = mysql_connect($db_host,$db_username,$db_password)
      or die("MySQL Said:".mysql_error());
      
    $database = mysql_select_db($db_database,$connect)
      or die("MySQl Said:".mysql_error());
    
    $slogin = $_SESSION['login'];
    $elink = mysql_query("SELECT * FROM `pilots` where login='$slogin'")
      or die("MySQL Said:".mysql_error());
    
    $edata = mysql_fetch_assoc($elink);
    $lname = $edata["lname"];
    $hub = $edata["hub"];
    $pwd = $edata["pwd"];
    $fname = $edata["fname"];
    $login= $edata["login"];
    $status= $edata["status"];
    $enewp = mysql_query("SELECT * FROM `pilots` where status ='0'")
      or die("MySQL Said:".mysql_error());
      
      $enewprow = mysql_num_rows($enewp);
      $eresult = count($enewp);
      
    
    
    
    
    
      if($edata['status'] == 0)
       {
        echo '<center>Your Account Is Not Active.</center>';
       }
      elseif($edata['status'] == 2)
        {
        echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
        <center><a href="logout.php">Log Out</a></br></center>
       
    <? } 
       elseif($edata['status'] == 3)
        {
        echo '<center>You Are Currently On L.O.A</center>';?>
         <a href="rfileloa.php?login=<? echo "{$edata["login"]}"?>">Return From L.O.A</a></br><?
       }
       else
       {
       
       
    ?>
       <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
       <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
       <center>
       <h7><i><b>Pilots Panel</b></i></h7></br>
       <a href="?page=pirepform&lname=<? echo "{$edata["lname"]}"?>">File Pirep</a></br>
       <a href="?page=fileloa&login=<? echo "{$edata["login"]}"?>">File LOA</a></br>
       <a href="#">Signatures</a></br>
       <A HREF="?page=profile&login=<? echo "{$edata["login"]}"?> ">My Profile</a></br>
       <a href="?page=editp&login=<? echo "{$edata["login"]}"?>">Edit My Profile</a></br>
       <a href="?page=events">Events</a></br>
       <a href="?page=rosterphp">VIew Roster</a></br>
       <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
       <a href="logout.php">Log Out</a></br>
       
       <br>
       <h7><i><b>Pilots Tools</b></i></h7></br>
       <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
       </center>
    
        <?php
       if($edata['hm'] == 1)
        {?>
         <center>
        <h7><i><b>Hub Manager Panel</b></i></h7></br>
         <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        </center>
        <?php
       }
       if($edata['fm'] == 1)
        {?>
         <center>
        <h7><i><b>Fleet Manager Panel</b></i></h7></br>
         <a href="addaircraft.php">Add Aircraft</a></br>
         <a href="manageaircraft.php">Manage Aircraft</a>
         </center>
        <?php
       }
       if($edata['ed'] == 1)
        {?>
       <center>
        <h7><i><b>Events Director Panel</b></i></h7></br>
        <a href="?page=addevent">Add Event</a></br>
        <a href="?page=manageevents">Manage Events</a></br>
        <a href="postnews.php">Post News</a></br>
       
       
    </center>
        <?php
       }
       if($edata['hr'] == 1)
        { ?>
        <center>
        <h7><i><b>Human Rescources Panel</b></i></h7></br>
        <a href="?page=newpilots">New Pilots</a></br>
        <a href="?page=editpilots">Edit Pilots</a></br>
        <a href="viewcomments.php">View Comments</a></br>
        <a href="viewsitecomments.php">View Site Comments</a></br>
       <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
    
    
       <?php
       }
       if($edata['bm'] == 1)
        {?>
        <center>
         <h7><i><b>Executive Staff Panel</b></i></h7></br>
         <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        <a href="addevent">Add Event</a></br>
         <a href="manageevents.php">Manage Events</a></br>
          <a href="?page=addnews">Post News</a></br>
       <a href="?page=editnews">Edit News</a></br>
        <a href="pilotrec.php">Pilot Records</a></br>
        <a href="?page=newpilots&staffid=<? echo "{$edata["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$enewprow"; ?></font></b></br>
         <a href="?page=editpilots">Edit Pilots</a></br>
         <a href="viewcomments.php">View Comments</a></br>
         <a href="viewsitecomments.php">View Site Comments</a></br>
       
       <?php
       }
      }
       }elseif($_SESSION['SESS_LOGGEDIN'] =FALSE){
      
       	if(isset($_POST['user'])){
     //Include Config File For DB info..
    include 'db.php';
    //Connect TO The MySQL Server
    $connect = mysql_connect($db_host,$db_username,$db_password)
      or die("MySQL Said:".mysql_error());
      
    $database = mysql_select_db($db_database,$connect)
      or die("MySQl Said:".mysql_error());
      
    $login = mysql_real_escape_string($_POST['user']);
    $pwd = mysql_real_escape_string($_POST['pwd']);
    
    $link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'")
      or die("MySQL Said:".mysql_error());
      
    $count = mysql_num_rows($link);
    $data = mysql_fetch_assoc($link);
    $lname = $data["lname"];
    $hub = $data["hub"];
    $pwd = $data["pwd"];
    $fname = $data["fname"];
    $login= $data["login"];
    $status= $data["status"];
    
    $newp = mysql_query("SELECT * FROM `pilots` where status ='0'")
      or die("MySQL Said:".mysql_error());
      
      $newprow = mysql_num_rows($newp);
      $result = count($newp);
      
    
    
    if($count == 1)
    {
    
    
    
    
      if($data['status'] == 0)
       {
        echo '<center>Your Account Is Not Active.</center>';
       }
      else
      {
       if($data['status'] == 2)
        {
        echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
        <center><a href="logout.php">Log Out</a></br></center>
       
    <?  }
       else
       {
         if($data['status'] == 3)
        {
        echo '<center>You Are Currently On L.O.A</center>';?>
      <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><?
       }
       else
       {
    
    
    
    $_SESSION['SESS_LOGGEDIN'] = TRUE;
    $_SESSION['SESS_LNAME'] = $lname;
    $_SESSION['SESS_HUB'] = $hub;
    $_SESSION['SESS_FNAME'] = $fname;
    $_SESSION['login'] = $login;
    $_SESSION['status'] = $status;
    
    
    ?>
       <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
       <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
       <center>
       <h7><i><b>Pilots Panel</b></i></h7></br>
       <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>
       <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br>
       <a href="#">Signatures</a></br>
       <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br>
       <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br>
       <a href="?page=events">Events</a></br>
       <a href="?page=rosterphp">VIew Roster</a></br>
       <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
       <a href="logout.php">Log Out</a></br>
       
       <br>
       <h7><i><b>Pilots Tools</b></i></h7></br>
       <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
       </center>
      
        <?php
       if($data['hm'] == 1)
        {?>
         <center>
        <h7><i><b>Hub Manager Panel</b></i></h7></br>
         <a href="?page=addnews_hub">Add News</a></br>
     <a href="?page=edithub">Edit Hub Page</a></br>
         <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        </center>
        <?php
       }
       if($data['fm'] == 1)
        {?>
         <center>
        <h7><i><b>Fleet Manager Panel</b></i></h7></br>
         <a href="addaircraft.php">Add Aircraft</a></br>
         <a href="manageaircraft.php">Manage Aircraft</a>
         </center>
        <?php
       }
       if($data['ed'] == 1)
        {?>
       <center>
        <h7><i><b>Events Director Panel</b></i></h7></br>
        <a href="?page=addevent">Add Event</a></br>
        <a href="?page=manageevents">Manage Events</a></br>
        <a href="postnews.php">Post News</a></br>
    
    
    </center>
        <?php
       }
       if($data['hr'] == 1)
        { ?>
        <center>
        <h7><i><b>Human Rescources Panel</b></i></h7></br>
        <a href="?page=newpilots">New Pilots</a></br>
        <a href="?page=editpilots">Edit Pilots</a></br>
        <a href="viewcomments.php">View Comments</a></br>
        <a href="viewsitecomments.php">View Site Comments</a></br>
    <a href="?page=addnews">Post News</a></br>
    <a href="?page=editnews">Edit News</a></br>
    
       <?php
       }
       if($data['bm'] == 1)
        {?>
        <center>
         <h7><i><b>Executive Staff Panel</b></i></h7></br>
         <a href="?page=edithub">Edit Hub Page</a></br>
          <a href="?page=addnews_hub">Add News For Hubs</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
         <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
         <a href="awards.php">Grant Award</a></br>
        <a href="addevent">Add Event</a></br>
         <a href="manageevents.php">Manage Events</a></br>
       	<a href="?page=addnews">Post News</a></br>
    <a href="?page=editnews">Edit News</a></br>
     <a href="pilotrec.php">Pilot Records</a></br>
        <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br>
         <a href="?page=editpilots">Edit Pilots</a></br>
         <a href="viewcomments.php">View Comments</a></br>
         <a href="viewsitecomments.php">View Site Comments</a></br>
       
       <?php
       }
      }
      } }
    }
    
    } else
    {
      echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?>
    
    
    <style type="text/css">
    .idBox {
    width:50px;
    }
    .passwordBox {
    width:80px;
    }
    </style>
    
    <table border="0" align="center">
    <form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
      <tr>
        <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
      </tr>
      <tr>
        <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
      </tr>
      <tr>
        <td></td><td align="center"><p align="center">
          <input type="submit" name="login" value="Login">
        </p>
          <p align="center">        <a href="#">Forgot Password</a></p></td>
      </tr>
    </table>
    
    <?
    }
    
    }
    
    ?>
    

     

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