Jump to content


Photo

Preventing repeated registration


  • Please log in to reply
No replies to this topic

#1 xprt007

xprt007
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 23 November 2003 - 11:44 AM

Hello folks,
I am new to php/mysql, as may be reflected by my question.
I have a site where new members can register online & update their data and so on. That is functioning well. They are based on the tutorials http://www.phpfreaks...orials/78/0.php and & http://www.phpfreaks...rials/40/0.php

I also have old members who registered in person, but need to update their data. I had to devise a log in mechanism some of the data in database, which after the initial log in, they update their other data & also get a password & account activation link emailed to them. After that I want them to log in as those whose registration was fully done online. Thats working too. The only problem, is some one in the database can use the specially designed form to repeatedly register. I have not managed to write a script that tells them their account has already been activated.

I know I probably have to use some select query that checks that particular persons data & if they have \"Username\" and \"Password\" entered in the database, which they did not originally have, and the activation state at \"1\" and not at the default \"0\", but I dont know how to.
How would the WHOLE query be?

Something like:
[php:1:510ac96c3d]<?php

<?php
session_start();
header(\"Cache-control: private\");
if (!$_SESSION[\'MUK_Names\'])
{
echo \"You\'re not logged in!\";
include(\"login2.html\");
exit();
}
$MUK_Names = $_SESSION[\'MUK_Names\'];
$userid = $_SESSION[\'userid\'];

include (\"db.php\");
....



$sql_member_check = mysql_query(\"SELECT Username FROM Old_Students_MUK1
WHERE MUK_Names=\'$MUK_Names\' AND Registration_No=\'$Registration_No\' AND Year_of_Completion=\'$Year_of_Completion\'\");
$sql_encryptpass_check = mysql_query(\"SELECT encryptpass FROM Old_Students_MUK1
WHERE MUK_Names=\'$MUK_Names\' AND Registration_No=\'$Registration_No\' AND Year_of_Completion=\'$Year_of_Completion\'\");
$sql_activation_check = mysql_query(\"SELECT activated FROM Old_Students_MUK1
WHERE MUK_Names=\'$MUK_Names\' AND Registration_No=\'$Registration_No\' AND Year_of_Completion=\'$Year_of_Completion\'\");

......

?>[/php:1:510ac96c3d]


and then what?? Or if I am wrong, how should it be?

Under \"WHERE\", I included all those values, because the data is faulty with some almost similar entries in many fields which where causing trouble, until I did so.

Can some one help?

I also have at times or on some PCs an error message \"Stack Overflow at line 189\", when someone logs out. the logout.php page does not have that number of lines of code! What does it mean?
The logout code looks like that:

[php:1:510ac96c3d]<?php
<?
session_start();

if(!isset($_REQUEST[\'logmeout\'])){
echo \"<center>Are you sure you want to logout?</center><br />\";
echo \"<center><a href=logout.php?logmeout=true>Yes</a> |
<a href=javascript:history.back()>No</a>\";
} else {
session_destroy();
if(!session_is_registered(\'first_name\')){
echo \"<center><font color=red><strong>You are now logged
out!</strong></font></center><br />\";
echo \"<center><strong>Login:</strong></center><br />\";
include \'login_form.html\';
}
}
?>

?>[/php:1:510ac96c3d]


Thanks,
xprt007

:roll:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users