Wei, Alice J. wrote:
This may be a very dumb question, but I am having the problem of
putting the variables on the url through Perl to get it to execute
the following mkdir command.
#!/usr/bin/perl -w
use CGI qw(:standard -debug);
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
$id = param('id');
$filename = "/var/www/html/hello";
if (-e $filename)
{
mkdir("/var/www/html/hello/$id", 0755) || print "Cannot create directory";
mkdir("/var/www/html/hello/$id/test", 0755) || print "Cannot create
directory";
mkdir("/var/www/html/hello/$id/test2", 0755) || print "Cannot create
directory";
}
else {
&createFile;
}
Basically, everything is working fine, except the fact that I have to
do this through the Command line by pushing the value pairs to get my
perl script to do things. I tried using
http://192.168.10.63/file_linux.php?id=123, but it does not feed the
id into the appropriate variable of where I want it to go to.
How did you reach that conclusion? The above code does not help you
determine whether $id was assigned the value '123'. Did you try to
simply print the variable?
Since you say that the code works from the command line, I'd suspect
that you have a permissions problem, i.e. the web server does not have
sufficient permissions to create directories under /var/www/html/hello.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/