<?php if ($Submit<>"")
{ if ($email == "")
{ $message = "E-mail cannot be empty";
$msg = "Require"; }
if ($mailmessage == "" )
{ $mailfm = "Message cannot be empty";
$msg = "Require"; }
if ($msg == "")
{
$result = "E-mail : $email\n\n";
$result .= "Message : $mailmessage\n";
$to = "contact@findlogos.in";
$subject = "Live Message";
$mailheader =""; mail($to, $subject, $result, $mailheader);
$send = "Message sent successfully";
} }
?>
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Live Message</title>
<style type='text/css'>
.cfm {
padding-top: 50px;
}
.frm {
font-family: verdana;
font-size: 15px; padding-top: 10px;
margin-left: 25px;
}
.cfrm {
font-family: verdana;
font-size: 15px;
padding-top: 25px;
margin-left: 25px;
}
#email { width: 253px;
height: 25px; margin-left:
18px;
}
textarea {
vertical-align: top;
}
#submit {
width: 80px;
height: 32px;
margin-top: 25px;
margin-left: 180px;
}
.msg {
margin-top: 50px; margin-left: 93px;
}
.message {
margin-top: 15px;
margin-left: 93px;
}
.cnfrm {
margin-top: 30px;
margin-left: 143px;
}
</style>
</head>
<body>
<form id="cfm" name="form1" method="post" action="">
<p> </p> <p><font size="5">Use the form below to contact</font></p>
<div class="cnfrm">
<?php echo $send; ?>
</div> <div class="msg">
<?php echo $message; ?> </div>
<div class="frm">
<label>E-mail</label>
<input id="email" name="email" type="text">
</div>
<div class="message">
<?php echo $mailfm; ?>
</div>
<div class="cfrm">
<label>Message</label>
<textarea name="mailmessage" cols="29" rows="10"></textarea>
</div>
<div class="send">
<input id="submit" name="Submit" type="submit" value="Submit"> </div>
</form>
</body>
</html>
Create another file sendmessage.php and write the following code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title></title>
<style type='text/css'>
.send {
position: fixed; bottom: 3px;
right: 15px;
}
#msg {
background: #f8bc3a;
width: 200px
height: 35px;
}
</style>
<script language="JavaScript">
function email() {
var frm = 'directories=no,location=no,menubar=no,titlebar=no,toolbar=no,scrollbars=no,status=no';
var cfrm = 'width=500,height=350';
var cnfrm = frm + ',' + cfrm;
var msg = open("http://www.company name/cform.php", 'myWin', cnfrm); }
</script>
</head>
<body>
<div class="send">
<input id="msg" value="Send Message" onclick="email();" type="submit">
</div>
</body>
</html>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)