Hi,

  About the three param's that I am using in my code, all of these are meant to 
be passed on using GET. My problem is that I am not sure if the reason why 
http://192.168.10.63/file_linux.php?id=123 prints out something like: Cannot 
create directory Cannot create directory Cannot create directory, since the 
directory /var/www/html/hello does exist.

   If this is a permission problem, then why am I not getting something that 
says Permission denied? And, would you have suggestions on how I can fix this? 
I am currently running this on Apache with Linux.

Thanks for your help.

Alice

-----Original Message-----
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2008 9:49 PM
To: beginners@perl.org
Subject: Re: Passing Variables to Perl through HTTP

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/



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to