Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-11-22
5
Medium Priority
?
234 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 2000 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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
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…

722 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