Skip to main content

Create Simple Form Using PHP

Now, writter invite you to study hoe to create Simple Fom PHP.
Form example, we will a Comment Form, in the Comment Form, user will insert a name, email, and comment. For easy on this project, we will devide into 3 parts of pages, the pages is  comment_form.html, process.php, view.php, and connection.php.

Before you create that pages, writter suggest to create a Database first. 
Okay, the name of Database who created by writter is blog and the name of table is guest. Tha guest table are having 4 Field, there are id_guest, name, email, and comment. For detail of Fields, look at Below


After you create a Database, Table, and Field. Now, you create a connection.php page. That script like at below
<?
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "blog";

mysql_connect($hostname,$username,$password) or die ("Error connection...");

mysql_select_db($dbname);
?> 
And than, you create a comment_form.html page. That script like at below


<html>
<head>
<title>Comment Form</title>
</head>
<body>
<h1>Comment Form</h1>
<br>
<form method="post" action="process.php">
<table border="0" width="400">
<tr>
<td width="100">Name</td>
<td width="2">:</td>
<td width="298"><input type="text" name="name_guest" size="30"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input type="text" name="email_guest" size="30"></td>
</tr>
<tr>
<td>Comment</td>
<td>:</td>
<td><textarea name="comment_guest" cols="24" rows="5"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="send" value="Comment">&nbsp;<input type="reset" name="reset" value="Reset"></td>
</tr>
</table>
</form>
<br>
</body>
</html>


Than, you can create a process.php page. That script look at below
<?php
require("connection.php");
$name_guest = $_POST['name_guest'];
$email_guest = $_POST['email_guest'];
$comment = $_POST['comment_guest'];
$sql = "insert into guest(id_guest,name,email,comment) values ('','$name_guest','$email_guest','$comment')";
mysql_query($sql) or die ("error SQL query...!!!");
?>
<h3>Your Comment is Successfully....</h3>

And the last page is vew.php. Look at below


<html>
<head>
<title>View Comment</title>
</head>
<body>
<h2>View Comment</h2>
<?php
require("connection.php");
$sql = "select * from guest";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$name = $row['name'];
$email = $row['email'];
$comment = $row['comment'];
echo "Name : <b>$name</b><br>";
echo "Email : <b>$email</b><br>";
echo "Comment : <b>$comment</b><br>";
echo "<hr>";
}
?>
</body>
</html>


Finish, if you want to try it,

First, open the comment_form.html page. And complate the form, look at below


Second, Klik Comment,  if successfully, the this display like at below


Third, view all comment was inserted with open the view.php page. Look at below...

Okay, finish...
if you have any problems, you can leave your ask into comment at below.

Happy Paper 4Share !!!

Comments

Popular posts from this blog

eXploit WP Themes Brainstorm Arbitrary File Upload Vulnerability

Hello World ; Malam Fans, Please Say Hello Haters :* xixixhi, Nuenomaru disini,  Sekarang Nue akan Share   Tutorial Deface dengan eXploit WP Themes Brainstorm Arbitrary File Upload Vulnerability * ini exploit lama sih wkwkw exploit ini salah satu bug/celah yang ada pada theme di CMS WordPress. iseng2 aja share, Kali aja masih  crotz  wkwkw * yg master minggir dlu ;* Lanjut intip tutor ae gaes :* mau sampai kapan ?! Dork: inurl:/wp-content/themes/brainstorm (Selebihnya kebangin lg menggunakan imajinasi vokepers kalian, biar dpt yg vuln n verawan) 1. Dorking di search Engine 2. pilih salah satu web target yg pengen ente tusb0l pak wkwk, lalu masukan exploitnya. exploit: /[path]/ /wp-content/themes/brainstorm/functions/jwpanel/scripts/uploadify/uploadify.php 3. Vulnerability ~ Blank Kurang lebih sih gituh awkkaw~ 4. Buat File Baru Berekstensi .php Contoh brain.php Dan Simpan Script Berikut Di Directory C:/XAMPP/php Masukan Script Berikut Edit-Edit Dikit dan taruh juga shell sobat di dire

Method Amazon Terbaru + Seller

Hallo Sobat Cyber, Kali Ini Saya Akan Membagikan Method AMAZON. Mungkin Sobat Sudah Pada Tahu Apa Itu AMAZON, Dan Sudah Tahu Juga Method AMAZON Bagi Yang Hoby Carding. Tapi Masih Ada Juga Sobat Yang Belom Tahu Method Untuk Carding Di AMAZON. Bagi Sobat Yang Penasaran Method Amazon, Silahkan Ikuti Tutorial Dari Saya, Cekidot : Alat Tempurnya : Akun Amazon VPN Premium, ane sih pake hma Jika sobat punya akun uk,fr,de,it,dll. loginnya di amazon . com aja, pake seller yang dibawah, jadi misalkan agan punya akun IT, akun itu gaperlu selalu login di amazon.it, di amazon . com juga bisa.Tapi jika sobat punya seller sendiri sillahkan gunakan :D boleh di amazon manapun :v Jika sobat co sebaiknya 1 1 dulu, setelah prepairing silahkan order lagi.   METHODE PAKE AKUN BULE (BILL=SHIP) : -Siapkan akun amazon live pastinya harus have card -Connect VPN sesuai negara cc akunnya, lalu clear cookies and chache - Terus Buka Check2ip.com dan atur tanggal dan waktu nya agar tidak ada yang merah -Buka a

How To Install Xpath Automated Sqli tool on Windows

Assalamualaikum warohmatullah wabarokatuh ^_^ Download Xpath Automated Sqli tool Mirror 1 Mirror 2 Bahan-Bahan : -Python27 -Prettytable -Requests -Colorama Langkah-langkahnya soub : 1. Install Python :v 2. Install Module  [ Prettytable ] Buka CMD, Masuk ke Directory C:/Python27/Scripts kemudian eksekusi perintah berikut : C:\Python27\Scripts>pip install prettytable 3. Install Module [ Requests ] Buka CMD, Masuk ke Directory C:/Python27/Scripts kemudian eksekusi perintah berikut : C:\Python27\Scripts>pip install requests 4. Install Module [ Colorama ] Buka CMD, Masuk ke Directory C:/Python27/Scripts kemudian eksekusi perintah berikut : C:\Python27\Scripts>pip install colorama 5.  Berhasil Terinstall ^_^ Cara pemakaiannya : xpath.py -u http://www.test.com/index.php?id=1 --dbs xpath.py -u http://www.test.com/ --data "index.php?id=1" --dbs Yang Mau bertanya silahkan di kolom komentar