User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,582 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,640 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1122 | Replies: 21 | Solved
Reply
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to direct page to login page

  #11  
Feb 19th, 2008
You are welcome!
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 7
Reputation: amit6sharma86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
amit6sharma86 amit6sharma86 is offline Offline
Newbie Poster

Re: How to direct page to login page

  #12  
Feb 20th, 2008
$username = $_POST['user'];
$password = $_POST['pass'];

$sql="Select memid,passw from member where memid='$username'";
$result = dbQuery($sql);
// $numProduct = dbNumRows($result);
while ($row = dbFetchAssoc($result)) {
//extract($row);
if($username == $row['memid'] && $password == $row['passw'] )
{
session_start();
$_SESSION['adnuser']=$_POST['user'];
if (isset($_SESSION['login_return_url'])) {
header('Location: '. $_SESSION['login_return_url'].'DBGSESSID='.$_REQUEST[DBGSESSID].'&PHPSESSID='.$_REQUEST[PHPSESSID].'');
exit;
} else {
header('Location: index.php?DBGSESSID='.$_REQUEST[DBGSESSID].'&PHPSESSID='.$_REQUEST[PHPSESSID].'');
exit;
}

}
Reply With Quote  
Join Date: Sep 2006
Posts: 86
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to direct page to login page

  #13  
Feb 21st, 2008
hi guys when user get login... how to get its id and store it to other table?
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to direct page to login page

  #14  
Feb 21st, 2008
Can you explain in detail what exactly you mean by that ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Sep 2006
Posts: 86
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to direct page to login page

  #15  
Feb 21st, 2008
Yes.... I want the particular ID.... When a user get online i need to obtain its aurto generated ID of its Database and to store it in variable ... coz i am making a forum.... and have to use the ID for a Particular thread... like this user Starts this thread....
So hope u Understand?

Regards
Scorpion
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to direct page to login page

  #16  
Feb 21st, 2008
  1. $q="select * from user_table where username='$user' and password='$password'"; //when the user is logging in
  2. $result=mysql_query($q);
  3. if(mysql_num_rows($result) > 0) {
  4. echo "Valid user";
  5. while($row=mysql_fetch_array($result)){
  6. $id=$row['id']; //is the autogenerated id
  7. echo "Id is ". $id; //$id will have the id
  8. }
  9. } else {
  10. echo "Invalid user";
  11. exit;
  12. }

Something like that ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Sep 2006
Posts: 86
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Men I Fix it before your Response

  #17  
Feb 21st, 2008
Men I Fix it before your Response
But After All Thanks A lot for your Response
Glad to see this

Regards
Scorpionz
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to direct page to login page

  #18  
Feb 22nd, 2008
Great ! congrats !
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Sep 2006
Posts: 86
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: How to direct page to login page

  #19  
Feb 22nd, 2008
Thanks Buddy!!!
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to direct page to login page

  #20  
Feb 22nd, 2008
If your problem is fixed, why not mark this thread as solved ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 10:53 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC