|
Posted by Benjamin Esham on 11/09/18 11:53
walterbyrd wrote:
> Okay, I think I may be making some progress. My authenticate.php now
> starts like this [...] And that seems to work.
Good to hear.
> > > Benjamin Esham wrote:
> >
> > The $username and $password were empty because you have register_globals
> > off; this means that you can only access your form variables through
> > $_POST. *This is the way it should be!* Turning register_globals on is
> > potentially a great security risk.
>
> Okay, from now on I will have register_globals on. Er, how do I do that?
Perhaps you misunderstood: most people consider register_globals a potential
security risk and advise to leave it off, as it seems to be already for you.
Either way, reading this page will do a better job of explaining.
http://us3.php.net/register_globals
> > This error is caused by sending output before headers. "Output" is
> > usually your outputted HTML code, but *any text at all*, including
> > whitespace, that comes before the opening <?php
>
> I am certain that is not the case. I have absolutely nothing before the
> <?php or after the ?>, not even white space.
OK, but does this file contain any right-to-left (e.g. Hebrew or Arabic)
text? Another recent thread in this group involved some phantom bytes at
the beginning of a file due to the different text direction, and the same
problem occurred there. (The reason that I'm being really persistent about
the beginning of the file is because I can't really think of any other
possible cause to this problem.)
> > By the way, I'm not sure whether using HTTP_REFERER is the best way to
> > return to the previous page. You're probably better off just doing a
> >
> > header('Location: login_form.php');
>
> Did that. It works. Thanks.
OK, cool.
> My script is still giving me trouble, only now in a different part.
>
> Warning: Cannot modify header information - headers already sent by
> (output started at C:\xampp\htdocs\WMS\authenticate.php:29) in
> C:\xampp\htdocs\WMS\authenticate.php on line 30
This is the same problem you were having before: somehow, text is being
outputted before the headers or cookie information can be sent. Go back
through your code; take a look at *everything* that happens between the time
your script is called and your cookie commands. Make sure that nothing
generates any output (remember, error messages count as output). Hopefully
the error rests with something in there.
HTH,
--
Benjamin D. Esham
bdesham@gmail.com | AIM: bdesham128 | Jabber: same as e-mail
"Men never do evil so completely and cheerfully as when they
do it from religious conviction." — Blaise Pascal
Navigation:
[Reply to this message]
|