PHP – Make Form Contact


contactphp
Step by step for make Form Contact Website:

1. Copas this script to new page editor, save name “contact.html”
Script:
<form action=”cekcontact.php” method=”post”>
<table border=0 cellpadding=4>
<tr><td>Nama:</td><td><input type=”text” name=”nama”></td></tr>
<tr><td>Email: </td><td><input type=”text” name=”email”></td></tr>
<tr><td>Subjek:</td><td><input type=”text” name=”subjek”></td></tr>
<tr><td>Pesan: </td><td><textarea name=”pesan” cols=”50″ rows=”10″></textarea></td></tr>
<tr><td colspan=2><input name=”vemail” type=”submit” value=”KIRIM”> <input type=”Reset” value=”CANCEL”></td></tr>
</table>
</form>

2. Copas this script to new page editor, save name “cekcontact.php”
Script:
<?php

$nama=$_POST[‘nama’];
$email=$_POST[’email’];
$subjek=$_POST[‘subjek’];
$pesan=$_POST[‘pesan’];

$to=”handexcel@gmail.com”;
$header=”From: $email”;

@mail($to, $subjek, $pesan, $header);?>
<script language=”JavaScript”>alert(‘Pesan Success Di kirim.’);
document.location=’index.php'</script>
<?php

?>

note: “handexcel@gmail.com” change your email.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s