Jump to content

Secure Register Project


justinede

Recommended Posts

Hello All,

 

I want to start this project for my school that is basically a whole Social Networking Web Site only for the school. When someone wants to register they have to fill in there first and last name and ID number. Once they hit Register, I want the script to check the first and last name with the ID number they gave and see if its valid. If it is, there account is made. But if it isn't they cant make an account. This is basically making sure people from outside the school cant make an account. I would get the list of names and id numbers from my school and have to put them into a database.

Link to comment
https://forums.phpfreaks.com/topic/140253-secure-register-project/
Share on other sites

is this a project that is supported by your school and if so is it on school servers.

if so your school properly has a database that they could allow you access to that contains that kind of thing and is updated when new students come in or old ones leave

 

Scott.

$result = mysql_query(sprintf("SELECT `firstName`, `lastName` FROM `iddb` WHERE `id` = '%s'",mysql_real_escape_string($_REQUEST['id'])));
if ($a = mysql_fetch_assoc()) {
  if ($a['firstName'] == $_REQUEST['firstName'] && $a['lastName'] == $_REQUEST['lastName']) {
    // valid name ID
  }
  else {
    // invalid name
  }
}

no this isnt supported by the school, but the school has their information an a public network drive and i downloaded the list of the current students and their ID numbers. so all i have to do is import that into a database and add a line of code the this Social Networking Site I downloaded.

If you know basic PHP and MySQL then this should be easy.

 

$firstname = mysql_real_escape_string($_POST['firstname']);
$lastname = mysql_real_escape_string($_POST['lastname']);
$studentid = mysql_real_escape_string($_POST['studentid']);

$query = mysql_query("SELECT * FROM `students` WHERE firstname='{$firstname}' AND lastname='{$lastname}' AND studentid='{$studentid}'");
$num = mysql_num_rows($query);

if ($num == 1) {
     // is a student
} else {
    // not a student
}

If you know basic PHP and MySQL then this should be easy.

 

$firstname = mysql_real_escape_string($_POST['firstname']);
$lastname = mysql_real_escape_string($_POST['lastname']);
$studentid = mysql_real_escape_string($_POST['studentid']);

$query = mysql_query("SELECT * FROM `students` WHERE firstname='{$firstname}' AND lastname='{$lastname}' AND studentid='{$studentid}'");
$num = mysql_num_rows($query);

if ($num == 1) {
     // is a student
} else {
    // not a student
}

 

oh true that :o why didn't I include firstName and lastName into the query? :( lol

I think its spelled pedofile, and yeah its a pretty good idea, but I don't really think your school would condone this, as the schools already block myspace, facebook, etc.. This would be just another distraction for children in computer/technology classes, in class on sidekicks, psps, cellphones. The schools wouldn't approve, but the kids might enjoy it.

oh yeah.. didnt think about that. any suggestions on how to stop this..

well also, most people only know their own ID numbers. Their ID number is assigned to them once they hit elementary school and sticks with them through public school. I only know mine by heart and the list I found was hard to find.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.