I fetched some data(eg:name ,email,phone,mobile etc) from a website using simpleDOMhtml.I want to store it into the database.Which page will write the code and how will write?Please help me.Thanks in advance.

Recommended Answers

Which page will write the code and how will write?Please help me.Thanks in advance.

This doesn't make sense. Post your code so far with more explanation.

Jump to Post

All 2 Replies

Member Avatar

Which page will write the code and how will write?Please help me.Thanks in advance.

This doesn't make sense. Post your code so far with more explanation.

My code is like this

<?php
// example of how to modify HTML contents
include_once('simple_html_dom.php');

// get DOM from URL or file

//$html = file_get_html('http://google.com');


$html = file_get_html('http://yellowpages.sulekha.com/agra/abhay-integrated-technology-ltd-sadar-bazar-agra_contact-address.htm?business=pst');
foreach($html->find('http') as $e)
$e->outertext = '';


// remove all image
foreach($html->find('img') as $e)
$e->outertext = '';

// replace all input
foreach($html->find('input') as $e)
$e->outertext = '[INPUT]';

foreach($html->find('div#div.core_add') as $e)
echo $e->innertext . '<br>';


foreach($html->find('span.myClass') as $e)
echo $e->outertext . '<br>';


foreach($html->find('span[span]') as $e)
$e->outertext = 'span';


// dump contents
//echo $html;
?>

Can I write the datainsertion code into the same page? How will write the code(for eg: name,email,phone etc)to insert the data into database?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.