Jump to content

HTML form for blog


blogsmith

Recommended Posts

I have only used Notepad to create HTML documents stored in my computer and have never tried creating a normal website. But I am very familiar with Google Blogger. I see this in w3schools (edited):<form>Name: <input type="text" name="name"><br>email address: <input type="text" name="emailaddress"></form>I haven't tried putting this in a blog, but expect it to show a box for inputting the info requested, but what will it do? Is it possible to use something like this in a blog to collect visitors' names and email address? If so, how? If not, what are the alternatives?Thanks.

Link to comment
Share on other sites

There's nothing special about a "blog", where you are allowed to use certain things there and not in other places. You can use that code on any web page to show a form, it doesn't matter if that web page is a blog, or a photo gallery, or a forum, or a plain web page, or whatever. It's all just web pages.The form needs an action, which will be a page that the form information gets sent when you press submit. That action will need to be a page such as a PHP or ASP page that can read the form information and send the email, or whatever else you want to do.

Link to comment
Share on other sites

The form needs an action, which will be a page that the form information gets sent when you press submit. That action will need to be a page such as a PHP or ASP page that can read the form information and send the email, or whatever else you want to do.
Sounds like I will need to have a website that uses PHP or ASP, etc which definately will not be available on blogspot.com where we have no access to the server and no choice as to software used (they use XHTML)OK, I put the form on the blog. I set up a site that uses PHP. How do I format that script for HTML form to send the info to the site with PHP which will then relay the info to my email address, for example. The example shown above don't seem to provide for this as it will only display the requested info and the box to input the info.
Link to comment
Share on other sites

You need to specify a form action like this:<form action="send_email.php" method="post">The page that is inside the action will need to read the information from $_POST and send the email. The PHP tutorial on the w3schools site has a section about using PHP to process forms, and there is also a PHP tutorial thread in the PHP forum that shows how to process a form. For email, do a Google search for PHP email to see how that's done, you need to use the mail function:http://www.php.net/manual/en/function.mail.php

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...