Jump to content

Referencing A Variables Value From Another Web Page?


cbsarge

Recommended Posts

This has to do with a game that I play called Superhero City. There is a page - http://www.shc-strategy.com/ - that someone else has created where you can put in a replay link (example: http://superherocity...attle=857337182 but, you would need a Facebook account) from a battle on the actual game page and it will show you a detailed breakdown of the battle. The person hosting the page has taken it down several times, password protected it, blocked certain people from using it, etc. I'd like to create something similar and make it open for everyone to use.

 

That being said. The data that the above page uses is contained in a variable on the replay page called fvars. I believe he using file_get_contents or something like that to grab the page and then parse out the fvars variable value and perform some math on it to create charts and graphs.

 

Everything I've written to date has been html or javascript. I have no php skills as yet and I'm finding it difficult to find a solution to this. It seems as if many of the php forums are assuming you are already an accomplished php programmer.

 

Can anyone give me some help with this? If I could even just get the fvars content to echo out I'd be able to start work on using it to create some stats.

 

Thanks in advance for any help given!

 

My non-working (I knew it wouldn't work) attempt

 

 

<?php

$file = file_get_contents('http://superherocity.klicknation.com/game/pages/battle_replay.php?battle=857337182');

Echo fvars;

?>

Edited by cbsarge
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.