Search Webmaster Help and Solution

Spaces being removed on form submittion

Hi everyone,
this is a curious little problem that I have run into that I can not quite explain.

Login box: contains two fields for username and password. On submit it gets sent to login.php where by sessions are registered for the username(I.e. neil) if the username/password is found using:

PHP Code: SELECT * FROM cms_admin WHERE username=$myuser and password=$mypassword
Echoing the $_SESSION[username] shows the username as correct, i.e. neil.

However! If we add a space after the username when logging in, the echo statement of $_SESSION[myuser] shows neil but when progressing to the user menu the $_SESSION[myuser] miraculously adds in the space at the end of the username.

This is damn confusing which i do apologise for but any suggestions anyone may have I am sure would be amazingly helpful. Hi everyone,
this is a curious little problem that I have run into that I can not quite explain.

Login box: contains two fields for username and password. On submit it gets sent to login.php where by sessions are registered for the username(I.e. neil) if the username/password is found using:

PHP Code: SELECT * FROM cms_admin WHERE username=$myuser and password=$mypassword
Echoing the $_SESSION[username] shows the username as correct, i.e. neil.

However! If we add a space after the username when logging in, the echo statement of $_SESSION[myuser] shows neil but when progressing to the user menu the $_SESSION[myuser] miraculously adds in the space at the end of the username.

This is damn confusing which i do apologise for but any suggestions anyone may have I am sure would be amazingly helpful.

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).