0 Users appreciate this thread.
Creating a register in PHP
(Capt.)Orb (2013-06-28 12:08:46)Not bad, not bad at all.
I would recommend tracking ip's as well.
For the N00bies at coding who just copy and paste, replace the smiley with a ) .
Aviation fact: The a380 is the largest commerical aircraft in service!
Go to Splashiverse! Splashiverse
Go to Splashiverse! Splashiverse
klubadmin (2013-06-28 20:27:52)I'd recommend using PDO instead. Set a better example for the n00bs to follow.
I'd use MySQLi, because I prefer it to PDO. MySQL_xxxx functions are deprecated and will be removed, so you should use MySQLi or PDO.
Personally, I use MySQLi with my own compatibility layer.
SomeLuigi is changing in 2015.
SPCOxion (2013-07-03 21:51:02)Nice.
Wow. I managed to get a ) out of nowhere.
2013-07-04 08:35:11
SPCOxion (2013-07-04 01:45:00)Errors show
Code show
Since I'm banned, I can't post new comments.
So I'll just edit this one.
What would I edit for my username/password/everything else? Also, I assume I would use my cPanel user and pass, right?
2013-07-08 11:20:15
klubadmin (2013-07-07 02:27:24)@SPCOxion Make sure you are using the username/password/url/database names specific to your host/website. It sounds like you couldn't connect.
wellsandlava (2013-11-06 04:17:48)Nice tutorial. "
2013-11-06 04:18:08
This account is under a new owner
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes

Hello, today I will show you the code and some explanation to creating a register script! This is the one used in my site, ChatPlaza Extended.
1. Start by creating the table in the database
Setup your table like the following:
Column One
Name: id
Type: int
Length: 5
Other: AUTO INCREMENT
Column Two
Name: username
Type: char
Length: 20
Other: None
Column Three
Name: password
Type: text
Length: Leave Blank
Other: None
Column Four
Name: ip
Type: char
Length: 15
Other None
Feel free to add other column's as well
2. Use the code below
<?php session_start(); $logged = $_SESSION['username']; mysql_connect("localhost","USER","PASS" ); mysql_select_db("DATABASE" ); $user3 = $_POST['user']; $user2 = mysql_real_escape_string($user3); $user = htmlspecialchars($user2, ENT_QUOTES); $pass4 = $_POST['pass']; $pass3 = mysql_real_escape_string($pass4); $pass2 = htmlspecialchars($pass3, ENT_QUOTES); $pass = hash('sha256', $pass2); $select = mysql_query("SELECT * FROM user_table WHERE username='$user' and password='$pass'" ); $count = @mysql_num_rows($select); $ip = $_SERVER['REMOTE_ADDR']; if($user != '' && $pass != '' && $count == '0'
Be sure to edit the MySQL stuff and make the file named register.php
Click Here, for another version of the code
The next code I will do will be a login!
2013-07-15 17:26:48