sammville
sammville

Reputation: 383

How do i call a CGI script from PHP

I have tried all the suggestions i have seen on how to do this but none seem to be working. Please how do i call an external CGI script (on another website) from a PHP script and collect the output of the script.

The URL given to me is something like this:

https://abc.com/cgi-bin/mbsn.cgi?
PRODUCT_ID=35277&ORDER_ID=12345&QUANTITY=1&FIRSTNAME=Sam&LASTNAME=K&E
[email protected]

Thanks.

Upvotes: 1

Views: 4832

Answers (1)

evan
evan

Reputation: 12535

What you want to do is get the results of a web page. It doesn't really matter that it's cgi.

PHP has several methods for doing this.

  1. file_get_contents() http://php.net/manual/en/function.file-get-contents.php
  2. curl() http://www.php.net/manual/en/curl.examples-basic.php

Either one of these should get you what you want.

Upvotes: 4

Related Questions