SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: contact form problem
-
Feb 24, 2009, 05:50 #1
- Join Date
- Feb 2009
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
contact form problem
Hi all i'm sk2k newbie i need a bit help i' m new to html just built my first site from the book build your own site the right way. But i have one problum i can't get my contact form to work
i'm with 123 reg when i press send it comes up with this Method Not Allowed
The requested method POST is not allowed for the URL used freedback for
my question air. So i'm not sure if i missed out any html could you point
me in the right direction pleaseLast edited by sk2k; Feb 24, 2009 at 05:51. Reason: spelling mistake
-
Feb 24, 2009, 09:26 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Are you using a regular HTML page as the target for the action attribute in your form? You can't POST to HTML pages; you need a server-side script (e.g., written in PHP, .NET, ColdFusion, etc.).
Birnam wood is come to Dunsinane
-
Feb 24, 2009, 09:42 #3
- Join Date
- Feb 2009
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi thank you for getting back to me i want to get this sorted out asp
Yes i using html and action it did not say anything in the book on that.
Do i need to set up a php script or cgi bin not sure what to do a bit confused
something like this
<form action="" method="post" class="contact">
<fieldset>
<form enctype="multipart/form-data" method="post"
action="web address.php" accept-charset="UTF-8">Last edited by sk2k; Feb 24, 2009 at 09:56. Reason: missed a bit out
-
Feb 24, 2009, 09:52 #4
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
First of all: welcome to SitePoint Forums! (Forgot to say that in my first post.)
HTML is 'just' a markup language. It informs browsers and other user agents what various bits of content are (paragraphs, lists, tables, forms, links, etc.). It's not a programming language.
When you submit information from a form, you presumably want to do something with that info – store it in a database, send it via email, or whatever. In order to do that you need a program or a script on your server, that receives the data and does something useful with it. That's quite a lot to learn, if you're new at this.
The most you can make without a server-side application is to attempt to send the form data via email:
Code HTML4Strict:<form action="mailto:name@example.com">
Sorry to be the bearer of bad news.Birnam wood is come to Dunsinane
-
Feb 24, 2009, 10:18 #5
- Join Date
- Feb 2009
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That's ok so if i wanted this to work would i have to set up a program or a script on my server, would my host company be able to help me out with configering it or would i have
to find this script my self?
-
Feb 24, 2009, 12:18 #6
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There are scripts that you can download for trivial tasks (such as a contact form). These usually come with the appropriate HTML as well, since you have to get all the field names etc right so they match what the script is expecting. I would recommend that you become a bit more familiar with HTML before you attempt to use one of those, though. You'll need that knowledge if you want to customise the form in some way.
Your hosting company can tell you what server-side scripting language(s) they support. Really cheap hosts don't allow scripting at all, many others only support one language (often PHP). Learning a server-side language is a far bigger task than learning HTML, though. And in order to make something useful you might also need to learn SQL and database management, plus a fair bit about web security to prevent your form from being hijacked by spammers.
Some hosts offer a few ready-made scripts, too, but they're usually very simplistic and will give your site a really amateurish appearance.Birnam wood is come to Dunsinane
-
Feb 24, 2009, 14:16 #7
- Join Date
- Dec 2008
- Location
- United Kingdom
- Posts
- 197
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could try http://www.response-o-matic.com/ you just signup and they generate the HTML needed for your site and all server side is handed by them.
-
Feb 25, 2009, 03:33 #8
- Join Date
- Aug 2007
- Location
- Netherlands
- Posts
- 10,287
- Mentioned
- 51 Post(s)
- Tagged
- 2 Thread(s)
The newer edition of the book has some replacement for that one... freedform? Maybe the poster in that other thread made a typo so maybe it's called "freeform".
BTW this is the second time I've seen weird forms.
Code:<form enctype="multipart/form-data" method="post" action="web address.php" accept-charset="UTF-8">
The enctype is "multipart/form-data" by default unless your server says otherwise (if it says so in your headers you don't need to write it in your HTML form).
The accept-charset is utf-8 unless your server says otherwise. Check your headers, again it usually will already have this. Usually if the system doesn't know the charset it will try to default to utf-8 (or at least, ours do). You'd need to state this specifically if you were working with a machine that might have something else set.
The only time I see form action="" is when someone wants Javascript to do something inline like onClick on the submit. Ew. action="" keeps the validator quiet, but it's not really stating an action. I'll have it on "dummy forms" though when I build static HTML pages-- because they're dummies and don't actually interact with any servers. They don't work at all.
-
Feb 25, 2009, 11:10 #9
- Join Date
- Feb 2009
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you all for the comments i will have another look at my form and see i can get it to work.
regards
sk2k
-
Mar 3, 2009, 19:31 #10
- Join Date
- Feb 2009
- Location
- Illinois, USA
- Posts
- 126
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have the book for Building your Website the Right way too and I like it, but I also have the book Build Your Own ASP .NET 3.5 as well as a pdf of the .NET 2.0.
What you could do is implement what you learned in Building Your Website the Right Way and then use the information from the .NET book to create a contact form. Which book you buy would be up to you as you should check what your host supports.
However, if you would like for visitors to be able to e-mail you without showing your e-mail, you could use a reCaptcha control which is free, it attempts to ensure that you are human and not a web bot by having you complete a field prior to displaying an e-mail address. This can be placed in a regular html page, just like the pages you learned to build.
There was an article on this site about different kinds of Captchas, but this one includes the option to hear audio to solve the Captcha. It's at: http://recaptcha.net/
The 3.5 .Net Book is at: http://www.sitepoint.com/books/aspnet3/index-B.php which is sold in paper and pdf; I believe the 2.0 .NET book is only sold as a pdf.
You can build the site you learn about using Visual Studio 2008 Express, which is free.
Chris
Bookmarks