Contact form is not showing headers

Started on the old forum in November 2013 · view the original in the archive · old links redirect here

6 replies · 422 views · started 13 years ago · 1 min read

3 participants
Sumeeth6666 Junior · 15 posts #1

I have a contact form in my site...when i send message through it the headers are not displayed...rest everything is displayed.and i want to set required field for email and address and show error message when not filled out...please give some idea i am new to it

Attachments: send-mail.php
something else Fellow · 2,296 posts #2

I would try adding:

$headers .= 'X-Mailer: PHP/' . phpversion();

to your existing headers

Sumeeth6666 Junior · 15 posts #3

something else wrote: I would try adding:

$headers .= 'X-Mailer: PHP/' . phpversion();

to your existing headers

that isnt working...

Added after 29 minutes:

Can you please give me a contact form that has required fields and secure...

arnage Lead · 811 posts #4

Form:

echo '<input type="text" name="your_email" value="' . $youremail . '"/>';

Check:

$your_email = !empty($_POST['your_email']) ? $_POST['your_email'] : null;
if (isset($your_email)) {
// continue..
}
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
Sumeeth6666 Junior · 15 posts #5

arnage wrote: Form:

echo '<input type="text" name="your_email" value="' . $youremail . '"/>';

Check:

$your_email = !empty($_POST['your_email']) ? $_POST['your_email'] : null;
if (isset($your_email)) {
// continue..
}

and where can i put error message to be displayed

arnage Lead · 811 posts #6

This is an example, you will had to see this structure how it actually works...

if (isset($your_email)) { 
// continue.. 
} else {

// 1.
echo 'No e-mail';

// 2.
$error = 'No e-mail';

}
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
something else Fellow · 2,296 posts #7

Try turning on php error messages to see if the headers parameter has been disabled by the host.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close