I am trying to write a script that will send a user to a certain webpage
based on the refering url.  I am embedding it in a .shtml page as an
include.  There are 3 urls that I will redirect to based on the refering
url.  The way it is now, if I type in the url
"http://www.mysite.com/atlhmbnk/index.shtml"; in my browser, I get a web page
that reads, "This is atlcas."

If I type in the url "http://www.mysite.com/atlcas/index.shtml"; in my
browser, I get a webpage that reads, "This is atlcas."

If I type in the url "http://www.mysite.com/brook/index.shtml"; in my
browser, I get a webpage that reads, "This is atlcas."

If I include the redirect.pl file in a file named test.pl to test the else
statement, I still get a webpage that reads, "This is atlcas."

Any assistance would greatly be appreciated.

Thanks,
Andrew

########################################################

#!/usr/bin/perl -w
use CGI;
use strict;

my $q = new CGI;

my $referer = $q->referer;
my $onesite_atlhmbnk =
$q->param("http://www.mysite.com/atlhmbnk/index.shtml";);
my $onesite_atlcas = $q->param("http://www.mysite.com/atlcas/index.shtml";);
my $onesite_brook = $q->param("http://www.mysite.com/brook/index.shtml";);

if ($referer eq $onesite_atlcas) {
print $q->header("text/html"),
      $q->start_html,
      $q->p("This is atlcas"),
      $q->end_html;
}


elsif ($referer eq $onesite_atlhmbnk) {
print $q->header("text/html"),
      $q->start_html,
      $q->p("This is atlhmbnk"),
      $q->end_html;
}


elsif ($referer eq $onesite_brook) {
print $q->header("text/html"),
      $q->start_html,
      $q->p("This is brook"),
      $q->end_html;
}

else {
print $q->header("text/html"),
      $q->start_html,
      $q->p("$q->referer is not a valid.  Please check the address and try
again."),
      $q->end_html;
}

###################################################

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to