Could it be that your code from the other site relies on the use of global variables?
On DreamHost, if you use PHP5, register_globals is OFF by default; with DH’s PHP4, they are ON.
One easy way to “test” to see if this is, indeed, responsible for your error, is to set your domain to use PHP4 from the Control Panel > Domains -> Manage Domains screen. Just click the “edit” link under the “Web Hosting” column in the row for your domain, change the radio button to PHP 4x, and “save” the changes. You can always change it back to PHP5 if you wish at a later time.
If the register_globals setting was the problem, then your pages should work under PHP4. If that is the case, you can either modify your code to work without the register_globals setting being “ON” (best choice, and some info on how to do that is in that wiki article I linked above), or just run your script(s) under PHP4.