Page 1 of 1
postback in php
Posted: Mon Jan 19, 2009 9:53 am
by tanmay
Can we use facility equivalent to postback method of asp.net in php?
Re: postback in php
Posted: Tue Jan 20, 2009 12:59 pm
by Shiki
What exactly do you mean (or want)? Care to explain more?
Re: postback in php
Posted: Tue Jan 20, 2009 1:06 pm
by Burrito
php by default does not have a postback method similar to the ViewState postback that .net has. There may be a framework built somewhere that utilizes similar functionality, but I don't know of one off-hand.
Re: postback in php
Posted: Wed Jan 21, 2009 9:37 am
by tanmay
thanks burrito for replying...i'll post reply if i get anything.
Re: postback in php
Posted: Wed Jan 21, 2009 9:39 am
by tanmay
Shiki wrote:What exactly do you mean (or want)? Care to explain more?
i'm passing some values in url and according to that value m deleting the entry or updating that entry. but when i refresh the page it takes the value again updates the entry...so what should i do?
Re: postback in php
Posted: Wed Jan 21, 2009 9:43 am
by Burrito
your best bet would be to redirect using
header() to a different page after the update completes.
Re: postback in php
Posted: Wed Jan 21, 2009 12:38 pm
by Shiki
Right. What Burrito said is what you could do. Forward it to a page without the parameters:
Say, this is your original url:
http://www.something.com/update.php?deleteid=1
In update.php, after your code processes the deleleteid parameter, you can forward it to a clean page: