Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem ze skrpytem hostingu blogów.
andegrand2
post 4.02.2009, 01:29:38
Post #1





Grupa: Zarejestrowani
Postów: 96
Pomógł: 0
Dołączył: 19.10.2007

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


Witam,

Otrzymałem w prezencie od znajomego fajny skrypcik hostingu blogów smile.gif Jak twierdził za nic nie mógł go odpalić jednak mo drobnych modyfikacjach pliku .htaccess i config.php udało się. Jednak mam kilka innych problemów.
Oto 1 z nich smile.gif

-Importuję sobie baze danych SQL i wszystko działa poza jedną linią kodu:
Kod
INSERT INTO `blog` VALUES (1, 'admin', 'Official Blog', 'spring.css', '1140030959', '1132405401', '1', '20', '1', '3', '', '', '', '', '', '1', '480726000', NULL, 3492, '');


php my admin wyrzuca to:

Kod
Błąd
     zapytanie SQL:

               INSERT  INTO  `blog`
VALUES ( 1,  'admin',  'Official Blog',  'spring.css',  '1140030959',  '1132405401',  '1',  '20',  '1',  '3',  '',  '',  '',  '',  '',  '1',  '480726000',  NULL , 3492,  ''  );

    

      MySQL zwrócił komunikat: [url="http://dev.mysql.com/doc/refman/error-messages-server.html"][img]https://sql.sznajdrowicz.nazwa.pl/mysql5/themes/original/img/b_help.png[/img][/url]

  #1136 - Column count doesn't match value count at row 1


Problem numer 2:

W panelu admina na samej górze mam taki błąd:

Kod
Warning:  file(http://sznajdrowicz.nazwa.pl/blog212.106.22.116) [[url="http://sznajdrowicz.nazwa.pl/blog/admin/function.file"]function.file[/url]]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found  in /home/sznajdrowicz/ftp/blog/includes/logincheck.php on line 11

  Warning:  implode() [[url="http://sznajdrowicz.nazwa.pl/blog/admin/function.implode"]function.implode[/url]]: Invalid arguments passed in /home/sznajdrowicz/ftp/blog/includes/logincheck.php on line 11
[b]

Oto plik logincheck.php[b]

  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. ?>


Dodatkowo jak wylogowuje się z admina wyrzuca jeszcze to:

Kod
Warning: Cannot modify header information - headers already sent by (output started at /home/sznajdrowicz/ftp/blog/includes/logincheck.php:11) in /home/sznajdrowicz/ftp/blog/includes/functions.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/sznajdrowicz/ftp/blog/includes/logincheck.php:11) in /home/sznajdrowicz/ftp/blog/includes/functions.php on line 230

Warning: Cannot modify header information - headers already sent by (output started at /home/sznajdrowicz/ftp/blog/includes/logincheck.php:11) in /home/sznajdrowicz/ftp/blog/includes/functions.php on line 231


Będe bardzo wdzięczny za pomoc smile.gif


Pozdrawiam,

Ten post edytował andegrand2 4.02.2009, 01:33:12


--------------------
http://zamojski.orgs.pl/ - Serwer Counter Strike 1.6

http://mobilesite.pl/ - Blog nowości technicznych
Go to the top of the page
+Quote Post
Pilsener
post 4.02.2009, 13:40:32
Post #2





Grupa: Zarejestrowani
Postów: 1 590
Pomógł: 185
Dołączył: 19.04.2006
Skąd: Gdańsk

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


1.
  1. INSERT INTO `blog` VALUES (1, 'admin', 'Official Blog', 'spring.css', '1140030959', '1132405401', '1', '20', '1', '3', '', '', '', '', '', '1', '480726000', NULL, 3492, '');
- złe zapytanie. Składnia jest następująca:
  1. INSERT INTO tabela (pole1,pole2,pole3) VALUES(wartosc1,'tekst2',wartosc3)
- używanie innej składni jest bez sensu, bo drobna operacja typu przesunięcie pola w tabeli powoduje potężny dzwon. Zmień zapytanie na poprawne.


2. Wczytujesz plik do tablicy funkcją file - NIE ZAWSZE możesz to zrobić przez protokół http, taki kod jest absolutnie niezalecany i uzależnia poprawne działanie skryptu od konfiguracji serwera. Jeśli musisz pobrać plik z innej lokalizacji użyj socketów albo curl, jeśli z serwera na którym stoi strona to podajesz ścieżkę do pliku, a nie jego adres url.
Go to the top of the page
+Quote Post
andegrand2
post 8.02.2009, 19:29:03
Post #3





Grupa: Zarejestrowani
Postów: 96
Pomógł: 0
Dołączył: 19.10.2007

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


Dzięki za odpowiedz. Na razie próbuje rozwiązać problem z mysql ale próbuje wszystkie i zawsze mam ten sam błąd.

Pozdrawiam

Mógłby mi ktoś napisać jak powinna wyglądać ta funkcja w mygql ?

Pozdrawiam

Odświeżam


--------------------
http://zamojski.orgs.pl/ - Serwer Counter Strike 1.6

http://mobilesite.pl/ - Blog nowości technicznych
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: 12.07.2025 - 22:57