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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:21:34+00:00 2026-05-21T07:21:34+00:00

I have this: main.php: ID: <input name=id id=id type=text size=20 value=<?php echo $_POST[‘id’]; ?>><br>

  • 0

I have this:
main.php:

ID: <input name="id" id="id" type="text" size="20" value="<?php echo $_POST['id']; ?>"><br>
Password: <input name="password" id="password" type="password" value="<?php echo $_POST['password']; ?>" size="20">

File main.php is index page.

File main.php is a form with action=”main.php”

When i go from main.php to console.php, i dont get the values id and password.

When i go from main.php to plugins.php, i dont get the values id and password.

From main.php, you can get into plugins.php and console.php. But you don’t get the values then.

I know why it happens.

How to fix this? How can i make, that when i go to console.php, or plugins.php, the fields will stay remembered?

Sessions are too hard for me to learn. Is there any other solution?

  • 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-21T07:21:35+00:00Added an answer on May 21, 2026 at 7:21 am

    Too hard? Put simply, at the top of every page you want to use sessions with, use session_start(). Now, you want to save something to a session?

    #page1
    session_start();
    $_SESSION['foo'] = 'bar';
    
    #page2
    session_start();
    echo $_SESSION['foo'] #echoes bar
    
    unset($_SESSION['foo']); #destroy foo
    #if you want to discard the entire session, use
    session_destroy(); #going down! 
    

    So, in your case, maybe something like:

    #main.php
    session_start();
    if (isset($_POST['id'], $_POST['password'])) {
        $_SESSION['id'] = $_POST['id'];
        $_SESSION['password'] = $_POST['password'];
    }
    #rest of main.php
    
    #console.php and plugins.php
    session_start();
    if (isset($_SESSION['id'], $_SESSION['password']))
        #do stuff
    

    I feel bad for spoon-feeding you with it, but basic session functionality is really all that’s needed in the case you’re describing, and it’s probably the easiest way to pass around sensitive info, and is basically what sessions were made for.

    For more info:

    • http://www.php.net/manual/en/reserved.variables.session.php
    • http://www.php.net/manual/en/function.session-start.php
    • http://www.phpriot.com/articles/intro-php-sessions
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this as Main int[] M ={ 10, 2, 30, 4, 50, 6,
I have this code #include <iostream> using namespace std; int main(int argc,char **argv) {
I have this program in c++: #include <iostream> using namespace std; int main() {
Events are synchronous in C#. I have this application where my main form starts
For example: This is main body of my content. I have a footnote link
Supposing to have something like this: #include <map> int main(){ std::map<int,int> m; m[1] =
Have you ever tried this before? static void Main(string[] args) { int x =
I have a main canvas 'blackboard' in a panel, this canvas has itself several
I hope I can explain this clearly enough. I have my main form (A)
I have this code in jQuery, that I want to reimplement with the prototype

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.