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
#12
no oot plis
just share tentang konsep2 belajar php aja dulu

@killerbyte
coba cari tentang setcookie dan cara membaca cookie
di php.net ada mungkin
=====================
im back
Reply
#13
Kereen Bro,,,,


Siiip


dapat ilmu baru,,asssiikkkkk
[Image: 262_433049166739904_488152172_n.jpg]
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)