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

The Archive Base Latest Questions

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

Let’s say I am building an web app that is connecting and basically parsing

  • 0

Let’s say I am building an web app that is connecting and basically parsing another website. my question is, if you are posting (let’s say were using jquery/ajax via shorthand $.post) with a php script that has multiple variables. Take for example this script:

$user = $_POST['user'];
$pass = $_POST['pass'];

if(isset($user) && $user !== null){
   if(isset($pass) && $pass !== null)
    echo 'true'
   else
    echo 'false';
}

Now our app is really weird (just an example) and decides to submit the user and password to the script at different intervals via jQuery’s $.post, which will basically in an ajax shorthand submit to script and retrieve data. Our app is going to submit the username the user enters first, but just to piss the user off, in a separate post call it submits the password five minutes later.

So in a visual way

$.post('script.php',{user: 'username'}) -> posts to the script, but doesn't
return anything, as in this case it would return false

<em>5 minutes later</em>

$.post('script.php',{pass: 'password'}, function(data){
       alert("data returned: " + data);
});

Would the script remember the previous username post variable passed if it all originated from the same page? or would it forget it and not run at all (for username is not set)?

basically my overall questions is, can you submit different post variables to a php script from the same page at different times and will they work together in the script or no?

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

    No. The $_POST array ‘s context changes with each request, in that it will always contain the last POSTed key – value pairs. You may be after a mechanism for preserving state, such as the $_SESSION array, which of course you need to initialize and transfer values to yourself.

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

Sidebar

Related Questions

Let's say I'm building a data access layer for an application. Typically I have
Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's assume that we are building a high traffic site that will be used
Let's say I have an facebook application running using the JS SDK. First user
Let's say I have multiple requirements for a password. The first is that the
Let's say that I have a date in R and it's formatted as follows.
Let's say you have a class library project that has any number of supplemental
Let's say I want to write a function that validates an email address with
Let's say I have an abstract parent class called shape, and that there are

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.