Jump to content

Preventing repeated registration


xprt007

Recommended Posts

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.com/tutorials/78/0.php and http://& http://www.phpfreaks.com/tutorials/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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.