I’ve got a fairly extensive data entry task to perform in a PHP application. The application allows you to enter one data set at a time (first name, last name, email), click ‘Go’, and then uses AJAX to submit the data and blanks the form, putting your cursor back in the first input. I have a data set of 1,300 that needs to be entered using this method. It’s currently in an Excel file, but of course that could just as easily be in a database, a CSV, etc.
This is by no means to exploit a site or application, it’s to enter user data from an old site into a new one. I’m looking for a way to automate this entry – populate email, populate first name, populate last name, submit the form, delay a second for the response (this is running locally so it should be snappy), select a new row to insert, repeat.
Edit – I absolutely realize that JS isn’t the right technology for this job, but I’m confident it can work. The ONLY reason I’m trying to use JS here is because that’s the one language capable of getting this done that I’m comfortable with, and doesn’t require a ton of work within the application. I can only use other technologies if it’s really spelled out.. normally I’d go for the learning route, but I simply can’t this time. Sorry to be so picky!
Ok, I worked through this one on my own.. I appreciate all of your input, but I really needed to get this done with JS, as I explained. I’m always very adventurous, but not when I absolutely cannot spend more time than necessary on it (which is rare). The solution isn’t complicated:
First I got the data into a MySQL table using LOAD DATA in phpMyAdmin. Trivial. Next, I wrote just a little bit of PHP for the JS to send AJAX requests to.
This PHP does not need to be clean, does not need to sanitize, does not need to be optimized, etc – this is happening ONE TIME, and locally.
Next, the JavaScript:
Again – could be better executed, but it does not matter because this is a one time process. This worked perfectly, and the increment time could probably be even shorter, requiring less time to complete the process.
Thanks again for the input, probably a lot of help for somebody who either has a grasp on these other technologies or some time to play with them. Doesn’t go unappreciated!