Solved

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

Posted on 2007-11-22
5
228 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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