Jump to content

Recommended Posts

I am having a strange problem with a script.  I only have the problem with FF but not with IE.

 

Here is the error I am getting:

Warning: session_start() [function.session-start]: open(/tmp/sess_91c647c5925ebb4eed7fa0b0bd89f66e, O_RDWR) failed: Permission denied (13) in /home/freedemo/public_html/admin/index.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/freedemo/public_html/admin/index.php:2) in /home/freedemo/public_html/admin/index.php on line 2

Sign in form

Warning: Unknown: open(/tmp/sess_91c647c5925ebb4eed7fa0b0bd89f66e, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0

 

Here is the code:

 

<?php
session_start();


include "db_connect.php";
if(!$_POST['submit'])
{
?>

<html>
<head><link rel="stylesheet" href="style.css"></head>

<div class="divider">

<strong>Login</strong>
<form method="post" action="index.php">

<div class="formElm">
<label for="username">Username</label>
<input id="username" type="text" name="username" maxlength="16">
</div>

<div class="formElm">
<label for="password">Password</label>
<input type="password" name="password" maxlength="16">
</div>

<input type="submit" name="submit" value="Login">
</form>
<a href="register.php">Register Here</a>

</div>
</html>

<?php
}
else
{
  $user = protect($_POST['username']);
  $pass = protect($_POST['password']);

if($user && $pass)
{
$pass = md5($pass); //compare the encrypted password
$sql="SELECT id,username FROM `users` WHERE `username`='$user' AND `password`='$pass'";
$query=mysql_query($sql) or die(mysql_error());

    if(mysql_num_rows($query) > 0)
    {
      $row = mysql_fetch_assoc($query);
      $_SESSION['id'] = $row['id'];
      $_SESSION['username'] = $row['username'];

      echo "<script type=\"text/javascript\">window.location=\"home.php\"</script>";
    }
    else
   {
    echo "<script type=\"text/javascript\">
alert(\"Username and password combination is incorrect!\");
window.location=\"index.php\"</script>";
   }
}
else
{			
   echo "<script type=\"text/javascript\">
alert(\"You need to gimme a username AND password!\");
window.location=\"index.php\"</script>";
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/155667-solved-first-time-having-this-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.