JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to try submission code on localhost, before upload web pagesAsked by cribbervr on March 21, 2016 at 04:23 AM
I am using your great job and I would started with something more advanced.
I'd like to use the submission functionality on my website, made with Netbeans and programmed with php and mysql. Moreover I am used to check it locally using Wampserver.
With Jotform, too, I would like to try my post-submission code locally, before to put my pages in production, but it seems to me that it's not possible to redirect the thanks pages URL locally. So it is possible to check my code only live on my provider web server.
Is it so? How to test all before uploading php pages? Can we set the URL link in thanks page to localhost o even using a relative url as "managedata.php", for example?
Many thanks in advance.
I'm afraid you can't use relative links as your thank you URLs. Even if you could use relative links, they would be relative to the JotForm's submit page rather then relative from the page where the form is embedded.
When it comes to how to test your forms locally, even if testing, they will have to submit their data to JotForm. After data is submitted to JotForm, it will automatically redirect to the URL you have set up as your thank you page URL.
Simply enter your local server's URL there, and if the local URL is accessible by your browser, it should redirect there. You may want to use an URL such as this to load the page from your local server:
Please try it out and let us know how it goes.
Thanks for your quick answer. I tried as you said and it work perfectly.
I created two php pages (let's say: form_page.php and data_page.php). The first one contain the Jotform's script. The second one receive the data submitted and display them.
Within the form's 'Thanks page' I wrote the url pointing to my second page.
As I use Virtualhosts I put an URL like "http://myvirtualhost/data_page.php", where myvirtualhost is obviously the real name of my local host.
As expected the browser displayed my page correctly showing the submitted data.
Moreover I tried to launch the first page from inside of Netbeans in debug mode, with a breakpoint on a line of the second page to see my variables and this functionality worked well too.
If I am right now I can try all my code logic locally and before to upload all in production I will have only simply to change the URL with the real final web URL. Correct?
Yes. You are right. Since the form is already embedded on your pages and the data transmitted from JotForm servers to the data page, you'll need not to change anything related to form except the correct URL to the data page.
Hope this information helps! If you need any further assistance, please let us know. We will be happy to help.