Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem, help please

Status
Not open for further replies.

mertcek123

Programmer
Joined
Nov 19, 2010
Messages
4
Location
IT
I need to get a contents of a div class from another website, I know the class name, I know the class ID, but couldn't find a working script. Can you help me? I used php but my people say that javascript is more better solution for this. This is the php script that I used.

<?php $conts = file_get_contents('
$pattern = '~<div.*.id="middle-column".*.class="productDetail_clearfix">(.*)</div>~iUs';
preg_match($pattern, $conts, $matches);
array_shift($matches);

echo $matches[0];
?>
 
>I need to get a contents of a div class from another website, I know the class name, I know the class ID, but couldn't find a working script. Can you help me? I used php but my people say that javascript is more better solution for this. This is the php script that I used.
Either you have something to hide, or that the reasoning is just a kind of verbiage. Are you implying your php listed work? (I don't think so) and just that you don't know how it can be done in javascript?! I would say we have a php forum if you don't know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top