Thread: Auto POST

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Auto POST

    The project i am working on requires the HTML POST data to be sent automatically to a local server... Without the user pressing any button on a HTML page etc..

    This needs to be done untill the local server BAN's the IP. The problem is how do i send the POST data like that.. if it was GET i could just create the URL and use a software to check that URL any number of times.. Can a JAVA script or some software send the required POST data required number of times...


    Help would be appreciated

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    why are you doing that?

    from a webpage? easiest way I can think of is in a flash movie. you can post very easily and repeatedly in flash.

    in an app? there's always a WinInet looping post thing. shouldn't be more than a few lines of code
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Doesn't sound like the nicest thing to make...

  4. #4
    Much older and wiser Fountain's Avatar
    Join Date
    Dec 2001
    Location
    Engeeeerland
    Posts
    1,158
    Originally posted by -KEN-
    Doesn't sound like the nicest thing to make...

    Yeh, why are you doing this?
    Such is life.

  5. #5
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    I am doing it to test and debug our colleges intranet posting board.. since some students last week started bombarding the server and crashed it.. I am incharge of this thing. So i have to generate continous post requests.. and the ASP page on the server has to add the IP to the list if too much POST data comes from a PC.

  6. #6
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    i guess you can do a javascript function that opens a child window in the background, and that child window loops sending the post?

  7. #7
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    can any one here please give an example or a small java script code snipet on how to do it...

  8. #8
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    can you use a perl script?
    Code:
    #!/usr/bin/perl
    
    %form = ( key1 => "key1value",   # whatever you want to post goes here, fairly straightforward.
              key2 => "key2value",
    	  key3 => "key3value" );
    
    use URI::URL;
    use LWP::UserAgent;
    
    while(1)
    {
     $ua = new LWP::UserAgent;  
     my $curl = url("http:");
     $curl->query_form(%form);
     my $req = new HTTP::Request 'POST',
     "http://www.singtel-mobile.com/products_services/online_services/sms.html"; # your url here
     $req->content_type('application/x-www-form-urlencoded');
     $req->content($curl->equery);
     print $ua->request($req)->as_string; #this will print the results, comment it out if you feel it slows things down too much.
    }
    Last edited by Brian; 06-07-2003 at 08:00 AM.

  9. #9
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Thanx for your help but i cannot use perl script.. Java script would be appreciated

  10. #10
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Originally posted by vasanth
    Thanx for your help but i cannot use perl script.. Java script would be appreciated
    of course you can.

    get activeperl from here:
    http://downloads.activestate.com/Act...SWin32-x86.msi

    then install, then open a DOS box (command prompt)
    and type

    set path=%path%;c:\perl\bin
    (or wherever the binaries were installed)

    then save that script as a text file
    and run it from the command line by typing
    perl whatever.pl

  11. #11
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    thanx.. it works now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help (Trying to post message)
    By mrkm in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 10-06-2003, 04:05 PM
  2. Post your Best Text Adventure
    By Joe100 in forum Game Programming
    Replies: 3
    Last Post: 08-15-2003, 05:47 PM
  3. post update
    By iain in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-12-2001, 10:47 AM