Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Parse error: syntax error, unexpected T_IF in
demek1987
post 1.02.2010, 23:27:23
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


mam tutaj błąd nie wiem co jest grane

Parse error: syntax error, unexpected T_IF in

Kod
if file_exists('torrent/file/'.md5($plik).'.torrent'),
            echo '<strong>jest przeniesiony</strong>',
            unlink($plik),
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 15)
Szeszek1992
post 1.02.2010, 23:35:28
Post #2





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Kod
if(file_exists('torrent/file/'.md5($plik).'.torrent'))
           { echo '<strong>jest przeniesiony</strong>';
            unlink($plik);}

PS. Forum to nie parser, przed napisaniem postu zastanów się, co jest nie tak, zajrzyj do manuala itp.


--------------------
Go to the top of the page
+Quote Post
demek1987
post 1.02.2010, 23:48:46
Post #3





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


czytałem... niestety tak jak wyzej jest wklejone sprawdzałem i także nie dziąła nie wiem co jest grane...
Go to the top of the page
+Quote Post
Szeszek1992
post 1.02.2010, 23:50:15
Post #4





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Pokaż cały kod.


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:02:06
Post #5





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


Kod
<?PHP
error_reporting(E_ALL);
@include 'init/php/funkcje_main.php';
$baza = polacz(); //połączenie z bazą danych

$cookie = 'cookie.txt';

$loginUrl = 'http://torrent-polska.info/login.php';
$login = 'xxx';
$password = 'xxx';
$useragent = 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3';

$ch = curl_init( $loginUrl );
curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie );
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie );
curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, 'uid='.$login.'&pwd='.$password );
curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
$afterLogin = curl_exec($ch);
curl_close($ch);

$kategorie = array('14|7','15|7','17|47','18|47','19|47','22|5','23|6','24|6','25|2','26|100','27|9','28|4','30|19','31|19','32|23','35|15','36|16','37|16','38|16','40|63','41|58','42|55','43|54','44|62','46|24','48|24','55|70','56|72','57|73','60|12','62|11','63|13');
$kategorie = array('14|7');
foreach ($kategorie as $jaka) {
        $x = explode('|',$jaka);
        echo $x[0].' '.$x[1].'<br/>';
        
        $ch = curl_init('http://torrent-polska.info/torrents.php?category='.$jaka.'');
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
        curl_setopt( $ch, CURLOPT_HEADER, 0);
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
        $profile = curl_exec($ch);
        curl_close($ch);
    
    //ttuaj jest cała zawartość
    
    $start = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    $profile = substr($profile,$start);
    $koniec = strpos($profile,'<TR><TD COLSPAN=2 align=center> <p align="center"><b>');
    $zawartosc = substr($profile,0,$koniec);
    
    $początek = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    $koniec = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    
    preg_match_all('/<div><tr><td class="block" height=20  colspan="2" align="center"><a href=(.+)><b><font color=royalblue>(.+)<\/b><\/font><\/a><\/td><\/tr><div style="padding-left: 6px"><TR>(.+)<p><A HREF=(.+)>Plik torrent<\/A>/Us',$zawartosc,$matches);
    
    preg_match_all('/<p><A HREF=download.php?id=(.+)>Plik torrent<\/A>/Us',$zawartosc,$matches);
    
    
    
    //poniżej pętla wyświetlająca pobrane rekordy
    for($i=0; $i<count($matches[1]); $i++) {
        echo '<img src="http://torrent-polska.info/torrentimg/'.substr($matches[4][$i],16,40).'.jpg" alt="" style="float:left;" />'; //img
        echo '<strong>Nazwa: '.$matches[2][$i].'</strong><br/>'; //nazwa pliku
        echo 'Link:'.$matches[1][$i].'<br/>'; //link do pliku (bez HTTP)
        echo 'Torrent:'.$matches[4][$i].'<br/>'; //link do torrenta
        echo '<div style="clear:both;" />';
        echo 'TorLin: '.substr($matches[4][$i],
        //$plik = $matches[4][$i];
        //$jp = 'http://torrent-polska.info/torrentimg/'.substr($matches[4][$i],16,40).'.jpg';
        
        $ch = curl_init('http://torrent-polska.info/'.$plik), //pobieranie torrta
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie),
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie),
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie),
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent ),
        curl_setopt( $ch, CURLOPT_HEADER, 0),
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' ),
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ),
        $fh = fopen($plik, 'w'),
        curl_setopt($ch, CURLOPT_FILE,$fh),
        curl_exec($ch),
        fclose($fh),
        curl_close($ch),
        
        //poniżej przenoszenie torrta
        if (file_exists('torrent/file/'.md5($plik).'.torrent'))
           { echo '<strong>jest przeniesiony</strong>';
            unlink($plik);}
        
        else
            rename($plik, 'torrent/file/'.md5($plik).'.torrent'),
            echo 'plik przeniesiony',
        
        
        
        //tutaj pobranie opisu
        $ch = curl_init('http://torrent-polska.info/'.$matches[1][$i]), //pobieranie torrta
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie),
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie),
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie),
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent ),
        curl_setopt( $ch, CURLOPT_HEADER, 0),
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' ),
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ),
        curl_setopt($ch, CURLOPT_FILE,$fh),
        $opis = curl_exec($ch),
        curl_close($ch),
        
        $start = strpos($opis,'<div style=\'padding-left:5px; padding-right:12px;  padding-top: 10px; padding-bottom: 10px;\' align="left">
')+106,
        $opis = substr($opis,$start),
        $koniec = strpos($opis,'</div>'),
        $opis = substr($opis,0,$koniec),
        $opis = str_replace("<img border=0 src=\"http://torrent-polska.eu/torrentimg/6abe970f204d632679f091b3122e1ef3d9162d71.gif\">", " ", $opis),
        echo $opis.'<br/>';
        echo '<hr/>',
    }

}
    $plik = 'download.php*.torrent';
    
