Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Link do pliku prośba o pomoc
acess
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.05.2009

Ostrzeżenie: (0%)
-----


Witam

Jak zrobić z tej linii odnośnik do pliku wgranego na serwer ?

  1. <?php
  2. print "<br>Orignal Filename:".$_POST["file_name_orig"][$i];
  3. ?>


Dokładnie chodzi o ten wiersz:


  1. <?php
  2. ".$_POST["file_name_orig"][$i];
  3. ?>


jak i gdzie zagnieżdzić
  1. <a href ... </a>
?

Ten post edytował acess 23.05.2009, 17:06:21
Go to the top of the page
+Quote Post
Flo
post
Post #2





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 25.05.2008
Skąd: Bydgoszcz

Ostrzeżenie: (0%)
-----


Kod
<?php
print '<br>Orignal Filename: <a href="#">'.$_POST["file_name_orig"][$i].'</a>';
?>
Go to the top of the page
+Quote Post
ikssde
post
Post #3





Grupa: Zarejestrowani
Postów: 217
Pomógł: 40
Dołączył: 20.08.2008

Ostrzeżenie: (0%)
-----


Chyba raczej :

  1. <?php
  2. print 'Orginal filename: <a href="'.$_POST["file_name_orig"][$i].'"> costam </a>';
  3. ?>


Ten post edytował ikssde 23.05.2009, 21:06:37
Go to the top of the page
+Quote Post
acess
post
Post #4





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.05.2009

Ostrzeżenie: (0%)
-----


Niestety ani jeden kod anu drugi nie działa sad.gif wyskakuje błąd 500
Go to the top of the page
+Quote Post
ikssde
post
Post #5





Grupa: Zarejestrowani
Postów: 217
Pomógł: 40
Dołączył: 20.08.2008

Ostrzeżenie: (0%)
-----


Może podaj cały kod, czyli skąd bierzesz zmienną $i, oraz cały błąd jaki skrypt wyświetlił
Go to the top of the page
+Quote Post
acess
post
Post #6





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.05.2009

Ostrzeżenie: (0%)
-----


  1. <?php
  2. #!/usr/bin/perl
  3. use CGI;
  4. use strict;
  5. my $share_url = "http://mysite.com/uploads/";
  6. my $cgi = CGI->new();
  7.  
  8. my @file_fields = ('file_name','file_name_orig','file_size','file_status','file_descr','file_mime');
  9. my $h;
  10. @{$h->{$_}}=$cgi->param($_.'[]') for @file_fields;
  11.  
  12. #Files info
  13. print"Content-type: text/html\n\n";
  14. for(0..$#{$h->{file_name}})
  15. {
  16. print "<b>Filename:</b> $h->{file_name}->[$_]";
  17. print "<br><b>Orignal Filename:</b> $h->{file_name_orig}->[$_]";
  18. print "<br><b>File Size:</b> $h->{file_size}->[$_]";
  19. print "<br><b>File Status:</b> $h->{file_status}->[$_]";
  20. print "<br><b>File Description:</b> $h->{file_descr}->[$_]";
  21. print "<br><b>File MIME:</b> $h->{file_mime}->[$_]";
  22. print "<hr>";
  23. }
  24.  
  25. #Special & Form variables
  26. print "<br><b>Other variables:</b><br>";
  27. for my $x ($cgi->param())
  28. {
  29. next if grep{$x eq $_.'[]'}@file_fields;
  30. print"$x => ".$cgi->param($x)."<br>";
  31. }
  32. ?>


a błędu niema takowego , tylko białą strona i napis ERROR 500

Ten post edytował acess 24.05.2009, 15:30:01
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 12:34