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 9050497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:39:47+00:00 2026-06-16T12:39:47+00:00

i did this code : file index.php: <?php if (isset($_POST[‘valider’])) { if (!isset($_SESSION)) {

  • 0

i did this code :

file index.php:

  <?php
        if (isset($_POST['valider']))
            { if (!isset($_SESSION)) { session_start(); }
                   require("function.php");
                        $email                   = mysql_escape_string($_POST['email']); 
                        $password                    = mysql_escape_string($_POST['password']); 
                        if(!VerifierAdresseMail($email)){?>
                        <script>alert('invalid mail');</script>
    <?php
                        }
                        else{
                        if(!authentification($email,$password))
                        {?>
                        <script>alert('logging failed');</script>
                        <?php
                        }
                        else{
                        header('Location: choice.php'); 
                        }}
                        }
        ?>

In function.php:

<?php
function VerifierAdresseMail($adresse)  
{  
   $Syntaxe='#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$#';  
   if(preg_match($Syntaxe,$adresse))  
      return true;  
   else  
     return false;  
}
function statistics($id){
$HOST_DB ="localhost";
                $NAME_DB="makempf3_captcha";
                $USER_DB ="root";
                $PWD_DB="";

                $connect = mysql_connect($HOST_DB,$USER_DB,$PWD_DB);
                $db=mysql_select_db($NAME_DB);
?><script>alert(<?php echo $cle ?>);</script><?php              
                $Log_query=mysql_query(
                    "   
                        SELECT * 
                        FROM  tbl_captcha
                        WHERE user_id ='$id'


                        ") or die(mysql_error());
$_SESSION['success'] =0;
$_SESSION['fail'] =0;
                      if ($Log_query == true && mysql_num_rows($Log_query) >0) {
?><script>alert('heni');</script><?php
                               while ($Res_user = mysql_fetch_array($Log_query) ) {
                                $_SESSION['success'] += $Res_user['success'];
                                $_SESSION['fail'] += $Res_user['fail'];


                            }
}





}
function authentification($mail,$pwd_U){

                 $HOST_DB ="localhost";
                $NAME_DB="makempf3_captcha";
                $USER_DB ="root";
                $PWD_DB="";

                $connect = mysql_connect($HOST_DB,$USER_DB,$PWD_DB);
                $db=mysql_select_db($NAME_DB);          

                $Log_query=mysql_query(
                    "   
                        SELECT * 
                        FROM  tbl_user
                        WHERE email ='$mail'
                        AND   user_pass   ='$pwd_U'

                        ") or die(mysql_error());

                        if ($Log_query == true && mysql_num_rows($Log_query) >0) {
                            $Res = array();
                            while ($Res_user = mysql_fetch_array($Log_query) ) {
                               $_SESSION['mail'] = $mail;
                                $_SESSION['pwd'] = $pwd_U;
                                $_SESSION['id'] = $Res_user['id'];


                            }
                            return true;
                        }
                        else return false;

}




?>

when i verify $_SESSION[‘id’] in choice.php, it is null, but in index.php (before redirection) it has a value. i don’t understand why i lost this session variable

  • 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-16T12:39:49+00:00Added an answer on June 16, 2026 at 12:39 pm

    Your isset() check isn’t sufficient, because it would only be executed if $_SESSION is NULL, and it will never be – it’s an empty array instead and it always exists, even before you call session_start().

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

Sidebar

Related Questions

i did this code : the file index.php <html> <head> <title>Jeu de dammes</title> </head>
I did the Nodebox tutorial on the graph library: http://nodebox.net/code/index.php/Graph#loading_the_library I installed the library
I have this code in the login.php file : //save user data $token=$user->getId().'_'.hash('sha256',$user->getUsername().microtime()); $name='fsusr_'.$user->getUsername();
according to this code i dont understand about NSClassFromString how did i know viewControllerName
Did I not get enough sleep or what? This following code var frame=document.getElementById(viewer); frame.width=100;
This is the code i have. The NSDictionary did used to be something, but
I just recently found myself writing this line of code, which i did not
I want v0.1.27 of nodejs code base. This is what I did. git clone
I did this but it didn't work. Can anyone help me? Thanks. $('.current_element').mouseover(function() {
This is my php code that connects me with another ftp server and shows

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.