Jump to content

freshJet

Members
  • Posts

    1470
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by freshJet

  1. This example will be done using a single page, if you want a redirect after form submit just enter an action and move the PHP over to the new page.

    <?php if(isset($_POST['submit'])){
    login();
    }
    ?>
    
    <form action="" method="post">
    <input type="text" name="username" />
    <input type="password" name="password" />
    
    <input type="submit" value="Login" name="submit" />
    </form>
    
    <?php
    function login(){
    $user = $_POST['username'];
    $pass = $_POST['password'];
    
    $login = Auth::ProcessLogin($user, $pass);
    }
    ?>
    

    • Like 1
  2. I do it like this:

    <?php
    function login(){
    $user = $_POST['username']; // username field in form
    $pass = $_POST['password']; // password field in form
    
    Auth:ProcessLogin($user, $pass);
    }
    ?>

    Add name="submit" to your submit button and then:

    if(isset($_POST['submit'])){
    login()
    }
    

    Then you can do an else for errors etc...

  3. Need a new twitter feed in light of the new API (yes, it's been some time now). It's useless how the new one requires OAuth etc, whereas with the old one it was a case of a few lines of PHP or Javascript.

    Any suggestions?

  4. Going back to this after a few months, still no avail:

    
    public function totalPax($pilotid){
    $query = "SELECT SUM(load) AS totalpax FROM phpvms_pireps WHERE pilotid = '".$pilotid."'";
    $result = DB::get_row($query);
    return $result->totalpax;
    }
    

    I am completely stumped. The only thing that comes to mind is that the field name is wrong, but I checked and right enough it is called 'load'.

×
×
  • Create New...