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
https://forums.phpfreaks.com/topic/185373-javascript-locationhref-vs-php-header/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.