You are here: Re: $HTTP_REFERER crashes my system like clockwork « PHP Programming Language « IT news, forums, messages
Re: $HTTP_REFERER crashes my system like clockwork

Posted by walterbyrd on 10/17/01 11:53

Benjamin Esham wrote:
>
> This may or may not help, but is there really no space between "Location:"
> and "$HTTP_REFERER"? Because there should be.
>

I found that I can set PHP to 4.4.2-pl1 with Xampp. That didn't help. I
tried putting in a space, that didn't help either.

> Also, you might try using $_SERVER['HTTP_REFERER'] instead, assuming you're
> running PHP >= 4.1.0.
>

I am not sure exactly how to do this. I had:

header("Location: $HTTP_REFER");

Do I keep the quotes? Do I keep the "Location:" ? It doesn't seem to
work either way.

I tried it like this:

header($_SERVER['HTTP_REFERER']);

And got these errors:

Warning: Cannot modify header information - headers already sent by
(output started at C:\xampp\htdocs\WMS\authenticate.php:2) in
C:\xampp\htdocs\WMS\authenticate.php on line 5

I also don't understand why this works perfectly on my web-site. Also,
I don't understand why I'm not getting my $username and $password
strings.

This is from by index.html file:
<form action="authenticate.php" method="post">
Username:<br>
<input type="text" name="username">
<br><br>
Password:<br>
<input type="password" name="password">
<br><br>
<input type="submit" name="Log In">
</form>


This is the authenticate.php file:
<?php
#if either form field is empty return to the log-in page
if ( (!$username) or (!$password) )
{
header($_SERVER['HTTP_REFERER']);
exit();
}


The $username and $password strings seem to be empty. I tested them.

> HTH,
> --
> Benjamin D. Esham
> bdesham@gmail.com | AIM: bdesham128 | Jabber: same as e-mail
> "I think I'd most like to spend a day with Harry. I'd take him
> out for a meal and apologise for everything I've put him through."
> - J. K. Rowling

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация