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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:44:06+00:00 2026-06-08T06:44:06+00:00

I want to use one div at a time using an echo and $_SESSION.

  • 0

I want to use one div at a time using an echo and $_SESSION. When I put this on the web it only shows $form. Can you see if I’m doing anything wrong?

    $signedIn ='<h3 id="throughHeader"> Account options</h3><br/>
        <p id="throughP"> <a href="convenientaccountinfo.php> Account Info </a></p><br/>
        <p id="throughP"><a href="convenientaddaddress.php> Add Address </a></p><br/>
        <p id="throughP"> <a href="convenientaddcreditcard.php> Add C. Card </a></p><br/>
        <p id="throughP"> <a href="convenientsignout.php> Sign Out </a></p>';


        $form='<form id="signInForm" method="POST" action=""><h3 id="formHeader">Sign Into Account</h3><br/>
        <p id="pRegister"><a id="register" href="convenientregisterpage.php"> Register </a></p><br/>
        <label>Email Addr:</label><input type="text" name="userEmail" id="email" size="15"/><br/>
        <label>Password:</label><input type="password" name="password" id="password" size="15"/><br/>
        <input type="submit" value="Sign In" id="formSubmit" name="submit"/> </form>';

    $username = $_SESSION['userEmail'];
    if(!$username){
        $signedInForm="$form";
    }
    else{
        $signedInForm="$signedIn";
    }
}

This is the form POST with validating until it sets the $_SESSION. Thanks for looking at it again.

 $email=$_POST['userEmail'];
$password=$_POST['password'];
if(isset($_POST['submit'])){
    if(empty($email) || empty($password)){
    $msg_to_user3="Fill in both fields";
    }
    else{
    $results=mysql_query("SELECT * FROM register WHERE userEmail='$email'");
   if (mysql_num_rows($results)==0)
       $msg_to_user3 ="No such User";
    else
    {
      while ($login_row = mysql_fetch_assoc($results))
      {
       $password_db = $login_row['password'];
       if ($password!=$password_db){
         $msg_to_user3 ="Password doesn't match";
       }
         if ($password_db!=$password){

        $msg_to_user2="<a id='forgetpassword' href='convenientforgotpassword.php'>Forget Password</a>";
     }
       else
       {
          $active = $login_row['active'];
          $userEmail = $login_row['userEmail'];
          if ($active==0){
             $msg_to_user3= "Activate account at ($userEmail) </p>";
      }
         else
          { 
           $_SESSION['userEmail']=$username;//assign session
      }

      }
      }
    }
       }
}   
<html>
    <body>
    <div id="formSignIn">
        <?php echo $signedInForm ;?>
        </div>
    </body>
    </htmo>
  • 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-08T06:44:06+00:00Added an answer on June 8, 2026 at 6:44 am

    Ok, I got the $_SESSION working which switched in between the $form and $signedIn variables. And as far as two only showing with the p s I took the ids off and in the a href the quotes weren’t closed so it didn’t shut each link. Thanks for all your help!!

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

Sidebar

Related Questions

I want to use many bars like this one in my app (i don't
I want to use one program as a shared library for an other program.
We are two students who want to use one-class svm for dectection of summary
I have two User Controls already created now I want to use one as
string one = find; combobox1.text = one; I want to use one i.e string
I have a few pages and want that they use one style. See in
I want to use NSString from one UIView in another UIView . There are
I want to use the values of JTextFields from one class in another class
I want to use the Hibernate3 maven plugin in one of my projects. But,
I want to use @PreAuthorize annotation on service methods with Spring Security. One of

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.