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,043 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

You're right it was line #107; mistyped it. Yes the captcha is case sensitive.
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

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

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

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

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

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
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

All earlier versions of PHP-Fusion from 7 on back had to use $db_prefix(table_name) but the builtin db function ".DB_." takes care of the prefix. So my short answer is that it probably won't work but try it and see Fred.
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

If you change line 18 from pre_register.php from this
$result = dbquery("SELECT user_last FROM ".DB_HPHS64_REG." WHERE user_last='$lastname'");


to this:
$result = dbquery("SELECT user_last FROM fusion6S71B_hphs64_reg WHERE user_last='$lastname'");


it should eliminate the error message and still work, won't it?
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

Here is what the phpmyadmin of the hphs64_reg table looks like. Let me know if you need any other information
You do not have access to view attachments
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

OK then there's something wrong with your table Fred. Don't have a clue without being able to see your phpMyAdmin.
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

Yes, when trying to register a non-alumni, it blocks it from registering. The error message still exists however. See the screen shot.
You do not have access to view attachments
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

No I'm not. The first email that you sent me concerning this has the table as INNODB. If it's MyISAM great !!!
OK I have it done and tested(at least as far as a non alumni trying to register). You'll have to test it yourself where you actually have the alumni table. The pre_register.php goes in the root folder.
Edited by Grimloch on 13-11-2022 23:26,
You do not have access to view attachments
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

All of the php-fusion tables are MyISAM...are you saying they should be INNODB?
You do not have access to view attachments
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

This is just a suggestion Fred. All fusion tables are using the MyISAM storage engine. I think as a first step you should redo your table accordingly instead of using INNODB.
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

OK, sounds good. Yes, I have the original file I can put back there.
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

OK well, I think maybe it's time to try MathiasHU's suggestion. What you would need to do is change the url that Register points to(which is normally register.php) and have it point to a script that I will build for you. That script will check the table against the last name that the prospective user inputs. If there is a match it will then redirect to register.php and if it fails it'll just print an error to the user. I'll get back to you on the script Fred. Hopefully you still have the original files that you can put back in place? If not just copy them from an unzuipped file system.
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

I already tested that...if the registrant is not in the table, then it stops the registration from going on. It is placing that registrant info into the new_users table however so that if I want to use that same registrant name again it won't let me because of the fact it is in the new_users table.
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

OK well; progress of a sort. You need to do a test. Register someone that is NOT in the table and see if it goes through. In the meantime I'll look at the code again.
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

Getting a different problem...it is not letting me register someone that is on the eligible list. It is giving me this error message:

Registration failed for the following reason(s):

The posted last name is not allowed.
Please Try Again.
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