I have a script like this:
[code]<?php
session_start();
// Define your username and password
$username = “username”;
$password = “password”;
$_SESSION[‘txtUsername’] = $_POST[‘txtUsername’];
$_SESSION[‘txtPassword’] = $_POST[‘txtPassword’];
if ($_SESSION[‘txtUsername’] != $username || $_SESSION[‘txtPassword’] != $password) {
?>
Login
Username:
<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
<?php
}
else {
//---------------------------------------------------------------------------------------
$filename = $_GET['filename'];
if (empty($filename))
{
?>
<?php
}
else
{
if (strpos($filename,".zip") >= 1)
{
exec(‘unzip $filename’,$ret);
echo “Successful unzipping”;
session_destroy();
}
elseif ((strpos($filename,".tgz") >= 1) || (strpos($filename,".tar.gz") >= 1))
{
exec(‘tar -xzf $filename’,$ret);
echo “Successful untargzing”;
session_destroy();
}
else
{
?>
The only part we need to worry about is logging in. The problem is that After I logon and use the text box to submit my filename, it takes me to the login screen again. I thought I had solved this by using session variables that only expire after a successfull uncompressing, but apparently I was wrong. Help!