The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Code for checking if user registration fields have been filled
Hi
I have removed most of the user registration fields and now want to check if fields not displayed are being filled in by spambots. In particular, I want to check if the 'homepage' field has been filled in and then discontinue the registration procedure. I have tried the following but it is not working - if ($_POST['homepage'] > ''){ exit(); } I have put this in register.php after this code > // ############################### start add member ############################### if ($_POST['do'] == 'addmember') { $vbulletin->input->clean_array_gpc('p', array( 'options' => TYPE_ARRAY_BOOL, 'username' => TYPE_STR, 'email' => TYPE_STR, 'emailconfirm' => TYPE_STR, 'parentemail' => TYPE_STR, 'password' => TYPE_STR, 'password_md5' => TYPE_STR, 'passwordconfirm' => TYPE_STR, 'passwordconfirm_md5' => TYPE_STR, 'referrername' => TYPE_NOHTML, 'imagestamp' => TYPE_STR, 'imagehash' => TYPE_STR, 'coppauser' => TYPE_BOOL, 'day' => TYPE_UINT, 'month' => TYPE_UINT, 'year' => TYPE_UINT, 'timezoneoffset' => TYPE_NUM, 'dst' => TYPE_UINT, 'userfield' => TYPE_ARRAY, 'showbirthday' => TYPE_UINT, )); Can anyone suggest some simple code to check whether 'homepage' has been entered and where to put this code in register.php? Thanks. |
#2
|
|||
|
|||
You could try:
Code:
if ($_POST['homepage'] != ''){ exit(); } |
#3
|
|||
|
|||
Thanks I tried what you suggested but that didn't work as well I think the problem might be maybe I should do the check somewhere else? Do you have any suggestion where I can do this check? Or do you think it is the correct place and the correct code? Maybe it needs different code. Thanks again.
|
#4
|
|||
|
|||
On my test site 'homepage' isn't something that's asked for on the registration page, so you can't check for it before the registration is complete. I think the best you could do is to check in profile.php and ban or delete the user at that point. (But maybe I'm missing some option that puts it on the registration page?)
|
#5
|
|||
|
|||
I have examined profile.php and found the following line where I think 'homepage' is being entered (it says updated but I assume that includes inserted .. anyway I can check it out):
$userdata->set('homepage', $vbulletin->GPC['homepage']); My problem is I don't understand how this code works and therefore I don't know how to examine the contents of 'homepage'. I want to check if 'homepage' has something entered and if it does then exit(). I don't know if I need to write to a temporary variable and check the temporary variable or check something in the code here. Would you please tell me what code I can use to check to see if 'homepage' is entered when the code in profile.php says: $userdata->set('homepage', $vbulletin->GPC['homepage']); The code doesn't have to be brilliant just has to get the job done. If you give me an idea what to write then I can check it you don't have to check it. Thank you very much for your help. |
#6
|
|||
|
|||
Quote:
First of all, sorry, I had "can" in my post above where I meant "can't". The code you posted is in profile.php, at that point the user is already registered. So you could exit at that point but it will only stop the user from setting the profile. But if you want to do that, you could put: Code:
if (!empty($vbulletin->GPC['homepage'])) { exit(); } But that would also stop any user from setting a homepage. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|