PDA

View Full Version : PHP forms



mathare
5th September 2004, 17:05
I've been looking around on the web for ways in which to create a feedback form for a website. I found some PHP tutorials that seemed to lead me through what I want to do (create a form that sends an e-mail) but for some reason I keep getting Error 405 "Method not found" when I hit the submit button.

What am I doing wrong?

I am using my free webspace on Blueyonder which claims to be running PHP version 4.2.2. I'm developing the website in MS Frontpage (except the PHP which was written in Notepad). I normally use Frontpage to uplaod the files via FTP to the server but I have tried WS_FTP in case Frontpage wasn't transferring the PHP as ASCII.

Any ideas?

The specific error is "The requested method POST is not allowed for URL /sendmail.php"

Win2Win
5th September 2004, 17:39
I think it means your address to the sendmail.php is incorrect, I think you need to include the full server address, not the web address, but I'm still learning PHP (got a little side tracked with poker!!).

mathare
5th September 2004, 17:43
The HTML I have in the webpage has in it

form action="sendmail.php" method="post"
<FROM method="post" action="sendmail.php">
and both the webpage and PHP script file are in the same folder on the server. That's what the sites on the web seemed to be telling me to do.

I tried having a look at the source for some other feedback forms on the web but when I try View Source it doesn't work :(

I know what you mean about the poker though - I have given up on the form and have brought up Ladbrokes poker room :)

Win2Win
5th September 2004, 18:08
But have you checked the senmail script is installed by the host or called something else? Now I've lost me :doh

mathare
5th September 2004, 18:12
Sendmail.PHP is what I have written and added to my area on the server. The host (Blueyonder) claim they are running PHP 4.2.2

I'm pretty lost myself but at least the poker is going well

zomby
5th September 2004, 18:27
Mat,

Do Blueyonder offer you a mysql database (I'm with them but can't be :butthead: checking). If they do, have you thought about going whole-hog (so to speak) and installing a CMS like Mambo or e107 that has all of the stuff built in (contact forms, polls, guest books, etc), but allows you to create (or modify) a theme to suit your tastes?

mathare
5th September 2004, 18:30
OK, slowly, from the start please :)

I know what SQL is and I've heard of mysql, not that I know the difference. I haven't seen it mentioned on Blueyonder's website admin pages though. So I assume they don't offer it.

CMS - content management system? I work in a job where CMS has at least three different meanings, and none of them are website related.

I don't know a lot about creating websites, hence why I am using FrontPage and scrounging code snippets off the web.

Win2Win
5th September 2004, 18:35
You don't need MySQL for a form!!

mathare
5th September 2004, 18:36
I didn't think you did :doh

zomby
5th September 2004, 18:39
mysql / sql are just different flavors of database. All of Keith's forums use databases to store information (the posts by us). You're probably right about blueyonder not offering it though.

CMS is content management system, as you thought. It basically allows you to install a script that will let you post any information to your website without ever going into something as nasty as frontpage, it's all done via your webpage. Pretty similar to vBulletin is that used here and phpBB that Keith uses on other sites. ie, you can type stuff into the webpage and it automically appears without you creating html or php files. The only difference between vBulletin or PhPbb and a CMS is that the CMS's are more feature rich.

I have a php script on one of my sites that I nicked off someone else, I'll see if I can dig it up for you before the morning.

TheOldhamWhisper
5th September 2004, 18:39
I think you need to change sendmail to sendmail.php in your form action.

zomby
5th September 2004, 18:43
Ughh, I must have whacked it from my server..Have a look at the link below (mods feel free to delete it and kick my **** if you want to). The link below has literally 100's of php form processors, some with wizards to get you up and running. The one I was using was from there but I can't remember which one it was.. :geek

http://www.hotscripts.com/PHP/Scripts_and_Programs/Form_Processors/index.html

mathare
5th September 2004, 18:44
Err, that's a cock-up on my part in the forum post. It says sendmail.php in the HTML but the forum kept deleting my tags or doing something odd so I just ended up typing it out without the tags and mistyped it. I'll correct it now...

mathare
5th September 2004, 21:09
Ughh, I must have whacked it from my server..Have a look at the link below (mods feel free to delete it and kick my **** if you want to). The link below has literally 100's of php form processors, some with wizards to get you up and running. The one I was using was from there but I can't remember which one it was.. :geek

http://www.hotscripts.com/PHP/Scripts_and_Programs/Form_Processors/index.html
Just been looking through that site Zomby. There's some good stuff on there and I have tried a few of the scripts but I still get the same error :(

mathare
5th September 2004, 21:25
Tried working through some Blueyonder diagnostic stuff.

They have a test PHP file you can download and upload to your site, then navigate to in a browser. That's their instructions.

I have put a copy in the root area of my site on the server, gone to my site's default/home page and then typed in the name of the script on the end so the address bar read

http://www.<mysite>.co.uk/test-php.php

What happens then is a dialog box saying File Download opens up warning me the file may contain harmful content and giving me options to Open, Save, Cancel or get More Info. If I hit Open it says it can't find something in my temporary internet files folder.

I'm now very confused. I had hoped this would help me establish whether or not PHP was working on my website. It doesn't seem as if it is but I could just be doing something wrong I suppose.

Anyone able to offer any help?

Win2Win
6th September 2004, 08:42
PHP will be working if they say it's installed, but the problem maybe be your trying to send the email through a system that isn't on the server. Try using a 3rd party sendmail script.

The reason they may not have the sendmail function operating on the server is because its free space and to prevent spam.

GlosRFC
8th September 2004, 12:34
Mathare,

You say that you're using your "free" space - if so, it does not have PHP installed. You have to pay an additional £4 per month for Tier 2 webspace to have PHP enabled.

View Source - when you say this doesn't work, do you mean that when you right-click and select View Source on any webpage, nothing happens? If so, it means that your Temporary Internet folders have become overloaded/corrupted. Go into Tools, Internet Options, Delete Temporary Internet Files and the View Source option will be restored to normal.

mathare
12th September 2004, 16:29
Only just seen this Glos, cheers for the heads-up. I didn't realise that the operated two tiers of webspace. So I can't use PHP or ASP or anything like that so I'll have to make do with their ZISP mailer script.

I mean exactly that on the View Source thing. I will do as you suggest and clear out the temporary internet files.

manckevin
12th September 2004, 22:57
Another link that may help, at least in the interim is http://www.response-o-matic.com - again, mods, feel free to delete and kiss my :censored: if you ain't gonna allow this which is posted with all good intentions.

bigcumba
12th September 2004, 22:59
Bend over and pucker up then.... :yikes:

Link is Ok by me Kevin - looks useful!

John
12th September 2004, 23:10
Seen this before, I think Sparky might have posted it when I was after some help with a form?

Link is fine by me btw. :)

GlosRFC
13th September 2004, 16:34
Hi Mathare,

Correct, you will need to upgrade.
And deleting your temp internet files is almost guaranteed to solve the View Source issue - it's a known IE6 bug that Microsoft seem extremely tardy in addressing.

Glad to have helped

sparkyminer
13th September 2004, 23:07
Seen this before, I think Sparky might have posted it when I was after some help with a form?

Link is fine by me btw. :)
I'd be absolutely gobsmacked if it was me who posted it SJ Ooo , I wouldn't have a clue. It took 2 days to e-mail my sim team to Vegy. :geek :yikes: :)

manckevin
14th September 2004, 22:56
Apologies, the above should actually read KICK my and not KISS my!