Jump to content

Archived

This topic is now archived and is closed to further replies.

spires

Can you see the problem?

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

Share this post


Link to post
Share on other sites
Even a space?

Thats a bit harsh.


This is the very top of the page.
[code]
<?php
include('functions/wrapper1.php');
include('dbconnect.php');
$arrErrors = array();
[/code]

I cant see any spaces anywhere.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

×

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.