is there a postback function 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
Castles
Forum Newbie
Posts: 14
Joined: Tue Nov 04, 2003 10:21 am

is there a postback function in php?

Post by Castles »

Hi, I was just wondering if there is a postback function in php like asp.net? I guess I could just have a html_post variable but was wondering if there was a specific function I should use
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

can you explain postback?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

it's a mechanism that assigns an unique id to a html-element and adds a small javascript function to the generated document to submit a request on certain events for that element. e.g. having a form like

Code: Select all

<form runat="server" id="aForm">
  <asp:linkbutton id="aButton" runat="server" text="bla bla bla" onclick="aButton_Click" />
</form>
you can define a function (server-side)

Code: Select all

<script language="VB" runat="server">
Sub aButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    ' event handler code
End Sub
</script>
that is invoked for the specific element-event.
Php does not provide such a mechanism by default. It's a light-weight framework
But you might want to use http://php.net/uniqid if you're going to code something similar yourself. Maybe a similar framework already exists for php but that I don't know ;)
Castles
Forum Newbie
Posts: 14
Joined: Tue Nov 04, 2003 10:21 am

Post by Castles »

like, when you refreash a page in asp.net you can test to see if it has been refreased.

Basically I want to display a send email form. When the form is submitted I would like a confirmation message that the email has been sent. If the user then refreashes the page it should go back to the send form.
Castles
Forum Newbie
Posts: 14
Joined: Tue Nov 04, 2003 10:21 am

Post by Castles »

Ahh, thanks for your help... I think i will use http vars.
Post Reply