Page 1 of 1

Helpme please, div content in variable php

Posted: Thu Mar 29, 2012 8:28 pm
by t-dat0r
Hello I need to read and save the contents of a div on a php variable: :idea:
<div id="content"> that I read </ div>

please help me

Re: Helpme please, div content in variable php

Posted: Thu Mar 29, 2012 9:06 pm
by Zoey76
Moved to viewforum.php?f=4, since viewforum.php?f=46 is for L2J related scripts.

For the information you need please visit this site: http://www.w3schools.com/php/php_forms.asp

Re: Helpme please, div content in variable php

Posted: Thu Mar 29, 2012 10:52 pm
by t-dat0r
hello, thanks for replying, but I need is to read a html, find a div and read the contents,

Code: Select all

 <?//myphp$url="html_file.html";$ch=curl_init();$timeout = 60;curl_setopt ($ch, CURLOPT_URL, $url);curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);$file_contents = curl_exec($ch);curl_close($ch);?> 

Code: Select all

 my html... read in html ( <div name="contentread">I want to read this content</div> ) 
with this function I want to read the votes Topzone current as does the vote reward system (java) but in php

Re: Helpme please, div content in variable php

Posted: Fri Mar 30, 2012 12:11 am
by Zoey76
This has everything you need and more to get the job done:
Source: http://simplehtmldom.sourceforge.net/
Example: http://davidwalsh.name/php-notifications

You could do it hardcoded for a specific site without using the API.

Re: Helpme please, div content in variable php

Posted: Wed Apr 04, 2012 2:45 pm
by t-dat0r
i made it :)

thks!!