okhokhar Posted December 16, 2009 Share Posted December 16, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/185373-javascript-locationhref-vs-php-header/ Share on other sites More sharing options...
ignace Posted December 16, 2009 Share Posted December 16, 2009 In PHP there is no location.href. location.href is from JavaScript which is a client-side language while PHP is a server-side language it's two different worlds. It's like the Earth and Mars Quote Link to comment https://forums.phpfreaks.com/topic/185373-javascript-locationhref-vs-php-header/#findComment-978636 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.