[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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!

6.2

about Header in PHP

Asked by tom_mk in PHP Scripting Language

Tags: gb2312

hi, this is the code of mine.
some i got it from this site ( http://www.phpfreaks.com/tutorials/77/1.php )
it's a tut about 'Customized Timeout Sessions'

i am trying to incoperate tat site code with mine. but i have very little knowleage about header thingly.
and i not sure what i did wrong here.

any suggestion would be appreciate, and some comment on how header works would be great.
what i know now about header is, we use header to redirect to other site, or pop user for a file to download.

anyway, this is my code,
and this is the error i received from firefox when i tried to run the code.
------------------------------------------------------------------------------------------------------------------------------------------------------
redirection limit for this URL exceeded. unable to load the requestes page. this may by caused by cookies that area blocked.
--------------------------------------------------------------------------------------------------------------------------------------------------------

code
-----------------

<?php

session_start();
header("Cache-control: private"); //IE 6 Fix

$username = null;

function validate_user($username, $password)
{
      if(($username == 'admin') and ($password = 'admin'))
      {      
            return true;
      }
      else
      {
            return false;
      }
}

if (($username != null) && ($password != null ))
{
      if (validate_user($username,$password) == true)
      {  
        //session_start();
        //session_register('username'); // not good due to security reason
            //session_register('password');
            
            $username      = $_POST['name'];
            $password      = $_POST['password_field'];

            $_SESSION['name'] = $username;
            $_SESSION['password'] = $password;        
            
            $sess_id = session_id();
        header("Location: index.php?PHPSESSID=$sess_id&new_login=1");
        exit;        
    }
      else
      {
        $message = urlencode("<b>ERROR:</b> Username does not exist.");
        header("Location: session1.php?message=$message");
        exit;
    }
}
else
{
    $message = urlencode("<b>ERROR:</b> You must enter a username and password to enter.");
      header("Location: session1.php?message=$message");
      exit;
}


?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" method="post" action="session1.php">
  <table width="232" height="94" border="0">
    <tr>
      <td width="76" valign="bottom">Username </td>
      <td colspan="3"><input name="name" type="text" id="name_filed"></td>
    </tr>
    <tr>
      <td valign="bottom"><br>
Password </td>
      <td colspan="3"><input type="password" name="password_field"></td>
    </tr>
    <tr>
      <td rowspan="2">&nbsp;</td>
      <td colspan="2"><input type="checkbox" name="checkbox" value="checkbox">
      remember me?</td>
      <td width="49" rowspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td width="46"><input name="enter_button" type="submit" id="enter_button" value="Enter"></td>
      <td width="98"><input name="reset_button" type="reset" id="reset_button" value="Reset"></td>
    </tr>
  </table>
</form>

<a href = "session2.php"> GO2- ession2 </a>

</body>
</html>
[+][-]06/29/05 10:58 PM, ID: 14335743Accepted Solution

View this solution now by starting your 30-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: gb2312
Sign Up Now!
Solution Provided By: ravikiran_mullangi
Participating Experts: 1
Solution Grade: C
 
[+][-]06/29/05 11:06 PM, ID: 14335763Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/30/05 12:26 AM, ID: 14336006Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/30/05 01:25 AM, ID: 14336251Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/30/05 01:27 AM, ID: 14336260Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/30/05 01:33 AM, ID: 14336288Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92