Page 1 of 1

is there a postback function in php?

Posted: Sat Nov 08, 2003 9:48 pm
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

Posted: Sat Nov 08, 2003 10:27 pm
by Sevengraff
can you explain postback?

Posted: Sat Nov 08, 2003 11:15 pm
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 ;)

Posted: Sat Nov 08, 2003 11:18 pm
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.

Posted: Sun Nov 09, 2003 6:26 pm
by Castles
Ahh, thanks for your help... I think i will use http vars.