Don't know about eBay, but usually it works that way:
- database engine (lets say mySQL),
- http server (lets say Apache).
You use a bunch of scripts to send queries to database engine and fetch answers. There is no problem is including php in html (although you have to say Apache to parse every HTML in search for php code, which can be a performance hit). It's no problem to run all of this on a single computer.
I don't know if I understood your worries, but such a site with dynamic content would need a connection to database, so yes, it should be online. :-)
http://www.freewebmasterhelp.com/tutorials/php - You will find a php tutorial here. PHP/mySQL tutorial is linked somwhere there.
--
trochej