$login =(trim($_POST['login'])); // login name# h( E% Z' V! I& P5 ^% [
$passwd =(trim($_POST['passwd'])); // login passord
3 j. Y: e: u/ l6 a* O% Y4 H! N! e /**************************************************************************/+ ?1 M* f( F; M+ S, S
, c- ~" \" Q( a //Validating UserName and Password
3 E e: b2 f" `" r4 H $valid = 1;
: s+ Y! x& ?! d G if(ereg(" ",$login)) $valid = 0;4 ^9 l# q( H$ `
if(ereg(" ",$passwd)) $valid = 0;3 r4 O8 D; n- U- h7 j2 k! K7 _% P
if($valid == 0)
6 w: C q' p2 H2 {7 l# j) i {
' `3 i& E$ j* V header("Location:index.php?Err=ad1002");
. x" K4 q7 X# z1 t+ Y4 W# ~6 d1 n exit;
$ S5 a8 H# M3 T5 P7 `: b+ H# I0 o }8 W: j/ X4 r4 j, D# [
- a4 J" M% s8 e& b1 {4 n
/********************checking login***************************************/
/ g% F& P9 ~" }, w
5 g) N4 M( ^, e1 n* p $sql ="SELECT * FROM partners_admin where pma_login='$login'='$login' AND pma_password='$passwd'";4 W2 A# j% W, m5 Q3 S! C" K6 Q
$result =mysql_query($sql);7 g. N8 b/ \; ?$ a" t
echo mysql_error();
& H. c ^- {/ N$ s4 o, S6 s4 X( j if(mysql_num_rows($result)) //login sussess ful/ ^* S+ t& ?! k/ h/ ]
# P/ P* [/ l$ y- ~& K' k! j. z+ Q+ x! Q: N6 Q; I
------------------------------
9 k6 E# s8 F% g: A, r, r8 B! `3 d. N3 p! z% y4 w
這到底是怎麼驗證登錄的
" x' p9 W1 k0 l, S這個驗證和sql沒關係吧 |
|