Guest_imported
New member
- Jan 1, 1970
- 0
I'm making a part for my perl script to view administrators for my control panel.
It is supposed to take the username and password and put it in a table.
Here is what my code for that sub routine looks like:
sub view_admins {
print "Content-type: text/html\n\n";
open (FILE, ">/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi"
;
foreach my $username (keys %admin_profile) {
$admin_list = "<TR><TD>$username</TD><TD>$admin_profile{$username}</TD></TR>";
}
close FILE;
chmod(0777, "/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi"
;
print<<THIS;
<P>
<CENTER>
<TABLE WIDTH="92%" BORDER="1" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD><B>Username</B></TD><TD><B>Password</B></TD>
</TR>
$admin_list
</TABLE>
</CENTER>
THIS
}
When I go to the admin file I get the following error:
/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi did not return a true value at /home/puremadnezz/cgi-bin/test/admin.cgi line 10.
Like 10 on my script is:
require "/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi";
I know I am doing somthing totally wrong, but I can't find the problem. Please help me.
Also I was wondering if someone can write me a sub routine to delete administrators?
Thank you!! :-D
It is supposed to take the username and password and put it in a table.
Here is what my code for that sub routine looks like:
sub view_admins {
print "Content-type: text/html\n\n";
open (FILE, ">/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi"

foreach my $username (keys %admin_profile) {
$admin_list = "<TR><TD>$username</TD><TD>$admin_profile{$username}</TD></TR>";
}
close FILE;
chmod(0777, "/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi"

print<<THIS;
<P>
<CENTER>
<TABLE WIDTH="92%" BORDER="1" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD><B>Username</B></TD><TD><B>Password</B></TD>
</TR>
$admin_list
</TABLE>
</CENTER>
THIS
}
When I go to the admin file I get the following error:
/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi did not return a true value at /home/puremadnezz/cgi-bin/test/admin.cgi line 10.
Like 10 on my script is:
require "/home/puremadnezz/cgi-bin/test/variables/vars_admin.cgi";
I know I am doing somthing totally wrong, but I can't find the problem. Please help me.
Also I was wondering if someone can write me a sub routine to delete administrators?
Thank you!! :-D