Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Błedy na stronie
dark_root
post 22.10.2008, 22:09:03
Post #1





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

Ostrzeżenie: (10%)
X----


Jak próbuje dodać zdjęcie na mojej stronie poprze <input type=file...> wyskakuje mi taki błąd
  1. <?php
  2. [b]Warning[/b]:  date() expects parameter 2 to be long, string given in [b]/home/lech/domains/lech.pdg.pl/public_html/cars_class.php[/b] on line [b]228[/b]
  3.  
  4. [b]Warning[/b]:  fopen() expects parameter 1 to be string, array given in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]47[/b]
  5.  
  6. [b]Warning[/b]:  filesize() [[url="http://lech.pdg.pl/function.filesize"]function.filesize[/url]]: stat failed for Array in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]48[/b]
  7.  
  8. [b]Warning[/b]:  fread(): supplied argument is not a valid stream resource in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]48[/b]
  9.  
  10. [b]Warning[/b]:  fclose(): supplied argument is not a valid stream resource in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]49[/b]
  11.  
  12. [b]Warning[/b]:  move_uploaded_file(/home/lech/domains/lech.pdg.pl/public_html/org_pic/cid_avatar179243_1.gif) [[url="http://lech.pdg.pl/function.move-uploaded-file"]function.move-uploaded-file[/url]]: failed to open stream: Permission denied in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]61[/b]
  13.  
  14. [b]Warning[/b]:  move_uploaded_file() [[url="http://lech.pdg.pl/function.move-uploaded-file"]function.move-uploaded-file[/url]]: Unable to move '/tmp/phppef37u' to '/home/lech/domains/lech.pdg.pl/public_html/org_pic/cid_avatar179243_1.gif' in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]61[/b]
  15. error on moving
  16. ?>

Skrypt pliku, w którym wyskakują te błędy znajduje się tu http://ruben.pdg.pl/carphoto.txt.
Wie ktoś czemu one wyskakują?
Go to the top of the page
+Quote Post
nexis
post 22.10.2008, 22:23:53
Post #2





Grupa: Zarejestrowani
Postów: 1 012
Pomógł: 109
Dołączył: 26.09.2003
Skąd: nexis.pl

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


Błędy zdaje się dużo mówią - wystarczy je zrozumieć. A jeśli mamy naprawdę pomóc, to pokaż kod jaki stosujesz (link nie działa, a poza tym posty mają być źródłem informacji dla przyszłych zainteresowanych, więc umieść go na forum).

Ten post edytował nexis 22.10.2008, 22:24:45


--------------------
Zend Certified Engineer

Kliknij POMÓGŁ jeśli moja odpowiedź okazała się użyteczna!
Go to the top of the page
+Quote Post
dark_root
post 23.10.2008, 08:31:51
Post #3





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

Ostrzeżenie: (10%)
X----


Link do kodu u mnie działa. kodu na stronie podać nie mogę bo jest zbyt długi. Jeszcze raz podam link http://ruben.pdg.pl/carphoto.txt

Ten post edytował dark_root 23.10.2008, 08:32:08
Go to the top of the page
+Quote Post
nospor
post 23.10.2008, 08:45:43
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




bledy sa przeciez dosc oczywiste

date() expects parameter 2 to be long, string given - drugim argumentem funkcji date() jest liczba, a ty podajesz jakis string. W kodzie co pokazales nie ma date

fopen() expects parameter 1 to be string, array given - fopen oczekuje stringa a ty mu dajesz tablice
W kodzie masz: fopen($_FILES["pics"]["tmp_name"], 'rb');
wnioskujac po twoim wczesniejszym kodzie, widze ze masz tam tablice plikow do uploadu. Powinno byc wiec:
fopen($_FILES["pics"]["tmp_name"][$ctrP], 'rb');

Pisz troche uwazniej


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
-gox-
post 23.10.2008, 11:40:04
Post #5





Goście







Moge offtopnac?

co daje rb, ab, wb, czym rozni sie od r, a, w ?
przec chwile myslalem ze zastepuje flock() ale nie ;p
Go to the top of the page
+Quote Post
nospor
post 23.10.2008, 11:42:25
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




w manualu masz to napisane:
http://pl.php.net/manual/pl/function.fopen.php
Cytat
Windows oferuje flagę ('t') konwertującą tryb tekstowy, która przezroczyście przekłada \n na \r\n kiedy pracujesz z plikiem. Dla kontrastu, możesz także uzyć 'b' aby wymusić tryb binarny, wtedy nie będzie konwertować twoich danych. Aby użyć tych flag, wstaw 'b' lub 't' jako ostatni znak w parametrze tryb .


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
dark_root
post 23.10.2008, 15:04:19
Post #7





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

Ostrzeżenie: (10%)
X----


Wielkie dzięki, usunąłem już większośc błędów. Jednak nie mogę się uporać z tym kawałkiem kodu linia 57-
  1. <?php
  2. if (move_uploaded_file($_FILES['pics']['tmp_name'][$ctrP], NEWPICPATH . "/" . $orgImageName) or die("error on moving"))
  3. ?>

Wyskakuje teraz taki komunikat
Kod
[b]Warning[/b]:  move_uploaded_file(/home/lech/domains/lech.pdg.pl/public_html/org_pic/cid_mode_hybrid.gif) [[url="http://lech.pdg.pl/function.move-uploaded-file"]function.move-uploaded-file[/url]]: failed to open stream: Permission denied in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]57[/b]

[b]Warning[/b]:  move_uploaded_file() [[url="http://lech.pdg.pl/function.move-uploaded-file"]function.move-uploaded-file[/url]]: Unable to move '/tmp/phpxAFT1Z' to '/home/lech/domains/lech.pdg.pl/public_html/org_pic/cid_mode_hybrid.gif' in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]57[/b]
error on moving

Co jest nie tak?

Ten post edytował dark_root 23.10.2008, 15:11:31
Go to the top of the page
+Quote Post
Lars
post 23.10.2008, 15:17:06
Post #8





Grupa: Zarejestrowani
Postów: 279
Pomógł: 15
Dołączył: 29.04.2005
Skąd: Gdynia

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


Spróbuj copy().


--------------------
(\.../) This is Bunny. Copy and paste bunny into
(O.o) your signature to help him gain world domination.
(> <) Zanim zapytasz | Też się przyda | Pomogłem ci? Kliknij "Pomógł"
Go to the top of the page
+Quote Post
dark_root
post 23.10.2008, 15:44:16
Post #9





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

Ostrzeżenie: (10%)
X----


Popróbuje jeszcze z move_uploaded_file. Pokombinowałem trochę i doszedłem do wniosku, że to NEWPICPATH . "/" wszystko psuł. Zmieniłem go i teraz wyskakuje takie coś
Kod
[b]Warning[/b]:  move_uploaded_file() [[url="http://lech.pdg.pl/function.move-uploaded-file"]function.move-uploaded-file[/url]]: SAFE MODE Restriction in effect.  The script whose uid is 13637 is not allowed to access / owned by uid 0 in [b]/home/lech/domains/lech.pdg.pl/public_html/carphoto.php[/b] on line [b]57[/b]
error on moving
Jakieś pomysły na pozbycie się go?
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 Wersja Lo-Fi Aktualny czas: 5.07.2025 - 23:29