I am trying to display a jquery modal overlay if an HTML form successfully inserts the form data into my database.
i.e. if the form data is inserted, it displays a “success!” modal overlay, otherwise it displays a “sorry, your post was not uploaded.” modal overlay.
How would I use PHP to check if the data were inserted or not?
Extra credit: can I then just put the modal overlay code inside an if/else statement after that PHP check?
Submit the form via Ajax and then call the modal if the Ajax returns success.