Creating Dynamic Sig

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
extraordin
Forum Newbie
Posts: 4
Joined: Wed Apr 02, 2008 8:47 pm

Creating Dynamic Sig

Post by extraordin »

Bad thing to start off with, But I'm sorry if this could be placed some place better. I have some html, java, and basic experience but i'm in the dark when it comes to php.

I would love to learn it, but that will come. Mainly I'm looking for help on creating a Signature that retrieves data from this site http://hiscore.runescape.com/index_lite ... extraordin and then creates the image so I can put it as a signature. Plenty of sites have them like this one http://www.rsbandb.com/runescape_skill_signatures-sig but I want to learn something new have have my own original signature, and possible create a few for some friends.

I've searched the web high and low for a tutorial on how to create the code for one, and once I found your site I thanked the lord. I've searched your site for other ppl looking for the same thing, but not getting what I wanted.

So if someone could please start me off on creating a code and exactly what I'll have to learn or do that would be great. If it would be advance code, and would be easyer for someone else to do it just tell me to go to the Volunteer Help section...

I say this topic that had partial code for this... viewtopic.php?f=1&t=8309&p=37857&hilit=runescape#p37857 ...YES... But I need some more help

How would I initialize the starting variables from the site http://hiscore.runescape.com/index_lite ... extraordin starting from the second and going every 3. then outputting those in an image with text.

Thanks for the time, and if this is just to much send me off to volunteer help, but I would really like to know how the code works.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Creating Dynamic Sig

Post by John Cartwright »

So if someone could please start me off on creating a code and exactly what I'll have to learn or do that would be great. If it would be advance code, and would be easyer for someone else to do it just tell me to go to the Volunteer Help section...
I'm tempted to move this to the Volunteer section if your expecting "volunteer work".

What we can do for you here is give you some starting points to help you learn. Give a man a fish.. eat for a day blah blah. What we won't do for you here is do the work for you. Sorry.

Anyways, the first think you'll need is the capture the contents of the url you posted.

Code: Select all

$stats = file_get_contents('http://hiscore.runescape.com/index_lite.ws?player=extraordin');

Then you'll need to explode the data by comma, using explode(), which will produce an array containing each element in the stats.

As a quick excercise, try running

Code: Select all

 
$stats = file_get_contents('http://hiscore.runescape.com/index_lite.ws?player=extraordin');
$elements= explode(',', $stats);
 
echo '<pre>';
print_r($elements);
Try some things out, play around, and let us know when you are having specific difficulties or questions.

Try taking a look at arrays also
extraordin
Forum Newbie
Posts: 4
Joined: Wed Apr 02, 2008 8:47 pm

Re: Creating Dynamic Sig

Post by extraordin »

Ok thank you very much. Yea I'm trying to decide exactly how much work this will be. I really do want to learn about it though. I'll give it a go with your help thanks.

I've seen a lot of different ppl suggesting different ways of breaking up the data. It given in an easy format though, so I just wanted a simple way to take the information I needed.
extraordin
Forum Newbie
Posts: 4
Joined: Wed Apr 02, 2008 8:47 pm

Re: Creating Dynamic Sig

Post by extraordin »

Ok I had made a new php document in dreamweaver CS3. I insterted
<?php
$stats = file_get_contents('http://hiscore.runescape.com/index_lite ... extraordin');
$elements= explode(',', $stats);
echo '<pre>';
print_r($elements);
?>
in the body, but what prints out is
'; print_r($elements); ?>
when I preview the site. Is it ok that I'm doing this in DW CS3? and i'm testing offline? I'm sorry I'm new, just want things solved.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Creating Dynamic Sig

Post by John Cartwright »

You realize PHP is a serverside language. Meaning, you need a webserver with apache (preferably 2) and php (prefererably > 5.1.2) installed to run php code.
Post Reply