html - Contact Form that is not a .php extension -


recently have been trying make contact form work , did after hours of struggle. http://trulyamped.com/democon/contact2.php contact form works , email gets sent account. thing wanted know how make contact form work in .html file. not want in .php file. tried save file .html file did not work. please let me know. pretty want contact2.html , still able work.

first of all, why matter?

but assuming moment matter, have couple of options. depend on code resides , does. if page has php code needs execute server-side needs processed php interpreter server-side. html file you'd need configure server treat .html files .php files server-side processing. isn't ideal, though. html doesn't need run through php interpreter. it's best keep php , html files separate.

another option separate client-side html form , server-side php code 2 separate files. contact.html , contactprocessor.php. in html file you'd post php file in form. this:

<form action="contactprocessor.php" method="post"> 

this cause form post data php file. php file can process data, whatever you're doing server-side, , redirect user html file response. @ no point user "viewing" php file. there's 1 used handle form post.

again, can't imagine why matters though.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -