if my php website is ideal for 30 minutes it shuld be redirected to login page
please help me....
this is my checkuser.php

<?php
    session_start();
    include("config.php");
    if (isset($_POST['sub'])) {
        $myusername = $_POST['txtusername'];
        $mypassword = $_POST['txtpassword'];
        $name       = stripslashes($myusername);
        $password   = stripslashes($mypassword);
        $myusername = mysql_real_escape_string($name);
        $mypassword = mysql_real_escape_string($password);
        $sql        = "SELECT * FROM $tbl_name WHERE MUSE_NAME='$myusername' and MUSE_PWD='$mypassword'";
        $result     = mysql_query($sql);
        $count      = mysql_num_rows($result);
        if ($count == 1) {
            $_SESSION['login'] = "1";
            header("location:Main_Dashboard.php");
        } 
		else 
		{
		    $_SESSION['error'] = "Incorrect username or password";
            header("location:Main_Login.php");
        }
    }
?>

can i use "session_cache_expire();" for time out....
is it ok...?

yes,
by this

session_cache_expire(30);

but check that page is ideal or not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.