问题
I have a third party script and in this script I want to add a new input field in the User profile update -page. I want to save the bank field where user can save their bank names. I have already created a bank column in the database table members.
The script does not save the bank name to the database.
<form id="settingsform" onsubmit="return submitform(this.id);">
<input type="hidden" name="a" value="submit" />
<td align="right" width="50%">Bank Name:</td>
<td><input type="text" name="bank" id="bank" value="{$user_info.bank}"></td>
This is the code that I have for the form.
All settings are shown on the .tpl (Smarty) -file. Could you please help me out?
回答1:
Try adding the line
$bank = $input->pc['bank'];
to the code here
if ($_POST['a'] == "submit") {
verifyajax();
$email = $input->pc['email'];
$bank = $input->pc['bank'];
I think You have not retrieved the bank field on the php file.
you need to get the posted bank value as you have retrieved the other fields
来源:https://stackoverflow.com/questions/25479413/i-want-to-add-a-new-form-input-field-using-a-smarty-page-with-php