I am surprised that how google allows to create ads on its server and after creating that ad it generates the script file. That script file can be used in any page (Raw html, php, aspx, jsp etc...).
However I am not competing with Google, but I want to know that how it is possible to let user of site create/customize a form and after finalization generate a script file which can be used any where. An example can be seen here http://www.jotform.com/
or polldaddy.com etc.
Any other alternative approach is appreciated.