Jump to content

[SOLVED] Problems with contact form in PHP!!


laurieballard

Recommended Posts

Hi

 

I have coded a contact form in HTML and created a PHP script to send the form to my email address. I uploaded both to the server and when i click on 'Send' it just takes me to the php script as if t is a link instead of running the actual script itself.

 

The coding is below:

 

This is the HTML code i used to create the form

 

http://www.complain2.co.uk/test/text/contactus.txt

 

This is the PHP script i used (minus the <?php and ?> tags)

 

http://www.complain2.co.uk/test/text/contactform.txt

 

The actual form on the server is here

 

http://www.complain2.co.uk/test/contactus.html

 

Any help would be appreciated.

Link to comment
Share on other sites

yeah i realized that you may indeed have had it correct (I viewed source of your actual link and your action points to a .php) so... what type of hosting do you have? You may want to check your mime types in your cpanel make sure php is listed as an application and .php is listed as a mime type for it.  Failing that, you probably want to contact your host and ask them wtf.

Link to comment
Share on other sites

Thanks for the fast responses.

 

The phpinfo is in the link below

 

http://www.complain2.co.uk/test/phpinfo.php

 

under default_mimetype it says 'text/html'.....would this be correct?

 

I have a forum on the webserver which uses PHP and it works perfectly so i am guessing php is workinh correctly on the server.

 

Does the actual php code look correct because i am completely new to php and this is my first script?

Link to comment
Share on other sites

oh ok i was a bit unsure of that bit anyway...i thought it would take the user to the thanks.html page on the server......it doesnt echo anything when you click 'Send' so i am guessing its not even getting as far as that part in the code.

 

To be honest i dont think it is running the php script at all....does the html code look ok?

Link to comment
Share on other sites

ah, well, the link you posted to the text file version is missing a > on your closing form tag but when I view source of the real link it's all there and the form part of your html is okay.  I enter in some random information into your form and it takes me to your .php file.

 

And I think it's being processed because if it wasn't recognizing it, it would just spit out your code like a text file.  But if the code you posted is exactly what you have, minus the php tags..it should work.  So it's definitely something to do with the server.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.