Contact PHP Mail Form..

Page 1 of 8 123 ... LastLast

  1. Posts : 532
    Windows 8.1 64 bit
       #1

    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 Computer


  2. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #2

    your opening it as file:// ... just an ordinary file so it will display as text
    try http://localhost/RHCS/contact.php instead.
      My Computer


  3. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #3

    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 Computer


  4. Posts : 532
    Windows 8.1 64 bit
    Thread Starter
       #4

    Kaktussoft said:
    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 Computer


  5. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #5

    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 Computer


  6. Posts : 532
    Windows 8.1 64 bit
    Thread Starter
       #6

    Kaktussoft said:
    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 Computer


  7. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #7

    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!
    Contact PHP Mail Form.. Attached Files
      My Computer


  8. Posts : 532
    Windows 8.1 64 bit
    Thread Starter
       #8

    Kaktussoft said:
    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 Computer


  9. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #9

    Post your contact.php file. Then I test further. It did work on my site!
      My Computer


  10. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #10

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


 
Page 1 of 8 123 ... LastLast

  Related Discussions
Our Sites
Site Links
About 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 05:39.
Find Us