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
/printthread.php 16 require_once



UserSpice
Send values of input radio to database - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Send values of input radio to database (/showthread.php?tid=744)



Send values of input radio to database - JulienS - 09-13-2017

Hi everyone,

I'm trying to get the values from an input radio in the login form and send it to the database. This is my code in the form field:
<input type="radio" name="typeaccountpro" id="typeind"> An individual
<input type="radio" name="typeaccountpro" id="typepro"> A professional / An agency
What should I write in the script which will send everything to the database?
Also, for a select? A textarea? A checkbox?
Many thanks


Send values of input radio to database - Brandin - 09-13-2017

You also need to assign values to your radio buttons.

You will do the same scripting as you would for any - including an input type text.

Same follows for select, textarea, and checkbox Smile


Send values of input radio to database - JulienS - 09-13-2017

So like this for the input?
<input type="radio" name="typeaccountpro" id="typeind" value="<?php if (!$form_valid && !empty($_POST)){ echo $typeind;} ?>"> An individual
<input type="radio" name="typeaccountpro" id="typepro" value="<?php if (!$form_valid && !empty($_POST)){ echo $typepro;} ?>"> A professional / An agency

And like this for the script? http://pasted.co/328d5415


Send values of input radio to database - mudmin - 09-13-2017

It's essentially the same as this video.
https://www.youtube.com/watch?v=Ls2NTY2mMHw