newbie on PHP. Question.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AluminX
Forum Newbie
Posts: 19
Joined: Sat Jul 17, 2004 9:53 am

newbie on PHP. Question.

Post by AluminX »

hello guys..well i'm a newbie on php.
i just want to know how to get some info from this website and display it on my signature down below on different board?
thnx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]file_get_contents[/php_man]() and it's brothers, if you have url wrappers turned on at your server. [php_man]cURL[/php_man] is also an option, which works outside of having url wrappers on.

As for displaying info, it generally will only work if you make a dynamic image, and can place images in your sig.
AluminX
Forum Newbie
Posts: 19
Joined: Sat Jul 17, 2004 9:53 am

Post by AluminX »

thanks for the reply but i'm a total noob in this field and can't understand any of the links u gave me...
can any of u do an exaple and post so i can change img source,vars etc? plzz.
thnx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

<?php

$html = file_get_contents("http://www.foo.com/bar.html");        // <-- the page you want to retrieve

preg_match('#<td>my special data(.*?)</td>#is',$html,$match);     // <-- extract the information you want, kettle_drum posted a link to regex information within the last day

$im = imagecreatetruecolor(300,50);     // <-- create a new true color image

// do whatever text or graphic printing you want

header('Content-type: image/jpeg');  // <-- let the browser know what you are sending

imagejpeg($im); // <-- output the image

?>
in your sig, you write:
Image


we also have a small thread in the code snippets section:
viewtopic.php?t=16746&start=0&postdays= ... dom+avatar
Post Reply