PHP

Heuristics are Nice : (working toward) Facebook-style Previews

I was thinking about how facebook updates parse out the url, then construct a nice looking preview. I think what it takes is scanning the textarea for a url, and then using ajax to tell the server to fetch a summary of the page at the url. get the data back, and insert it into a template, and reveal it.

Reused a Variable Name

I accidentally reused the variable name $count twice in a function.

WordPress: Exporting Articles into WordPress Extended RSS (WXR)

This is an example template file that will export articles from your bespoke CMS to and XML file that WordPress version 3.5 will import.

Learning the Facebook API

For the past few months I've been working on web apps. The first was a mobile site based on jQuery Mobile. While it was "cool", it quickly dawned on me that it wouldn't get any significant usership. For one, it was like a clone of 4square and Scvngr - and who really uses that? I'd peer into the lists of checkins, and it wasn't looking too encouraging. People use it when they're bored and alone, and my scenario didn't involve either of those situations.

PHP Namespaces with Autoloader Example

It took a while to wrap my mind around PHP namespaces - despite the fact I've needed them for years. It's just one of those features that seems weirder in PHP than in other systems. But that's normal for PHP - quirky. Unfortunately, it's not quirky like Perl, where the quirk eventually makes you feel good. With PHP you just feel kind of odd, maybe a little inferior... like your language is slipping toward becoming the Visual Basic of the web.

Drupal Updated (and a few bugs)

What a pain in the ass. Drupal updates look so slick when they work, but when they fail, it's a nightmare. I ended up reverting to a backup and doing it by the book (which seems to matter a lot), and lost a few posts. Oh well. They were mostly programming posts so the code's around somewhere, and probably slightly improved, and may end up on here again.

PHP Runs an Old Version of PCRE Causing Problems with Drupal and MediaWiki

This seems to happen a lot - and it took several searches and many pages of reading to find the solution. This page will try to even the odds a little more.

Decode php Shells Obfuscated with eval gzunzip base64_encode str_rot13

I got hacked (more than once) and they installed a backdoor php shell. It sucked (and I must suck for allowing it to happen...

A Demo of Transmitting Passwords Encrypted

This is a demo of a technique to transmit password encrypted. It's not a perfect solution yet, but it's getting there.

Mass Convert IP Addresses to Domain Names with a Filter

A PHP script to convert many IP addresses to domain names.

Data and Input Validation with Filters (PHP 5.2 and up)

For years (and years) we've done data validation in PHP "by hand" either with string functions or with regular expressions. The problem with PHP has been that, well, PHP programmers aren't so great at regexs. Also, unlike Perl, there's no data tainting feature that forces you to validate your inputs before they're used in expressions. The upshot is that a lot of bad data gets through. PHP finally added some data validation function, but it seems like nobody is using them. It still lacks tainting. The former problem, we can address.

Reading Code with GVIM/VIM and ctags

Vim has a couple features to make it easy to read C (and PHP and Perl) code.

First is the "go to file" feature.

PHP OOP Links

This is a list of links to articles about OOP in PHP. I need to read up on it. Though I know the OO features (most of them at least) I wanted to read some code.

Decoding gzinflate base64_decode

Some themes add a copyright notice using a technique also seen in hack scripts. They take the PHP code, and the base64 encode it, and gzip it.

.


Syndicate content