Jump to content

Please help me on multi login


austine_power007

Recommended Posts

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. :)

Link to comment
Share on other sites

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 14
Wrong data.

but i also think i have some problem with my session please help me.
Link to comment
Share on other sites

[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??
Link to comment
Share on other sites

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.html

You 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.
Link to comment
Share on other sites

[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.html

You 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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.