PDA

View Full Version : Add zipcode to registration.php


fredclarkjr
10-27-2011, 02:27 PM
Hi:

So I want to add a field so that a registrant can add their zip code during the registration process.

I can, start add member:
if ($_POST['do'] == 'addmember')
{
$vbulletin->input->clean_array_gpc('p', array(
$vbulletin->input->clean_array_gpc('p', array(
'zip' => TYPE_STR));

I can check for missing fields like:
// check for missing fields
if (empty($vbulletin->GPC['username'])
OR empty($vbulletin->GPC['email'])
OR empty($vbulletin->GPC['zip'])

I can set the variable by:
//set zipcode
$userdata->set('zip', $vbulletin->GPC('zip'));

Can you please tell me what file the class $vbulletin is originally defined, and do I have to add 'zip' there?

Can you think of any other basis I need to cover to get this to work?

Thanks in advance.

setishock
10-27-2011, 03:19 PM
I'm not a programmer but I'd have the field as numerical only. 0-9. Reject anything else.
You're going to find all sort of junk entries if you don't.