From our sponsor: Elevate all your marketing with Mailchimp Smarts.
Here’s an updated version of the PHP Login System. You can check the old version here.
The following was added:
1. Registration fields:
- email confirmation
- password confirmation
- country
- recaptcha
Email confirmation and password confirmation are configurable fields. By default they are shown, but if you wish to remove one or both of them you have to set it in the file constants.php:
define("REPEAT_EMAIL",true);
define("REPEAT_PASSWORD",true);
2. Table fields:
- the user ip,
- number of logins of a user,
- flag is_admin
- flag is_blocked
- new table – Country table
3. dbcontroller class sanitizes user input data
4. Edit Account Area
5. Admin Area – incomplete (for next version)
For now just the list of users is shown and a world map indicating where the users come from. You can delete Users and set them as Admins. If there are no users to list, no map is shown. Also the User seeing the panel is not shown.
Note that in the demo you will not be able to see the admin part – for admin reasons 🙂
6. New CSS
7. Some other small details in the php code.
For the next version I am planning to :
- add all admin functions
- improve and improve ….
To use the recaptcha you need to get a public/private key here . Then you need to define them in constants.php:
define("PUBLICKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("PRIVATEKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
In order to use the demo for those who have registered in the previous version’s demo, you need to register again (in the demo login system), since I had to set up another database for it.
Hope you like it. Any suggestions or improvements are welcome!
Download the source code here
Just downloaded PHP Login System. I have a problem with register/index.php I get an error at line 100 indicating “E_PARSE syntax error, unexpected”}
at index.php line 100″ Using PhpED as development tool. Tried to find unbalanced “{}” in index.php but find none. Also checked /php/core.php thinking it may be there but no luck. Any ideas?
Anyone seen a problem in /register/index.php regarding line 100 and a ‘unexpected “}”‘? I am using PhpEd to run through and understand the code. Code seems to run until I get to the login screen and select “register”.
The code looks correct and I looked for places where an extra “}” may be, found none
getSessionInfo()->isLoggedIn()) {
echo “Registered”;
echo “We’re sorry $session->username, but you’ve already registered. ”
.”Main.”;
}
else {
?>
Registration
Personal Details
First and Last name
Country
For inserting a country, just start typing and wait a little. A drop down is going to be shown and you can pick your country.
Account Details
E-Mail
Repeat E-Mail
Password
Repeat password
Verification
var RecaptchaOptions = {
theme: ‘clean’,
lang: ‘en’
};
Register
I think its great system so I have never seen big problem
Hi chad!
great script!
I have a question, how can I add additional field such as birthdate, contact etc.. I tried to add those fields but when I start to modify your script, everything doesn’t work.. can anyone help me, what should I do or where can I add additional fields?
thanks..
Big thx !
I am looking forward to seeing the next version !
could anyone here kindly help to advise how to update a field in TABLE users? i’d tried to add in core.php following
$this->dbcontroller->updateUserField($this->sessioninfo->getUserKey(), “my_field_name”, “my_data”)
$this->dbcontroller->query(“my_query_here”);
and even add a public function in dbcontroller.php to call it from core.php
the executions work OK, but NONE of them really update the field in TABLE users.
Any advice is highly appreciate.
Hi, is it possible to change the content of each users page so I can add things to a diffenernt users page than everyone elses.
Thanks for the script 😛
MY captcha is not working?? Its saying: input error: K: format of the site key is not valid
good once…
Hi ChadKing,
Firstly, thankyou for the code, save me a lot of time, very much appreciated.
Can you please relink the public and private keys I am trying to download them but I get an ERROR 404, or maybe explain to me how I would go about generating my own.
Great! Work!
toadz…
When I tried to get public/private key I get 404 error. Kindly help to get these keys.
Is this the reason that when i start your code on my local host as http://localhost:8080/snap/public_html/index.php it shows a blank page?
Regards
Shrz
Hi I am facing this error: What is meant:
Input error: k: Format of site key was invalid.
How i can solve to it
hello how are you i need some help. im trying to create two different register pages, “one for customers and one for resellers”, and i have created the tables in my database:
“users”
“resellers”
“active_users”
“active_guests”
“banned_users”
now im trying to have the info for when customers sign up for the approicate pages and have the info go to the right pages. code below:
function addNewUser($username, $password, $email, $firstname, $lastname, $address, $addressline2, $city, $state, $zip, $phone, $fax, $addresstype, $companyname, $businessphone, $resellpermitnumber, $issuedstate, $monthly){
$time = time();
/* If admin sign up, give admin user level */
if(strcasecmp($username, ADMIN_NAME) == 0){
$ulevel = ADMIN_LEVEL;
}else{
$ulevel = USER_LEVEL;
}
$z = “INSERT INTO “.TBL_USERS.” VALUES (‘$username’, ‘$password’, ‘0’, $ulevel, ‘$email’, $time, ‘$firstname’, ‘$lastname’, ‘$address’, ‘$addressline2’, ‘$city’, ‘$state’, ‘$zip’, ‘$phone’, ‘$fax’, ‘$addresstype’, ‘$businessphone’)”;
mysql_query($z, $this->connection);
$q = “INSERT INTO “.TBL_RESELLERS.” VALUES (‘$username’, ‘$password’, ‘0’, $ulevel, ‘$email’, $time, ‘$firstname’, ‘$lastname’, ‘$address’, ‘$addressline2’, ‘$city’, ‘$state’, ‘$zip’, ‘$phone’, ‘$fax’, ‘$addresstype’, ‘companyname’, ‘$businessphone’, ‘$resellpermitnumber’, ‘$issuedstate’, ‘$monthly’)”;
return mysql_query($q, $this->connection);
}
but when i test it out. its not working. its repeating in info from one register page and puts into both, while the other page comes up as errors. how can i have these two pages inerts the proper info into the two different page without errors ?
thank you
sketchone
You have to generate your own public/private keys people..
Use this: http://www.google.com/recaptcha/whyrecaptcha
Has anyone tried to use PostgreSQL with these scripts instead of MYSQL.
The MYSQL version runs alright but when I am try to convert to PostgreSQL nothing seems to work and its just a blank page!
hey chadking, i no this was posted like 4 years ago but if you still look at it I need, some help, for some reason every time I try and type a country for a registration form nothing shows up and on the bottom of the browser it says error on page, please someone get back to me as soon as possible cause i kind of want to get this project done. thanks for you time
I am implementing this system in POSTGRESQL, finally it seems to work but there looks some problem in the javascript portion as the register, edit profile and send password button doesnt work. Has anyone done something similar?
Got an issue where I get an “an error occurred bla bla bla” popup whenever I try and register. I think it is the javascript throwing the error. Any ideas?
FEATURES:
-NO directory strature
-NO captcha
– SOME ERRORS UPDATED
http://depositfiles.com/files/18hj9vqhm
inbox at nelsonsalvador dot com
Login System with Nice & Clean Sliding Login Panel built with jQuery
-NO directory structure
-NO captcha
– SOME ERRORS UPDATED
demo: http://web-kreation.com/demos/Sliding_login_panel_jquery/
http://depositfiles.com/files/w5os90lra
inbox at nelsonsalvador dot com