misi mas mau tanya lagi nih,.
klo saya punya script seperti ini:
<?php
session_start();
if($_POST) {
$nama = $_POST['nama'];
$email = $_POST['email'];
$telp = $_POST['telp'];
$berat = $_POST['berat'];
$jumlah = $_POST['jumlah'];
$isi = $_POST['isi'];
$tanggal = $_POST['tanggal'];
$company = $_POST['company'];
$alamat = $_POST['alamat'];
$error = array();
if(empty($nama)){
$error['nama'] = 'NAMA tidak boleh Kosong';
}
if(empty($email)){
$error['email'] = 'EMAIL tidak boleh Kosong';
}
if(empty($telp)){
$error['telp'] = 'No.TELP tidak boleh Kosong';
}
if(empty($berat)){
$error['berat'] = 'BERAT BARANG tidak boleh Kosong';
}
if(empty($jumlah)){
$error['jumlah'] = 'JUMLAH BARANG tidak boleh Kosong';
}
if(empty($tanggal)){
$error['tanggal'] = 'WAKTU PENJEMPUTAN tidak boleh Kosong';
}
if(empty($isi)){
$error['isi'] = 'ISI tidak boleh Kosong';
}
if(empty($alamat)){
$error['alamat'] = 'ALAMAT tidak boleh Kosong';
}
if(empty($error)){
//prosess data
} else{
$_SESSION['error'] = $error;
$_SESSION['post'] = $_POST;
header("location: pickupbox.php");
}
$to = "info@mywebsite.com";
$subject = 'Request PickUp';
$email = $_REQUEST['email'] ;
$nama = $_REQUEST['nama'] ;
$message = $_REQUEST['telp'] ;
$message .= $_REQUEST['berat'] ;
$message .= $_REQUEST['jumlah'] ;
$message .= $_REQUEST['isi'] ;
$message .= $_REQUEST['tanggal'] ;
$message .= $_REQUEST['company'] ;
$message .= $_REQUEST['alamat'] ;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional header
$headers .= 'From: $email' . "\r\n";
$headers .= 'Cc: email_cc' . "\r\n";
mail($nama, $email, $subject, $message, $headers);
}
?>
<body>
<?php
session_start();
if(isset($_SESSION['error'])){
$error = $_SESSION['error'];
$_POST = $_SESSION['post'];
unset($_SESSION['error']);
unset($_SESSION['post']);
}
?>
<form name="PickUp" method="post" action="pickupreq.php" enctype="multipart/form-data">
<table align="center" style="margin-top:15px;">
<tr>
<td valign="top">NAMA</td>
<td height="45px" valign="top">:
<input name="nama" id="nama" type="text" size="33" value="<?php echo isset($_POST['nama']) ? $_POST['nama'] : '';?>"/></div>
<div style="color:red; position: relative;">
<?php echo isset($error['nama']) ? $error['nama'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">EMAIL</td>
<td height="45px" valign="top">:
<input name="email" id="email" type="text" size="33" value="<?php echo isset($_POST['email']) ? $_POST['email'] : '';?>"/>
<div style="color:red">
<?php echo isset($error['email']) ? $error['email'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">TELP</td>
<td height="45px" valign="top">:
<input name="telp" id="telp" type="number" size="33" placeholder="Telp / HP yang dapat di Hubungi" value="<?php echo isset($_POST['telp']) ? $_POST['telp'] : '';?>"/>
<div style="color:red">
<?php echo isset($error['telp']) ? $error['telp'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">BERAT BARANG</td>
<td height="45px" valign="top">:
<input name="berat" id="berat" type="text" size="33" value="<?php echo isset($_POST['berat']) ? $_POST['berat'] : '';?>"/>
<div style="color:red">
<?php echo isset($error['berat']) ? $error['berat'] : '';?>
</div>
</td>
</tr> <tr>
<td valign="top">JUMLAH BARANG</td>
<td height="45px" valign="top">:
<input name="jumlah" id="jumlah" type="text" size="33" value="<?php echo isset($_POST['jumlah']) ? $_POST['jumlah'] : '';?>"/>
<div style="color:red">
<?php echo isset($error['jumlah']) ? $error['jumlah'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">ISI KIRIMAN</td>
<td height="45px" valign="top">:
<input name="isi" id="isi" type="text" size="33" value="<?php echo isset($_POST['isi']) ? $_POST['isi'] : '';?>"/>
<div style="color:red">
<?php echo isset($error['isi']) ? $error['isi'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">WAKTU PENJEMPUTAN</td>
<td height="45px" valign="top">:
<input name="tanggal" id="tanggal" type="text" size="33" value="<?php echo isset($_POST['tanggal']) ? $_POST['tanggal'] : '';?>" />
<div style="color:red">
<?php echo isset($error['tanggal']) ? $error['tanggal'] : '';?>
</div>
</td>
</tr>
<tr>
<td valign="top">ALAMAT<br />
</td>
<td height="161px" valign="top">:
<input name="company" id="company" type="text" placeholder="Nama Perusahaan / Usaha" size="33" value="<?php echo isset($_POST['company']) ? $_POST['company'] : '';?>"/>
<div style="float:bottom; margin-left:8px; margin-top:5px;">
<textarea name="alamat" cols="25" rows="5" id="alamat" type="text" placeholder="Penulisan Alamat Harus Lengkap dan Jelas" value="<?php echo isset($_POST['alamat']) ? $_POST['alamat'] : '';?>"></textarea>
</div>
<div style="color:red">
<?php echo isset($error['alamat']) ? $error['alamat'] : '';?>
</div>
</td>
</tr>
<tr>
<td> </td>
<td>
<input name="submit" type="Submit" value="REQUEST PickUp" />
<input name="button" type="button" value="BATAL" onclick="closeWin()" />
</td>
</tr>
</table>
</form>
</body>
mohon pencerahan nya mas untuk mengirim form html tersebut ke dalam email admin,..
saya jg kurang yakin untuk script mail php yg saya buat,.mohon penjelasan ny mas,..
terimakasih