Jump to content

cat250

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by cat250

  1. Thaaaaaanks!
  2. Thank u so much. Now I've tried to show User2 <234.151.143.110> - Reason 2 - 1 minute but don't get it. I need to edit regular expression? I've tried to use foo to show other items but no succes. Thanks again.
  3. Hmm, || it's unique. Also, I need to remove "Reason: " and "Ban Length: ". But it's hard for me, never worked with this. From this L 02/10/2012 - 15:17:39: DEF <STEAM_ID_LAN> banned i need only "DEF". It seems I need only 2, 4, 6, 8 lines etc. If u understand what i say, bad english here. :-\ Will no be "17 other kinds of lines", i put the exact code. Thanks.
  4. Thanks for reply. I looked over preg_math_all, but still don't know how can i do this. :-\
  5. Hei there. I have this in file.log L 02/10/2012 - 15:50:56: Log file started (file "cstrike\addons\amxmodx\logs\ban_history.log") (game "cstrike") (amx "1.8.1.3746") L 02/10/2012 - 15:03:38: ABC <STEAM_ID_LAN> banned User1 <284.121.146.100> || Reason: "Reason 1" || Ban Length: 1 minute L 02/10/2012 - 15:17:24: Ban time is up for: User1 [284.121.146.100] L 02/10/2012 - 15:17:39: DEF <STEAM_ID_LAN> banned User2 <234.151.143.110> || Reason: "Reason 2" || Ban Length: 1 minute L 02/10/2012 - 15:18:39: Ban time is up for: User2 [234.151.143.110] And I want to show in page only: ABC - User 1 <284.121.146.100> - Reason 1 - 1 minute DEF - User 2 <234.151.143.110> - Reason 2 - 1 minute How can I do this? Thanks.
  6. Many thanks. Finally solved.
  7. mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("movies") or die(mysql_error()); $f = mysql_query("SELECT * FROM movies") or die(mysql_error()); while($inf = mysql_fetch_assoc($f)) { $two= $inf['id']; $link = "http://www.imdbapi.com/?i=$two"; $thr = file_get_contents($link); $json = json_decode($thr,true); echo "<img src='".$json['Poster']."' />";
  8. Ok, now i get "Poster IS set!"... but that isn't true. This is what i wanted to say above. I try to explain again: I have in mysql 2 entries, one with poster and one without. Script return "Poster IS set!" in both cases.
  9. Thanks, but isn't working. Tried with this: if (!isset($json['Poster'])){ echo "Hi."; } else { echo "Bye."; } Get "Bye."
  10. One more problem... I'm sorry if I bother u. I have: echo "Image: ".$json['Poster'].""; and if image exist I get in return URL... but if there's no image get a error: Notice: Undefined index: Poster in C:\xampp\htdocs\file.php on line 48 How can I show a message error for this? Maybe I have too many questions but it's first time when I use PHP and don't understand too much. Help is appreciated, again. Thanks! I readed about if, else... still can't solved.
  11. Can't belive, it's perfect. Thank you so much!
  12. Thank u so much, this is perfect. But... i was a big idiot in first post... i want only "first number" and now don't know how to do this. Can u help me, again, please? Thanks thanks. It's ok anyway.
  13. Hello again. I use echo "Rating:".$json['Rating]."/10"; and get in return: 7.5/10 - it's ok. But I want to replace 7.5 with 75.png (image), 6.3 with 63.png, 9.4 with 94.png... hope u understand. Know someone how I can do this? Thanks.
  14. yes, i saw now. sorry and thank u very very much for your help, i think i couldn't solve this without you and Keith, ofc. many thanks again, have a nice day and a wonderful life.
  15. some progress here, i guess... for this: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("base") or die(mysql_error()); $f = mysql_query("SELECT * FROM movies") or die(mysql_error()); while($info = mysql_fetch_assoc($f)) { $tid= $info['id']; $url = "http://www.imdbapi.com/?i=$tid"; echo "<br>$url<br>"; $link = file_get_contents($url); $json = json_decode($link,true); print_r($json); echo "<br><br><strong>".$json['Title']."</strong><br><br>"; } ?> i get: http://www.imdbapi.com/?i=tt1285016 Array ( [Title] => The Social Network [Year] => 2010 [Rated] => PG-13 [Released] => 1 Oct 2010 [Genre] => Biography, Drama [Director] => David Fincher [Writer] => Aaron Sorkin, Ben Mezrich [Actors] => Jesse Eisenberg, Andrew Garfield, Justin Timberlake, Rooney Mara [Plot] => Harvard student Mark Zuckerberg creates the social networking website that would become known as Facebook, but is later sued by two brothers who claimed he stole their idea, and the co-founder who was later squeezed out of the business. [Poster] => http://ia.media-imdb.com/images/M/MV5BMTM2ODk0NDAwMF5BMl5BanBnXkFtZTcwNTM1MDc2Mw@@._V1_SX320.jpg [Runtime] => 2 hrs [Rating] => 8.0 [Votes] => 177854 [iD] => tt1285016 [Response] => True ) The Social Network http://www.imdbapi.com/?i=tt1324545 Array ( [Response] => Parse Error ) Notice: Undefined index: Title in C:\xampp\htdocs\muvi.php on line 12 so i tried: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("baza") or die(mysql_error()); $f = mysql_query("SELECT * FROM filme") or die(mysql_error()); while($info = mysql_fetch_assoc($f)) { $tid= $info['id']; $url = "http://www.imdbapi.com/?i=$tid"; $link = file_get_contents($url); $json = json_decode($link,true); echo "<strong>".$json['Title']."</strong><br><br>"; } ?> and i get: The Social Network Notice: Undefined index: Title in C:\xampp\htdocs\muvi.php on line 10 in mysql i have 2 "entries": tt1285016 - appear and tt1324545 - error.
  16. while($info = mysql_fetch_assoc()) { Warning: mysql_fetch_assoc() expects at least 1 parameter, 0 given in C:\xampp\htdocs\x.php on line 5 unbelievable
  17. Ignore using $info for now. My suggested code had an alternative id hard coded in it. See what that returns. All the best Keith i hope i understood what u said... my english isn't good. i already tried what u gave and i get this: {"Title":"Dietro le mura del convento","Year":"2009","Rated":"N/A","Released":"N/A","Genre":"Comedy, Drama, Thriller, Crime, Mystery","Director":"Lodovico Gasparini","Writer":"N/A","Actors":"Nino Frassica, Simone Montedoro, Natalie Guetta, Francesco Scali","Plot":"N/A","Poster":"N/A","Runtime":"N/A","Rating":"N/A","Votes":"N/A","ID":"tt1421545","Response":"True"} Notice: Undefined variable: json in C:\xampp\htdocs\x.php on line 9 hope u didn't want to say something else. thank u boys.
  18. hehe, it's ok. now i get this: Fatal error: Call to undefined function mysql_fetch_asocc() in C:\xampp\htdocs\x.php on line 5 maybe is a little stupid for me but i never worked with mysql... so i really don't understand these errors...
  19. hehe, i saw that and added but still this error. Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\x.php on line 6
  20. Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\x.php on line 6 i really don't understand. thank u again... any idea now?
  21. sure. <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("base") or die(mysql_error()); $f = mysql_query("SELECT * FROM movies") or die(mysql_error()); while($info = mysql_fetch_array($f)) { $link = file_get_contents("http://www.imdbapi.com/?i=tt1285016"); $json = json_decode($link,true); echo $json["Title"]; } ?>
  22. thanks again {"Title":"The Social Network","Year":"2010","Rated":"PG-13","Released":"1 Oct 2010","Genre":"Biography, Drama","Director":"David Fincher","Writer":"Aaron Sorkin, Ben Mezrich","Actors":"Jesse Eisenberg, Andrew Garfield, Justin Timberlake, Rooney Mara","Plot":"Harvard student Mark Zuckerberg creates the social networking website that would become known as Facebook, but is later sued by two brothers who claimed he stole their idea, and the co-founder who was later squeezed out of the business.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTM2ODk0NDAwMF5BMl5BanBnXkFtZTcwNTM1MDc2Mw@@._V1_SX320.jpg","Runtime":"2 hrs","Rating":"8.0","Votes":"177854","ID":"tt1285016","Response":"True"} Notice: Undefined variable: json in C:\xampp\htdocs\x.php on line 10 hmmm? so, if I use this: $alink = file_get_contents("http://www.imdbapi.com/?i=tt1285016"); $json = json_decode($link,true); echo $json["Title"]; return: The Social Network and that is ok. but i whant to change tt1285016 with $info["id"];... i really don't know what u do. thank u very much.
  23. hi keith, thank u very much for reply too. i tried what u said, print_r($json); and i get: Array ( [Title] => The Social Network [Year] => 2010 [Rated] => PG-13 [Released] => 1 Oct 2010 [Genre] => Biography, Drama [Director] => David Fincher [Writer] => Aaron Sorkin, Ben Mezrich [Actors] => Jesse Eisenberg, Andrew Garfield, Justin Timberlake, Rooney Mara [Plot] => Harvard student Mark Zuckerberg creates the social networking website that would become known as Facebook, but is later sued by two brothers who claimed he stole their idea, and the co-founder who was later squeezed out of the business. [Poster] => http://ia.media-imdb.com/images/M/MV5BMTM2ODk0NDAwMF5BMl5BanBnXkFtZTcwNTM1MDc2Mw@@._V1_SX320.jpg [Runtime] => 2 hrs [Rating] => 8.0 [Votes] => 177854 [iD] => tt1285016 [Response] => True ) what do with 'Title' now? thank u again.
  24. thank u but i already tried that. Error message: Notice: Undefined index: Title in C:\xampp\htdocs\x.php on line 9 Line 9: echo $json["Title"]; So i tried echo $json; and now say "Array". what do?
  25. First of all, sorry for my bad english. I have this: PHP Code: [select] $link = file_get_contents("http://www.imdbapi.com/?i=tt1285016"); $json = json_decode($link,true); echo $json["Title"]; and I want to replace tt1285016 with $info["id"]; (this is something from mysql, first time when i use ). If I put echo $info["id"]; it return exactly what i need: tt1421545. How can I do that? thank u very much and sorry again for bad enlighs, not native language. EDIT: Sorry for bad section, first time when i come here.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.