Advertisement

07.01.2007 at 08:54AM PDT, ID: 22669318
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

php login script

Asked by Steggs in PHP Scripting Language

Tags: , ,

Hello,

I have this php login script which checks the username and password in a database... the problem is that it goes straight to the ELSE statement. I think I have set up everything correctly i.e the user details in the database... maybe I am not querying the database correctly, I don't know. How do you debug this kind of thing? Here is the script:

<?php
// Check for required fields from the form
if ((!$_POST[username]) || (!$_POST[password])) {
    header("Location: /somepage.php");
    exit;
}

// Connect to server and select database
$conn = mysql_connect("localhost","#######","########")
or die(mysql_error());
mysql_select_db("arbhleh_clientDB",$conn) or die(mysql_error());

// create and issue the query
$sql = "select clientName from clientDetails where username =
'$_POST[username]' AND password = password('$_POST[password]')";
$result = mysql_query($sql,$conn) or die(mysql_error());

// get the number of rows in the result set; should be 1 if a match
if (mysql_num_rows($result) == 1) {

    // if authorized, get the value of clientName
    $clientName = mysql_result($result, 0, 'clientName');
       
    // set authorization cookie
    setcookie("auth", "1", 0, "/", "my website", 0);
   
    // create display string
    $display_block = "<p>$clientName is authorized!</p>
    <p>Authorized Users' Menu:
    <ul>
    <li><a href=\"secretpage.php\">secret page</a>
    </ul>";
   
} else {

        // redirect back to login form if not authorized
        header("Location: /anotherpage.php");
        exit;
}
?>
<html>

</html>Start Free Trial
[+][-]07.01.2007 at 09:00AM PDT, ID: 19399404

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 09:05AM PDT, ID: 19399414

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.01.2007 at 09:14AM PDT, ID: 19399446

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 09:17AM PDT, ID: 19399465

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 09:33AM PDT, ID: 19399505

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 12:17PM PDT, ID: 19399898

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 12:20PM PDT, ID: 19399903

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 12:27PM PDT, ID: 19399917

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 12:47PM PDT, ID: 19399969

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 12:50PM PDT, ID: 19399982

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: login, php, script
Sign Up Now!
Solution Provided By: yodercm
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.01.2007 at 12:52PM PDT, ID: 19399989

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.01.2007 at 12:54PM PDT, ID: 19399997

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 01:01PM PDT, ID: 19400016

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 01:02PM PDT, ID: 19400020

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2007 at 03:17PM PDT, ID: 19400307

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42