•
•
•
•
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
![]() |
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 238
•
•
Join Date: Feb 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 1
$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;
}
}
$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;
}
}
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 238
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*
*PM asking for help will be ignored*
•
•
Join Date: Sep 2006
Posts: 86
Reputation:
Rep Power: 2
Solved Threads: 0
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
So hope u Understand?
Regards
Scorpion
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 238
php Syntax (Toggle Plain Text)
$q="select * from user_table where username='$user' and password='$password'"; //when the user is logging in $result=mysql_query($q); if(mysql_num_rows($result) > 0) { echo "Valid user"; while($row=mysql_fetch_array($result)){ $id=$row['id']; //is the autogenerated id echo "Id is ". $id; //$id will have the id } } else { echo "Invalid user"; exit; }
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*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 238
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 238
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*
*PM asking for help will be ignored*
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- How to disable Back button of IE when executing welcome.aspx page? (ASP.NET)
- Creating a login page (ASP)
- Please help with login page code behind (ASP.NET)
- ASP.NET Registration Page (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: Parse error: syntax error, unexpected T_VARIABLE
- Next Thread: change row to colum


You are welcome! 
Linear Mode