Skip Navigation LinksHome > Categories > Code from a Category

Using remote / remote files.



User Name: serfcompany
Name: Serf
Contact Me: www.datawebcoder.com
Home Page: www.datawebcoder.com
php,mysql,javascript,html,css. Preferable working with Zend Framework. Good know javascript. I worked with various, javascript frameworks such as(jquery, YUI3, extjs, sencha touch). [More]
Viewed Times: 107
Add Date: 05/05/2012
The article tells how you can work with remote / remote files with PHP.

If support for "URL fopen-wrapper / wrapper" is enabled when configuring PHP (unless you explicitly gave the flag - disable-url-fopen-wrapper to configure (for versions newer than 4.0.3) or not set allow_url_fopen to off in the file php.ini (for newer versions)), you can use HTTP and FTP-URLs with most functions that take a filename / filename as a parameter, including - operators require () and include ().


Note: Windows-version of PHP currently does not support remote file access for the following functions: include (), include_once (), require () require_once ().


For example, you can use it to open a file on a remote web-server, parse the output data and then use these data in a query to the database, or just put them in the style of your web-site.


Example: Getting the name / title remote page



You can also write to files via FTP, if you are connected as a user with the correct access rights and if the file does not exist yet. To connect as any user other than 'anonymous', you must specify a username (and possibly, password) in the URL, such as: 'ftp://user:password @ ftp.example.com / path / to / file' . (You can use the same syntax to access files via HTTP, if necessary Basic-authentication.)


Example: Storing data on a remote server



Note: this example you may have the idea to use this technique to write to a remote log, but, as stated above, you can only record a new file using shell URL fopen (). To perform a distributed loginga like this, you should see syslog ().


.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.