Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Contact PHP Mail Form..

16 Oct 2013   #1

Windows 8.1 64 bit
 
 
Contact PHP Mail Form..

Hey Guys , anyone here have experience with PHP , especially when it comes to creating a contact form. If you do will you be able to help me with my problem?. I am trying to send mail through my contact form but it's not working for some reason. Every time I click on my contact link I am presented with

Contact PHP Mail Form..-2qvsj1s.png

PHP CODE
hastebin

HTML CODE

hastebin



My System SpecsSystem Spec
.

16 Oct 2013   #2

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

your opening it as file:// ... just an ordinary file so it will display as text
try http://localhost/RHCS/contact.php instead.
My System SpecsSystem Spec
16 Oct 2013   #3

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

What html page do you open? I mean http:/localhost/ ..... html
I may not start with file!!

I think it's http://localhost/RHCS/NameOfhtmlfile.html
or http://localhost/NameOfhtmlfile.html
My System SpecsSystem Spec
.


16 Oct 2013   #4

Windows 8.1 64 bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
What html page do you open? I mean http:/localhost/ ..... html
I may not start with file!!
That was the problem, the location I was entering was incorrect which cause the page to load as a text file. Thanks man, although I have errors now. and it's not displaying the $strValidationMessage.I know I am forgetting some mail functions but I don't know exactly what.

Contact PHP Mail Form..-errors.png


My System SpecsSystem Spec
16 Oct 2013   #5

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

What errors? Mail is actually sent and recieved? If not check some mail.err and mail.log file.
Also check php.ini : it has some entries like:
SMTP = smtp.somemailserver.com
smtp_port = 25

Copy/paste those lines please to forum (only needed if mail has not been sent succesfully)
My System SpecsSystem Spec
16 Oct 2013   #6

Windows 8.1 64 bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
What errors? Mail is actually sent and recieved? If not check some mail.err and mail.log file.
Also check php.ini : it has some entries like:
SMTP = smtp.somemailserver.com
smtp_port = 25

Copy/paste those lines please to forum (only needed if mail has not been sent succesfully)
I Just posted the errors , look at my last post.
My System SpecsSystem Spec
16 Oct 2013   #7

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

I merged the two scripts together. Of course they can't talk to each other... so $strValidationMessage doesn't work.
Also you format to give the form elements a correct name. And some typos.

See attachment for final script (both scripts you posetd merged together). It works (just tested).
Remove line: echo $name.$email.$message;
from source I posted!


Attached Files
File Type: txt contact.php.txt (2.8 KB, 12 views)
My System SpecsSystem Spec
16 Oct 2013   #8

Windows 8.1 64 bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
I merged the two scripts together. Of course they can't talk to each other... so $strValidationMessage doesn't work.
Also you format to give the form elements a correct name. And some typos.

See attachment for final script (both scripts you posetd merged together). It works (just tested).
Remove line: echo $name.$email.$message;
from source I posted!
awesome it worked but whenever add echo "$strValidationMessage" it gives me an error , I want the text to display if nothing is filled saying Email has to be filled , name has to be filled, etc.

It's giving me and undefined variable .
Contact PHP Mail Form..-error.png


My System SpecsSystem Spec
16 Oct 2013   #9

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Post your contact.php file. Then I test further. It did work on my site!
My System SpecsSystem Spec
16 Oct 2013   #10

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

It actually does sent an email if all fields are entered? You recieve the mail correctly (check subject, sender etc)?
My System SpecsSystem Spec
Reply

 Contact PHP Mail Form..





Thread Tools



Similar help and support threads for2: Contact PHP Mail Form..
Thread Forum
Got windows 8 Pro upgrade in form of ISO Installation & Setup
Collecting information from an interactive form via e-mail Browsers & Mail
apostrophe in mail changes form Browsers & Mail
Techtracker form cnet Software
How to fill sevenforums form General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:22 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33