Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP-MSSQL user event notification

Status
Not open for further replies.

ideasworking

Programmer
Dec 2, 2001
120
CA
Hello,

I have a form that adds records to a MsSQL database; the submit action loads a page UpdateRecords.php which contains the code to update the records and then redirects the browse back to the original page. Everything works great, however I would like to give the user some feedback as to the result of the update request. Either "Records updated successfully" or "Failed to update records". What is the best way to do this?

My initial thought is to pass a variable back from the UpdateRecords.php page and depending on the variable use Javascript to alert a message. If the variable was empty no alert would be raised.

Does this sound like the right approach or is there a better method to achieve the desired result?

TIA,
Lou
 
the best way to do this is to have the form autoprocess. i.e. all the code is on the same page.

if you must use separate pages for processing and then redirecting then i would use a session variable to store the result of the query and/or redirect the user to different pages based on the result of the query.

i do not see the point in coding for a javascript alert or message unless your site is heavy on the js already - in which case why use a form action at all? just send the data up an ajax connection and feed the result back down!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top