Hey, i've been using php for a while now.. [though not enough to concider myself very good] and im encountering an annoying and frustrating problem in writing a bit of code that my mind has been toying with for a bit.
the goal of the project is to get infromation about a planetside account and produce an image describing the user from the information gathered. a minor hitch in the concept is that they dont expose their database, or any tie in to their database to anyone, save for this website:
http://myplanetside.station.sony.com/character.jsp
so that left me with trying to parse that website using php.
my first semi-successful attempt was to fread the entire site into a string and then display the string just to see what i'd get. what was returned was the top of the page down to the bottom of the "Planetside" top nav bar, but none of the dynamic content. im guessing(blindly) that this is because it's deciding its done reading before the website has decided its done spouting information. can anybody tell me how to make it hold on a bit before ending, or perhaps point me in an entirely different direction?
thank you,
~keedy
frustrating problem
Moderator: General Moderators
Code: Select all
$data = file_get_contents($url);I'm not sure why it would stop sending you a page.
Have another look at the HTML you are getting, or view source from your browser and see if there's frames or javascript that might be generating some of the page. Both these will cause problems - frames because PHP doesn't know to get a frame that's referred to, and javascript becuase PHP is just pulling HTML, and doesn't run/interpret js. Does it really just stop right in the middle of a chunk of HTML ?
Also remember that that site has a login, so you may need to find some way to pass your login details to the site from PHP to be able to get the information you're after, or if the information is public, pass parameteres to the site about which user you want info on.
Have another look at the HTML you are getting, or view source from your browser and see if there's frames or javascript that might be generating some of the page. Both these will cause problems - frames because PHP doesn't know to get a frame that's referred to, and javascript becuase PHP is just pulling HTML, and doesn't run/interpret js. Does it really just stop right in the middle of a chunk of HTML ?
Also remember that that site has a login, so you may need to find some way to pass your login details to the site from PHP to be able to get the information you're after, or if the information is public, pass parameteres to the site about which user you want info on.