[PHP] Premature EOS Header

2001-12-22 Thread Anthony F. Rodriguez

When I call the following script, I get Premature End of Script Header. Why?
?php
// file: root/reg/dis/dis_4.php, updated: 12/15/01
$connection=@mysql_connect(localhost,wagner,pw) or die (No connection!);

$db=@mysql_select_db(sbwresearch,$connection) or die (No database!);

$qry_1=select * from con_inf where username=\$username\;
$result_1=@mysql_query($qry_1,$connection) or die (No query # 1!);
$row_1=@mysql_affected_rows();

// username

if ($row_1==0)
{
  @mysql_free_result($result_1);
  @mysql_close($connection);
  header (location:dis_2.htm);
  exit;
}

// password

else
{
  $row_2=@mysql_fetch_array($result_1);
};

if ($password!=$row_2[password])
{
  @mysql_free_result($result_1);
  @mysql_close($connection);
  header (location:dis_3.htm);
  exit;
}

else

{
  echo 
  html
  body
  TEST
  /body
  /html
  ;
};

@mysql_free_result($result_1);
@mysql_close($connection);
exit;
?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])




Re: [PHP] Premature EOS Header

2001-12-22 Thread Brian Clark

* Anthony F. Rodriguez ([EMAIL PROTECTED]) [Dec 22. 2001 10:25]:

 When I call the following script, I get Premature End of Script Header. Why?
 ?php

[...]

 if ($password!=$row_2[password])
 {
   @mysql_free_result($result_1);
   @mysql_close($connection);
   header (location:dis_3.htm);

It may be because of that ^^^ line. Try this:

header(Location: dis_3.htm);

Or check your server's error_log (which is bound to give you the reason
why).

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Common sense is not.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]