Solved

awstats question

Posted on 2006-11-20
6
577 Views
Last Modified: 2008-02-01
Hello,

 I am trying to add authentication to my awstats.pl page. I already have the authentication script in my asp.net page. I want to check if the cookie is set in awstats.pl page, if not redirect user to the login.aspx page. I am not familiar with perl, any help would be helpful,


thanks
0
Comment
Question by:tamilgirl77
  • 3
  • 3
6 Comments
 
LVL 18

Accepted Solution

by:
Morcalavin earned 500 total points
Comment Utility
use CGI;
$cgi = new CGI;
$cookievalue = $cgi->cookie('cookiename');
if($cookievalue ne "thevalueyouwant") {
     print redirect('http://yoursite/login.aspx');
}
0
 

Author Comment

by:tamilgirl77
Comment Utility
Hello,

 Thanks for your reply. It gives me following error:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
0
 
LVL 18

Expert Comment

by:Morcalavin
Comment Utility
Where are you putting it in your the awstats.pl page.  It will need to be present before any header information is sent to the browser.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:tamilgirl77
Comment Utility
Actually, I am not familiar with any perl. So I added the code at the top of the page. Can you tell me where exactly i should add this code,

thanks
0
 
LVL 18

Expert Comment

by:Morcalavin
Comment Utility
I'm not sure.  I'm not familiar with awstats.pl code and how the are handling the html.
0
 

Author Comment

by:tamilgirl77
Comment Utility
Thank you Morcalavin, with trial and error i got the code to work,

Thanks for your immediate help,
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now