Results 1 to 9 of 9
  1. #1

    How to submit non repeating variable randomly chosen from a list?

    Hi, I need a little help here. I've been asking at stackoverflow but was not able to help me with my problem.. Some people there just post one comment then runaway.
    I need to retype a bunch of names written on a paper and make a digital copy of it to a computer (a txt file). Then copy/paste each name and submit it again into a website one by one. Type one name then submit, wait until the page reloads, then repeat again. I saved the html file of the website but I don't have access to website's server. I was thinking I could modify the html file I saved so I'll just copy/paste once then click submit once. I'm not sure if it's possible to copy the names from the text file and embed it in the html code or maybe make a code to read the names from the txt file. Honestly, I don't mind copy and pasting the names one by one into the website. What slows me down is the page reload time and the website only has one input field. It takes a few seconds to reload after submitting one name. So I want to be able to copy paste all then submit it once. I saved a local copy of the html file of the website and added action="website.com/xxxx" so it submits it to the website even if the html file is saved on my computer. The code below is a part of the website's html code:
    Code:
    <form method="post" action="website.com/xxxx">
    <input type="text" name="t" style="width:250px">
    <button type="submit"><p>Submit<img src="submit.png" style="width:32px;vertical-align:middle"></p></button>
    </form>
    I was thinking if I could modify it like this but didn't work:
    Code:
    <form method="post" action="website.com/xxxx">
    <input type="text" name="t" style="width:250px" value="jane">
    <input type="text" name="t" style="width:250px" value="jenny">
    <input type="text" name="t" style="width:250px" value="mark">
    <input type="text" name="t" style="width:250px" value="ben">
    <input type="text" name="t" style="width:250px" value="cathy">
    <button type="submit"><p>Submit<img src="submit.png" style="width:32px;vertical-align:middle"></p></button>
    </form>
    I was able to modif it to automatically submit a value "val" in the input field whenever the page is loaded:
    Code:
    <form method="post" action="website.com/xxxx">
    <input type="text" name="t" style="width:250px" value="val">
    <button type="submit"><p>Submit<img src="submit.png" style="width:32px;vertical-align:middle"></p></button>
    </form>
    <SCRIPT LANGUAGE="JavaScript">document.forms[0].submit();</SCRIPT>
    How do I make it automatically replace "val" with a non repeating variable chosen from a list(a txt file or within the html code)? Like for example I want to submit val1, val2, val3 and so on.. Everytime the page is loaded it choose one value from that list and then keep reloading until it submitted all the values without repeating any value. Or maybe submit it all immediately by opening different tabs for each value submitted. From the original html code, fter clicking submit, it shows a page and prints "Successful" so maybe I could submit all at once and make it open each result in another tab and?
    ALso, how would I embed the list of values into the html code so it wouldn't need to retrieve the values from a file because I found out that "due to security restrictions, client-side scripts may not be allowed to access the user's computer beyond the web browser application"?
    I need a client side script because I don't have access to the server. I just need a script to speed up my task.
    Last edited by jennydeguzman; 12-14-2013 at 06:00 AM.

  2. #2
    Hi
    For what you want, you need to use ajax, to submit data without refreshng the page.
    Try look on the net for "Ajax Tutorials".

  3. #3
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    Not to be negative about your issue, but what is the purpose of this request? From reading it, you're looking to spam someone's form automatically instead of needing to submit properly.
    Having problems, or maybe questions about WHT? Head over to the help desk!

  4. #4
    Quote Originally Posted by bear View Post
    Not to be negative about your issue, but what is the purpose of this request? From reading it, you're looking to spam someone's form automatically instead of needing to submit properly.
    Hi, I've already mentioned my purpose
    "I need to retype a bunch of names written on a paper and make a digital copy of it to a computer (a txt file). Then copy/paste each name and submit it again into a website one by one."
    This is part of my job. I work at a branch of a small company here. It's starting to get so frustrating because of their slow crappy website. This website is from the main office.
    I'm not interested in mastering html/javascript/ajax or whatever. I only know basic html coding. I just need to speed up my task.
    Last edited by jennydeguzman; 12-14-2013 at 10:32 AM.

  5. #5
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    Quote Originally Posted by jennydeguzman View Post
    Hi, I've already mentioned my purpose
    Well, you've mentioned what you need to do, but not why, which would be the purpose of your request.
    This is part of my job. I work at a branch of a small company here. It's starting to get so frustrating because of their slow crappy website. This website is from the main office.
    If it's their own website and company and someone you work for, surely someone there can assist in making this simpler?
    Having problems, or maybe questions about WHT? Head over to the help desk!

  6. #6
    Quote Originally Posted by bear View Post
    Well, you've mentioned what you need to do, but not why, which would be the purpose of your request.
    If it's their own website and company and someone you work for, surely someone there can assist in making this simpler?
    What do you mean why?

    They give me datas written by a bunch of people, then make a copy on the computer and archive it. Then submit the data. Type it one by one to the company's website. I don't think I'm in the position to bash them how crappy their website is designed. They're surely gonna kick me out.

    Could you tell me if I am asking something illegal? I've been asking help everywhere but no one seems wanting to help me out.
    Last edited by jennydeguzman; 12-14-2013 at 11:00 AM.

  7. #7
    Join Date
    Oct 2002
    Location
    State of Disbelief
    Posts
    22,951
    I've no way of knowing if something you're doing is illegal, but from the description (until you mention it's the company you work for) it sounded kind of suspicious.

    Back on the subject, what you're trying to do could be accomplished far simpler by the person running the site, but then you'd have no job perhaps.
    What you're asking to do will, unfortunately, require extensive programming. You need to parse the file and place the data into an array, then loop through that array one at a time, posting to the form. If the form has any sort of referral checking, you won't be able to use a local form, it will have to be done on the site.

    If it were my job to do, I'd break the list into chunks, open the form in a dozen tabs and hand submit until I was through the list.
    Having problems, or maybe questions about WHT? Head over to the help desk!

  8. #8
    Quote Originally Posted by bear View Post
    I've no way of knowing if something you're doing is illegal, but from the description (until you mention it's the company you work for) it sounded kind of suspicious.

    Back on the subject, what you're trying to do could be accomplished far simpler by the person running the site, but then you'd have no job perhaps.
    What you're asking to do will, unfortunately, require extensive programming. You need to parse the file and place the data into an array, then loop through that array one at a time, posting to the form. If the form has any sort of referral checking, you won't be able to use a local form, it will have to be done on the site.

    If it were my job to do, I'd break the list into chunks, open the form in a dozen tabs and hand submit until I was through the list.
    Thanks. That's a nice idea. I just hope this computer could handle more than a hundred tabs

  9. #9
    I have a lot of experience navigating poorly designed websites maintained by large bureaucracies! (aka what I've learned in college)

    You can save yourself a lot of trouble using a browser script. That way you don't have to worry about referral checking or csrf tokens, as Bear pointed out.

    This differs slightly by the browser, and they all have different names for it, but it's really just a JavaScript function specified by you that the browser will execute as if it were on the page.

    Here's what I would do:

    Initialize a local storage variable (or use a cookie if your browser is old) with all the names you need to submit. A CSV format would be the most straight forward (you could also use a JSON string), and you could inject a textbox on the page to do this step.

    Assuming (from your own script above) that document.forms[0] is the target form, you could do something like this:

    PHP Code:
    //get the names from the local storage variable
    var namesList window.sessionStorage.namesList.split(",");

    //grab the next name and update the list
    var nextName namesList.shift();
    window.sessionStorage.namesList namesList.join(",");

    //fill in the name and submit the form
    document.forms[0].elements[0].value nextName;
    document.forms[0].submit(); 
    That's the gist of it. (Hope I didn't just give any spammers any ideas )

    The installation will vary by browser:
    - For Chrome, check the docs for userscripts
    - For Firefox, look for the Greasemonkey addon
    - For Opera, you can either make an Opera extension or stick it in the monolithic user.js file
    - IE and Safari - I don't know
    Ken S. - RateLobby
    Collect & Display Real Customer Testimonials
    Featured Reviews / Widgets / Dispute Resolution

Similar Threads

  1. Submit Your Proxy To Unique Proxy List! Uptime/Speed!
    By scribby in forum Advertising Offers
    Replies: 0
    Last Post: 11-12-2008, 11:38 PM
  2. Replies: 26
    Last Post: 12-14-2006, 06:01 PM
  3. Replies: 1
    Last Post: 05-21-2006, 10:06 AM
  4. submit your hosting list ( FREE )
    By kicihost in forum Other Offers & Requests
    Replies: 1
    Last Post: 03-14-2005, 02:30 AM
  5. Replies: 23
    Last Post: 10-01-2004, 03:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •