Hello,
Iam trying to password protect a script show.pl to be exact but not all of it just specific function in it.
if( param('Αποστολή') )
{
if ( ($name eq 'delete') or ($name eq 'deletelog') or ($name eq 'dr
+op')) {
if ($ENV{REMOTE_USER} eq 'Nik') {
if ($name eq 'delete') {
$dbh->do( "DELETE FROM guestbook WHERE name=$pray" );
push @print_later, span( {class=>'lime'}, "Μόλις διαγρά
+ψατε τον χρήστη => " );
exit 0;
}
elsif ($name eq 'deletelog') {
$dbh->do( 'DELETE FROM guestlog' );
push @print_later, span( {class=>'tip'}, "Η βάση δεδομένω
+ν με τα logs μόλις διαγράφηκε!" );
push @print_later, span( {class=>'yellow'}, $pray );
exit 0;
}
elsif ($name eq 'drop') {
$dbh->do( 'DELETE FROM guestbook' );
push @print_later, span( {class=>'tip'}, "Όλες οι εγγραφέ
+ς διαγράφηκαν από τη βάση δεδομένων!" );
exit 0;
}
}
else {
print header(-status=>'401 Unauthorized', 'WWW-Authenticate'=
+>'Basic realm="Only Nik can do perform that!"');
}
}
They told me to create a location configuration directive on httpd.conf which i did but remove the Require user Nik which i did and in fact when at the form a user gives soemthing as delete a drop the http auth box pops in but i cannot be vbalidatind as user. Any ideas?
Also i had a problem with a header which should have been print befoe any other print statement and so i had to to push every print in an array and print at the end of the script after the header.
But i dont like the idea of pushing things to an array very much isnt any other way to pop a http auth box when a requested feature/function of my cgi-script needs to be run fopr example if the user enters a "delete" or "drop" value at my @name variable?
I hope i agve you to understand what iam about to do.