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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:41:10+00:00 2026-05-11T16:41:10+00:00

I pass a variable to domain.com/index.php?user=username In my page (index.php) contains others pages like

  • 0

I pass a variable to domain.com/index.php?user=username

In my page (index.php) contains others pages like about.php, profile.php, contact.php etc..

My question is, is it possible that i pass variable to index.php, then about.php, profile.php can also retrieve the variable using $_GET[‘user’]; method??(actually i tried, its failed, give me “undefined index:…”

If this method failed, is there any other way?

EDIT:
yeah, i can use SESSION. How about I want to display others profile? means other username?

  • 1 1 Answer
  • 3 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-11T16:41:10+00:00Added an answer on May 11, 2026 at 4:41 pm

    You can save the variable in a session.

    In your index.php file.

    session_start();
    $_SESSION["user"] = $_GET["user"];
    

    And then in your following files you can start the session and call $_SESSION["user"]

    EDIT:
    If you need to display different content that can take the same arguments, then you need to have those arguments in that url.

    EDIT 2:
    BTW this is sort of guessing since I don’t know your code or skill level.

    Lets assume you have this index.php page. Which you access by index.php?user=john

    And in this page you list friends of john. And you can access their profile also by doing index.php?user=alex and index.php?user=tim

    Then you can reference the url of their friends with. (assuming you have arrays of friends in a standard mysql_fetch_* way)

    <?php
        echo "<a href='index.php?user=".$friend["name"]."'>".$friend["name"]."</a>
    ?>
    

    And fetch your link by using the $_GET variable

    <?php
        echo "<a href='index.php?user=".$_GET["user"]."'>".$_GET["user"]."</a>
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to pass the environment variable to the glassfish domain.xml as the
Trying to pass the variable flickrurl to a PHP page with jQuery/ajax. It works
Here what I've already done. RewriteRule ^([a-z]+)$ index.php?file=$1 So when visiting domain.com/browse it actually
How do I pass a variable in a php file that is loaded into
I need to extract a sub domain and pass to a variable to then
how to pass variable from zf to javascript/jquery? thanks
If I pass a variable to ant by doing ant -Dsomething=blah How can I
How would I pass a variable to an iframe which is on the same
How can I pass a variable value from a template using JavaScript without using
I want to pass a variable to he buttonEvent method in the selector. [button

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.