I want to add a new form input field using a smarty page with php

。_饼干妹妹 提交于 2019-12-11 18:23:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!