Zenax
Active Member
- Messages
- 1,377
- Reaction score
- 4
- Points
- 38
OK so i have finally started creating my CMS. I have already written up the registration script that allows you to register an account.
So basically what I want you to do is to test out my registration script, take a look at the overall design of the script and also how secure it is. The idea of ZenCMS is to provide an easy to use CMS that will also have really good security on it.
Try it out here:
http://zenax.x10hosting.com/ZenCMS/register/
I am now writing the login script that will also hopefully have the right amount of security, and I will post when I have completed it, which will hopefully be later today.
Many Regards,
Zenax
EDIT:
Please just gimme a hand with this as well:
something produces this error:
I left in the code because I want it to be open source.
I also update my SQL file to this:
I am thinking that somewhere I forgot to do something and also it has something to do with updating the script.
Sorry if this post seems really long to you!
So basically what I want you to do is to test out my registration script, take a look at the overall design of the script and also how secure it is. The idea of ZenCMS is to provide an easy to use CMS that will also have really good security on it.
Try it out here:
http://zenax.x10hosting.com/ZenCMS/register/
I am now writing the login script that will also hopefully have the right amount of security, and I will post when I have completed it, which will hopefully be later today.
Many Regards,
Zenax
EDIT:
Please just gimme a hand with this as well:
PHP:
<?Php
if (isset($_POST['submit'])) {
// including the db connection script
require_once("connect_db.php");
// declaring the variables
$username = $_POST['username'];
$password = md5($_POST['password']);
$passrept = $_POST['passrept'];
$email = $_POST['emailaddy'];
// stripping HTML tags from the info entered
$username = strip_tags($_POST['username']);
$password = strip_tags($_POST['password']);
$passrept = strip_tags($_POST['passrept']);
$email = strip_tags($_POST['emailaddy']);
// Checking a username is not already taken
$q = mysql_query("SELECT * FROM users WHERE users = '$username'") or die(mysql_error());
if(mysql_num_rows($q) > 0)
{
echo '<script>alert("The username you entered is already in use, please try again.");</script>';
echo '<script>history.back(1);</script>';
exit;
}
else {
// Checking the two passwords match each other
if ($password != $passrept) {
echo '<script>alert("The passwords did not match.");</script>';
echo '<Script>history.back(1);</script>';
exit;
}
// Checking the format of the email address
if (!preg_match("/.*@.*..*/", $email) || preg_match("/(<|>)/", $email)) {
echo '<script>alert("Invalid Email Address");</script>';
echo '<script>history.back(1);</script>';
exit;
}
// inserting the data into the db
$insert = mysql_query("INSERT INTO users VALUES ('". $_POST['username'] ."', '". $_POST['password'] ."', '". $_POST['emailaddy'] ."') ")
or die("Could not insert data because ".mysql_error());
header( 'Location: register_success.php' ) ;
}
}
?>
something produces this error:
Could not insert data because Column count doesn't match value count at row 1
I left in the code because I want it to be open source.
I also update my SQL file to this:
Code:
... Removed the comments to shorten post length ...
CREATE TABLE `users` (
`users` varchar(40) NOT NULL,
`password` varchar(50) NOT NULL,
`emailaddy` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`users`, `password`) VALUES
('test', 'test'),
('test1', 'test1')
I am thinking that somewhere I forgot to do something and also it has something to do with updating the script.
Sorry if this post seems really long to you!
Last edited: