Jump to content

Sava

Members
  • Posts

    575
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Sava

  1. Nothing prevents you from charging for your services Vantiy. If he decided to charge and help out his family any way he can, I support that and wish him all the best and your comments are really not appropriate.

  2. I didn't do much yet but first of all I started displaying only the airports from the last arrived to airport in the schedules. The next thing to do was start programming the fleet positioning and incorporating all of that to display correctly in kACARS.

    I will be going away on holiday on Wed but once I am back I will get to work on that ;)

  3. The basic idea is to create a form

    <form method="post" action="yourfile.php">
    <input type="text" name="ur_name"/>
    <!-- some more input fields here -->
    <input type="submit" name="submit" value="Submit Form!"/>
    </form>
    

    and then inside yourfile.php do something like

    <?php
    $name=mysql_escape_string($_POST['ur_name'];
    //and same goes for other fields
    if( some verification you want here) {
    mysql_query("INSERT INTO TABLE_NAME (name, and other values separated by , ) values ('$name')");
    }else{
    //do something else
    }
    ?>
    

    To display the info:

    <?php
    $query = mysql_query("SELECT * FROM users");
    $count = mysql_num_rows($query);
    $smth=mysql_fetch_array($query);
    if ( $count > 0 ) {
    
      echo $smth['name']
      //and other from array
    } else {
    echo "no data can be retrieved for specifed conditions or smth like that"; }
    ?>
    

    Bare in mind that I wrote this in 3mins and that this is not completely correct way of doing things and it can be prone to a lot of hacks. This is just to give you a basic idea on how to do things. Check W3 schools to see how to INSERT, GET, DELETE, CHANGE etc. stuff from a MySQL database using PHP.

    Hope this helps you out a bit.

  4. Just got 15 free minutes.

    It would be good if you can explain in detail on what you actually want to do with the data as I can maybe do a different approach.

    If you only want to have a loginscript that checks for the user info, it can be done more easily with something like (considering you got the username and password entered in the form, stripped them of anything that can hurt your website and loaded them into variables)

    
    $q=mysql_query("SELECT * FROM phpvms_pilots WHERE pilotid='$id_entered' AND password='$pass_entered'");
    $count=mysql_num_rows($q);
    If( $count  == 1) {
      // do what you want here
    
    }
    else{ 
    echo "The login info is not correct etc";
    

    though you should check how phpvms stores passwords, they are hashed and have a salt so you have to acount for that also.

    If you just want the arrays you can do a query like SELECT * FROM phpvms_pilots and than do

    while($rows=mysql_fetch_array(your query))

    $ids[]=$rows['pilotid'];

    Etc

    With that you can get a specific id. For example echo $ids['0'] would show you the id that is first in the table.

    The second script should work, but I am not sure as I can't check ATM.

    If you don't get anywhere by the time I am available, I will try and help.

×
×
  • Create New...