Jump to content


Photo

Can you see the problem?


  • Please log in to reply
3 replies to this topic

#1 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 23 August 2006 - 06:15 PM

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?

$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;

Regards
Jeff
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 23 August 2006 - 06:18 PM

what about the code above that? even a space above your <?php tag counts as html
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 23 August 2006 - 06:23 PM

Even a space?

Thats a bit harsh.


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

I cant see any spaces anywhere.
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#4 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 23 August 2006 - 06:38 PM

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:

header('Location: download_item.php');

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users