Author |
Message |
XenoMorpH
Hangin' Around
![](modules/Forums/images/avatars/gallery/blank.gif)
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
Sells PC To Pay For Divorce
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined:
Posts: 5661
|
Posted:
Tue Jul 18, 2006 5:13 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
gregexp
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/458c161744a70db912a6e.jpg)
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!! |
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Wed Jul 19, 2006 12:34 am |
|
Why not? You can use fopen or other file functions (assuming fopen is allowed) to access remote files. |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
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; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
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... |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
XenoMorpH
![](modules/Forums/images/avatars/gallery/blank.gif)
|
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 ![Cheers](modules/Forums/images/smiles/cheers.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
XenoMorpH
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jul 21, 2006 8:33 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|