The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple select box or checkboxes in the registration form
#8
Hmmm....I have changed the code to what you suggested in reply #2819...like so: (I removed the array thingy otherwise the whole page went blank)

<pre>
Code:
$emailAddress = Input::get('email');
//This is clunky, but gets back your user id of the new user
$findNewUser = $db->query("SELECT * FROM users WHERE email = ?",array($emailAddress));
$newUser = $findNewUser->first();
$newId = $newUser->id;

//now you have to decide where you want those checkboxes to go.
//the left side is the column in the db, the right side is what you are inputting

$over18=Input::get(‘over_18’);
if ($over18 == ‘on’){
$over18=1;
}else{
$over18=0;
}

$loveus=Input::get(‘love_us’);
if ($loveus == ‘on’){
$loveus=1;
}else{
$loveus=0;
}

$amhuman=Input::get(‘am_human’);
if ($amhuman == ‘on’){
$amhuman=1;
}else{
$amhuman=0;
}

//If you want this info to exist in the existing user table, you do
$db->update('users',$newId,$moreInfo);

//If you want it to be a new row in the db, let's say more_info
//note that you would also want to pass in 'id'=>$newId into the array
//above so you know whose data this is!
//$db->insert('more_info',$moreInfo);

Redirect::to($us_url_root.'users/joinThankYou.php');
}

} //Validation and agreement checbox
} //Input exists

?>
</pre>


But it does not seem to be working. What have I done wrong?
  Reply


Messages In This Thread
multiple select box or checkboxes in the registration form - by LBC - 11-15-2016, 07:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)