Avatar billede 1115822 Nybegynder
15. juni 2001 - 11:12 Der er 2 kommentarer og
1 løsning

Hvordan og hvor...?

Hejsa:

Jeg skal angive: The absolute path.
The absolute path er:      /Opgaver/
Og jeg ved at den skal sætte i denne linie, altså
    if($Data =~ /\\/$/) {
Jeg ved bare ikke om jeg skal sætte den efter før, slette noget og sætte den ind på midten eller hvad..?

Kan nogen hjælpe.?

--------------------------------------------------
    }
    }
    if($Data =~ /\\/$/) {
    print \"<FONT COLOR=\\\"#FF0000\\\">NOTE: Your variable \\$Data ends with a trailing slash. Please<BR>remove this trailing slash, upload the program again<BR>and run debug once more to see if you have a valid directory.</FONT><BR><BR>\\n\";
    }
Avatar billede 1115822 Nybegynder
15. juni 2001 - 11:15 #1
En lille fejl fra mig

den skal sættes ind i denne..!
Around line 63 is the variable $Data. You will have to set this variable to the absolute path to the directory you created.



if(($ENV{\'QUERY_STRING\'} =~ /^debug/) && !$no_debug) {
    print \"Pragma: no-cache\\nContent-type: text/html\\n\\n\";
    print \"<TITLE>PSUpload Demonstration Upload Program - Debug Mode</TITLE></HEAD><BODY BGCOLOR=\\\"#ffffff\\\" TEXT=\\\"#330066\\\" LINK=\\\"#336666\\\" ALINK=\\\"#336666\\\" VLINK=\\\"#336666\\\" BGCOLOR=\\\"#FFFFFF\\\"><FONT SIZE=\\\"2\\\" FACE=\\\"verdana, arial, helvetica\\\">\\n\";
    print \"<CENTER><B><H2>Charity Ware\'s PSUpload Program</H2></B><BR><BR><TABLE BORDER=0><TR><TD COLSPAN=2><FONT SIZE=\\\"2\\\" FACE=\\\"verdana, arial, helvetica\\\">\\n\";
    print \"<DL><DT><B>Your web root directory appears to be located at:</B><DD>$ENV{\'DOCUMENT_ROOT\'}<BR><BR><DT><B>You specified directory for storing the uploads is:</B><DD>$Data<BR><BR><DT><B>Your specified directory...</B><DD>\\n\";
    if(-d $Data) {
    print \"...appears to be a valid directory.<BR><BR>Make sure this \\$Data directory is CHMOD 777.\\n\";
    } else {
    print \"...does not appear to be a valid directory.<BR><BR>\\n\";
    unless($Data =~ /^$ENV{\'DOCUMENT_ROOT\'}/) {
        print \"The value you specified in the \\$Data variable is incorrect. Please<BR>correct your \\$Data variable and run debug again.<BR><BR>\\n\";
    }
    }
    if($Data =~ /\\/$/) {
    print \"<FONT COLOR=\\\"#FF0000\\\">NOTE: Your variable \\$Data ends with a trailing slash. Please<BR>remove this trailing slash, upload the program again<BR>and run debug once more to see if you have a valid directory.</FONT><BR><BR>\\n\";
    }
    print \"</DL><BR><BR></FONT></TD></TR><TR><TD WIDTH=\\\"50%\\\" VALIGN=\\\"TOP\\\"><FONT SIZE=\\\"2\\\" FACE=\\\"verdana, arial, helvetica\\\"><B>OS:</B><BR>$^O<BR><BR><B>Perl:</B><BR>$]</FONT></TD><TD VALIGN=\\\"TOP\\\"><FONT SIZE=\\\"2\\\" FACE=\\\"verdana, arial, helvetica\\\"><B>Installed:</B><BR>\"; my @inst = split(/\\//, $ENV{\'SERVER_SOFTWARE\'}); print join(\"<BR>\", @inst); print\"</FONT></TD></TR></TABLE><BR><BR><BR><BR><A HREF=\\\"http://www.charityware.ws/\\\">&copy; 2001, Jim Melanson</A></CENTER><BR><BR></FONT></BODY></HTML>\\n\";
} else {
    use CGI;
Avatar billede erikjacobsen Ekspert
15. juni 2001 - 11:16 #2
Dit program i Perl vil ikke have den sidste \"/\" - hvorfor er jo ikke godt at vide.
Man kan jo bare fjerne den, hvis den er der.

i stedet for hele if-sætningen kunne du jo prøve

$Data =~ s/\\/$//;

som bare fjerner den stille og roligt
Avatar billede 1115822 Nybegynder
15. juni 2001 - 11:19 #3
Jeg har lige fundet ud af det.....!!!!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester