Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]problem z pewnym skryptem
cubix
post
Post #1





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

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


Mam problem. Otóż mam skrypt blogowy i przy zakładaniu bloga nie wyświetla mi obrazku z kodem, a na górze strony mam coś takiego:

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/freehost/b/e/beafighter/www/includes/logincheck.php on line 11

Warning: file(http://beafighter.lua.pl/uip/?uip=83.23.215.153) [function.file]: failed to open stream: no suitable wrapper could be found in /home/freehost/b/e/beafighter/www/includes/logincheck.php on line 11

Warning: implode() [function.implode]: Bad arguments. in /home/freehost/b/e/beafighter/www/includes/logincheck.php on line 11

plik logincheck.php

  1. <?
  2. //error_reporting(0);
  3. $uid ="";
  4. if($_COOKIE[blog_user] and $_COOKIE[blog_pass])
  5. {
  6. $q = mysql_query("select * from ".$table_prefix."_users where user='$_COOKIE[blog_user]' and pass='$_COOKIE[blog_pass]'");
  7. while($l = mysql_fetch_array($q))
  8. {
  9. if($l[location] =="")
  10. {
  11. $country = implode("",file("http://devzone.gorani.net/uip/?uip=".$_SERVER['REMOTE_ADDR']));
  12. }else{
  13. $country = $l[location];
  14. }
  15. mysql_query("UPDATE `".$table_prefix."_users` SET `lastvisit`='".time()."', location='$country' WHERE `Id`=$l[Id];");
  16. $uid = $l[Id];
  17. $ustat = $l[cat];
  18. $user = $l[user];
  19. $pname = $l[rname];
  20. $mudata = $l;
  21. $q2 = mysql_query("select * from ".$table_prefix." where uid='$uid'");
  22. while($l2 = mysql_fetch_array($q2))
  23. {
  24. $blogid = $l2[Id];
  25. $blogurl = $l2[bname];
  26. $mbdata = $l2;
  27.  
  28.  
  29. $totsize = 0;
  30. $q3 = mysql_query("select * from ".$table_prefix."_fotos where uid='$uid'");
  31. while($l3 = mysql_fetch_array($q3))
  32. {
  33. $totsize = $totsize + filesize("fotofiles/$l3[fotofile].jpg") + 1000; 
  34. }
  35. $totspace = $user_space;
  36. $frespace = $totspace - $totsize;
  37. $usperc = round(($totsize / $user_space)*100);
  38. $frperc = 100 - $usperc;
  39.  
  40.  
  41. }
  42. if($_GET[page] !="register" and $blogurl =="")
  43. {
  44. $_GET[page] = "register";
  45. }
  46. }
  47. }
  48. ?>


Proszę o odpowiedź.
Powód edycji: dodalem tag (cysiaczek)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
em1X
post
Post #2





Grupa: Zarejestrowani
Postów: 984
Pomógł: 41
Dołączył: 16.03.2002
Skąd: Płock

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


Znaczy czytać nie umiesz? Czy nie umiesz angielskiego?

Cytat
URL file-access is disabled in the server


To oznacza, że taki kontekst, przez który próbujesz otworzyć plik jest niedozwolony. Na tym serwerze nie można otworzyć pliku zdalnego (tj. http://xxx)
  1. <?php
  2. file("http://devzone.gorani.net/uip/?uip=".$_SERVER['REMOTE_ADDR'])
  3. ?>


co jednoznacznie potem implikuje następny napisany przez Ciebie błąd
Cytat
Warning: implode() [function.implode]: Bad arguments. in /home/freehost/b/e/beafighter/www/includes/logincheck.php on line 11


bo skoro nie otworzono pliku i nie stworzono tablicy, to funkcja implode jest bezużyteczna.

Ten post edytował em1X 8.02.2008, 01:41:58


--------------------
eh, co polska wódka to polska wódka
Go to the top of the page
+Quote Post
cubix
post
Post #3





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

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


ok, wytłumaczyłeś o co chodzi. wielkie dzięki, ale ja nie wiem co w tej sytuacji mam zrobić ;( ?
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #4





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Możliwości

1. Włącz dyrektywę allow url fopen w php.ini (nie wiem, czy na pewno pomoże)
2. Pobierz sobie ten plik na serwer i wtedy a nim operuj (choć to jest skrypt, więc może być ciężko)
3. Użyj CURL" title="Zobacz w manualu PHP" target="_manual

Przenoszę na Przedszkole


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
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: 20.08.2025 - 04:40