I have a web site written in classic AASP. The server supports PHP as well. I have a PHP script that resizes images, and need to execute that script from within the ASP code. I can call the PHP script from the web page via ajax, but would prefer to save the bandwidth and just have the ASP script call the PHP directly. It could be either asynchronously, or synchronously.

Thanks in advance!

Sloan

    Sounds more like an ASP question. There's two basic ways you can call the PHP script, either by having the ASP page make a request to your webserver or directly call the PHP executable (something analogous to PHP's [man]exec[/man] functions) to execute the script.

    Either way, I have no experience in ASP, so I can't really help you out as far as actually writing ASP code for either of the above scenarios.

      "having the ASP page make a request to your webserver or directly call the PHP executable (something analogous to PHP's exec functions) to execute the script."

      Thanks for the idea. I'll try the ASP server.execute function to see if it will execute the php script.

      What would the syntax to call the PHP script and pass the filename and a size?

        HumbleOne;10951954 wrote:

        What would the syntax to call the PHP script and pass the filename and a size?

        That would depend on how your webserver was setup. If it was properly configured, then PHP should be in the PATH environment variable, and you'll be able to do something like "php myscript.php parameter1 parameter2 parameter3".

        See this section in the manual for more information about invoking PHP from the command line: [man]features.commandline[/man].

          Thanks! That looks like it will work -- at lest a quick test did the trick!
          🙂

            Write a Reply...