Jump to content

file_get_contents() in data changing page


waSaf

Recommended Posts

i have a problem with my application here.. hope u guys can help me out of it...

 

i have this page (www.data.com/page.asp)

 

where this page dislay somesort of daily data.

 

the data will change daily and to view previous data, we need to key in specific date and click on submit button. the form using $_POST data thus the URL of the page is remain the same regardless of the date selected and data displayed.

 

 

i need to get few data in this website including the previous one.

 

so i create a web-based apps (PHP) to display the html as string and strip the unneccessary string.

 

this is the main structure of my apps..

 

==================

 

$code = file_get_contents("www.data.com/page.asp");

$html = htmlspecialchar($code);

 

<--function strip unwanted string and return required data here-->

 

==================

 

 

the apps can run successfully, but only for current day data. since i use direct URL (www.data.com/page.asp), the apps will only grab data shown on the page by default. i cant grab the data for previous date.

 

so how to make my apps work as i intend? please help me. thanks in advance.

Link to comment
Share on other sites

you can pass the date in querystring

 

(www.data.com/page.asp?date=26-nov-2009)

 

can necessary changes to throw output for the provided date !!.

 

the www.data.com/page.asp is not my own page.. it is an external page that i dont have control of it...

 

so is there any way php can detect the $_POST data of the page?

Link to comment
Share on other sites

rephrase my problem....

 

 

i intend to get few data on this specific page, eg. www.data123.com/page.php

 

the method that i am using is, to parse the whole page into source code and use regex to filter what i want...

 

the page have a form ($_POST) so that the visitor can select the data base on the date submitted.

 

so, how to get the source code each time i submit new date? because im using file_get_contents here and the parameter used is only URL, while each time i submit new date, there is $_POST variable there...

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.