|
-
Mar 4th, 2014, 05:45 PM
#1
Thread Starter
New Member
Client Side Data Collector to Server Side Database
I currently have a html web page containing both visual basic and java script sections. As a result, it loads on the client side. The client answers a series of questions. Once the client has provided the information requested, he/she clicks on a "Submit" button. I want that button to transfer the answers provided on the client side to a sql database operating on the server side. I currently have a visual basic script that creates an insert string for the sql database on the client side when the "Submit" button is clicked. How do I get this insert string from the client side to operate on the server side to update the sql database? Can I pass the insert string to a php script that connects to and opens the sql database so that the insert string can be used to insert the desired data? If yes, wouldn't this require calling a php function from within a visual basic script operating on the client side and passing the insert string to the php function operating on the server side?
-
Mar 4th, 2014, 06:14 PM
#2
Re: Client Side Data Collector to Server Side Database
How do I get this insert string from the client side to operate on the server side to update the sql database?
You don't... or rather you shouldn't. Your form should be set with an Action of "Post" (form actions have two options: Get - which passes everything trhough the querystring/url - if you look at the address above right now, you'll see the post id of 756527, plus the text of the title... that's a get... The other option is a Post... where everything is sent back to the server through session/cookies/what ever it is) you should then have a PHP page on the recieving end that then know what to do with the data and it's the THAT code that should be inserting the data into the database... you shouldn't be doing it from the client.
-tg
-
Mar 4th, 2014, 11:12 PM
#3
Thread Starter
New Member
Re: Client Side Data Collector to Server Side Database
Thank you for your speedy response, tg, but the information I am collecting is not being gathered using a form. I've used javascript to create a series of 20 to 30 tabbed pages with yes/no checkboxes and some buttons which appear under a header containing 6 fields of text data. This could not be done on your typical form. Therefore, there is no "Post" or "Get" action to initiate. I understand that security is important but I still need to find a way to get the answers provided by my users on the client-side into the database which exists on the server-side. Does this suggest any other answers?
-
Mar 5th, 2014, 05:22 AM
#4
Re: Client Side Data Collector to Server Side Database
What is your submit button sat on? I would have expected that, at least, to be a form. Set that form's action to post. Your javascript pages can add all teh information required to the session object ready to be submitted from the main form.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Mar 5th, 2014, 07:38 AM
#5
Thread Starter
New Member
Re: Client Side Data Collector to Server Side Database
Scratch what I said earlier. I've been working on this tool for a number of months and got confused with the nearly 30,000 lines of code I've written. It is a complex form but a form nonetheless. My submit button is intended to do two things. The first is to verify the data to be input. It checks to see if all of the fields have been filled in and that the email address provided generally fits the format of an email address. If something is missed or appears to be incorrect, the user is prompted to verify the information before it is submitted. This is all done on the client-side. Only after the the data is verified and the client consciously decides to submit it is the data actually submitted to the server side database. This is why I have not used the "Post" and "Get" options previously suggested.
-
Mar 5th, 2014, 08:44 AM
#6
Re: Client Side Data Collector to Server Side Database
I'm still confused why it's a problem... in the onClick event of the button, you can do your data validation... then once it's done, use the form.post method (from JS) to post the form to an address...
I've done it before (don't have a copy of the code handy, or I'd post it) but this https://www.google.com/search?q=post...rom+javascript should help...
-tg
-
Mar 5th, 2014, 09:44 AM
#7
Re: Client Side Data Collector to Server Side Database
This seems like the perfect time to use Ajax to post the data and get a response. Is that outside the realm of what you can do?
I'm also curious about something. How do you have VISUAL BASIC code in a web page?
-
Mar 5th, 2014, 09:54 AM
#8
Re: Client Side Data Collector to Server Side Database
I'm also curious about something. How do you have VISUAL BASIC code in a web page?
It only works in IE, flaky at best, and it's done the same way javascript is - with a script tag, but it's VBScript instead of javascript.
-tg
-
Mar 5th, 2014, 11:04 AM
#9
Thread Starter
New Member
Re: Client Side Data Collector to Server Side Database
Thank you all for your help. I'll keep working at it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|