NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Simple CGI Script - PLEASE HELP!!!

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 02-13-2005, 08:15 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Feb 2005
Posts: 2
ak47bih is an unknown quantity at this point
 



Simple CGI Script - PLEASE HELP!!!


I am trying to do a simple CGI script that checks the referer and if referrer is valid, displays one thing, if not, displays another (I know very little about cgi/perl, by the way). Now here's what i have so far:

#!/usr/bin/perl

if (($ENV{'HTTP_REFERER'} eq "http://www.top-dollars.com/blank.htm") ||
($ENV{'HTTP_REFERER'} eq "http://top-dollars.com/blank.htm"))
????: NamePros.com http://www.namepros.com/programming/69969-simple-cgi-script-please-help.html
{
print "Content-type: text/html\n\n";
print "<html><head><title>Sucess!</title></head>
<body bgcolor=white>
<p></p><p><center><font face=\"Verdana, Arial\" color=red size=\"3\"><b>GOOD REFERER!</b></font></center></p>
</body></html>";
exit;
}
else {
print "Content-type: text/html\n\n";
print "<html><head><title>Error!</title></head>
<body bgcolor=white>
<p></p><p><center><font face=\"Verdana, Arial\" color=red size=\"3\"><b>Invalid referer</b></font></center></p>
</body></html>";
exit;
}
###############################

The problem is, it goes to the "else" page even if the refered is valid!? What am i missing??? Thanks.
ak47bih is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:17 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger