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 2,931 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

Post a snapshot of your phpMyAdmin so I can see how the table looks to phpMyAdmin 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

Here is the screenshot
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

Thats not what I mean Fred. I need to see some of the other fusion table names as well. Use your Cpanel's phpMyAdmin and not that weird interface that I know you are using.
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, here is the screenshot from phymyadmin
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

And another one of the actual table
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. On line #227 of the "UserFieldsInput.class.php" where it pulls the data from the table change it by getting rid of the table prefix. It should be DB_HPHS64_REG
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

Again, it is stopping the registration but still getting the error message. See screen shot.
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

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

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

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

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

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

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

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

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

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

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