Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Błąd w pliku PHP
Forum PHP.pl > Forum > PHP
RobertR
Witam wyświetla się taki błąd gry chcę dodać ogłoszenie
Cytat
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'o_images/20090206202758_1.jpg' is not a valid JPEG file in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 124

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 126

Warning: imagesx(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 131

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 132

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 134

Warning: imagesx(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 135

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 135

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 135

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 136

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 137

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 138

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'o_images/20090206202758_1.jpg' is not a valid JPEG file in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 140

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 142

Warning: imagesx(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 147

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 148

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 150

Warning: imagesx(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 151

Warning: imagesy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 151

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 151

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 152

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 153

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/accounts_t/themypl/public_html/ogloszenia/pad/include/function.php on line 154

jednak na dole pisze że ogłoszenie zostało poprawnie dodane. Gdy wchodzę w wymienione ogłoszenie widzę że błąd dotyczy zdjęć, ponieważ Ich nie wyświetla. Niżej dołączam link do pliku odpowiedzialnego za błędy
http://rapidshare.com/files/194820660/function.rar.html .
matixrr
Nie wrzucaj na RS bo jak Ci ludzie maja pomoc jak nie moga sciagnac? Tu wrzucam wersje z linku!

  1. <?
  2. $nazwa_sesji='pad_ogloszenia';
  3.  
  4. function connection() {
  5.  global $conn;
  6.  
  7.  include('config.php');
  8.  
  9. if ($conn)
  10.  return $conn;
  11. else {
  12.  $conn = mysql_connect ($mysql_host, $mysql_base, $mysql_pass);
  13.    if (!$conn || !mysql_select_db ($mysql_users, $conn))
  14.      return 0;
  15.    else
  16.      return $conn;
  17. }
  18. }
  19.  
  20. function query ($sqlquery) {
  21. if (!($conn = connection ()))
  22.  return 0;
  23. else {
  24.  $result = mysql_query ($sqlquery, $conn);
  25.    if (!$result)
  26.     echo "Błąd w zapytaniu!";
  27.    else
  28.     return $result;
  29. }
  30. }
  31.  
  32. function next_record ($result) {
  33. $ans = mysql_fetch_row ($result);
  34. return $ans;
  35. }
  36.  
  37. function records_qty ($result) {
  38. return (mysql_num_rows ($result));
  39. }
  40.  
  41. function check ($sql_zapytanie) {
  42. $sql_result = query ($sql_zapytanie);
  43. return records_qty ($sql_result);
  44. }
  45.  
  46. function sql_select ($sql_zapytanie) {
  47. $sql_result = query ($sql_zapytanie);
  48. $result[0][0] = records_qty ($sql_result);
  49.  
  50. for ($a = 1; $a <= $result[0][0]; $a++) {
  51.  $ans = next_record ($sql_result);
  52.  $result [$a] = $ans;
  53. }
  54. return ($result);
  55. }
  56.  
  57. function sql_update ($sql_zapytanie) {
  58. $sql_result = query ($sql_zapytanie);
  59. }
  60.  
  61. function sql_delete ($sql_zapytanie) {
  62. $sql_result = query ($sql_zapytanie);
  63. }
  64.  
  65. function sql_insert ($sql_zapytanie) {
  66. $sql_result = query ($sql_zapytanie);
  67. }
  68.  
  69. function idtodate($id){
  70.  $rok=substr($id,0,4);
  71.  $miesiac=substr($id,4,-8);
  72.  $dzien=substr($id,6,-6);
  73.  $data="$dzien-$miesiac-$rok";
  74.  return $data;
  75. }
  76.  
  77. function domyslny_plik($d_plik){
  78.  if ($d_plik == 0)
  79.    $wyjscie="ogloszenia.php";
  80.  else
  81.    $wyjscie="oczekujace.php";
  82.  return $wyjscie;
  83. }
  84.  
  85. function zdjecia($zdjecie, $ogl_id, $i){
  86.  //copy ($zdjecie, "../o_images/".$ogl_id."_".$i.".jpg");
  87.  move_uploaded_file($zdjecie, "o_images/".$ogl_id."_".$i.".jpg");
  88.  $source2 = imagecreatefromjpeg("../o_images/".$ogl_id."_".$i.".jpg");
  89.  
  90.  if(imagesy($source2)>150){
  91.    $new_height2 = floor(imagesy($source2)*(150/imagesx($source2)));
  92.    $new_width2 = 150;
  93.  }
  94.  else{
  95.    $new_width2 = imagesx($source2);
  96.    $new_height2 = imagesy($source2);
  97.  }
  98.  $dest2 = imagecreatetruecolor($new_width2,$new_height2);
  99.  imagecopyresampled($dest2,$source2,0,0,0,0,$new_width2,$new_height2,imagesx($source2),imagesy($source2));
  100.  imagejpeg($dest2,"../o_images/min_".$ogl_id."_".$i.".jpg",50);
  101.  imagedestroy($source2);
  102.  imagedestroy($dest2);
  103.  
  104.  $source = imagecreatefromjpeg("../o_images/".$ogl_id."_".$i.".jpg");
  105.  
  106.  if(imagesy($source)>400){
  107.    $new_height = 400;
  108.    $new_width = floor(imagesx($source)*(400/imagesy($source)));
  109.  }
  110.  else{
  111.    $new_width = imagesx($source);
  112.    $new_height = imagesy($source);
  113.  }
  114.  $dest = imagecreatetruecolor($new_width,$new_height);
  115.  imagecopyresampled($dest,$source,0,0,0,0,$new_width,$new_height,imagesx($source),imagesy($source));
  116.  imagejpeg($dest,"../o_images/".$ogl_id."_".$i.".jpg",50);
  117.  imagedestroy($source);
  118.  imagedestroy($dest);
  119. }
  120.  
  121. function zdjecia_user($zdjecie, $ogl_id, $i){
  122.  //copy ($zdjecie, "o_images/".$ogl_id."_".$i.".jpg");
  123.  move_uploaded_file($zdjecie, "o_images/".$ogl_id."_".$i.".jpg");
  124.  $source2 = imagecreatefromjpeg("o_images/".$ogl_id."_".$i.".jpg");
  125.  
  126.  if(imagesy($source2)>150){
  127.    $new_height2 = floor(imagesy($source2)*(150/imagesx($source2)));
  128.    $new_width2 = 150;
  129.  }
  130.  else{
  131.    $new_width2 = imagesx($source2);
  132.    $new_height2 = imagesy($source2);
  133.  }
  134.  $dest2 = imagecreatetruecolor($new_width2,$new_height2);
  135.  imagecopyresampled($dest2,$source2,0,0,0,0,$new_width2,$new_height2,imagesx($source2),imagesy($source2));
  136.  imagejpeg($dest2,"o_images/min_".$ogl_id."_".$i.".jpg",50);
  137.  imagedestroy($source2);
  138.  imagedestroy($dest2);
  139.  
  140.  $source = imagecreatefromjpeg("o_images/".$ogl_id."_".$i.".jpg");
  141.  
  142.  if(imagesy($source)>400){
  143.    $new_height = 400;
  144.    $new_width = floor(imagesx($source)*(400/imagesy($source)));
  145.  }
  146.  else{
  147.    $new_width = imagesx($source);
  148.    $new_height = imagesy($source);
  149.  }
  150.  $dest = imagecreatetruecolor($new_width,$new_height);
  151.  imagecopyresampled($dest,$source,0,0,0,0,$new_width,$new_height,imagesx($source),imagesy($source));
  152.  imagejpeg($dest,"o_images/".$ogl_id."_".$i.".jpg",50);
  153.  imagedestroy($source);
  154.  imagedestroy($dest);
  155. }
  156.  
  157. function tytul($tytul){
  158.  $s_len=strlen($tytul);
  159.  if (strlen($tytul) > 25){
  160.    for ($i=0;$i<25;$i++){
  161.     $new_t=$tytul[$i];
  162.     echo $new_t;
  163.    }
  164.    echo' ...';
  165.  }
  166.  else
  167.    echo $tytul;
  168. }
  169.  
  170. function tytul_ogl($str){
  171.  $str=str_replace(" ","_",$str);
  172.  $str=str_replace("ą","a",$str);
  173.  $str=str_replace("ć","c",$str);
  174.  $str=str_replace("ę","e",$str);
  175.  $str=str_replace("ł","l",$str);
  176.  $str=str_replace("ń","n",$str);
  177.  $str=str_replace("ó","o",$str);
  178.  $str=str_replace("ś","s",$str);
  179.  $str=str_replace("ż","z",$str);
  180.  $str=str_replace("ź","z",$str);
  181.  $str=str_replace("Ą","A",$str);
  182.  $str=str_replace("Ć","C",$str);
  183.  $str=str_replace("Ę","E",$str);
  184.  $str=str_replace("Ł","L",$str);
  185.  $str=str_replace("Ń","N",$str);
  186.  $str=str_replace("Ó","O",$str);
  187.  $str=str_replace("Ś","S",$str);
  188.  $str=str_replace("Ż","Z",$str);
  189.  $str=str_replace("Ź","Z",$str);
  190.  $str = strtolower($str);
  191.  $str = preg_replace('/[^a-z0-9_]/', '', $str);
  192.  return $str;
  193. }
  194. ?>
ayeo
Witaj!

Tak jak masz napisane: Plik nie jest poprawnym plikiem jpg. Pozostałe błędy to implikacja tego faktu.
Poza tym, do str_replace(); możesz przekazywać tablice winksmiley.jpg

Pozdrawiam!
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.