$zap = mysql_query("SELECT * FROM `torrent` WHERE `kategoria` = '".$jaka[1]."' ORDER BY `id` DESC LIMIT 10");
while ($odp = mysql_fetch_array($zap)) {
    echo $odp['tytul'].'<br/>';
}
?>


jak mam średnikami to mi już wcześniej wyskakują błędy

Parse error: syntax error, unexpected ';' in /home/radeon92/domains/torrentosy.pl/public_html/test.php on line 67

Ten post edytował demek1987 1.02.2010, 23:56:28
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 00:04:03
Post #6





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Chwilka...
PS. Przepraszam, że usunąłem POST
Gdzieś wcześniej są inne błędy, np.
Kod
echo 'TorLin: '.substr($matches[4][$i],

(niezamknięty nawias)

Kod
<?PHP
error_reporting(E_ALL);
@include 'init/php/funkcje_main.php';
$baza = polacz(); //połączenie z bazą danych

$cookie = 'cookie.txt';

$loginUrl = 'http://torrent-polska.info/login.php';
$login = 'xxx';
$password = 'xxx';
$useragent = 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3';

$ch = curl_init( $loginUrl );
curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie );
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie );
curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, 'uid='.$login.'&pwd='.$password );
curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
$afterLogin = curl_exec($ch);
curl_close($ch);

