Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Nie działający header (?)
daniel333
post
Post #1





Grupa: Zarejestrowani
Postów: 28
Pomógł: 0
Dołączył: 18.08.2011

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


Cześć,
Mam taki kod, który ładuje mi zdjęcie na serwer. Po załadowaniu zdjęcia chcę przejść do innej strony i... nie przechodzę :|

  1. <?php
  2. $result = 0;
  3. if ($_FILES['myfile']['type']=="image/gif"||$_FILES['myfile']['type']=="image/jpeg"||$_FILES['myfile']['type']=="image/png") {
  4. $destination_path = getcwd()."/upload".DIRECTORY_SEPARATOR;
  5. $target_path = $destination_path . basename( $_FILES['myfile']['name']);
  6. if(move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
  7. $result = 1;
  8. }
  9. }
  10. if($result == 1) header('Location: zaladowano.html');
  11. else header('Location: niezaladowano.html');
  12. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
abort
post
Post #2





Grupa: Zarejestrowani
Postów: 590
Pomógł: 107
Dołączył: 25.10.2011

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


E, chwila. Coś mi się wydaje, że w header() trzeba dać pełny adres...
  1. header ("Location: http ://www.mojastrona.com/katalog/plik.html");


P.S.
uwaga na spację po "http" i przed dwukropkiem - ma jej nie być - ale bez tej spacji pehapowe bbcode głupieje... (IMG:style_emoticons/default/smile.gif)

Ten post edytował abort 9.11.2012, 23:01:20
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 - 14:13