Coming Soon - Premium WordPress Theme Giveaway To All Our Email Subscribers
PHP login script with advanced features – Documentation
Documentation
-
Installation
If you are looking for the tutorial on PHP login system with added features, click here. Below is the documentation for the above tutorial
Download the script from the DOWNLOAD page and extract it to your SITE ROOT
Action File name File Content Open the file dbtables.sql It contains the details of required MySQL tables
All the tables needed for the Login System are written in the file dbtables.sql. You can look at the file and create each table manually or you can just run the file with mysql and it will create all the necessary tables automatically or you can also copy and paste the contents of this file in mysql query window and run the query.
# # dbtables.sql # # Simplifies the task of creating all the database tables # used by the login system. # # Can be run from command prompt by typing: # # mysql -u yourusername -D yourdatabasename < dbtables.sql # # That is with dbtables.sql in the mysql bin directory, but # you can just include the path to dbtables.sql and that is # fine too. # # Please subscribe to our feeds at http://blog.geotitles.com for more such tutorials # # # Table structure for users table # DROP TABLE IF EXISTS blog_users; CREATE TABLE blog_users ( username varchar(30) primary key, password varchar(32), userid varchar(32), userlevel tinyint(1) unsigned not null, email varchar(50), timestamp int(11) unsigned not null ); # # Table structure for active users table # DROP TABLE IF EXISTS blog_active_users; CREATE TABLE blog_active_users ( username varchar(30) primary key, timestamp int(11) unsigned not null ); # # Table structure for active guests table # DROP TABLE IF EXISTS blog_active_guests; CREATE TABLE blog_active_guests ( ip varchar(15) primary key, timestamp int(11) unsigned not null ); # # Table structure for banned users table # DROP TABLE IF EXISTS blog_banned_users; CREATE TABLE blog_banned_users ( username varchar(30) primary key, timestamp int(11) unsigned not null );
Action File name File Content Open and Edit constants.php(found in include folder) It contain all the constants and important information used by the login system
The constants.php file contains all the important information, settings and constants used by the login script, Please open this file in a text editor like Notepad or Dreamweaver and edit the file, declaring all the constants given below.
define("DB_SERVER", "localhost");//If you don't know what to edit here, then leave it as it is define("DB_USER", "database_username");//enter your database username define("DB_PASS", "database_password");//database password define("DB_NAME", "database_name");//database namedefine("ADMIN_NAME", "admin"); define("GUEST_NAME", "Guest"); define("ADMIN_LEVEL", 9); define("USER_LEVEL", 1); define("GUEST_LEVEL", 0);define("TRACK_VISITORS", true);/** * Timeout Constants - these constants refer to * the maximum amount of time (in minutes) after * their last page fresh that a user and guest * are still considered active visitors. */ define("USER_TIMEOUT", 10); define("GUEST_TIMEOUT", 5); /** * Cookie Constants - these are the parameters * to the setcookie function call, change them * if necessary to fit your website. If you need * help, visit www.php.net for more info. * */ define("COOKIE_EXPIRE", 60*60*24*100); //100 days by default define("COOKIE_PATH", "/"); //Available in whole domaindefine("EMAIL_FROM_NAME", "Your Name"); define("EMAIL_FROM_ADDR", "yourname@domain.com"); define("EMAIL_WELCOME", true);//set this false if you do not want your users to receive a welcome Email after registration
After editing the constants.php file. Save it and upload the entire Script to the server
In order for you to use the Login system as an administrator , Register yourself in the Sign-Up page ( register.php) with username – Admin
Great! Now you are finished with everything, just login and enjoy
you can make customization to the script, as per your needs.If you need any other improvisations to this script or want to request a new tutorial, Please Contact me.
Click here to go back to the tutorial.

