I was wondering how I would be able to parse a url after loading it through a users IP address. I want to know this because for this site I want to parse it loads a new key with everyones IP address. So when I parse it through file_get_contents of cURL, it gives me the default value and not the unique key. The only way I though of it to work was to load the page in an iframe then get the source of the iframe. However, I don't know if this is possible. If this is or if you guys know of a way I can do this please let me know. Thanks!
feedback
|
You say you're trying to parse a URL, so use But it also sounds like you mean you want to parse the HTML in the page results, in which case you should use a DOM parser. See http://htmlparsing.com/php.html for examples of how to properly parse HTML with PHP modules. If anyone tells you to use regular expressions to parse your HTML, ignore them. |
|||||
feedback
|
Sounds like you need the user to actually get the url from their own computer and send you the results. Why not load the url into the iframe, then use an ajax function to send the contents of the iframe back to your site, act on it and redirect if necessary. See this conversation about using jquery to act on content loaded into an iframe iframe contents change event? See the jquery ajax documentation on how to submit this information to your own php files http://api.jquery.com/jQuery.ajax/ Not sure if this is what you wanted but it's what you might have to do in order to get the url's content as your user's ip address. |
|||||
feedback
|