Thanks for the reply.
I have checked the coding again and it seems that there is an error which is
Parse error: parse error, unexpected T_VARIABLE in /homepages/7/d189163962/htdocs/GUTest/combined.php on line 16
from this line in the code
$form ="<form action=\"$_SERVER['PHP_SELF']\"method=\"post\">";
I have looked at the code that you have gave me and placed it in with a few amendments, but it stil dosent work.
Not to sure if I placed it in right.
<body>
<?php
$username = $_POST['username'];
$useraddr = $_POST['useraddr'];
$phoneno = $_POST['phoneno'];
$comments = $_POST['comments'];
$sent = $_POST['sent']
$form ="<form action=<?php echo $_SERVER['PHP_SELF']; ?> method=\"POST\">";
$form.="Name:<input type=\"text\" name=\"username\"";
$form.=" size=\"30\" value=\"$username\" > <br> <br>";
$form.="Email:<input type=\"text\" name=\"useraddr\"";
$form.=" size=\"30\" value=\"$useraddr\" > <br> <br>";
$form.="Phone Number:<input type=\" numbers\" name=\"phoneno\"";
$form.=" size=\"30\"value=\"$phoneno\" > <br> <br>";
$form.="value=\"Send Form\"></form>";
if($sent)
{ $valid=true;
if( !$username)
{ $errmsg.="Enter your name:<br>"; $valid=false; }
if( !$useraddr)
{ $errmsg.="Enter email address:<br>"; $valid=false; }
if( !$phoneno)
{ $errmsg.="Enter your phone number:<br>"; $valid=false; }
}
if (empty($_POST['username']) || empty($_POST['useraddr']) || empty($_POST['phoneno']){
echo "You need to set everything.";
} else {
$username = $_POST['username'];
$useraddr = $_POST['useraddr'];
$phoneno = $_POST['phoneno'];
$comments = $_POST['comments'];
$sent = $_POST['sent']
{ $to = "info@globeunited.org";
$re = "Feedback form" $username";
$msg = $comments;
$headers = "From: $useraddr \r\n";
if( mail( $to, $re, $msg, $headers ))
{ echo("Thanks for your comments, $username");}
}
?>
</body></html>