Below is a collection of examples and snippets you can use inside Apaches htaccess files to modify behaviour of your website. Everything from altering the URL structure to disabling directory listing on your domain and blocking certain IP addresses.
WPTweeter is a WordPress plugin that I have developed to automatically update my Twitter feed when new content is posted or updated on my website. It’s a very basic plugin, with only a small amount of features (the ones I use) such as global hashtags and URL shortening.
There are many, many jQuery accordions floating around on the internet – Many of them are too complicated for a simple task, options, styles and different effects. I was recently challenged to make a very simple jQuery accordion with the least amount of code needed. I have uploaded an example of this Just Here
PHP has a very useful library – The DOM Document. Using this you’ll be able to get the source code of a page and go through each element of the HTML filtering out what you need and don’t need, If you’re using this for scraping websites for information the DOMDocument library is invaluable.
Below I will be showing you how to get the source code of an external website and return an array of links.
Twitter has now moved over to OAuth (no longer supporting Basic Auth) – You’re now forced to use this when wanting to post/retrieve information using a Twitter account and Twitter Application. Since searching around I haven’t found any good examples of how to post a Tweet to twitter using the Twitter REST API.
I will be using a third party library as an example and creating an wrapper class to set it up and use it, all you’ll have to do is include a file and a few lines of code to get started. Before we proceed you’ll need to download the Twitter OAuth API from GitHUB by Clicking Here which is developed by Abraham Williams.
Developing your own Captcha verifications can be quite simple with PHP and the GD library. I’ve made a very basic captcha class below that should give you a head start when protecting your web pages from automated bots. Like I said, this is a very simple implementation so It isn’t perfect but It’s a start.
cURL is a very powerful command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos…), file transfer resume, proxy tunneling and a busload of other useful tricks.
In this post I’ll be showing you a basic class I put together to be used with PHP – It’ll allow you to fetch the source code, info and headers of a remote website.