Saved Bookmarks
| 1. |
Solve : How to include data from other ftp site?? |
|
Answer» I wish to display a part of numerical data from a ftp site into my WEBSITE ( phpbb3) http://earth-station-forum.stationforum.com/ .
I am not a professional software PERSON ... but have attempted a few complex programs in C BASIC etc. Just a very preliminary code will do .. I will try to refine it. I tried $string.. $ SUBSTR etc but could not succeed. Thanks in advance. ========== S S SalviAre you happy with regex? If so perhaps use curl to fetch the HTML VIA HTTP, then regex the data out? So: Code: [Select]$connect = curl_init(); curl_setopt($connect, CURLOPT_URL, 'http://pageurl.com'); curl_setopt($connect, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($connect, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($connect, CURLOPT_POST, TRUE); curl_setopt($connect,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($connect,CURLOPT_TIMEOUT,2); //curl_setopt($connect, CURLOPT_POSTFIELDS, 'Post content. Probably not needed'); $response_content = curl_exec($connect); $response = curl_getinfo($connect); Then use a simple regular expression on $response to get the required data?Thanks TristanPerry, Actually HTML, PHP etc are all equally alien to me. Regex is also same. So I can just go to basics of it and try to adapt the code for my use. Thanks for the input ... will come back and REPORT the happenings . ===== sssalvi |
|