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
Rawad

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

-2qvsj1s.png

PHP CODE
hastebin

HTML CODE

hastebin




My System SpecsSystem Spec
.

16 Oct 2013   #2
Kaktussoft

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
Kaktussoft

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
Rawad

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.

-errors.png


My System SpecsSystem Spec
16 Oct 2013   #5
Kaktussoft

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
Rawad

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
Kaktussoft

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
Rawad

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 .
-error.png


My System SpecsSystem Spec
16 Oct 2013   #9
Kaktussoft

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
Kaktussoft

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
Thread Forum
How can I save a new contact in G-mail
I use 'Basic HTML' view in G-mail. How can I manually save a new contact to my contacts list, by typing the e-mail of the contact and saving it? Thank you,
Browsers & Mail
My Yahoo Mail Spamming too other Contact
guys . i want ask ... there's any way too solved this problem? my Email send spam Email too my other mail ,and my other account too... my friends said change the password... but i want ask too, after i changed the password, the old one password can't use anymore? Thanks
Browsers & Mail
Remove contact from windows mail ? !
I've deleted it from windows mail contacts, and from within explorer contacts but when I type the persons name it comes up as the old email address I deleted not the new contact... How can I remove the contact completely so the new contact details are initiated when I type the persons name in...
Browsers & Mail
Collecting information from an interactive form via e-mail
My site is working properly, but lately I added a form to inter act with my clients but it seems that it does not work with people that have live mail set on their laptop with windows 7. Every time the click the submit button on my form, live mail starts & opens a new mail window instead of sending...
Browsers & Mail
apostrophe in mail changes form
Using windows 7 and live mail, an apostrophe used in an outgoing mail changes to a series of characters which I can only illustrate by an attachment. Before sending, the message reads 'I've been'. Having sent it, looking at the message in the 'Sent' folder shows the message already distorted and...
Browsers & Mail
Is there any way to add a brand new contact within an open e-mail?
I've been banging my head against the wall and I was hoping someone could help.... :mad: I am using Windows 7 / Outlook 2010.
Browsers & Mail

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 02:46.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App