I'm looking for a cheap flash, and found this one. It states that it works for Pentax K-7; will it work for my Pentax K-5 as well? I don't know what to look for in the specifications.
It depends on what you call "work". The flash does not support PTTL, so you'll get a flash that will require you to operate it (or your camera?) manually (to enter ISO, length, apperture, shutter speed, etc.). The documentation writes "Flash control: Automatic at F2.8", so it is not clear how you adjust it for other appertures or ISO values.
If you are looking for a "point&shoot"-like operation of theflash, you'd probably better to stay with PTTL flashes.
The cheapest original flash would be AF200FG: http://www.pentaximaging.com/accessories/AF200FG/ however it lacks many feature.
I would try finding 2nd hand Sigmas: Sigma EF-530 or 610
You may want to have a look at this site: http://pttl.mattdm.org/
Anyway, getting correct exposure with K5 flash is tricky, so feel free to come back with more questions after you buy your flash ;)
This particular model looks like a generic, "dumb" slave that will work with anything. Look at the list of brands it supports, and it calls itself "universal". So, yes, it's very likely that it will work.
Some flashes are "dedicated": they work with a specific system only. If you buy a third-party flash — that is, not from your camera brand directly — the flash protocol is usually reverse engineered, and usually they require a firmware update to work with new camera bodies. (Sometimes, they work completely, sometimes only partially, sometimes not at all.)
If you get your flash from a big-name third party like Metz, Sigma, or Nissin, these firmware updates are usually fairly prompt. For newer models, they can even be done over USB by the end-user. For others you have to send it back for service, usually paying only the cost of shipping.
If you buy a cheaper model (like a rebadged "Tumax" flash — very common in the Pentax world), firmware updates are much less likely to be easy.
But in this case, as I said, it shouldn't matter.
Yes. There is nothing changed between the K-5 and K-7 regarding flash support.