Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:09:38+00:00 2026-06-14T17:09:38+00:00

I have the login code as below: <?php session_start(); if (isset($_GET[‘action’]) && $_GET[‘action’]==’logout’ ){

  • 0

I have the login code as below:

<?php
session_start();
if (isset($_GET['action']) && $_GET['action']=='logout' ){
    session_destroy();
    header('location:index.php');
    exit();
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/login_style.css" />
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<script src="js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

<title>Login</title>
<style>
a:hover{
    cursor:pointer;
    text-decoration:none;
}
</style>
<script>
$(document).ready(function(){
    $("#myform").validationEngine();
});
</script>
</head>
<body>

<div class="form_controller">    
   <form action="index.php" method="post" id="myform" name="log">
    <table style=" margin-left: 164px; margin-top:86px;width: 292px;">
     <tr>
        <td style="color:#30a3b8;">Identifiant:</td><td><input type="text" name="text_username" class="validate[required]" style="border:1px solid #c9bbbb; height:20px; width:180px;"/></td>
     </tr>

   <tr>
    <td style="color:#30a3b8;"><br />Mot de passe: </td>
    <td><input type="password" name="text_password"  class="validate[required] TextInput" style=" margin-top:20px;border:1px solid #c9bbbb; height:20px; width:180px;"/><br /></td>
     </tr>

     </table>
    <table style="margin-top:50px; margin-left:197px;">
      <tr>
        <td></td>
        <td><input type="submit" name="tbn_submit" class="btnValider" value="Valider" style=""/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" class="btnValider" value="Annuler" /></td>
     </tr>
     </table>
     <table style="text-align:left; margin-top:-22px;">
         <tr>
            <td colspan="2"><a  href="register.php" style=" text-decoration:none; color:#30a3b8;" id="NewUser">Nouvel utilisateur?</a></td>
         </tr>
    </table>
        </form>
            <?php 
             include('include/encriptUrl.php');
             include ('include/connectdb.php');
                if(isset($_POST['tbn_submit'])){
                      $username = $_POST['text_username'];
                      $password = $_POST['text_password'];
                      $query = "SELECT * FROM tblusers WHERE `user_username`='".$username."' AND user_password='".$password."'";
                      $res = mysql_query($query) or die (mysql_error());
                      if($res){
                            if(mysql_num_rows($res)){
                                $user = mysql_fetch_assoc($res);
                                $_SESSION['username'] = $user['user_username'];
                                $_SESSION['password'] = $user['user_username'];
                                    if($user['user_possition'] == "Admin"){
                                        echo '<script type="text/javascript">window.location = "view_form.php"</script>';
                                    }
                                    else if($user['user_possition'] == "User"){
                                        echo '<script type="text/javascript">window.location = "view_edit_uid.php?uid='.encode5t($user['user_id']).'"</script>';                                        
                                    }                                       
                                    else if($user['user_possition'] == "R1"){
                                        echo '<script type="text/javascript">window.location = "view_form_res1.php"</script>';
                                    }
                                    else if($user['user_possition'] == "R2"){
                                        echo '<script type="text/javascript">window.location = "view_form_res2.php"</script>';
                                    }                               
                             } 
                             else {
                        echo '<script>alert("Invalid identifiant ou votre mot de passe.");</script>';             
                        }
                     }       
        }   
    ?>

 </div>
</body>
</html>

Problem:
I use session to take session of user when login according to my code above it works well in local,but when I upload it to the server I got the warning message Warning: session_start() [function.session-start]: open(c:/wamp/tmp/sess_2m7odit3i1mprbmk1qg5b3j701, O_RDWR) failed: No such file or directory (2) in /homepages/0/d315362104/htdocs/demo/segpp/index.php on line 2 ,Warning: Unknown: open(c:/wamp/tmp/sess_2m7odit3i1mprbmk1qg5b3j701, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 and Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:/wamp/tmp) in Unknown on line 0. I do not know how to fix this.

Anyone help me please,Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:09:38+00:00Added an answer on June 14, 2026 at 5:09 pm

    Thanks so much for your answers, now I solved it as below code:

    session_save_path('/tmp');
    session_start();
    

    So I just add session_save_path('/tmp');.Than it works well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code for displaying content for login and registration in my PHP
Suppose that I have below code: <?php $html = ' <form id=formA> <!-- Form
I have the following php code below... if ($username == 'fredk') { $fname =
I have below code.The logic here is if HostList conatains any blanck entry it
I have some login code that works well for Firefox and other browsers, but
I have a Login.aspx page, and I wanna incude some piece of code in
I have code that redirects visitor to login -page via authentication provider selector -page
I have this code in JS: if($('.log input:checked')) { alert('login checked'); alert('do what you
i have a code to send a Form Post with login credentials to a
I have this horribly stripped delphi code that basically login to server, save cookie

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.