• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

Hot to create a register and login page Dreamweaver cs3

Hi guys,

I'm very new to web design and am trying to find out how to create a page for people to login with a username and password, and if they don't have one there would be an option for them to register their details and get a username and password. I only the log in to apply to a couple of pages on the website.

They would then be able to access a contact info page, and a classified section, how would I direct them to these pages once they have logged in?

I am using Dreamweaver CS3 on a Mac and am looking for the easiest way possible to do this!

Any help would be greatly appreciated.

Thanks in advance
0
hobbittfeet
Asked:
hobbittfeet
  • 3
3 Solutions
 
GodDoesntExistCommented:
Hi!

You have a really good tutorial here:

http://forum.codecall.net/php-tutorials/2014-simple-register-login-logoff-system.html

That one is simple and pedagogic.

Hope this helps!
0
 
hobbittfeetAuthor Commented:
Hi,

Sorry, I really am a novice at this.

I have no idea how to create the database? I assume I can just copy and paste the text for the .php pages?

Thanks


0
 
GodDoesntExistCommented:
Yeah, you can just copy and paste the code into the .php files. The script uppermost is a MySQL script (database) and it will create the table you will need in the databse.

What you will need to do is to either run the script in PHPMyAdmin (easiest way) or make a MySQL connection in a separate .php file where you type this code:

<?php
// File create_db.php
 
$conn = mysql_connect('localhost', 'db_username', 'db_password') or die ('Cannot connect to server');
mysql_select_db('db_name') or die ('Cannot open database');
 
return $conn;
 
$query = "CREATE TABLE `users` (
      `id` INT( 50 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
      `username` VARCHAR( 15 ) NOT NULL ,
      `password` VARCHAR( 15 ) NOT NULL ,
      `email` VARCHAR( 50 ) NOT NULL
      )";
$result = mysql_query($query);
 
?>

Open in new window

0
 
GodDoesntExistCommented:
On line 4 you will have to find out your MySQL connection information. localhost is used in most cases, but it can also be an IP number or something, it differs from web host to web host. db_username and db_password is your login username and password that you received from the web host. And db_name is the name of the database.

When you're done with that file, upload it to your web space and run it in the web browser. Example: www.yourdomain.com/create_db.php.

After that, check if the table has been created in the database in PHPMyAdmin and if it has been created, remove the file create_db.php to ensure that it will not be executed again.

Regards ~ Joel
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now