austine_power007 Posted November 22, 2006 Share Posted November 22, 2006 i am working on a project and i am new in PHP. [color=red][b]1) I need to make a page where user can logged in and view their profile. so multiple login can be done (Its like a web mail page or other website where user login). 2) After finish working user will log out from the page. how can i do it??[/b][/color][b]Please provide me some example so that it will be easy for me to understand.[/b]I am working with PHP 4.3.3 (front end) and Microsoft Access 2003 (Back end).Its urgent save me please. ???Thanks in advance. :) Quote Link to comment Share on other sites More sharing options...
printf Posted November 22, 2006 Share Posted November 22, 2006 Are you using a database for the user data?printf Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted November 22, 2006 Author Share Posted November 22, 2006 Yes i am using Microsoft Access 2003 for Using user data. the table name for user data is user_info Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted November 23, 2006 Author Share Posted November 23, 2006 is there anyone here to help me?? i m really need a sample code for this .....i have my code and getting error please can u solve? [code]<?php//include "connect_db.php";$db_conn = new COM("ADODB.Connection");$db = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("C:\Inetpub\wwwroot\DB_files\activity.mdb").";";$odbc=odbc_connect($db,'','');if (isset($_POST['Submit'])) // name of submit button{ $id=$_POST['id']; $password=$_POST['pass']; echo"$id"; echo"$password"; $query = odbc_exec($odbc, "SELECT * FROM login WHERE dev_id = '$id' and pass = '$password' ") or die ("Wrong data"); // echo"$query"; $isAuth = false; //set to false originally while($row = odbc_fetch_array($query)) { $isAuth=true; //session_start(); // $_SESSION['id']=$id; } //$page= "mypage.php";if($isAuth==true){ session_start(); $_SESSION["id"]=$_POST["id"]; header('Location: '.$page); exit; print "logged in successfully<br><br>"; print "<A href='admin.php'>Go to next Page</a>"; } else { print "Wrong username or password"; }}else { header('Location: index.php?wrong=1'); echo"Wrong Pass"; exit; }?>[/code]Here is the ERRORS i am getting :Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in c:\inetpub\wwwroot\flash\login.php on line 14Wrong data.but i also think i have some problem with my session please help me. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 23, 2006 Share Posted November 23, 2006 Are you positive you are using PHP 1.4.3? Just about every distribution / installation comes with at least version 4 these days. Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted November 23, 2006 Author Share Posted November 23, 2006 [quote author=roopurt18 link=topic=115842.msg472417#msg472417 date=1164252997]Are you positive you are using PHP 1.4.3? Just about every distribution / installation comes with at least version 4 these days.[/quote]PHP Version 4.3.3 System Windows NT 5.1 build 2600 Build Date Aug 24 2003 22:01:16 Server API CGI/FastCGI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety enabled Registered PHP Streams php, http, ftp, compress.zlib This program makes use of the Zend Scripting Language Engine:Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies Now what i can do?? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 23, 2006 Share Posted November 23, 2006 There was another thread in which someone wanted help with a login page where I had a few replies that seemed to help them, which you can read here:http://www.phpfreaks.com/forums/index.php/topic,114046.0.htmlYou might be able to pull some useful information out of that for your own login mechanism.As for the session trouble, session_start() needs to be the first line of your script, immediately after the <?php. In addition, there can't be any text, including white space, before the < in <?php.I can't help you with your ODBC problem, no experience there. Quote Link to comment Share on other sites More sharing options...
austine_power007 Posted November 23, 2006 Author Share Posted November 23, 2006 [quote author=roopurt18 link=topic=115842.msg472424#msg472424 date=1164253728]There was another thread in which someone wanted help with a login page where I had a few replies that seemed to help them, which you can read here:http://www.phpfreaks.com/forums/index.php/topic,114046.0.htmlYou might be able to pull some useful information out of that for your own login mechanism.As for the session trouble, session_start() needs to be the first line of your script, immediately after the <?php. In addition, there can't be any text, including white space, before the < in <?php.I can't help you with your ODBC problem, no experience there.[/quote]Thanks for your time roopurt18 i am glad that you helped me lot only you are alive in this forum. i already solved the problem. its MS Access which don't accept ' ' within a variable when comparing rows in a database. Thanks a lot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.