 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DevShed: Implementing Internet Protocols with PHP
by Chris Cornutt June 04, 2008 @ 09:32:22
On DevShed today, there's a new tutorial on showing how to create a simple application to use one of the simpler protocols - 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.
They introduce the FTP functions for PHP (a basic list, PHP manual style) and include the code - the CSS to make it easier to use and the PHP code to make the FTP connection and grab the remote file listing. A screenshot is included to give you an idea of the end result.
voice your opinion now!
tutorial ftp protocol application css remote file list
Chris Hartjes' Blog: How To HTTP-PUT A File Somewhere Using PHP
by Chris Cornutt January 14, 2008 @ 09:39:00
Chris Hartjes has a quick post (but complete with code) about moving files around a bit differently than the norm - it's his method for using a HTTP-PUT to push a file out.
A work project is getting close to 0.1 status. Pretty underwhelming, I know. One of the last 'milestones' for 0.1 is taking these wonderful XML documents that my web app creates and sends them to an internal web service. This web service will accept documents via an HTTP PUT [...] so I dug around a bit on the web and put together some code.
The code is a generic "publish" method that opens a stream to the remote server and, in a binary format, pushes the contents of a local file and parses out the response.
voice your opinion now!
http put remote location file push http put remote location file push
Gareth Heyes' Blog: Faking the unexpected
by Chris Cornutt December 04, 2007 @ 08:36:04
Gareth Heyes has an example of yet another way he's seen developers incorrectly handle incoming connections and the information inside. This time, he focuses on the remote IP coming from the client.
Developers place too much trust in everything, they assume that certain data cannot be faked and therefore these pieces of data can be used as a Trojan horse. Lets take the REMOTE IP of a user, it seems a trusted source because of the TCP/IP connection between the user and the server.
He points out the difference between HTTP_X_FORWARDED_FOR and REMOTE_ADDR and how, despite them being the same almost all of the time, shouldn't be trusted since they could be spoofed. He even includes an example script showing how it could be done (and how a bit of Javascript can even be inserted).
voice your opinion now!
remoteaddr httpxforwardedfor remote ip address exploit remoteaddr httpxforwardedfor remote ip address exploit
Jonathan Street's Blog: When scraping content from the web don't make it obvious
by Chris Cornutt November 07, 2007 @ 11:26:00
Jonathan Street has a tip for those developers out there that have no other choice than scraping content from a remote site - don't make it obvious. He also includes a suggestion on how to make it a little less obvious.
A couple of hours ago I was playing around scraping some content from a website. All was going well until suddenly I couldn't get my script to fetch meaningful content. [...] The first thing I did was stop visiting the site for 15 minutes or so and then increase the time between requests. It briefly worked again but quickly stopped.
One simple change to his user agent string in his php.ini made the problem evaporate pointing to a user agent filtering happening on the remote side. His helpful hint involves two methods - one in just PHP and the other in cURL - to change the user agent that your scripts are sending. An even better sort of solution might be some sort of rotating array that would alternate between four or five strings to make things even more random.
voice your opinion now!
scrape content remote server useragent filter modify phpini scrape content remote server useragent filter modify phpini
|
Community Events
Don't see your event here? Let us know!
|