Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3354542
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:17:08+00:00 2026-05-18T02:17:08+00:00

I’ve got a fairly extensive data entry task to perform in a PHP application.

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:17:08+00:00Added an answer on May 18, 2026 at 2:17 am

    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.

    getUser( $_POST['uid'] );
    
    function getUser( $uid ){
        $usr = "********";
        $pwd = "********";
        $db = "import_users";
        $host = "localhost";
    
        $cid = mysql_connect($host,$usr,$pwd);
        if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }
    
        $SQL = "SELECT * FROM users WHERE id = $uid";
        $retid = mysql_db_query($db, $SQL, $cid);
        if(!$retid){
            echo( "error: " . mysql_error());
        } else{
            while ($row = mysql_fetch_array($retid)) { 
                $user = array(
                    'email' => $row["email"],
                    'firstname' => $row["firstname"],
                    'lastname' => $row["lastname"],
                    'username' => $row["username"],
                 );
                echo json_encode($user);
            }
        }
    }
    

    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:

    function incrementUser(){
        $.ajax({
            type: "POST",
            url: "/path-to-php-file/ajax.php",
            data: "uid="+i,
            success: function(msg){
                console.log( "Completed: " + JSON.parse(msg) );
                var user = JSON.parse(msg);
                jQuery('#email').val(user.email);
                //jQuery('#user_login').val(user.username);
                jQuery('#first_name').val(user.firstname);
                jQuery('#last_name').val(user.lastname);
                jQuery('#user_info_form').submit();
            }
         });
        if( i > 1463 ){
            clearTimeout( time );
        } else{
            i = i + 1;
        }
    }
    

    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!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.