SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    In a house in the USA
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access url through CURL on non anonymous access page

    I have a Windows 2003 Server running IIS and have disabled anonymous access. This is being used for a local Intranet webserver. We have disabled anonymous access so we can use single sign on with the custom PHP app we have created. However, I now have a script that I need to run through a scheduled task from the CLI and I do not have authorization to access it.

    I would use just the standard php.exe to access the php file, however I am using CodeIgniter framework which does not load the core of the framework while being accessed by just php.exe. Thus, the reason why I am having to use CURL to run my particular process via the servers website URL.

    Any suggestions?
    Daniel
    http://www.wlscripting.com - PHP Tutorials and code snippets
    Notepad++ Function List plugin tip - for PHP developers

  2. #2
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    In a house in the USA
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I found a workaround for trying to run a process via a scheduled task with IIS setup to not allow for Anonymous access. I created a separate php and added:
    PHP Code:
    <?php
    $ch 
    curl_init("myurl");
        
    curl_setopt($chCURLOPT_HEADER0);
        
    curl_setopt($chCURLOPT_POST1);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_USERPWD'username:password');
        
    curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_NTLM);
        
    $output curl_exec($ch);      
        
    curl_close($ch);
        echo 
    $output;
    ?>
    Anybody know of a better solution or would this be the best?
    Daniel
    http://www.wlscripting.com - PHP Tutorials and code snippets
    Notepad++ Function List plugin tip - for PHP developers


Bookmarks

Posting Permissions

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