News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Using cURL for Remote Requests
August 08, 2013 @ 09:09:13

PHPMaster.com has posted a tutorial showing you how to use the cURL functionality that can be built into PHP. Note that not all PHP installations will have this extension installed, but most will these days. You can find out by making a phpinfo page.

If you're a Linux user then you've probably used cURL. It's a powerful tool used from posting mails to downloading the latest My Little Pony subtitles. In this article I'll explain how to use the cURL extension in PHP. The extension offers us the functionality as the console utility in the comfortable world of PHP. I'll discuss sending GET and POST requests, handling login cookies, and FTP functionality.

He walks thorough the basic flow of a request and how to set options on the cURL handle to modify its behavior. Several more "real world" examples are also included:

  • Retrieve a Web Page
  • Log in to a Website (via POST data, not HTTP Auth)
  • Working with FTP
  • Sending Multiple Requests

That last one changes things up a bit and uses the curl_multi_init function to create the connection and allow for the multiple request streams to happen.

0 comments voice your opinion now!
curl remote request tutorial login ftp multiple

Link: http://phpmaster.com/using-curl-for-remote-requests

Grzegorz Godlewski:
PHP.Kryptik.AB - Give me your FTP!
November 20, 2012 @ 14:14:04

Grzegorz Godlewski has written up a post about a piece of PHP-related malware that, if it gets into your application, can render your site inaccessible (not to mention blocked by Google's "safe browsing") - PHP.Kryptik.AB.

One could think a PHP Developer is free from viruses and malware - and be wrong. Meet PHP.Kryptik.AB - the PHP malware. If you already know this bastard - high five! But if you don't - be prepared! Basically the story starts from a standard computer trojan which (I suppose) attacks popular FTP clients that store FTP login credentials unencrypted. Then it sends fetched informations to a remote host which (by the cover of night) logs into the FTP servers and infects PHP base web-pages by injecting a piece of JavaScript code, that gets executed when a user enters a site.

He describes the injected code, what kind of files the malware looks for when it executes and how you can fix the problem if you've already been infected. There's also a bit about how you can prevent yourself from being infected (including the suggestion of using something like KeePass or 1Password to manage and create harder to crack passwords).

0 comments voice your opinion now!
malware javascript infect phpkryptikab ftp


PHPBuilder.com:
My Automated PHP Scripts for Creating FTP Connections to a Remote Server
June 19, 2012 @ 10:41:57

PHPBuilder.com has posted a new tutorial about creating automated FTP scripts to pull down information from a remote server (using FTP streams).

In 2007 I began working on a website project for an investment company in my hometown of Cleveland, Ohio USA. The purpose of this website was to automatically download financial data of traded securities from two (2) remote Web servers. [...] Both of these PHP scripts were set up on the Web server's "crontab manager" to automatically run at a set time each business day.

Code is included showing how to connect to the remote service (via curl) with a "ftp" stream-based URL as the location. Also included is an example using a fopen call to the URL and inserting the resulting data into their tracking tables. The other script pulls the data out and adds a new record to a transactions table for the current day.

0 comments voice your opinion now!
ftp tutorial connection transaction mysql cron automation


PHPBuilder.com:
Transfer Data via Multiple Protocols with Libcurl
September 19, 2011 @ 12:03:23

On PHPBuilder.com today there's a new tutorial showing how to use libcurl to communicate with multiple protocols like FTP, HTTP, HTTPS, SMTP and STMPS. The libcurl library that can be compiled in or installed as a shared module in your PHP install to provide enhanced networking abilities.

As I wrote in my PHP multithreading with cURL article, the libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. PHP supports the libcurl library which allows you to connect and communicate to many different types of servers with many different types of protocols.

The tutorial focuses on two different types of connections (well, four really) - FTP/FTPS and HTTP/HTTPS - and how to transfer data across each. Some code is included to create a (procedural) tool to send an uploaded file to a remote site.

0 comments voice your opinion now!
tutorial libcurl ftp ftps http https networking multiple protocol


PHP and Me Blog:
Use Phing to Update your SVN-Version-Controlled Website Automatically, Through FTP
June 20, 2011 @ 11:57:15

On the "PHP and Me" blog there's a new entry from Pinpin Bysma showing how to use the PHP-based deployment tool Phing to update your production website via an FTP connection, automated by a Phing build.

If you're working on a PHP project, like with any other project, probably comes a time when you need to "build a new release," e.g. update the production web site with the latest version of the code. And doing the whole thing manually isn't the most efficient way to get things done, especially if you're lazy, or have to do that every once in a while, over a long period of time. [...] Obviously if updating the site itself could be done without FTP but through a simple svn switch, things would be easier. Still, Phing would allow to make things easier just as nicely. It could for example still be used to create the new tag, trigger the switch, etc

He introduces the process by showing a basic Phing build file that uses the PEAR VersionControl_SVN component to get the latest from the repository and push it to another directory. There was one thing that he wanted to do that the default SVN task couldn't - export the difference between two tags. To make this happen, he had to extend Phing and make a new task - SvnExportDiff. He includes the code for this new task and an updated build file to show it all in use - complete with the FtpDeploy to push the code live.

0 comments voice your opinion now!
phing tutorial svn website deploy ftp custom task


NetTuts.com:
How to Work with PHP and FTP
May 12, 2011 @ 08:05:21

On NetTuts.com there's a new article stepping you through what you'll need to know about using FTP in PHP, including a basic useful and expandable class.

It's always important to first outline exactly what functionality your class should include. In our case: connecting to a server, create a folder on the server, upload a file, change directory, retrieving the directory listing and downloading a file.

They first look at what FTP is and then how to set up the class that includes some simple logging, connection handling and how to call the class with a username, password and hostname. The class lets you create a remote directory, upload a file, view a list of remote files and downloading a selected file. Full source for the class is available as a download.

0 comments voice your opinion now!
ftp tutorial class


PHPBuilder.com:
Implementing Internet Protocols with PHP
January 13, 2011 @ 08:20:24

On PHPBuilder.com today there's a new tutorial from Leidago Noabeb that looks at implementing internet protocols - in this case FTP.

PHP has many functions that help us to implement Internet and/or networking protocols. In this article we will look at how to implement some of those protocols using PHP.

His examples uses PHP's FTP methods to create a simple frontend to a remote FTP server. Included is the code to get the basics of it working - listing remote files and displaying them out in a styled list.

0 comments voice your opinion now!
tutorial internet protocol ftp


Justin's Blog:
An ftp server written in PHP
May 19, 2009 @ 10:40:30

Justin has written up a quick look at a FTP server that's been written entirely in PHP - nanoFTP.

nanoFTPd is an ftp daemon written in php. as of version 4.2.0, php supports the command-line interface (stable since 4.3.0), which nanoFTPd relies on. nanoFTPd is modular, so it's easy to add custom modules and other stuff, like different database interfaces (currently supports mysql and postgresql).

The server allows for a lot of the usual FTP functionality - uploads, downloads, user authentication, logging, etc. It works with PHP 4.2 and above and is pretty simple to install.

0 comments voice your opinion now!
server nanoftp ftp


Community News:
phpanywhere (Online PHP IDE)
April 29, 2009 @ 11:12:18

The phpanywhere site boasts itself as "the easiest way to bring work with you anywhere you go - without bringing anything". The free (still in beta) service offers online PHP editing through a web browser interface.

PHPanywhere is a web based free Integrated Development Environment or IDE for the PHP language, in other words it is an application that gives developers all the code editing capabilities they need to develop PHP applications online. It includes a real-time syntax code editor with support for all web formats and a powerful FTP editor.

You can add in FTP servers and pull files directly from them to edit and upload back over. You can also use the project sharing to allow others to see the current state of your code (real-time collaboration is "coming soon"). You can see screenshots of the editor interface, setting up FTP sites and modifying permissions for the files.

4 comments voice your opinion now!
phpanywhere online ide edit ftp share


DeveloperTutorials.com:
Port Scanning and Service Status Checking in PHP
April 08, 2009 @ 08:49:21

On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.

While building web applications, it's often important to keep an eye on the other services running on your server. Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).

Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.

0 comments voice your opinion now!
port scan fsockopen socket http ftp pop3 check connection



Community Events





Don't see your event here?
Let us know!


update opinion symfony release security series podcast introduction composer install package laravel community library version framework tool interview language voicesoftheelephpant

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework