Jump to content

topflight

Members
  • Posts

    402
  • Joined

  • Last visited

    Never

Posts posted by topflight

  1. Hello I am creating my registreation page and if the member select a certain group that will get an ID number plus 1 (i.e Group A = 1000 if a new member were to join it their ID would be 1001 and if another member join their id would be 1002.) Each group has their own A= 1000 B= 2000 C= 3000 4= 4000. But for some reason they are not going up. And I think the reason it is not working because I keep getting an undefined variable login on line 64,71,82 Here is my code:

     

     

    64:

                $update = mysql_query("INSERT INTO `pilots` (login,pwd,fname,lname,email,hub,thours,thoursc,rating,vatsimid,date,ip,status,hm,ed,bm,active

     

    71:

    pending ID of ($login)

     

    82:

    Is an email with the login information

     

    This is my code:

     

     

    <?php
    include 'db.php';
    $error = '';
    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 (!empty($error))
       { 
          echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" ONCLICK="history.go(-1)"></FORM> <?php 
       } 
       else 
       {
          $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(empty($error))
             {
    
                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 = "``````````";
                $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. what do u mean I am? this is my code

    <?php
    include 'db.php';
    $error = '';
    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 (!empty($error))
       { 
          echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" ONCLICK="history.go(-1)"></FORM> <?php 
       } 
       else 
       {
          $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(empty($error))
             {
    
                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 = "``````````";
                $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>';
             } 
          } 
       } 
    }
    
    ?>
    

  3.  

    Notice: Undefined variable: login in /home/simasa/public_html/application.php on line 64

     

    Notice: Undefined variable: login in /home/simasa/public_html/application.php on line 71

     

    Notice: Undefined variable: login in /home/simasa/public_html/application.php on line 82

     

    this is line 64:

                $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());

     

    Line 71

     

    A new member ($fname $lname) with the pending ID of ($login) has submitted an ApplicationPlease activate their test. ";

     

    Line 82

     

    When registering your username should be $login $fname $lname if your username is not that your account will be deleted and you will have to re register.

     

    Please help thanks.

     

  4. Well becuase in the database I have it set login and the login will equal what ever the login is on the application page. Becuase some people my have a login ID of 2009 or 1006 and the database will just go  1001 1002 1003.

  5. Hello I am creating my registreation page and if the member select a certain group that will get an ID number plus 1 (i.e Group A = 1000 if a new member were to join it their ID would be 1001 and if another member join their id would be 1002.) Each group has their own A= 1000 B= 2000 C= 3000 4= 4000. But for some reason they are not going up. Here is my code: Also you may say he has the $login = ''; Well the reason why I have that their is becuase if I don't I get an undefined login error.

     

    Thanks in adnvanced.

     

    <?php
    include 'db.php';
    $error = '';
    $login = '';
    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 (!empty($error))
       { 
          echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" ONCLICK="history.go(-1)"></FORM> <?php 
       } 
       else 
       {
          $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(empty($error))
             {
    
                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>';
             } 
          } 
       } 
    }
    
    ?>

  6. I currently have 4 groups in my database and I want to have it set up so if the admin select one group and type a message in, it will email all the members in that group, but if the admin select ALL members it will email all member. I already have the form made out but I am confused on how to get started on this. Please help.

     

     

    Thanks in Advanced!

  7. I have created a login script which gets the password from the mysql database well the problem is that when the user sign up I md5 the password so it is some big log character how can I use the password the user signed up with for the login script and still have the password MD5?

  8. I have edited this part of my script:

    $cerror = count($error);

      if ($cerror > 1 )

      {

          echo $error;?> <FORM><INPUT TYPE="BUTTON" VALUE="Fix Errors" ONCLICK="history.go(-1)"></FORM> <?php

      }

      else

      {

         

    and now I am not receiving no errors I click submit with no input field and it just gives me a white page.

  9. My code is a basic registration script. First it checks to make sure if all the fields are not empty if they are not then it will display an error message for that field or fields that is empty.  Next it will md5 the password then it will give the user a login ID depending on the hub they choose. Then it adds one to the ID so if their is a 1000 id number in the database it will make the new member ID number 1001. After that it should insert it into the database. Then email the new member letting them know what happening to their account and also an admin letting them know they have to activate a new member. Here is my code:

    <?php
    include 'db.php';
    $error = '';
    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> <?php 
       } 
       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>';
             } 
          } 
       } 
    }
    
    ?>

     

    Thanks

     

  10. Also I fixed that email thing to:

     

    $jto = "";

    $jsubject = "";

    $jmessae = ". ";

    $from = "";

    $jheaders = "From: $from";

     

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

     

    $to = "$email";

    $subject = "";

    $message = ""

    $from = "";

    $headers = "From: $from";

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

     

    Also of course in my code the fields have data in it. and by the way I am sending to emails one to admin and one to the new member. I am also not receiving the undefined error no more but I am getting a white page when everything is ok.

     

     

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