Solved

Create a user registration page to access a certain page on a website

Posted on 2007-11-22
5
226 Views
Last Modified: 2013-12-24
Hi,

I would like to create a user registration page on my website which allows users to register their details online [Name, Username, password, etc] which in turn would grant them access to a specific page on my site [a company download page].  

The item i do need in the registration is to be able to check that the customer code entered is an actual customer code - via MySQL database.  All the avaialble customer codes will be stored on a MySQL database so that they can be verified.

If anyone knows how i can go about this either with coded examples or with software which i can puchase i would very much appreciate it.

Kind Regards,
Anthony
0
Comment
Question by:d10u4v
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
qmic earned 500 total points
ID: 20334319
You have not to buy any software. Here you have good tutorial for php:
http://www.swish-db.com/tutorials/view.php/tid/601
Feel free to ask if something isn`t clear.
0
 

Author Comment

by:d10u4v
ID: 20334495
Thank you for the link.  It looks very intresting, i will get to work modifying it a little.  I may need your assistance later?

Instead of checking that a registering customer actually is a current customer [via customer code], would you suggest not allowing customers to register themselves and only allow me to add customer accounts to the database, granting them permission?

Anthony
0
 
LVL 1

Expert Comment

by:qmic
ID: 20334645
This tutorial should explain everything clearly, but don`t hesitate to ask.

I don`t know how many customers you have, but you can save your time if you force customers to make accounts by themselves and make only verification of submitted data (if you afraid of guessing Customer`s ID, you should request more than it in form - like a VAT Registration Number
0
 

Author Comment

by:d10u4v
ID: 20335313
Hi,

I have two Password fields that i want to check to make sure they have entered the correct password twice duign registration.  How do i check the the two Password Fields on the form match?

Anthony
0
 
LVL 1

Assisted Solution

by:qmic
qmic earned 500 total points
ID: 20335681
Use this function in php
http://pl.php.net/strcmp

Or try Javascript
IN PHP:

if (strcmp($_POST['pass1'],$_POST['pass2']==0) {
 

do something if equal
 

} else {

show again form

}
 

IN PHP (better version for me)
 

if ($_POST['pass1']==$_POST['pass2'] {
 

do something if equal
 

} else {

show again form

}
 
 
 
 

In Javascript:

EXAMPLE HTML CODE (IN <BODY> SECTION 

form 

   name="FormName" 

   method="POST" 

   action="/cgi-bin/script.cgi">

<input 

   type="text" 

   name="FieldA" 

   size="19" />

<input 

   type="text" 

   name="FieldB" 

   size="19" />

<input 

   type="submit" 

   onclick="return BothFieldsIdenticalCaseSensitive();" 

   value="Click Me" />

</form>
 

EXAMPLE JAVASCRIPT CODE IN <HEAD> SECTION - shows alert button if password mismatch on button submit  click (more elegant for user way)
 

script type="text/javascript" language="JavaScript">

<!--
 

function BothFieldsIdenticalCaseSensitive() {

var one = document.FormName.FieldA.value;

var another = document.FormName.FieldB.value;

if(one == another) { return true; }

alert("Password mismatch");

return false;

}
 

function BothFieldsIdenticalCaseInsensitive() {

var one = document.FormName.FieldA.value.toLowerCase();

var another = document.FormName.FieldB.value.toLowerCase();

if(one == another) { return true; }

alert("Password mismatch.");

return false;

}
 

//-->

</script>

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now