Jump to content

javascript location.href vs. php header


okhokhar

Recommended Posts

I have question about how php handles "location.href". I have a PHP file (lets call it file1) which creates some HTML code to take user input. Once the file has been submitted it goes to another file (file2) where I check what the input was and based on the input I use javascript's "location.href" function to go to the next PHP file (file3) which outputs HTML code. file2 however, does not output anything. Once file1 has been submitted and it goes to the server will file2, which use "location.href" to forward to file3, cause the client to be contacted again and then send send the request for file3 to the server? Also would the behaviour of PHP's header function cause the client to not be contacted at all from file2? I would prefer it if once file1 has been submitted file2 once gets parsed on the server without contacting the client and only file3 go back to the client.

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.