Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   cut the content of another page? (http://www.go4expert.com/forums/cut-content-page-t5797/)

hoangthienphuc 11Aug2007 06:44

cut the content of another page?
 
I used file_get_content() function to get the content of another page, then use substr function cut the content i need and echo it in my page. But i wonder if that page have change the content( by query data in database ) and my content substr from that page will be not correct and my page layout will break! How can i use another function instead of substr function?? :confused:

shabbir 11Aug2007 10:18

Re: cut the content of another page?
 
If you use some other function then also it will break because you should be having the provision for the changes that may happen at the source or what you could do it have the content and instead of displaying it directly you could insert into the database.

hoangthienphuc 11Aug2007 10:26

Re: cut the content of another page?
 
Oh! That's a good ideas! But when it's change the content and i must modify in my database, i think it's not so good! Have some other solution for my solution?
Thanks for your reading! :D

shabbir 11Aug2007 10:27

Re: cut the content of another page?
 
If you are not sure of the source you cannot have any algo.

hoangthienphuc 11Aug2007 10:43

Re: cut the content of another page?
 
Can i post my code in here? Please help for my problem

shabbir 11Aug2007 12:04

Re: cut the content of another page?
 
You can but have the code blocks in the posts for the code.

hoangthienphuc 12Aug2007 21:11

Re: cut the content of another page?
 
Yes! and this is my code :
Code:

$str1 = file_get_contents("an example page");                  $image = substr($str1, 10423, 120);
then, i echo $image that got "<img src="url"/>" from that page and want it's always stand like that whenever that page change the content.

shabbir 12Aug2007 23:30

Re: cut the content of another page?
 
You need to design a better algo rather than just to use the API for it.


All times are GMT +5.5. The time now is 04:36.