jaimeweb Posted December 13, 2006 Share Posted December 13, 2006 Hi everyone.Right, can anyone please help me or direct me to a script what will do the following...(i am not no expert with php or mysql so you may need to explain :d) What it is im looking for is a members script. People visiting my site will sign up by creating an account filling in username password address full name d.o.b ect. Then i would like the information to be saved in a MySQL database. Then they will login and be redirected to a page of my choice...It is not essiential to have any type of "update my settings/profile" or "forgot password" function...(only if its simple to set up...by that i mean it is on its own seperate page)Hope that makes sence!Please help!Thanks Link to comment https://forums.phpfreaks.com/topic/30533-members-sign-up-script/ Share on other sites More sharing options...
TEENFRONT Posted December 13, 2006 Share Posted December 13, 2006 http://www.google.co.uk/search?q=php+members+script&ie=utf-8&oe=utf-8&rls=org.mozilla:en-GB:official&client=firefox-aSearch on google brings up a ton of script results.. most on hotscripts etc are open source so you can learn from it, or simply use it. its best if you work with one of them and see what each one gives you, and which one works best for you. Link to comment https://forums.phpfreaks.com/topic/30533-members-sign-up-script/#findComment-140544 Share on other sites More sharing options...
chiprivers Posted December 13, 2006 Share Posted December 13, 2006 first you need mysql database to hold members details:[code]CREATE TABLE members (member_ID int unsigned not null auto_increment primary key,username varchar(12),password varchar(32),firstname varchar(50),surname varchar(50),dob date);[/code]Then you will need a script for a member to create an account, this is just a simple HTML form and PHP processing scipt to add the details to the database. It does not include any form checking or verification:[code]<?php// check to see is user has submitted formif (!isset($_POST['submit']) {// show registration form?><form name="create_user" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">First Name: <input name="firstname" type="text"><br>Surname: <input name="surname" type="text"><br>Date of Birth: <input name="dob" type="text"> (YYYYMMDD)<br>Username: <input name="username" type="text"><br>Password: <input name="password" type="text"><br><input name="submit" type="submit" value="Create User"></form><?php} else {// process new user details$query = "INSERT INTO members (username,password,firstname,surname,dob) VALUES('".$_POST['username']."','".md5($_POST['password'])."','".$_POST['firstname']."','".$_POST['surname']."',".$_POST['dob'].")";$result = mysql_query($query);// check member createdif ($result) {echo "Registration completed";} else {echo "There was a problem with your registration";}?>[/code]Then you will need a log in script:[code]<?php// check to see if user has submitted formif (!isset($_POST['login'])) {// show login form?><form name="login" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">Username: <input name="username" type="text"><br>Password: <input name="password" type="password"><br><input name="login" type="submit" value="Login"></form><?php} else {// connect to database here <=============// process login details$query = "SELECT * FROM members WHERE username = '".$_POST['username']."' AND password = '".md5($_POST['password'])."'";$result = mysql_result($query);if (mysql_num_rows($result) == 1) {// user has been verifiedecho "You have been logged";} else {// user rejectedecho "There was a problem with your login details";}?>[/code]Hope that gives you something to start with. Link to comment https://forums.phpfreaks.com/topic/30533-members-sign-up-script/#findComment-140558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.