Solved

awstats question

Posted on 2006-11-20
6
596 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Script - Remove row of data based on column value 3 75
Awk Question 2 127
File Find regex problem 4 62
Perl tar error 8 66
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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

777 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