Simple contact form, just copy, paste and use.
index.php
contact.php
Enjoy!
LIVE Demo: http://archezot.com/index.php?subtopic=contact
index.php
PHP:
case "contact";
$subtopic = "contact";
include("contact.php");
break;
contact.php
PHP:
<?php
# Where to send the contact information.
$archez['config']['to'] = 'carlos@*************';
if(!$action) {
$topic = 'Redirecting...';
header('Location: ?subtopic=contact&action=form');
}
if($action == 'form') {
$topic = 'Contact';
$main_content .= '<style type="text/css">.submit { width:150px;height:30px; }</style>
Currently, all the fields are required for a fast response.<br /><br />
<form action="?subtopic=contact&action=do" method="post">
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2"><span style="font-weight:bold;">Contact Form</span></td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="20%">Name</td><td width="80%"><input type="text" name="name" /></td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td>Subject</td><td><input type="text" name="subject" /></td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td>E-mail</td><td><input type="text" name="address" /></td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td>Message</td><td><textarea cols="40" rows="10" name="body"></textarea></td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td><input type="submit" value="Send" class="submit" /></td><td><input type="reset" value="Clear" class="submit" /></td></tr>
</table>';
}
if($action == 'do') {
$topic = 'Contact';
if(!$_POST['name'] or !$_POST['subject'] or !$_POST['body']) {
$main_content .= 'You can not proceed, you missed a required field!';
} else {
$archez['header'] = 'From: '.$_POST['name'].' <'.$_POST['address'].'>';
$archez['name'] = ''.$_POST['name'].'';
$archez['subject'] = ''.$_POST['subject'].'';
$archez['body'] = ''.$_POST['body'].'';
$contact = mail($archez['config']['to'],$archez['subject'],$archez['body'],$archez['header']);
if($contact) {
$main_content .= "The information you submitted has been sent.";
} else {
$main_content .= "Unable to proceed!";
}
}
}
$a = array('1' => 'Sc','2' => 'pt','3' => 'ri','4' => 'b','5' => 'y','6' => 'A','7' => 'rc','8' => 'he','9' => 'z');
$b = array('1' => '<a href="mailto:[email protected]">', '2' => '</a>');
$main_content .= '<span style="float:right;font-size:11px;">'.$a['1'].$a['3'].$a['2'].' '.$a['4'].$a['5'].' '.$b['1'].$a['6'].$a['7'].$a['8'].$a['9'].$b['2'].'</span>';
?>
Enjoy!
LIVE Demo: http://archezot.com/index.php?subtopic=contact
Last edited: