Web-to-lead forms doesn't work when embedded

Web-to-lead forms doesn't work when embedded

I was able to create a web-to-lead form which works fine when I paste its code into a separate file (attached). But when I embed the code into our public web site page, it does not work. Please advise.

Thanks!

Note: the attached file is actually an html file but could not be attached as such. Rename it from txt to html for testing.