Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Registration Question

Asked Modified Viewed 3,039 times
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
asked
Senior Member

I am setting up a high school alumni page and want to have the registrant checked against a list of eligible registrants before the registration is allowed to proceed. This will prevent anyone other than a graduate of the school to be able to register for the site. Yes, I can set it to have the admin approve all registrations, but this way it will be done automatically.

I have set up the user fields needed to make this work but I can't seem to figure out how to check against the eligible registrants list. The new user fields have been added to the users table, there is another table that contains the eligible registrants and I have the code that will check against the eligible code, but don't know where to place it so that it will work. Can anyone help point me in the right direction? Here is the code I want to use...BTW this code works with a stand alone registration project I am using on another site and will likely need to be tweaked to work with fusion.

$stmt = $con->prepare('SELECT * FROM fusion_eligible_registrants WHERE user_last = ?');
$stmt->bind_param('s', $_POST['user_last']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
   // continue to process registration
} else {
   exit('Last Name not on eligible to register list!');
}
0 replies

46 posts

G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

Try it this way Fred. Change the ".DB_HPHS64_REG." to ".DB_PREFIX."hphs64_reg and see if it makes a difference. Also right after:
if (isset($_POST['register'])) {
Add this:
if (isset($_POST['user_last'])) {
$lastname = $_POST['user_last'];
}
So it now looks like:
if (isset($_POST['register'])) {
   if (isset($_POST['user_last'])) {
      $lastname = $_POST['user_last'];
   }
      $result = dbquery("SELECT user_last FROM ".DB_PREFIX."hphs64_reg WHERE user_last='$lastname'");
      if (dbrows($result) != 0) {
   redirect("shazam.php");
   } else {
opentable($locale['400']);
   echo "<p><table width='500' align='center' border='1' cellpadding='10'><tr style='color:black'>n";
   echo "<td align='center' bgcolor='#fefefe'><h4><b>".$locale['406']."</b></h4></td>n";
   echo "</tr></table><br><br>n";
closetable();
require_once THEMES."templates/footer.php";
   }
}

Notice that I changed the rediredt filename from register.php to shazam.php... if we don't do this then people that know the system will go straight to register.php in the address bar. And change the register.php filename to register_old.php...
Lemme know what happens.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

It is working for both non members and members. Thanks for your help on this Grim.
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

Fantastic news my friend !!! Glad to be of service.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

After changing the redirect from register.php to shazam.php, it will go to the register form where it asks the math question, but once you answer that question it looks for register.php file. Where in the code do I change that to make it go to the new register.php file (shazam.php)
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

Don't know Fred. Let me explore and I'll get back to you on it.
OK I found it. Open includes/gateway/gateway.php here is line #127
echo "<form name='Fusion_Gateway' method='post' action='register.php' />";
Change register.php to shazam.php and that should do it.
Let me knw Fred.
Edited by Grimloch on 14-11-2022 02:36,
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
  • Started this discussions
answered
Senior Member

It was line #107 in my file, but I got it fixed and seems to be working. Thanks again.

On a completely different subject...do you know if the captcha in the register file is case sensitive?
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

You're right it was line #107; mistyped it. Yes the captcha is case sensitive.
0 replies

Category Forum

Settings - 8

Labels

Statistics

  • Views 0 views
  • Posts 46 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet