Jump to content

The best way to do this


yobo

Recommended Posts

Hey All,

 

I am making a small application to help me learn, my question is this I am making a page where the users enters a number asset number that is they click submit and if that record exsists it will have a link underneath the input box saying record found click here to view details if the record does not exsist there will be a link saying record not found click here to add the record.

 

my problem is that I dont know how to do this on one page I can do it with seperate pages but not sure how to do it on one

 

any ideas please?

 

Joe

Link to comment
https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/
Share on other sites

Simply put, it is the use of javascript that allows a page to change instantly on a condition and/or user event.  It allows you to asynchronously send and receive data from other scripts.  jQuery is a framework for Javascript and is widely used.  I suggest you look into jQuery as it is the solution to your problem.

Yup - you need two PHP pages.

 

"main" - shows the form - submit button uses jquery to extract value from form and send ajax request to 2nd page "service"

 

"service" - accepts an ajax request from "main" and returns appropriate data

 

when data is returned to main, perform any required reformatting and use jquery to append to the display area (usually a div)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.