A PHP based membership (registration/login) code

Overview

Simple Registration/Login code in PHP

Read more:PHP registration form PHP login form

Installation

  1. Edit the file membersite_config.php in the includes folder and update the configuration information (like your email address, Database login etc) Note The script will create the table in the database when you submit the registration form the first time.

  2. Upload the entire 'source' folder to your web site.

  3. You can customize the forms and scripts as required.

Files

  • register.php

    This script displays the registration form. When the user submits the form, the script sends a confirmation email to the user. The registration is complete only when the user clicks the confirmation link that they received in the email

  • confirmreg.php

    Confirms a user's email address. The user clicks the confirmation link that they receive at their email address and is send to this script. This script verifies the user and marks the user as confirmed. The user can login only after he has confirmed himself.

  • login.php

    The user can login through this login page. After successful login, the user is sent to the page login-home.php

  • access-controlled.php

    This is a sample accesscontrolled page. If the user is logged in, he can view this page. Else the user is sent to login.php

  • includes/membersite_config.php Update your confirguration information in this file

  • includes/fg_membersite.php

    This file contains the main class that controls all the operations (validations, database updation, emailing etc) If you want to edit the email message or make changes to the logic, edit this file

  • includes/class.phpmailer.php

    This script uses PHPMailer to send emails. See:http://sourceforge.net/projects/phpmailer/

  • includes/formvalidator.php

    For form validations on the server side, the PHP form validator from HTML form guide is used See: [PHP form validation] (http://www.html-form-guide.com/php-form/php-form-validation.html)

License

This program is free software published under the terms of the GNU Lesser General Public License. You can freely use it on commercial or non-commercial websites.

Comments
  • Requesting Feedback on Security Upgrades

    Requesting Feedback on Security Upgrades

    Hello,

    I used your RegistrationForm codebase to create a secure web application for a business I started. It was necessary, and desirable, for me to greatly increase the degree of security. I have attempted to endow the "vanilla" site you provided with the security improvements of my site.

    I would like for this more secure version to be merged so that in the future when people start a site with the RegistrationForm code they can more easily secure it, and start with a higher level of protection for their users.

    I fully welcome your feedback and the issues you take with the code's current state.

    opened by NickBorgers 8
  • This code is not working with PHP 7.3

    This code is not working with PHP 7.3

    Hi there bluehost has updated to php 7.3 and now my website is broken. Please can you tell me if your php code is compatible with php 7.3? If not, what should I do to make it compatible? Thank you in advance!!! P.S. I really really appreciate and love your registration form code!!!

    opened by 39edivad 5
  • MongoDB

    MongoDB

    I was trying to use this code with my mongoDB and got an error:

    Fatal error: Call to undefined function MongoClient_connect() in /var/www/html/include/fg_membersite.php on line 733

    I wondered if there is a version of this RegistrationForm for MongoDB or if anyone can help me change it from mysql to mongo.

    opened by miadmmam 4
  • confirmation email

    confirmation email

    thanks alot for offering this good script, but I got issue which is the confirmation email to continue the registration didnt receive. I dont know why but may be because I use localhost??

    opened by engwael 4
  • Error shown while resetting password (line 411)

    Error shown while resetting password (line 411)

    Selecting forgot password ---> email sent successful. Clicking on email confirmation link ---> the following is displayed:


    Warning: uniqid() expects at least 1 parameter, 0 given in /home/content/s/l/a/slanguilla/html/ProofingPlace/registration/source/include/fg_membersite.php on line 411

    Password is Reset Successfully Your new password is sent to your email address.

    ----- end -----

    line 411: $new_password = substr(md5(uniqid()),0,10);

    change to: $new_password = substr(md5(uniqid(rand())),0,10);

    opened by redcrayon 4
  • Password Security

    Password Security

    I noticed you made an update to password security, however it's nowhere near as secure as it should be. You should be using something meant for password hashing, like PBKDF2, rather than doing some random combination of salting, md5, and sha1. The point of using something meant for password hashing is so that it takes a long time to calculate the hashes. Here's a php script that has everything you need, https://crackstation.net/source/password-hashing/PasswordHash.php and a tutorial explaining general password security and the reasoning behind each part https://crackstation.net/hashing-security.htm

    opened by Rawrishly 3
  • Errors in all your coding - on website, formvalidator, fg_membersite

    Errors in all your coding - on website, formvalidator, fg_membersite

    I know you are trying hard and your registration form is a great concept... however you have multiple errors through out you Html Form Guide website and your include scripts fg_membersite.php and formvalidator.php.

    Firstly in reference to your website........ http://www.html-form-guide.com/php-form/php-registration-form.html

    ERROR 1 - under the heading "The database table structure"................ function CreateTable() { $qry = "Create Table $this->tablename (". "id_user INT NOT NULL AUTO_INCREMENT ,". "name VARCHAR( 128 ) NOT NULL ,". "email VARCHAR( 64 ) NOT NULL ,". "phone_number VARCHAR( 16 ) NOT NULL ,". ?????????????? etc etc

    why is phone_number in Create Table when under the heading "Inserting the registration to the table" you have ........ $insert_query = 'insert into '.$this->tablename.'( name, email, username, password, confirmcode ) values ( "' . $this->SanitizeForSQL($formvars['name']) . '", "' . $this->SanitizeForSQL($formvars['email']) . '", "' . $this->SanitizeForSQL($formvars['username']) . '", "' . md5($formvars['password']) . '", "' . $confirmcode . '" )';
    Question: where is the phone number going to be inserted... OBVIOUSLY nowhere! This code will insert the username data into the phone number field in the Created TABLE... thats if you know how SQL works... sequential inputs dude!! This coding will output data in wrong fields in your MySQL database... so maybe have a look at that. Also under the heading "The registration form"...... you dont even have a phone field in your form to input your phone number?????

    ERROR 2 - your SQL syntax is shockingly coded in fg_membersite.php...... anywhere there is $qry .... you have inconsistent coding with uppercase and lowercase operators... For example... operators such as Update - set - where - and - from............. SHOULD BE UPPERCASE CONSISTENTLY LIKE SO...... Example Update should be UPDATE, Set should be SET, Where should be WHERE, from should be FROM and and should be AND.....

    ERROR 3 - Online 103 in fg_membersite.php...... Should there be a space before and after the operand || .. or should there Not be a any spaces??? your code ...... if(empty($_GET['code'])||strlen($_GET['code'])<=10)................... should be .......if(empty($_GET['code']) || strlen($_GET['code']) <=10) because line 756 shows similar coding... however once again inconsistent, ......................if(!$result || mysql_num_rows($result) <= 0) SO QUESTION... what is the right way of doing such coding... Should there BE or should there NOT be a any spaces??????

    ERROR 4 - Online 806 in fg_membersite.php......there are spaces once again... should there BE or NOT be spaces...... your code ...... if(!mysql_query( $insert_query ,$this->connection)) should be ....... if(!mysql_query($insert_query,$this->connection))

    ERROR 5 - Confirmuser "code" is buggy.... you have multiple instances refering to confirmcode in a lot of different places... sometimes the database will put a 'y' in the confirmcode field or will put the 32 full characters code into the field... this causes problems for users logging in and also not receiving their confirmation emails.... if they dont get their confirmation emails and click the confirm link they will not be able to log on... if the database does put the UPDATE and SET confirmcode='y' the form works brilliantly... however once again if it puts in the long confirm code then the whole script is stuffed!! I recommend maybe looking at a different way of coding and confirming the new user registrant.

    ERROR 6 - throughout Formvalidator.php ..... inconsistent coding... for example... you have $bret=true and $bret = true everywhere throughout code...... you have $bret=false and $bret = false everywhere throughout code......

    on lines 261,265, 276 for example and lines 376, 378, 455, 464, 487, 497 coding is spread over multiple lines................. should have whatever in the brackets included all on the one line..... with parentheses doing that is ok...however...wait theres more.... on line 205 there is NO $max_len next to $variable_name like you have with min_len on line 220

    ERROR 7 - most of your html and php pages that come with the script have inconsistent coding as well.... for example single and double quotes throughout your HTML code... Upper and lowercase attributes... should validate your webpages at w3c before posting to be downloadable...

    ERROR 8 - all webpages are not HTML5 compliant and Mobile freindly.. you have to change all the head code and meta tags etc

    ERROR 9 - CSS conflicts - If someone wants to implement these webpages in a Bootstrap environment they will have to change the container class in the fg_membersite.css file. In change-pwd.php .... login.php .... confirm.php and reset-pwd-req.php for example you have < div class="container" > ........ wrapping the form inputs. The ID reference to the class you have in the css file ( #fg_membersite .container) conflicts with Bootstraps container class. Form input fields will expand to 100% of the page etc., basically stuffing up the form layout etc. The fix for that is to just change the container class in the fg_membersite.css file.. Change ........ #fg_membersite .container to .................. #fg_membersite .containernewword so change all the div fields in the html and php webpages .... change < div class="container" > to < div class="containernewword" > no more conflicts with Bootstrap CSS.container class. (Dont change the bootstrap container code in their framework or webpages... just the ones wrapping the form fields in change-pwd.php etc etc from HTML FORM Guide).

    Looking at your forum postings in both register form and form validator there seems to be nothing but problems with all the users downloading your scripts..... from deprecated code to basic not receiving certain info or PHP notices Undefining scripts..... as you most probably know with JavaScript there are things like JShint that recommends to fix code and tidy up the code.... Im not sure if there is a PHP complier that will check PHP code syntax errors etc.... but now i am looking for one so i can run it against code that people like yourself put up online to test to see if whether to implement someone else's buggy coding on my website.

    Recommend to validate all of your script and pages before making them downloadable or getting people to buy your Simfactic form builder... have a nice day!

    opened by QuantumField 3
  • Registration is not working

    Registration is not working

    After I try registrating it says Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /storage/ssd1/349/9719349/public_html/RegistrationForm-master/RegistrationForm-master/source/include/fg_membersite.php:773 Stack trace: #0 /storage/ssd1/349/9719349/public_html/RegistrationForm-master/RegistrationForm-master/source/include/fg_membersite.php(729): FGMembersite->DBLogin() #1 /storage/ssd1/349/9719349/public_html/RegistrationForm-master/RegistrationForm-master/source/include/fg_membersite.php(86): FGMembersite->SaveToDatabase(Array) #2 /storage/ssd1/349/9719349/public_html/RegistrationForm-master/RegistrationForm-master/source/register.php(6): FGMembersite->RegisterUser() #3 {main} thrown in /storage/ssd1/349/9719349/public_html/RegistrationForm-master/RegistrationForm-master/source/include/fg_membersite.php on line 773

    opened by hairyjuice 1
  • Using the forms in wordpress

    Using the forms in wordpress

    Hi Nice Job, Actually I am new to php, however I downloaded the files and try to use it with wordpress all errors I have been able to correct but when I test the register it automatically redirects me to index.php without creating the user. Meanwhile if I try it without wordpress it works but emails are not sent and also login does not work.

    May be you have Ideas on how to make this work. especially on wordpress,

    Thanks.

    opened by josat57 1
  • Please Help Me

    Please Help Me

    I am getting the above error whenever I try to run any form and my database login and password is correct.

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a2211478_admin'@'localhost' (using password: YES) in /home/a2211478/public_html/registration_files/include/fg_membersite.php on line 773

    see here for your self: http://mybitreturns.net23.net/registration_files/index.html

    please send replies to E-Mail: [email protected]

    opened by nickellawrence 1
  • email notification not sending

    email notification not sending

    hi guys great script, im facing the issue i cannot recieve email confirmation, email is not sending, is updated in the db but i get no email sending, im using gmail and followed all instructions yet nothing

    opened by walterhumphreys 0
Projeto de uma página de login desenvolvido totalmente em PHP (puro) - com conexão a banco de dados MySQL.

Projeto Página de Login com conexão à Banco de dados: Tecnologias Utilizadas: HTML(Em documento PHP); PHP (Sem a utilização de Frameworks - puro); MyS

null 1 Jun 15, 2022
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
Create (passwordless) login links for users

Generate login links for users Login links for Laravel is a package for Laravel 6, 7 and 8 that allows users to easily log in with a (one-time) login

null 13 Mar 29, 2022
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
Create read update & delete using Laravel 8 with Login & register

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Fawwaz Bayureksa 1 Feb 4, 2022
Gestor de Contraseñas basado en Laravel 8 + PHP 8 + MySQL 8. Self-hosted Password Manager based on Laravel 8 + PHP 8 + MySQL 8.

English Gestor de Contraseñas Esta aplicación permite una gestión completa de contraseñas para múltiples tipos de servicios (web, ssh, teléfonos, wifi

Lito 134 Jan 2, 2023
There is no better way to learn than by watching other developers code live. Find out who is streaming next in the Laravel world.

Larastreamers This is the repository of https://larastreamers.com. It shows you who is live coding next in the Laravel world. Installation Steps clone

Christoph Rumpel 201 Nov 24, 2022
Basic Crud Generator (With Code Files, like GII (YII2)) Using Laravel, Livewire and Tailwind CSS

LiveCrud Live Crud Generator. This package generates Basic Crud with Livewire. Features Generate Complete Crud With Livewire Component and Blade Files

Ritesh Singh 28 Oct 12, 2022
Code Driven Reporting Platform for Laravel.

Laracube Code Driven Reporting Panel for Laravel. Documentation, Installation, and Usage Instructions Click Here for Documentation, Installation, and

null 25 Dec 26, 2022
Code for database forms and Drupal module for the Lobbywatch.ch project

Lobbywatch.ch Lobbywatch.ch - the platform for transparent politics. Lobbywatch.ch maintains a database with links of politicians and lobby groups. Th

Lobbywatch 29 Dec 1, 2022
A Laravel REST API backend with React/Redux, hot module reloading in development and route-level code splitting

React Laravel Boilerplate This is the boilerplate that I personally use for getting projects off the ground quickly using my favourite stack of techno

Carwyn Stephen 174 Jan 6, 2023
Laravel CRUD Generator, Make a Web Application Just In Minutes, Even With Less Code and fewer Steps !

?? CRUDBOOSTER - Laravel CRUD Generator Laravel CRUD Generator, Make a Web Application Just In Minutes, Even With Less Code and fewer Steps ! About CR

Crocodic Studio 1.7k Jan 8, 2023
Menyimpan source code UTS Mata kuliah Rekayasa Web tentang User Authentication menggunakan Session dan Cookie. Deployed on Heroku.

About Academica Academica adalah website dengan tema edukasi yang mengimplementasikan user autensikasi menggunakan session dan cookie. Halaman dashboa

Galang Aidil Akbar 2 Nov 25, 2021
The source code behind the Laracasts Series: Image Uploading with Vue + Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Andrew Schmelyun 5 Dec 10, 2022
A @laravel based RAD platform for back-office applications, admin/user panels, and dashboards.

For the full documentation, visit orchid.software. Introduction Orchid is a free Laravel package that abstracts standard business logic and allows cod

Laravel Orchid 3.4k Jan 1, 2023
Cipi is a Laravel based cloud server control panel that supports Digital Ocean, AWS, Vultr, Google Cloud, Linode, Azure and other VPS.

Cipi is a Laravel based cloud server control panel that supports Digital Ocean, AWS, Vultr, Google Cloud, Linode, Azure and other VPS. It comes with nginx, Mysql, multi PHP-FPM versions, multi users, Supervisor, Composer, npm, free Let's Encrypt certificates, Git deployment, backups, ffmpeg, fail2ban, Redis, API and with a simple graphical interface useful to manage Laravel, Codeigniter, Symfony, WordPress or other PHP applications. With Cipi you don’t need to be a Sys Admin to deploy and manage websites and PHP applications powered by cloud VPS.

Andrea Pollastri 907 Jan 8, 2023
An account management Panel based on Laravel7 framework. Include multiple payment, account management, system caching, admin notification, products models, and more.

ProxyPanel 简体中文 Support but not limited to: Shadowsocks,ShadowsocksR,ShadowsocksRR,V2Ray,Trojan,VNET Demo Demo will always on dev/latest code, rather

null 17 Sep 3, 2022
CodeIgniter 4-based application skeleton

Bonfire 2 Just getting started. More details at Patreon What is Bonfire? Bonfire will be a robust application skeleton for CodeIgniter 4-based applica

Lonnie Ezell 79 Dec 25, 2022
EasyPanel is a beautiful, customizable and flexible admin panel based on Livewire for Laravel.

EasyPanel EasyPanel is a beautiful, customizable and flexible admin panel based on Livewire for Laravel. Features : Easy to install Multi Language RTL

Reza Amini 529 Dec 29, 2022