Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]Błąd syntax error, unexpected
czona
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 17.05.2007

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


Mój skrypt to:
  1. <DOCTYPE HTML PUBLIC "//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  5. <title>Motór nie odpalił
  6. </title>
  7. </head>
  8. <body>
  9. <?php
  10. $filesPath = "./";
  11. function checkFileName($name)
  12. {
  13. $plik = array(
  14. "motor.avi"
  15. );
  16. return array_search($name, $plik);
  17. }
  18. function send($fileName, $filePath)
  19. {
  20. if(!file_exists($filePath.$fileName)){
  21. return false;
  22. }
  23. $fd = fopen($filePath.$fileName,"r");
  24. $size = filesize($filePath.fileName);
  25. $contents = fread($fd, filesize($filePath.$fileName));
  26.  
  27. fclose($fd);
  28.  
  29. header("Content-Type: video/x-msvideo");
  30. header("Content-Lenght: $size;");
  31. header("Content-Disposition: attachment; filename=$fileName");
  32.  
  33. echo $contents;
  34. return true;
  35. }
  36.  
  37. if(isSet($_GET['name']) === false){
  38. include "nofile.html";
  39. }
  40. else{
  41. if (!send($_GET['name'], $filesPath)){
  42. include "nofile.html";
  43. }
  44. }
  45. }
  46. else{
  47. include "nofile.html";
  48. }
  49. ?>
  50. </body>
  51. </html>

prosze o pomoc w związku z błędem:
Parse error: syntax error, unexpected '}' in C:\Program Files\Apache Group\Apache2\htdocs\download.php on line 45

Ten post edytował czona 18.05.2007, 17:46:21
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.08.2025 - 16:55