Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PHP] BELAJAR PHP FOR NEWBIE
#11
(11-19-2011, 11:20 PM)Up_ Wrote: pake gini bro killerbyte

login.html
PHP Code:
<form action="login.php" method="post"> <input type="text" name="user"> <input type="password" name="password"> <input type="submit" name="submit" value="Login" > <form>

terus buat nangkap file login.html

login.php
PHP Code:
<?php if(($_POST['user']=='admin') AND ($_POST['password']=='hackernewbie')) { echo 'Selamat, Anda Telah Berhasil Login dengan User Name :'.$_POST['user']; } else { echo '<body text='red'><strong><center>Username Atau Password Salah Atau mungkin Anda Maho<br /><a href='login.html'><h4>Kembali Ke Login</h4></a></center></strong></body>'; } ?>

Keterangan
1. login.html
<form action="login.php" method="post"> ..form login mengirim data melalui metode post ke file login.php
2. login.php
($_POST['user']=='admin') AND ($_POST['password']=='hackernewbie') ..dan login.php menerima...!!

jika form user dan form passwordd iisi [admin] dan [hackernewbie] maka Benar..jika tidak.. anda tidak bisa login..

kalo yg ini ane udah bisa, yg ane cari yg ada penggunaan cookies atau semacamnya jadi nggak perlu login lagi kalo mau masuk ktab yg sama
[Image: siggi.gif]
Reply


Messages In This Thread
[PHP] BELAJAR PHP FOR NEWBIE - by Dika_xb - 11-19-2011, 06:30 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by d0ey_Grunch - 11-19-2011, 06:41 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by CMDhuman.Jr - 11-19-2011, 06:48 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by Jahat - 11-19-2011, 07:04 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by positive - 11-19-2011, 07:09 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by elzoo - 11-19-2011, 07:31 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by Dr.A - 11-19-2011, 08:54 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by killerbyte - 11-19-2011, 10:26 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by A5tr0 - 11-19-2011, 11:16 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by Up_ - 11-19-2011, 11:20 PM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by killerbyte - 11-22-2011, 04:41 AM
RE: [PHP] BELAJAR PHP FOR NEWBIE - by Dika_xb - 11-22-2011, 10:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PHP] Belajar simplexml_load_file pada PHP hogyz 7 116 08-28-2014, 08:27 AM
Last Post: newbie-herbet
  Belajar Php & HtML yook Up_ 162 5,582 08-03-2014, 12:19 AM
Last Post: zombiers_keder
  [php newbie] extends Dika_xb 1 63 12-15-2011, 09:24 PM
Last Post: BossSarkem
  [php for newbie] class Dika_xb 4 103 12-06-2011, 01:42 AM
Last Post: hiatus
  schools online program newbie .... soepri 8 209 12-05-2011, 02:00 PM
Last Post: soepri
  [php for newbie] DEFINE . RAND . STRLEN . GABUNG STRING Dika_xb 11 143 09-29-2011, 10:20 PM
Last Post: thedexwan
Death_16 Belajar Coding CSS (Cassading Style Sheet) NatyaOrigamiâ„¢ 13 319 05-08-2011, 08:53 PM
Last Post: Racifa

Forum Jump:


Users browsing this thread: 1 Guest(s)