I'm using the PHP samples (Edit Contact step 1) and (Edit Contact).
After the custustomer enters a new e-mail address then (Edit Contact) paints the new form for the customer to complete just below the original form, which asked for his e-mail address.
How can I tell program in effect, clear the screen of the orignial form, and just display the new form?
TIA - Tom
I may need some clarification on what you are looking for in order to answer your questions. Are you looking for the edit_contact.php page to show none of the contact details for the contact you edited after the form is submitted? Or are you looking for the add_contact.php page to clear out the form fields after a contact is submitted, so that you can immediately add another contact without having to clear out the previously added contacts details?
There are a couple places where this occurs, and for your reference here is a link to our sign up page: http://jmcserv.com/ipad/
It starts asking for the contacts e-mail address (basically script Edit Contact Step 1)
And after the contact finishes the form, and he successfully adds his name to the database, he gets a "successfully added message", but (here is the problem I'd like to solve) all the original forms are still displayed.
What I'd like to have happen, is to remove all the forms and have a clean page with only the message "Congrats you have added you name blah, blah, blah..."
There are a few different ways you could modify the php sample files in order to do this, and which is best is going to depend on the flow of your site and the expected user experience that you are looking for.
1. You could wrap the form portion of these pages in an if statement only to be displayed if the form is not submitted, that way it is only displayed until the form is actually submitted. Once the form is submitted, that portion of the page would no longer display as the POST array is not empty. This would work for keeping uses on the same page after submitting the form without actually showing it to them.
2. You could also add header('Location: http://www.yourdomain.com/successpage.html') instead of displaying the normal success message. This way when the form is submitted and a contact is successfully created, they would be moved to a specific page designed to handle the successful submission of the form. You could then use this page to display the success message and any other elements you feel are necessary upon creating or editing a contact.
View API documentation, code samples, get your API key.Visit Page
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...See Article