/    Sign up×
Community /Pin to ProfileBookmark

javascript output in to php-var?

i have the following problem:

the js-script output of a script is a number.
i want to get this number into a php var.
how do i do that?


——-

$lgz5on5 = <SCRIPT language=”JavaScript” type=”text/javascript” src=”http://www.leaguez.com/extern/?clan=7333&ladder=8&type=1″></script>
——-

please help!
thanks in advance

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@AdamBrillMar 14.2003 — Since PHP only runs once when the page loads, you can't get the information directly into a PHP variable. You have to make a hidden input field and get the data out of that. Or, since it looks like you are using a external file, you could just read the file and get the information that way. Something like this should work:[code=php]<?PHP
$filename = "http://www.leaguez.com/extern/?clan=7333&ladder=8&type=1";
$fp = file($filename);
if($fp){
$content = "";
$x=0;
while($fp[$x]){
$content.=$fp[$x];
$x++;
}
echo $content;
}
?>[/code]
The variable $content has the data out of the file. Let me know if you need any more help. ?
Copy linkTweet thisAlerts:
@stuntgirlauthorMar 14.2003 — thank u very much, adam. it worked.

excellent solution.
Copy linkTweet thisAlerts:
@AdamBrillMar 14.2003 — No problem. I'm glad I could help. ?
×

Success!

Help @stuntgirl 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.26,
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,
)...