timeout

Discussion in 'PHP' started by nit, Mar 20, 2007.

  1. #1
    Hi, below is a script that accepts a username and password and after accepting them, displays another form. I need to timeout the user after a specific amount of time using sessions,eg,30 seconds, and display a warning.Can anyone help me to do that?



    <?php

    if(!isset($_POST['submit1']) && !isset($_POST['submit2']))
    {
    ?>
    <form action="s9.php" method="post">

    Name:<input type="textfield" name="username">

    Password: <input type="password" name="password">

    <input type="submit" name="submit1" value="Log in">
    </form>

    <?
    }
    ?>

    <?
    if(isset($_POST['submit1']))
    {

    $name=$_POST['username'];
    $password=$_POST['password'];

    ?>

    <form action="s9.php" method="post">

    Full Name:<input type="textfield" name="fname">

    City: <input type="textfield" name="city">

    Phone no: <input type="textfield" name="phone">

    <input type="submit" name="submit2" value="View details">

    <?
    }
    ?>

    <?
    if(isset($_POST['submit2']))
    {
    $fname=$_POST['fname'];
    $city=$_POST['city'];
    $phone=$_POST['phone'];
    echo ("
    $fname");
    echo ("
    $city");
    echo ("
    $phone");
    }
    ?>
     
    nit, Mar 20, 2007 IP