Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
- php-forum Active User
- Posts: 300
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
It is because the function can't be found and if your server is using a higher version of PHP then that is why:
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0 (read here
Therefore you need to change your code to this (I have removed the storage of the password in a session as I can't think of anything less secure - there is just no need to do so and is totally unsafe):
Code: Select all
// If result matched $myusername and $mypassword,table is 1 row
$_SESSION['myusername'] = $myusername;
echo "Wrong Username or Password";
Make sure you have session_start(): at the very top of every page where you want to use / check your session data.
- New php-forum User
- Posts: 16
- Joined: Sun Dec 12, 2010 3:14 pm
The concept behind using session_register() for loading arrays into the session was fine, but the function was tied to register_globals under the hood... (register_globals was a huge mistake in PHP's development that has since been eliminated from the language)
Try using $_SESSION, like Simplypixie posted.
Who is online
Users browsing this forum: No registered users and 6 guests