Solved

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

Posted on 2007-11-22
5
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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…

739 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