Jump to content

cat data from HTML page with php


GodOfWar

Recommended Posts

Hi all  :D

 

I need help with building a PHP script.

The porpoise of the script is to cat data from HTML log page.

The result of the data retrieving from the HTML page, I need to troy to MYSQL.

I do not know where to start and I will be very happy if you could help me.

 

Thank you very, very much, for any help .

 

This is an example of the data on the HTML, second column is the filed that is needed.

 

Name                      Windows XP (Professional) Service Pack 2

Activation Status Activated

Checked Build         No

Boot Device           \Device\HarddiskVolume1

System Device         \Device\HarddiskVolume2

 

Link to comment
https://forums.phpfreaks.com/topic/52518-cat-data-from-html-page-with-php/
Share on other sites

$file=file_get_contents('yourhtmlfile.html'); #get the contets of the html file

$file=str_replace("  ", "^", $file); #to take care of the "  "(2) in the file... while ignoring the " "(1)

while(strpos($file,'^^')) $file=str_replace("^^", "^", $file); #to cleanup the ^^ --> ^

$content=explode('^',$file);

echo $content[1];

Archived

This topic is now archived and is closed to further replies.

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