#1 by Sunny on January 19, 2012 - 6:54 pm
im getting this type of errors … what i hav to do…help me..
logged_in){ echo ‘
This is the live demo of PHP login script with added features at GEO WEB STATION, Click here for the tutorial link
‘; echo ‘
Logged In
‘; echo “Welcome $session->username, you are logged in.
” .”[username\">My Account] ” .”[Edit Account] “; if($session->isAdmin()){ echo “[Admin Center] “; } echo “[Logout]“; } else{ ?>
This is the live demo of PHP login script with added features at GEO WEB STATION, Click here for the tutorial link
Admin Login
num_errors > 0){ echo “”.$form->num_errors.” error(s) found”; } ?>
Username: “> error(“user”); ?>
Password: “> error(“pass”); ?>
value(“remember”) != “”){ echo “checked”; } ?>> Remember me next time
[Forgot Password?]
Not registered? Sign-Up!
“; echo “Member Total: “.$database->getNumMembers().”
“; echo “There are $database->num_active_users registered members and “; echo “$database->num_active_guests guests viewing the site.
“; include(“include/view_active.php”); ?>
[Translate]
#2 by Praveen Gowda I V on January 19, 2012 - 9:00 pm
Would you give the url of the site where you are getting this error, because I think the php is not getting parsed.
[Translate]
#3 by Sunny on January 20, 2012 - 9:43 am
http://dasaradh.org/er.jpg
[Translate]
#4 by Praveen Gowda I V on January 20, 2012 - 10:44 am
Hi Sunny,
Do you have PHP installed on your local machine ?
[Translate]
#5 by Sunny on January 20, 2012 - 11:30 am
yeah it’s running and all my other site r working fine …
link….
http://dasaradh.org/er2.jpg
[Translate]
#6 by Praveen Gowda I V on January 20, 2012 - 11:47 am
Is it the same case with all the files or just the main page ?
[Translate]
#7 by Sunny on January 20, 2012 - 12:11 pm
yeah with all file incldng admin….
[Translate]
#8 by Praveen Gowda I V on January 20, 2012 - 12:31 pm
Ok this is strange.
Are other PHP files working fine ?
I mean php files which are not a part of our script but some other PHP files of your website.
If you make a page called test.php and have the only code in it be
what happens when you navigate to it?
[Translate]
#9 by Sunny on January 20, 2012 - 1:39 pm
it’s wrking
im getting all info of my server etc…
[Translate]
#10 by Sunny on January 20, 2012 - 4:08 pm
tanq
[Translate]
#11 by mehvish on May 17, 2012 - 11:43 pm
i have the same problem .but where i place the test.php file and how this link with other
[Translate]
#12 by Praveen Gowda I V on May 18, 2012 - 1:08 am
you need to change < ? to but this may be a bit tiring, hence an alternative solution is to open php.ini and
replace
short_open_tag = Offwith
short_open_tag = OnChoose whichever is convenient.
Hope it is helpful.
[Translate]
#13 by mehvish on May 26, 2012 - 3:01 am
i read your instrucation very carfully and i m successfully do my work.thank you for such a nice code
[Translate]
#14 by Jestin on March 3, 2012 - 9:26 pm
replace the opening php tag <? with <?php ….then its will be fine…thanx!!!
[Translate]
#15 by Ampere on March 13, 2012 - 11:58 pm
Great script… it is so much helpful for me
[Translate]
#16 by Me on March 23, 2012 - 3:54 am
Is there a way that you could incorporate ajax where if a user were to hit submit on the page wouldn’t refresh but the results would?
[Translate]
#17 by Praveen Gowda I V on March 23, 2012 - 9:59 am
Yes that is possible, but it will require significant amount of coding.
If you are very particular in converting this login script to be powered by AJAX, please contact us at praveen.vvstgy[@]gmail.com
We’ll definitely try our best to help you.
Do let us know if you need any other help.
[Translate]
#18 by se7en on March 25, 2012 - 5:07 am
My greetings to all and many thanks to the author.
How can I lock a page with this great script gents?
Help greatly appreciated
Shelly
[Translate]
#19 by Praveen Gowda I V on March 25, 2012 - 10:07 am
What do you actually mean by “lock a page” ?
[Translate]
#20 by se7en on March 25, 2012 - 7:54 pm
Thanks for the quick reply
I am accessing the script example http://www.mysite.com/login/register.php
How do I navigate from there to my website index or lock a page?
Thank you
Shelley
[Translate]
#21 by Vipul Anand on April 17, 2012 - 11:54 pm
Hi Praveen,
first off amazingly easy to implement security to
account activation only after clicking the link sent to the registering e-mail id.. how to go about it… i have another script that does it… my PHP skills are limited… to snippet copy paste..
[Translate]
#22 by Praveen Gowda I V on April 18, 2012 - 10:50 am
Here is the modified script I did for one of our users some time back to support email link activation.
You can download it here
Hope it is useful.
If you find our tutorials useful, do consider giving us a small donation
Thanks
[Translate]
#23 by Mark Scott on April 30, 2012 - 8:03 pm
Hello Praveen,
First and foremost, thank you so much for this tutorial. I have a bit of a stupid question though. When I add a new column to the ‘blog_users’ table (e.g., phone number), and I am no longer able to register new users. I am sure I am overlooking something obvious, but if you could help me out with this, I would greatly appreciate it. Thanks so much!
[Translate]
#24 by Praveen Gowda I V on April 30, 2012 - 10:11 pm
Adding additional fields in the registration form is much complicated than changing the number of fields in the mysql table.
There needs a lot of code within
register.php,session.phpanddatabase.phpwhich needs to be modified in order for it to work.I have a file which I modified for one of our users which has two more additional fields.
Have a look at it and let me know if it helps.
You can download it from here
If you need something customized more than this please contact me at praveen.vvstgy[at]gmail.com and I will be more than happy to help you with this.
[Translate]
#25 by Mike T on May 9, 2012 - 10:13 am
I was wondering,
Is there any way to add a link to one file on my server in the users account section?
The purpose of my needing a login system is to have a client access a single file from their account without any chance of anyone else getting to it.
Thanks
[Translate]
#26 by Praveen Gowda I V on May 9, 2012 - 3:24 pm
Just place the link to the file which you want only members to access in the main.php file next to other links like Edit Account, Logout, etc.
If you don’t want anyone else to download the file other than your users, you can password protect the files using .htaccess
[Translate]
#27 by Mike T on May 9, 2012 - 3:50 pm
Got it all figured out.
Found a piece of code that worked great and I did exactly what you recommended even before you posted. I am completely new to PHP but I managed.
I used an and it did exactly what I wanted. Then I listed my links in an index file and .htaccessed them. Perfect!!!
I have a test on my Client Login page you can try if you wish to see what I did.
Many thanks again.
Thank you for the prompt response.
Mike
[Translate]
#28 by Praveen Gowda I V on May 9, 2012 - 4:45 pm
I am glad you got it working.
[Translate]
#29 by Mike on May 9, 2012 - 9:04 pm
Sorry but I tried to post the code here and it did not all show up.
I used an iframe in main.php file to display a web page in the logged in section of the user that has links to a list of files that are all .htaccessed.
Works great.
[Translate]
#30 by Praveen Gowda I V on May 9, 2012 - 10:16 pm
Yeah the code displayed doesn’t make sense.
You must properly format the comment, If there are any “
<” or “>” within your code, please search and replace them with:<and>respectively.If you don’t mind I will edit and remove the code from your comment.
[Translate]
#31 by Mike Thellend on May 9, 2012 - 10:51 pm
I pasted the code straight out of my main.php into the box here and it decided to take away what it didn’t like.
I’ve provided links (I hope they works) to the change in the main.php file and the output. I also provided links to show you what the final product looks like.
http://firststophomeinspections.com/login/images/code.jpg
http://firststophomeinspections.com/login/images/output.jpg
http://firststophomeinspections.com/login/images/output2.jpg
http://firststophomeinspections.com/login/images/output3.jpg
[Translate]
#32 by Mike Thellend on May 9, 2012 - 11:03 pm
Please do what you have to in order to clean up the mess.
Thanks very much for everything, I will donate soon.
Mike
[Translate]
#33 by Praveen Gowda I V on May 10, 2012 - 7:13 am
Hi Mike,
Do come back if you need any help and we will be happy to help you.
Thanks for the donation
[Translate]
#34 by Mike T on May 11, 2012 - 10:12 pm
Hi Praveen,
Just wondering.
What would it take to make it so I activate accounts in my admin panel after a person registers?
Thanks
[Translate]
#35 by Praveen Gowda I V on May 11, 2012 - 11:05 pm
Contact me at praveen.vvstgy[at]gmail.com, I will assist you further.
[Translate]
#36 by Chris on May 22, 2012 - 8:53 am
Hello Praveen.
Thank you for this nice script. However, I get some errors. I followed your instructions to the letter.
Deprecated: Function eregi() is deprecated in /home/deb56386/domains/c-create.net/public_html/chem-wiz/include/session.php on line 134
The other is:
Warning: Cannot modify header information – headers already sent by (output started at /home/deb56386/domains/c-create.net/public_html/chem-wiz/include/session.php:134) in /home/deb56386/domains/c-create.net/public_html/chem-wiz/process.php on line 64
This happens when I put my username and password then click on log-in. As soon as I go a page back in my browser, it will show the status ‘Logged in’.
Refreshing the page (ctrl + F5) will result in the same error.
After I’ve clicked the back-button in the browser, all pages seem to be working fine for me though.
Any suggestions? Would be greatly appreciated!
Christiaan
The script is running
[Translate]
#37 by Praveen Gowda I V on May 22, 2012 - 9:40 am
With respect to the
eregi() is deprecatederror, read this article in order to fix it:http://takien.com/513/how-to-fix-function-eregi-is-deprecated-in-php-5-3-0.php
Coming to the second error, Have you tried to modify the script in anyway ?
may be that is what might be triggering the error.
I tried to visit the site where you have installed the script at http://c-create.net/chem-wiz/main.php, but it is showing an error with the mailer.php file.
Try to debug what went wrong using the error messages or leave me an email at praveen.vvstgy[at]gmail.com and I will help you get it fixed myself.
[Translate]
#38 by Cameron on June 18, 2012 - 2:01 am
Hi there, I have had the same problem with the ‘function eregi()’ error, and have noticed the link you provided to another user. I followed this link and (as I am new to PHP) changed all the ‘if(!eregi’ code to the ‘if(!preg_match’ code as mentioned on the website link you provided. When I made these changes, I had no more errors, but as soon as I tried registering as the ‘Admin’ I got this error: * Username not alphanumeric . What have I done wrong? If you see here: http://www.cpsecure.x10.mx/portal/register.php this is were I am getting trouble. Thanks in advance!
[Translate]
#39 by Praveen Gowda I V on June 18, 2012 - 11:17 am
You have not carefully observed, replacing
eregibypreg_matchalone, won’t work.You must wrap the pattern around
//and appendi.Here is how you must replace:
session.phpin function login()
if(!preg_match("/^([0-9a-z])*$/i", $subuser))in function register()
if(!preg_match("/^([0-9a-z])+$/i", $subuser))if(!preg_match("/^([0-9a-z])+$/i", ($subpass = trim($subpass))))$regex = "/^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$/i";
if(!preg_match($regex,$subemail))
in function editAccount()
if(strlen($subcurpass) < 4 ||!preg_match("/^([0-9a-z])+$/i", ($subcurpass = trim($subcurpass))))
else if(!preg_match("/^([0-9a-z])+$/i", ($subnewpass = trim($subnewpass))))
and similarly for the rest of the functions.
[Translate]
#40 by Joshua Sedore on June 18, 2012 - 6:25 am
Ive been using this script for awhile know but when i tried to use it locally it didn’t work out, so i read the comments and figured out the short tag setting in my php.ini, thanks again for making this script open source and for all your hardwork! While im here….if i wanted to change the user’s page from “userinfo.php?user=username” to having the users ID or name after the “user=”….thanks, im not new to php, i just dont know everything
[Translate]
#41 by Praveen Gowda I V on June 18, 2012 - 9:08 am
That is exactly what it does, when the
usernameinuserinfo.php?user=usernameis replaced by the username of a required user, it will display the Information of that user.Since the user id keeps changing for every login, you cannot pass user id for getting the user information.
But it is already working, exactly the way you asked it to, if your username is
joshuaand if you go to the urluserinfo.php?user=joshua, then your user details will be displayed.[Translate]
#42 by mehvish143 on June 19, 2012 - 12:11 am
First if all thanks for such a nice work.but i have little problem that after i login to my user os admin account i have link of another page but when this page is regirect to the main.php that my sesseion expire and ny user automacilly logout.what i do .plz help me.and check it on http://toyota.web44.net/login-form.php.(after i login i click on job oppertunty or online booking link if i opem on the same window)
[Translate]
#43 by mehvish on June 20, 2012 - 8:29 pm
Hello Praveen .
you can apply constrain on email ,as well as user name.in Register.php page
[Translate]
#44 by Praveen Gowda I V on June 20, 2012 - 8:46 pm
What do you mean by this ?
[Translate]
#45 by mehvish on June 20, 2012 - 9:23 pm
on register.php page.user name is unique and user cannot register with same name.i want to apply this restriction to email address field.that user cannot register with same id
[Translate]
#46 by mehvish on June 20, 2012 - 9:25 pm
/* Email error checking */
$field = “email”; //Use field name for email
if(!$subemail || strlen($subemail = trim($subemail)) == 0){
$form->setError($field, “* Email not entered”);
}
else{
/* Check if valid email address */
$regex = “^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*”
.”@[a-z0-9-]+(\.[a-z0-9-]{1,})*”
.”\.([a-z]{2,}){1}$”;
if(!eregi($regex,$subemail)){
$form->setError($field, “* Email invalid”);
}
$subemail = stripslashes($subemail);
if($database->email_taken($subemail)){
$form->setError($field, “* email already in use”);
}
}
error message:
Fatal error: Call to undefined method MySQLDB::email_taken() in /home/a3952226/public_ht
ml/include/session.php on line 312
[Translate]
#47 by kash on June 21, 2012 - 6:56 pm
why you not answering me dear?
[Translate]
#48 by Praveen Gowda I V on June 21, 2012 - 9:09 pm
I left you an email yesterday, you never responded
then how can you expect me to respond.
[Translate]
#49 by victoriawagman on June 21, 2012 - 7:41 pm
Hi!
It all worked nicely to create a admin user.. and now “register” doesn’t work, it just says “failed”… any hints on where in the “process” file I should be looking for what?
It’s up here: http://bunko.se
[Translate]
#50 by Praveen Gowda I V on June 21, 2012 - 9:33 pm
Did you edit any part of the code ?
If you did then there must be something wrong with the function register() in session.php.
or just send me the FTP details where you have installed the script to my email address at praveen.vvstgy[at]gmail.com and I will fix it myself for you.
[Translate]
#51 by Marco on July 1, 2012 - 1:47 am
Hi,
firstly I would like to thank you for this absolutely amazing Login system
This is the best script I have found this far.
I am making my websites and I use this Login system there. Would it be easy to add possibility for users to choose and change avatar for their account in Edit Account Information page?
[Translate]
#52 by gcgcuganda on August 9, 2012 - 1:33 pm
help i/m getting these errors…
Deprecated: Function eregi() is deprecated in /home/appocrita/project1/PHP-login-script/include/session.php on line 258
Deprecated: Function eregi() is deprecated in /home/appocrita/project1/PHP-login-script/include/session.php on line 287
Deprecated: Function eregi() is deprecated in /home/appocrita/project1/PHP-login-script/include/session.php on line 308
Warning: Cannot modify header information – headers already sent by (output started at /home/appocrita/project1/PHP-login-script/include/session.php:258) in /home/appocrita/project1/PHP-login-script/process.php on line 104
[Translate]
#53 by Praveen Gowda I V on August 9, 2012 - 2:04 pm
For fixing the eregi error, I have already answered the solution at
http://blog.geotitles.com/2011/07/php-login-script/#comment-1357
and
http://blog.geotitles.com/php-login-script-documentation/#comment-2644
Refer to these two comments for the solution
[Translate]
#54 by jadzrev13 on August 11, 2012 - 8:16 pm
Hi I am getting this kind of error: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/a8517293/public_html/include/database.php on line 206
[Translate]
#55 by Praveen Gowda I V on August 12, 2012 - 5:54 am
Did you carefully go through the database setup and configuration as it is given in the documentation page?
[Translate]
#56 by jadzrev13 on August 12, 2012 - 7:53 am
Yes I did
But everything works fine except that it shows that error on the page
[Translate]
#57 by Praveen Gowda I V on August 12, 2012 - 9:04 am
Did you edit the code?
[Translate]
#58 by jadzrev13 on August 12, 2012 - 7:37 pm
I just edited the constants.php for my localhost, etc. and that’s it. It still shows that kind of error.
[Translate]
#59 by karim on September 1, 2012 - 9:06 pm
hello awesome tutorial and easy to understand, but I get this error:
logged_in){ echo ‘
This is the live demo of PHP login script with added features at GEO WEB STATION, Click here for the tutorial link
‘; echo ‘
Logged In
‘; echo “Welcome $session->username, you are logged in.
” .”[username\">My Account] ” .”[Edit Account] “; if($session->isAdmin()){ echo “[Admin Center] “; } echo “[Logout]“; } else{ ?>
This is the live demo of PHP login script with added features at GEO WEB STATION, Click here for the tutorial link
LoginAdmin Login
num_errors > 0){ echo “”.$form->num_errors.” error(s) found”; } ?>
Username: “> error(“user”); ?>
Password: “> error(“pass”); ?>
value(“remember”) != “”){ echo “checked”; } ?>> Remember me next time
[Forgot Password?]
Not registered? Sign-Up!
“; echo “Member Total: “.$database->getNumMembers().”
“; echo “There are $database->num_active_users registered members and “; echo “$database->num_active_guests guests viewing the site.
“; include(“include/view_active.php”); ?>
—————————————————————————-
not sure whats going on, i changed all the <? tags to <?php and still get the same error, i also created a test.php page with and when i pull it up to my browser it shows a blank page, please help I would really appreciate, Im sorta new to this so im sorry if its a rookie mistake, oh and also i cant find php.ini, im using a mac , recently just switched from pc and im just getting used to it . Again please help and much thanks in advance.
[Translate]
#60 by Praveen Gowda I V on September 2, 2012 - 1:34 am
There are more than one tag in a page, I think you only replaced one tag on the first line of a page.
Use the find and replace feature of a text editor like Sublime Text 2 or Notepad++ to replace all the tags in a file with
[Translate]
#61 by Karim on September 2, 2012 - 4:04 am
Hey! Thanks for the quick response. I did change all the tags to all of the pages, and still got the same problem. Any other ideas what might cause this?
[Translate]
#62 by Praveen Gowda I V on September 2, 2012 - 8:08 am
Download the file from here and let me know if this one works.
It is the updated file which I planned to release soon which fixes most of the errors, so Have a try at this file and I am sure this one might help
[Translate]
#63 by Ron on September 2, 2012 - 5:06 am
Hi Praveen, I did send you an Email yesterday about adding 1 or 2 fields to blog_users.
But I thought maybe it is better this way, others can use it as well.
I have looked into the process, database and session files as you told me.
But I feel silly not being able to see/solve my problem.
Lets add 1 field at the end:
`UId` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`username`),
UNIQUE KEY `UId` (`UId`)
This field does not need to be filled by the programm, since it is AUTO_INCREMENT.
The point I am missing is what coding is needed, since this field works on its own.
The second field is adding, registered IP. probably the same issue.
I do not see if and where these fields needs to be registered.
Sorry being silly.
by the way, I love the script.
[Translate]
#64 by Praveen Gowda I V on September 2, 2012 - 8:10 am
Did you make changes on
process.phpfile,session.phpanddatabase.phpfile so that the values of fields can be stored in the database when the user submits the register.php file.I have a file which I modified for one of our users which has two more additional fields.
Have a look at it and let me know if it helps.
You can download it from here
[Translate]
#65 by karim on September 2, 2012 - 3:48 pm
Hi still doesnt work it shows the codes on the page, none of the pages work.
[Translate]
#66 by Gustav Leffler on September 26, 2012 - 9:14 am
Cant login on google chrome?
when i login im still stuck on the login screen. on the “whos online” thing it says im logged in. But i cant go to the control panel or anything else i should when im logged in.
It works on firefox just as normal. This happend 3 days ago and I last i changed anything was 2 weeks.
Please help!
[Translate]
#67 by Praveen Gowda I V on September 26, 2012 - 12:08 pm
Can you a put link to where you have installed the script,so I can have a look
[Translate]
#68 by Gustav Leffler on September 27, 2012 - 2:51 pm
http://postbuddy.org/membersarea/main.php
[Translate]
#69 by Will on October 12, 2012 - 6:03 pm
Hi Praveen
Thanks for your work on this and putting it for people to download. Very simply, I would like to know which bit of the php code to include on my other web pages, so that if someone hasnt logged in, they are redirected back to the login page. Im looking through the code and Im a little unsure what to do here?
Thanks
[Translate]
#70 by Graeme on October 16, 2012 - 9:07 am
Help… I’m really new to this PHP lark and having no luck in trying to setup and use this. Although it look exactly what I need… I’ve tried to register but it says that it failed to register please try later?
I’ve left everything in the login-update folder but it just doesnt seem to want to work… Day 4 of trying!
[Translate]
#71 by Praveen Gowda I V on October 16, 2012 - 10:43 am
Did you read the documentation post, were you able create database tables and setup the database credentials in constants.php file
[Translate]
#72 by Graeme on October 18, 2012 - 11:54 am
Any luck with this yet ?
[Translate]
#73 by Graeme on October 20, 2012 - 9:17 am
Hi Praveen,
Still trying to get this working.
Did you see any reason why it wouldn’t?
Cheers
Graeme
[Translate]
#74 by Praveen Gowda I V on October 20, 2012 - 10:30 pm
Contact me through the contact page and send me the FTP credentials.
I will look into it myself.
[Translate]
#75 by Milan on December 21, 2012 - 6:21 pm
Access denied for user ‘myusername’@'boscgi2701.eigbox.net’ (using password: YES)
This is when i go to index.php on my website.
Please help.
Thanks.
[Translate]
#76 by Praveen Gowda I V on December 22, 2012 - 1:14 am
Database credentials in constants.php file is set wrongly.
[Translate]
#77 by Keith on December 27, 2012 - 9:55 pm
To switch from md5 to phpass, the only two files needed to edit are session.php and process.php? Just replace md5 with phpass?
[Translate]
#78 by Trond on December 30, 2012 - 2:39 am
Great stuff!
I’m looking for additional information to be included in my cookie, so I downloaded the expanded version with fname and lname Fields in the db definition. However, i’d like to use an INT (number) as one of the Fields. Should I change the sql definition of one of the additional Fields, or just store a number in one of the additional Fields (i.e. fname Field) ?
Would appricate Your comment.
[Translate]
#79 by Praveen Gowda I V on December 30, 2012 - 10:48 am
Storing numbers in varchar field is not such a good idea, so just change it to int and I promise it will be really helpful in the future when you want to make use of the number that is stored for any kind of operations which you might come across.
Also the memory utilized when storing a int and varchar differs, so eventually we will be saving memory as well!
[Translate]
#80 by Ann Lee Watson on January 18, 2013 - 5:05 am
is this code safe against SQL injection and other injection threats?
thanks
[Translate]
#81 by Nouman on January 24, 2013 - 2:38 pm
hi i want to add restriction that a user which have logged in can access certain pages, please provide my that code so that i can paste it in secured pages. i have tried lot but was unable to generate such check.
Thanks!
[Translate]
#82 by rahul on February 5, 2013 - 11:37 am
what is admin password?
[Translate]
#83 by Praveen Gowda I V on February 5, 2013 - 12:04 pm
It has been fixed now, you can try admin demo at http://demo.geotitles.com/PHP-login-script/
[Translate]
#84 by Jason on February 17, 2013 - 1:12 am
I love this script, but I’m having one minor problem. When I got to the site and it loads the index.php, it shows thee admin user, and partial password. You can’t delete either one, and when you hit login it’s the wrong password. I have to go to the signup page and back to login to get around this. Any help you have on this would be much appreciated.
[Translate]
#85 by roy on February 19, 2013 - 9:36 am
Registration is not working: ‘Registration Failed’. I have not editted the code except contansts.php. I see that other users had the same problem. What could be causing the problem? Or, how can I generate a specific error message so I know where’s the problem? (I can’t share ftp info) Thanks!
[Translate]
#86 by Praveen Gowda I V on February 19, 2013 - 12:01 pm
Registration is working perfectly. May be the credentials in the constants.php file itself might be wrong.
If you have not edited the code, then I don’t think there is any other possibility.
[Translate]
#87 by Thayer on February 22, 2013 - 12:52 am
It all installed and worked so well! I am so pleased! However, I have a question: the purpose of the login is to be able to track users, but I can’t seem to get the username to save to the table in my database that the form loads to. I tried a $_GET and though <? echo "Hello ” . $_GET["user"] . “”;?> did echo out, the form refused to save the url variable to the db. I’m using $_POST to save other variables to my table, Any suggestions?
[Translate]
#88 by Thayer on February 22, 2013 - 1:06 am
OK, here’s some code. I’m not going to count my parentheses because the form works, just not the $_GET part. Anyway, here goes:
It all loads right up to the table except the username, which is what I need.
You went and gave me an inch, and now I want that whole mile.
thanks!
[Translate]
#89 by Thayer on February 22, 2013 - 1:10 am
My code was removed! Let me try it without the php tags:
if(isset($_GET['user'])) {
//do something
} else {
header(‘Location: login-update/main.php’);
}
if($_POST['formSubmit'] == “Submit”)
{
$var = $_POST['user'];
$sql = “INSERT INTO reviewEAS457(user) VALUES (“.
PrepSQL($var) . “, ” . “)”;
mysql_query($sql);
header(‘Location: reviewThankYou.html’);
exit();
[Translate]
#90 by Praveen Gowda I V on February 22, 2013 - 6:37 am
Hi Thayer,
I don’t get what you are trying to do here?
GET and POST on the same page?I don’t think it is absolutely necessary here
What are you trying to implement here?
If you want to check if a user is logged in then
if($session->logged_in)
{
//code foe logged in user
}
else
//not logged in.
Do reply back and I will be happy to help you further.
[Translate]
#91 by Donnette Thayer on February 22, 2013 - 11:13 am
Hi Praveen!
Super big thank you for your quick response and for this most excellent package.
What I want to do is save the username to a non-login-update table – let’s call it ‘summary’ – as a foreign key, then save a bunch of other inputs to ‘summary’.
It seems like it should not be that tricky. I am using $_POST to insert to my table on my database.
Thanks!!!!
[Translate]
#92 by Greg on March 29, 2013 - 8:27 am
Hi Thanks for the great script. I have it up and working but have one question. what determines if a page is level 1 or 9. I would like admin to access all pages but restrict other pages to reject guest or users. if all pages get session.php then is it somewhere in the dbase or should i paste something else on the page?
[Translate]
#93 by Greg on March 29, 2013 - 9:42 am
Never mind! I see that i must modify each page with if and else statments
[Translate]
#94 by maartenvsp on April 3, 2013 - 10:00 am
First of all, thanks for this wonderfull script!!
Is it somehow possible to keep the user logged in over multiple devices? For example, if I am logged in with my pc and I want to log in on my smartphone, the sessions on the pc automatically logs off and forces me to login again every time I want to visit the site even thoough I chose to remember me. I guess it has something to do with the user_id that is generated. It would be be great if you could inform me of a way to avoid having to loggin over and over again with cross-platform usage.
Thanks alot!
[Translate]
#95 by Praveen Gowda I V on April 4, 2013 - 6:07 am
Modify code so that you can have multiple userid, that seems to be the simplest way to go forward for what you need
[Translate]
#96 by Rahul Mitra on April 11, 2013 - 2:12 am
It is not sending verification email.
[Translate]
#97 by AZJOL on May 1, 2013 - 2:39 pm
If i need to open some site only as registered, what must i write to code?
[Translate]
#98 by dlrstoreVurkac on May 15, 2013 - 7:37 am
Hello,
Is there a way to send notification email to the site owner when someone registers?
[Translate]