I made a contact form but it's not sending the message, subject, and the e-mail of the person that contacts me?
Contact.php : prntscr.com/5uj9mo
Index.php : prntscr.com/5uj9zt
What I get actually : prntscr.com/5ujaqd
Kind regards and thanks ALOT,
Musa.
Don't put the IP in the form as a hidden field, they can just spoof it or remove it from the form submission.
In your contact.php script, change $field_ip = $_POST['ip'];
to $field_ip = $_SERVER['REMOTE_ADDR'];
and it will solve your initial problem and ensure the IP isn't tampered with.
Also, the post field names in your form processor differ from the names used in your HTML. $_POST['cf_email']
and $_POST['cf_message]'
need to be changed to just $_POST['email']
and $_POST['message']
since in your HTML you used email
and message
as the input names.
If the file extension of the code which you have the html in is not php (or some other extension which apache will handle as php) that is exactly what will happen. Any file which you are using php in must have an extension that is handled as php. Try changing your file extension to .php
I'm just guessing, has your form page maybe the .html extension and not .php ? If it's .html, apache will not let php interprete it.
Edit :
For your third problem, have you checked that all inputs have the same name=
as the $_post
or that they're all between the <form>
tags ?
Edit : Ok the reason is because you need to call you emails info like this :
You have your inputs named like this one :
<input name="message">
So to get what is written in it :
$field_message = $_POST['message'];
So basically, in $_POST
you get the infos of your <inputs>
from your <form>
with the name of your <inputs>
Hope you're understanding me ..