note 102634 added to function.odbc-connect

From: Date: Fri, 25 Feb 2011 12:04:59 +0000
Subject: note 102634 added to function.odbc-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-177321@lists.php.net to get a copy of this message
ca you please help me with these codes? I am making a login page using ms access as the database <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php session_start(); $tbl_name="tbllogin"; $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("C:\Users\SASHUU\Desktop\troll\DBstudent.mdb").";"; $conn=odbc_connect($connstr,'','') or die("connect error: ".odbc_error()); // get passed parameters $username=trim(stripslashes($_POST['username'])); $password=trim(stripslashes($_POST['password'])); $sql="SELECT * FROM $tbllogin WHERE username='$username' and password='$password'"; // prepare and execute in 1 statement $result=odbc_exec($conn,$stmt) or die ("result error ".odbc_error().'-'.odbc_errormsg()); // if no result: no rows read if (!odbc_fetch_row($result)) die("Wrong Username or Password"); // else: all is okay else { $_SESSION['username']=$username; $_SESSION['password']=$password; header("form.html"); } odbc_close($conn); ?> </body> </html> ---- Server IP: 69.147.83.197 Probable Submitter: 112.202.158.146 ---- Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php Edit -- https://master.php.net/note/edit/102634 Del: integrated -- https://master.php.net/note/delete/102634/integrated Del: useless -- https://master.php.net/note/delete/102634/useless Del: bad code -- https://master.php.net/note/delete/102634/bad+code Del: spam -- https://master.php.net/note/delete/102634/spam Del: non-english -- https://master.php.net/note/delete/102634/non-english Del: in docs -- https://master.php.net/note/delete/102634/in+docs Del: other reasons-- https://master.php.net/note/delete/102634 Reject -- https://master.php.net/note/reject/102634 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177321) next »