1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

running ASP via scheduler

Discussion in 'Plesk for Windows - 8.x and Older' started by parser, Feb 21, 2005.

  1. parser

    parser Guest

    0
     
    How can i run asp file via scheduler?
    when i try
    D:\vhosts\vhosts\domain.com\httpdocs\aspfile.asp
    is not run,
    anybody?

    Thanks
    David
     
  2. bonezpat

    bonezpat New Pleskian

    22
    53%
    Joined:
    May 29, 2005
    Messages:
    18
    Likes Received:
    0
    this sounds interesting for me too!
    also with .net files (aspx).

    Is it possible? and if so how?

    Saludos
    Pat
     
  3. kalexan

    kalexan Guest

    0
     
    Asp scripts and scheduler

    Yes it is possible with a trick.

    You can trigger whatever script you want, even if it is no local, with the following code in php:
    PHP:
    if ($_GET['password']=='whatever')    {    
    $CR curl_init();                    
    curl_setopt($CRCURLOPT_URL"http://www.domain_name.com/what_ever_script.asp?parameter1=".$_GET['parameter1']);    
    curl_setopt($CRCURLOPT_FOLLOWLOCATION1);
    curl_setopt($CRCURLOPT_TIMEOUT60);
    curl_setopt($CRCURLOPT_POST1);
    curl_setopt($CRCURLOPT_POSTFIELDS"parameter2=".$_GET['parameter2']);
    curl_setopt($CRCURLOPT_RETURNTRANSFER1);
    curl_setopt($CRCURLOPT_SSL_VERIFYPEER0);
        
    $result curl_exec$CR );
    $error curl_error$CR );
        
    if( !empty( 
    $error )) {
    curl_close$CR );
    echo 
    'Error:'.$error;
    }
    curl_close$CR );
    echo 
    'Ok:'.$result ;
    }
    Save the previous code as cronJob.php
    At scheduler you define the following:

    Script path:
    c:\program files\swsoft\additional\php\php.exe
    (or wherever the php.exe file at your plesk installation is...)

    Parameters:
    c:\full_server_path_to_file\cronJob.php password=whatever parameter1=value1 parameter2=value2part1+value2part2

    Note that:
    - Parameters are passed without being splitted with the & symbol (we use spaces instead), and each value must contain the + symbol in case of spaces
    - php handles each parameter as a GET parameter
    - you can pass parameters to the final script both through POST and GET methods.

    CIao.
     
Loading...