I need to develop a system that can retrieve data from another server. The system are for testimonial manager, which the process is like this: -Users can post the testimonial and save it into the system. -system will generate a few piece of code for the testimonials -the code can be used/paste/embed into another site(any sites) via html -the testimonial will be displayed on the site - which the data is come from the system Did you guys get what i mean? I just need a logic how to do that.. is it can be done just by php, or we need xml, or watever...? please help. Thanks in advanced
yeah you can use xml for that. from your description its function is actually same with rss feeds. or you can also write a script that will constantly update the xml file then create a xml parser on on your other site to display the xml content.
I think xml is the best way to do it. Use SimpleXML for this: http://php.net/manual/book.simplexml.php
hmm.. thank for the kind reply, but im kinda new with xml. can i know, if i use xml, can i get the data from mysql?
i would recommend using preg_match or preg_match_all and curl to cellect the data from the site and bring it back to you to place into a mysql database
I need to do something similar. I would like to offer other sites the facility to display some data (tables etc) generated by my server on their site. Wouldn't using iframe be a good way of going about it? I know iframe code can be a security risk but I believe that is only if you don't 'trust' the site that the data is coming from. Is that correct?
You can include a php script using javascript: <script language="JavaScript" src="url to your script.php"></script> HTML: In the php script itself you would have to do something like this at the end of the script I believe to get it to output your end result: document.write(<?php echo $output; ?>); HTML: That way you can use your php script and javascript is simple to setup on the other persons website.
Cheers guys. I still think that using iframe looks easy and doesn't require javascript. All the remote server needs to put in the source is: <iframe src="http://www.mysite.com/testfile.php" id="frame1"></iframe> Does anyone have reasons not to use this?
Sure! First of all, it has very ugly looking And the second, a frame blocks often by firewalls (security problems).