Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
XenoMorpH
Hangin' Around


Joined: Jan 23, 2004
Posts: 37
Location: Netherlands

PostPosted: Tue Jul 18, 2006 3:39 pm Reply with quote

Is it possible in php to get certain parts of a remote page? Like some certain parts or a table with info?
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Tue Jul 18, 2006 5:13 pm Reply with quote

Like rippin some text ?
 
View user's profile Send private message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Tue Jul 18, 2006 6:23 pm Reply with quote

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!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Jul 19, 2006 12:34 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
hitwalker
PostPosted: Wed Jul 19, 2006 6:50 am Reply with quote

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: 9449
Location: Arizona

PostPosted: Wed Jul 19, 2006 7:37 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
XenoMorpH
PostPosted: Fri Jul 21, 2006 7:46 am Reply with quote

Thnx for the replies guys. I'll have a look and c how far I'll get to work Cheers
 
XenoMorpH
PostPosted: Fri Jul 21, 2006 8:33 am Reply with quote

Thnx hitwalker was just the type of code I needed Smile. 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?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©