I want to build a web application that calls a SAS stored process and prints the results. I want the authentication to be handled behind the scenes.
The web application is built in PHP and I'll be using CURL to make the request.
Is this possible? What CURL options are necessary?
First ensure your stored process web server is configured correctly by following the instructions located here.
Create a .php file containing the below code.
Configure the following:
Once you have configured it, enter the URL of the .php file into your browser's address bar. You should see the output:
The PHP code listed used the minimum # of options required to work. It assumes that at some point you may also want to parse the header data to determine the CONTENT-TYPE of the result.
Also, when implementing the above code, be sure that any user credentials are stored securely. It is never a good idea to hardcode user credentials into source code (even if the SAS password has been run through PWENCODE).