PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have the following code, to try to log a user in, the only problem is everytime it fails and complains about line 13 ($count=mysql_num_rows($result);) Can anyone spot the problem?
now got that sorted but getting the following error when trying to register some session vars:
Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at /home/tom10001/public_html/edit/login.php:7) in /home/tom10001/public_html/edit/login.php on line 17
tommy1987 wrote:Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at /home/tom10001/public_html/edit/login.php:7) in /home/tom10001/public_html/edit/login.php on line 17
you're probably outputting something (even whitespace will trigger that error) above your session declaration. search this forum for 'headers already sent', you'll find a billion and 5 posts about it.
$HTTP_POST_VARS has been transitioned out to $_POST, unless you're using an old version of PHP.
By using $myusername and $mypassword without any filtration and/or transformation you may have a security hole that could allow anyone access to your site.
Unless you're using a fairly old version of PHP, session_register() shouldn't be called, ever.
header() based redirection needs full URLs to be standards compliant. Your current web server may not have a problem with them, nor may the browser you are using, but if moved to another server or someone with a different browser attempts to use this page, it may not work. A full URL starts with "http://" and so forth.