Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simulate button click Q

    Hi.

    1) I would like to click the Download button on this site, then wait lets say 60 sec & click free download button.

    http://uploading.com/files/S4WYPP73/...r_ENG.rar.html

    I remember that somehow it is possible to create the Request URL & then input it into IE & the server will think I hit the button.

    But how can I make the URL? And how is it called? posting URL request?

    I will be using firefox or I can make HTML file & execute it in IE for every file.

    PHP Code:
    <form action="http://uploading.com/files/get/S4WYPP73/" method="post" id="downloadform">
            <
    input type="hidden" name="action" value="second_page" />
            <
    input type="hidden" name="file_id" value="4663720" /> 
    PHP Code:
        function do_step_1()
        {
            
    do_request('files''get', {file_id4663720action'step_1'}, function(wait_time){
                if(
    wait_time 0)
                    
    start_timer(wait_time);
                else if(
    wait_time <= 0)
                    
    download();
            });
        }

        function 
    do_step_2()
        {
            
    do_request('files''get', {file_id4663720action'step_2'});
        } 
    PHP Code:
        function download()
        {
                        $(
    '#waitblock').html('Free Download');
                $(
    '#waitblock').click(function(){
                    
    do_step_2();
                });
                } 
    Last edited by nature; 09-07-2009 at 08:57 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,919
    Thanks
    79
    Thanked 4,423 Times in 4,388 Posts
    Don't think you can do it. JavaScript can't do cross-domain scripting, which is what you would be trying to do. That is, you'd be trying to use JS code from your site/domain to click the button from the page on that other domain's page. And browsers don't allow that.

    You might or might not be able to do this with server-side coding, instead. Dunno.


  •  

    Posting Permissions

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