To convert ASP scripts to PHP use this utility http://asp2php.naken.cc
See also http://www.asp2php.com