RE: How to argue with ASP people...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I used response.redirect in asp to avoid form re-submit, so I can have form
handling functions and other related functions on the same file.

new_customer_form.php :
< form action="form_results.php" >

Customer fills form and hits submit button.

form_results.php :
function validate_form_data(){
	if true show_results();
}
function show_results() {...}

Now customer is on results page in show_results().
If he hits the Refresh button or Back then Forward buttons in he will be
prompt to resubmit the form data or cancel.
If I add header("Location: form_results.php") inside function
validate_form_data() instead of calling function show_results() I can avoid
this behaviour.

I don't know if this is the right procedure, i am learning as I develop.
This was a workaround for shopping cart and customer area form handling form
handling code. Probably I'm doing it all wrong :)

And Robby thanks for the ob_start() tip!

I apologise for my bad English writing.

Pedro Almeida.


-----Mensagem original-----
De: John Holmes [mailto:holmes072000@xxxxxxxxxxx] 

Yeah, sure. You just can't have any output before you redirect with a 
Location header (unless you use output buffering as a workaround).

This is basic HTTP and ASP has to play by the same rules. If you can 
have output before Response.Redirect, then ASP is just doing the 
buffering for you before it sends a Location header.
John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux