/    Sign up×
Community /Pin to ProfileBookmark

Array Set Up Question

Ok, I want to take a certain line from a webpage, and post just that line. How would I do that?

More Info:

I’m trying to make a script that’ll ask someone for their Username (from the RPG RuneScape, located at [url]www.runescape.com[/url]) and post just the skill name/level/xp/rank. You can find out what I’m talking out by going here:

[url]http://hiscore.runescape.com/hiscorepersonal.ws?user1=zezima[/url]

Now, here’s my Index/action files:

Index.php

[code=php]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/ TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=iso-8859-1” />
<title>Just a Test</title>
</head>
<body>

<font size=+2><u>Personal History</u></font><br>
<form action=”action.php” method=”post”>
Username: <input name=”username” type=”text”/>
<input name=”submit” type=”submit”/>
</form>

</body>
</html>[/code]

Action.php

[code=php]<html>
<head>
<title>TITLE</title>
</head>

<body>

<?php

$username=$_REQUEST[‘username’];
$stats=file_get_contents(“http://hiscore.runescape.com/hiscorepersonal.ws?user1=”.$username);

echo $stats;

?>

</body>
</html>[/code]

Like….I want the page to look like this:

[B]Skill[/B][B]Rank[/B][B]Level[/B][B]XP[/B]
Attack-1-99-13,000,000

(In a table, of course…)
(All that info is on the page, the one shown in action.php

But, with all the stats. So, like…how…?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachOct 03.2008 — sent you a pm
×

Success!

Help @Andrew_Hucks spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...