Jump to content

Event driven Programming in PHP


gajubhai

Recommended Posts

Dear All,

      I am from ASP.NET back ground and new to PHP. I just started learning the PHP  for my new assignment but I could not understand how to handle Postback. My PHP page has many controls which can do post back. Each control has to do different task on postback. It can be easily done using control's event in the ASP.NET but I wonder how can it be done in PHP.

    How to make PHP page such that it will execute different code on post back caused by differnt controls.

 

This might be fullish query but please help. Also anybody could suggest be good PHP book for this?

Link to comment
Share on other sites

post back is round trip to the server for doing some task such as fetching the data from database based on user selection from combo box, adding data to database after pressing 'ADD' button on the server etc.

 

Actually in upper part of the form I want to fetch the data based on user selection from combobox. After fetching the data, I want to write a report in text box based on the fetched data and then again want to save it database.

Now in this case two post backs are required.

1.to fetch the data

2. To add new data.

 

how can it be done?

Link to comment
Share on other sites

ignace's example is correct and simple, but it sounds to me more like you'd be looking to use ajax which is a combination of Javascript & some server side tech.

 

With ajax you could make a request from the client to the server without refreshing the entire page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.