$kategorie = array('14|7','15|7','17|47','18|47','19|47','22|5','23|6','24|6','25|2','26|100','27|9','28|4','30|19','31|19','32|23','35|15','36|16','37|16','38|16','40|63','41|58','42|55','43|54','44|62','46|24','48|24','55|70','56|72','57|73','60|12','62|11','63|13');
$kategorie = array('14|7');
foreach ($kategorie as $jaka) {
        $x = explode('|',$jaka);
        echo $x[0].' '.$x[1].'<br/>';
        
        $ch = curl_init('http://torrent-polska.info/torrents.php?category='.$jaka.'');
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
        curl_setopt( $ch, CURLOPT_HEADER, 0);
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
        $profile = curl_exec($ch);
        curl_close($ch);
    
    //ttuaj jest cała zawartość
    
    $start = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    $profile = substr($profile,$start);
    $koniec = strpos($profile,'<TR><TD COLSPAN=2 align=center> <p align="center"><b>');
    $zawartosc = substr($profile,0,$koniec);
    
    $początek = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    $koniec = strpos($profile,'<div><tr><td class="block" height=20  colspan="2" align="center">');
    
    preg_match_all('/<div><tr><td class="block" height=20  colspan="2" align="center"><a href=(.+)><b><font color=royalblue>(.+)<\/b><\/font><\/a><\/td><\/tr><div style="padding-left: 6px"><TR>(.+)<p><A HREF=(.+)>Plik torrent<\/A>/Us',$zawartosc,$matches);
    
    preg_match_all('/<p><A HREF=download.php?id=(.+)>Plik torrent<\/A>/Us',$zawartosc,$matches);
    
    
    
    //poniżej pętla wyświetlająca pobrane rekordy
    for($i=0; $i<count($matches[1]); $i++) {
        echo '<img src="http://torrent-polska.info/torrentimg/'.substr($matches[4][$i],16,40).'.jpg" alt="" style="float:left;" />'; //img
        echo '<strong>Nazwa: '.$matches[2][$i].'</strong><br/>'; //nazwa pliku
        echo 'Link:'.$matches[1][$i].'<br/>'; //link do pliku (bez HTTP)
        echo 'Torrent:'.$matches[4][$i].'<br/>'; //link do torrenta
        echo '<div style="clear:both;" />';
        echo 'TorLin: '.substr($matches[4][$i]);
        //$plik = $matches[4][$i];
        //$jp = 'http://torrent-polska.info/torrentimg/'.substr($matches[4][$i],16,40).'.jpg';
        
        $ch = curl_init('http://torrent-polska.info/'.$plik); //pobieranie torrta
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
        curl_setopt( $ch, CURLOPT_HEADER, 0);
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
        $fh = fopen($plik, 'w');
        curl_setopt($ch, CURLOPT_FILE,$fh);
        curl_exec($ch);
        fclose($fh);
        curl_close($ch);
        
        //poniżej przenoszenie torrta
        if (file_exists('torrent/file/'.md5($plik).'.torrent'))
           { echo '<strong>jest przeniesiony</strong>';
            unlink($plik);}
        
        else
            rename($plik, 'torrent/file/'.md5($plik).'.torrent');
            echo 'plik przeniesiony';
        
        
        
        //tutaj pobranie opisu
        $ch = curl_init('http://torrent-polska.info/'.$matches[1][$i]); //pobieranie torrta
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie);
        curl_setopt( $ch, CURLOPT_COOKIE, $cookie);
        curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
        curl_setopt( $ch, CURLOPT_HEADER, 0);
        curl_setopt( $ch, CURLOPT_REFERER, 'http://torrent-polska.info/' );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt($ch, CURLOPT_FILE,$fh);
        $opis = curl_exec($ch);
        curl_close($ch);
        
        $start = strpos($opis,'<div style=\'padding-left:5px; padding-right:12px;  padding-top: 10px; padding-bottom: 10px;\' align="left">
')+106;
        $opis = substr($opis,$start);
        $koniec = strpos($opis,'</div>');
        $opis = substr($opis,0,$koniec);
        $opis = str_replace("<img border=0 src=\"http://torrent-polska.eu/torrentimg/6abe970f204d632679f091b3122e1ef3d9162d71.gif\">", " ", $opis);
        echo $opis.'<br/>';
        echo '<hr/>';
    }

}
    $plik = 'download.php*.torrent';
    
$zap = mysql_query("SELECT * FROM `torrent` WHERE `kategoria` = '".$jaka[1]."' ORDER BY `id` DESC LIMIT 10");
while ($odp = mysql_fetch_array($zap)) {
    echo $odp['tytul'].'<br/>';
}
?>

a teraz?

Ten post edytował Szeszek1992 2.02.2010, 00:07:34


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:12:23
Post #7





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/radeon92/domains/torrentosy.pl/public_html/test.php on line 22

teraz jeszcze inny błą wyskakuje niestety;/
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 00:16:01
Post #8





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Błąd mówi ci wszystko. Masz włączony safe_mode, więc przydałoby się pogrzebać w pliku php.ini(więcej i dokładniej przeczytasz w google)


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:25:02
Post #9





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


nie da sie niestety nadpisać php.ini
bo znalazłem już safe_mod
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 00:30:05
Post #10





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Jak to się nie da?


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:32:45
Post #11





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


przez total comandera wyskakuje mi ze nie można nadpisać pliku php.ini
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 00:37:06
Post #12





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


To twój prywatny serwer(w domu), czy na jakiś hosting?

Ten post edytował Szeszek1992 2.02.2010, 00:38:55


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:39:48
Post #13





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


na hostingu hekko.pl niestety
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 00:45:49
Post #14





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


Możesz do nich napisać i poprosić, by Ci zmienili te ustawienia, lecz wątpię, czy się zgodzą.
Z tego, co przeczytałem na ich stronie użytkownikowi pozwalają zmieniać tylko niektóre ustawienia.


--------------------
Go to the top of the page
+Quote Post
demek1987
post 2.02.2010, 00:52:34
Post #15





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.02.2010

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


ok dzięki za pomoc smile.gif

a nie wiesz na jakich serwerach jest może to włączone?? bo zawsze można przenieśc stronę
Go to the top of the page
+Quote Post
Szeszek1992
post 2.02.2010, 01:06:31
Post #16





Grupa: Zarejestrowani
Postów: 117
Pomógł: 29
Dołączył: 20.05.2009

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


1. włączone jest u Ciebie, a jeśli chcesz, żeby działało, to powinno być wyłączone.
2. nie chcę nikomu robić reklamy, poszukaj w internecie, coś na pewno znajdziesz;)


--------------------
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: 14.08.2025 - 10:43