Jump to content

Can you see the problem?


spires

Recommended Posts

Hi,

Can any one see why the header is not working.
I'm not using any HTML before it, but its still not working?

Is there any other ways around the header function?

[code]
$arrErrors = array();

if (!empty($_POST['submit'])) {
if ($_POST['username']=='')
$arrErrors['username'] = 'Add Your Username';
if ($_POST['password']=='')
$arrErrors['password'] = 'Add Your Password';

if (count($arrErrors) == 0) {

$username=$_POST['username'];
$password=$_POST['password'];


$sql="SELECT * FROM user_info WHERE username='$username' and password='$password'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);



if ($count == 1) {
session_register('username');
session_register('password');
header('Location:download_item.php');

} else {
$noinput = '<div class="white2">Sorry. You have entered an incorrect username or password,<br> please try again';
}

  } else {
if (empty($username) || empty($password)) { 
$strError = '<div class="white2">';
foreach ($arrErrors as $error) {
$strError .= "<li>$error</li>";
}
$srtError .= '</div>';
  }
}

}


echo '<br>
<form name="form1" method="post" action="'.$_SERVER['PHP_SELF'].'">
<table width="185" height="102" border="0" cellspacing="0" cellpadding="0" background="JPGS/tags/members.jpg">
<tr>
    <td valign="middle">
<center>
  <table width="95%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e5eaee">
          <tr>
            <td colspan="3">
<div align="center" class="layerText">MEMBERS AREA </div>
</td>
          </tr>
          <tr>
            <td class="small2">
&nbsp;&nbsp;Login:
</td>
            <td colspan="2">
<div align="left">
              <input name="username" type="text" size="14" id="username" value="'.$_POST['username'].'">
            </div></td>
          </tr>
          <tr>
            <td class="small2">
&nbsp;&nbsp;Password:
</td>
            <td colspan="2">
<div align="left">
              <input name="password" type="password" size="14" id="password" value="'.$_POST['password'].'">
            </div></td>
          </tr>
          <tr>
            <td colspan="3">

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
&nbsp;&nbsp;<a href="forgot_your_password.php" class="link">Forgot your password?</a>
</td>
<td>
&nbsp;&nbsp;<input name="submit" type="image"  src="JPGS/buttons/login.jpg" value="submit">
</td>
</tr>
</table>

</td>
          </tr>
      </table>
  </center>
  </td>
  </tr>
</table>
</form>
<br>';

echo $strError;
echo $noinput;
[/code]

Regards
Jeff
Link to comment
Share on other sites

No 'echoes' or 'prints' in one of those files you included?

Btw, do you get an error, or does simply nothing happen. If nothing happens, and you get no errors, try:

[code]header('Location: download_item.php');[/code]

Yes, it's only a space, but standards and protocols can be picky.

If that doesn't help, check your download_item.php. What exactly is in there anyway?
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.