Jump to content

login help


ujjainkar

Recommended Posts

When any user logs in then i have to set cookie in another table say active _user which does not contain any data  from static table where all the verification is to be done about user. Another table does not contain any data when user logs in i have to extract data from main table and insert it in another table so that i can retrieve info about active users. How can i do this?

Thanks in advance.

Link to comment
Share on other sites

that is the most confusing Question i have EVER seen.....

 

so you have 2 table?

 

1:) holds your login data

2:) holds your details

 

you need a comon field in them lest say id "user_id"

 

so when your user logs in you need to set a cookie holding the user id.

 

then create userdtails.php

 

<?php
$user_id = $_COOKIE[user_id'];

$sql = "SELECT * FROM table WHERE user_id='$user_id'";
$sql = mysql_query($sql);
$row = mysql_fetch_assoc($sql);

$email = $row['email'];

?>

 

then at the top of each page

 

 

<?php

include ("sql_connection.php");
include ("userdetails.php");

// test use of above code

echo $email;

 

if this isnt what you want you may want to re-thing your wording.

 

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.