I am working with a site that uses an outside source to work with payment transactions, one of the prerequisites is that on success a CGI script is called.
What I am wanting to know is it possible to do a redirect to a PHP page with the CGI script and have the PHP detect that it has been loaded via a Perl redirect, I currently have this is in my Perl.
#!/usr/bin/perl
#
# fixedredir.cgi
use strict;
use warnings;
my $URL = "http://www.example.com/";
Location: $URL;
The standard way to do CGI programming in Perl is using the CGI.pm module.
A redirect can be coded like this (not sure about the syntax).
I does not matter if the target page is PHP or whatever.
The other page can’t know for sure if it came from a “perl redirect” (actually the concept is rather absurd). If you have control over the other PHP page, you can set some convention and pass a parameter in the query string.
Update : As others have commented, the question really makes little sense – and some statements (“on success a CGI script is called”) suggest some basic misunderstandings about the basics of dynamic web pages and CGI. My example code shows how to make a redirect in Perl CGI, but it’s probable that the original question (and hence the answer) is inadequate for the real scenario.