Jump to content

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];

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.