Solved

awstats question

Posted on 2006-11-20
6
588 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
ID: 17979983
use CGI;
$cgi = new CGI;
$cookievalue = $cgi->cookie('cookiename');
if($cookievalue ne "thevalueyouwant") {
     print redirect('http://yoursite/login.aspx');
}
0
 

Author Comment

by:tamilgirl77
ID: 17980050
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
ID: 17980080
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:tamilgirl77
ID: 17980152
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
ID: 17980200
I'm not sure.  I'm not familiar with awstats.pl code and how the are handling the html.
0
 

Author Comment

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

Thanks for your immediate help,
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

21 Experts available now in Live!

Get 1:1 Help Now