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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:52:25+00:00 2026-05-12T08:52:25+00:00

How can you get the variables in URL to the next page in PHP?

  • 0

How can you get the variables in URL to the next page in PHP?

The user is at the URL

 http://localhost/codes/index.php?ask_question&email=masi@gmail.com&passhash_md5=202cb962ac59075b964b07152d234b70

He sends a question and he goes to the following url where variables lost their values for some unknown reason.

http://localhost/codes/index.php?question_sent&email=&passhash_md5=

The following code is the code handle_a_new_question.php.

 $result = pg_prepare($dbconn, "query77", "INSERT INTO questions
     (body, title, users_user_id)
     VALUES ($1, $2, $3);");
 $result = pg_execute($dbconn, "query77", array($body, $title, $user_id));

 if(isset($result)) {
     $header = ("Location: /codes/index.php?"                                                                                                                                                           
         . "question_sent"
         . "&"
         . "email="
         . $_GET['email']             // this seems to be correct to me
         . "&"
         . "passhash_md5="
         . $_GET['passhash_md5']      // this seems to be correct to me too
         );
     header($header);
  }

Do you see any mistake in the code?

  • 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-12T08:52:26+00:00Added an answer on May 12, 2026 at 8:52 am

    Try using session handlers in place of the GET variables. It does add a few keystrokes to your code but saves you a lot of headeache, in my point of view.

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

Sidebar

Related Questions

So suppose I have the url: http://url?x=1&y=2 Then I can just get all the
I just can't get my variables to carry over to the next page. The
I need to password protect on specific URL, for instance anyone can access index.php
How can I get Environnment variables and if something is missing, set the value?
I've played around quite a bit now, and can't seem to get variables to
Possible Duplicate: How can I get a list of all the defined variables in
I can't figure out how to get the SCOPE_IDENTITY() back to my variables from
I'm trying to access a member structs variables, but I can't seem to get
Can someone show me how to get the youtube id out of a url
I can get all those url's whose content/type is text/html, but If I want

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.