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

  • Home
  • SEARCH
  • 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 6564379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:57:33+00:00 2026-05-25T13:57:33+00:00

<div class=content clearfix> <div class=left> <!–info–> </div> <?php if(!$_SESSION[‘id’]): ?> <div class=left> <!– Login

  • 0
    <div class="content clearfix">
        <div class="left">
        <!--info-->

        </div>


    <?php

        if(!$_SESSION['id']):

        ?>

        <div class="left">
            <!-- Login Form -->
            <form class="clearfix" action="" method="post">
                <h2>Login</h2>

            <?php

                    if($_SESSION['msg']['login-err'])
                    {
                        echo '<div class="err">'.$_SESSION['msg']['login-err'].'</div>';
                        unset($_SESSION['msg']['login-err']);
                    }
                ?>

                <input class="field" type="text" name="username" id="username" value="User" size="23" onFocus="clearText(this)" />
                <input class="field" type="password" name="password" id="password" value="Pass" size="23" onFocus="clearText(this)" />
                <label><input name="rememberMe" id="rememberMe" type="checkbox" checked="checked" value="1" /> &nbsp;Remember me</label>
            <div class="clear"></div>
                <input type="submit" name="submit" value="Login" class="bt_login" />
            </form>
        </div>
        <div class="left right">            
            <!-- Register Form -->

            <form action="" method="post">
                <h2>Sign Up!</h2>       
            <?php echo $id; ?>
            <?php

                    if($_SESSION['msg']['reg-err'])
                    {
                        echo '<div class="err">'.$_SESSION['msg']['reg-err'].'</div>';
                        unset($_SESSION['msg']['reg-err']);
                    }

                    if($_SESSION['msg']['reg-success'])
                    {
                        echo '<div class="success">'.$_SESSION['msg']['reg-success'].'</div>';
                        echo $_SESSION['id'];
                        unset($_SESSION['msg']['reg-success']);
                    }
                ?>

I basically want to output the version of the $_SESSION['id']; into html upon submission so that it can be grabbed from the page as a user navigates the site. So, if a user were to go to index2.php and logged in successfully, their ID (the PK for their username and pass combo) would be outputted to HTML so the code could grab that if say they go to prof.php next, that session var ID from $_SESSION['id']; could be grabbed by the page and used on prof.php if a user were to submit the form on prof.php

Can someone please help me be able to reuse this ID over and over as pages are navigated?

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-05-25T13:57:34+00:00Added an answer on May 25, 2026 at 1:57 pm

    It sounds to me like you want the id variable to be accessible across all of the pages a user visits.

    That is exactly what session is designed to do. You don’t want to be writing the value to the page, since unless you put it in a form, and resubmit the form, the server side will never receive it again.

    Check out this reference

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

Sidebar

Related Questions

I have something like this: <div class=content> <a href=#>A</a> </div> <div class=content> <a href=#>B</a>
I've several <div class=sidebar></div><div class=content></div> The backgrounds of the sidebar and content are different.
I'm using Fancybox to load some content with AJAX. Content: <div class="container"> <h2>An image</h2>
I want to locate a div and replace both the content and div class
I have the following HTML and CSS: <div id=topdevelopments class=colnm colw6 clearfix> <a href=homes-for-sale/development/beaufort-park-6/
I have this markup: <div class=myToggledDiv> <div>content</div> </div> <div style=margin-top: 10px;> content </div> Via
I need to center html content inside a div class=partners (top div with 2
How can I get an image to stretch the height of a DIV class?
Let's say I do something stupid like this: <div class=my_class>fun wee!!</div> <span class=my_class><b class=my_class>Title</b></span>
$('div.box').html(hello) puts the word hello inside all my div's of class 'box'. They all

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.