Jump to content

[SOLVED] First Time Having This Problem.


SkyRanger

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.