Author |
Message |
XenoMorpH
Hangin' Around
Joined: Jan 23, 2004
Posts: 37
Location: Netherlands
|
Posted:
Tue Jul 18, 2006 3:39 pm |
|
Is it possible in php to get certain parts of a remote page? Like some certain parts or a table with info? |
|
|
|
|
hitwalker
Sells PC To Pay For Divorce
Joined:
Posts: 5661
|
Posted:
Tue Jul 18, 2006 5:13 pm |
|
|
|
|
gregexp
The Mouse Is Extension Of Arm
Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Tue Jul 18, 2006 6:23 pm |
|
I think html would be a problem but XML is possible. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
|
|
evaders99
Former Moderator in Good Standing
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Wed Jul 19, 2006 12:34 am |
|
|
|
|
hitwalker
|
Posted:
Wed Jul 19, 2006 6:50 am |
|
this should do it....
if(!($myFile=fopen("put here url to grab from","r")))
{
echo "No source available";
exit;
}
while(!feof($myFile))
{
// Read each line and add to $myLine
$myLine.=fgets($myFile,255);
}
fclose($myFile);
$start="put here whatever html to start";
$end="end with this html";
$start_position=strpos($myLine, $start);
$end_position=strpos($myLine, $end)+strlen($end);
$length=$end_position-$start_position;
$myLine=substr($myLine, $start_position, $length);
// Display HTML
echo $myLine; |
|
|
|
|
montego
Site Admin
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Wed Jul 19, 2006 7:37 am |
|
Whatever you do, make absolutely certain that the URL or path you use is properly sanitized / validated / initialized / ... (if its hardcoded, all the better, but also make sure no-one can overwrite your included html file) to ensure there is NO opportunity for you ending up echoing out malicious code (a form of XSS attack).
Functions such as fopen() can be quite dangerous if not coded right. Even include(), require(), ... basically anything that can take a path/URL ... can be dangerous if not properly coded... |
_________________ Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... |
|
|
|
XenoMorpH
|
Posted:
Fri Jul 21, 2006 7:46 am |
|
Thnx for the replies guys. I'll have a look and c how far I'll get to work |
|
|
|
|
XenoMorpH
|
Posted:
Fri Jul 21, 2006 8:33 am |
|
Thnx hitwalker was just the type of code I needed . Still fooling around with it to make it a bit more dynamic ...
[ Only registered users can see links on this board! Get registered or login! ] get's the info from:
[ Only registered users can see links on this board! Get registered or login! ]
When I'm online gaming...."Currently Playing" will say YES
I want to create a block/module where it showswhen I'm on or not. is it possible to get certain parts as a var? |
|
|
|
|
|