postback in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tanmay
Forum Newbie
Posts: 12
Joined: Mon Jan 19, 2009 9:51 am

postback in php

Post by tanmay »

Can we use facility equivalent to postback method of asp.net in php?
User avatar
Shiki
Forum Newbie
Posts: 9
Joined: Sat Nov 29, 2008 4:35 am

Re: postback in php

Post by Shiki »

What exactly do you mean (or want)? Care to explain more?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: postback in php

Post 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.
tanmay
Forum Newbie
Posts: 12
Joined: Mon Jan 19, 2009 9:51 am

Re: postback in php

Post by tanmay »

thanks burrito for replying...i'll post reply if i get anything.
tanmay
Forum Newbie
Posts: 12
Joined: Mon Jan 19, 2009 9:51 am

Re: postback in php

Post 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?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: postback in php

Post by Burrito »

your best bet would be to redirect using header() to a different page after the update completes.
User avatar
Shiki
Forum Newbie
Posts: 9
Joined: Sat Nov 29, 2008 4:35 am

Re: postback in php

Post 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:

Code: Select all

header('Location: update.php');
Post Reply