Set the User Agent With PHP cURL
A few months back, I shared with you how to download the contents of a URL and execute a HTTP POST transmission using PHP cURL. For security purposes, some hosts require that a common user agent be present in the POST. If an unacceptable user agent is given, the POST is ignored. Luckily, cURL allows us to "spoof" the server using any user agent we choose:
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:188.8.131.52) Gecko/20080311 Firefox/184.108.40.206');
A little sneaky but it could get you out of a jam at some point!
Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...
new Element Madness
The first way to create UI-driven...
I released a MooTools comment preview script yesterday and got numerous requests for a jQuery version. Ask and you shall receive! I'll use the exact same CSS and HTML as yesterday.
On the keypress and blur events, we validate and...