I have this function in php; a separate file, function dbRowInsert($table_name, $form_data)
.
I included it in my php file in which registration happens. My problem is how do I call the function on form submit and pass a parameter to the dbRowInsert
function. This is the data of my form:
$form_data = array(
'username' => $username,
'password' => $password,
'title' => $title,
'first_name' => $first_name,
'middle_name' => $middle_name,
'last_name' => $last_name,
'position' => $position,
'residence' => $residence,
'monthly_salary' => $monthly_salary,
);
I tried this method:
<form id="signup_form" class="form-horizontal" role="form" action="<?php dbRowInsert(tblperson, $form_data) ?>">
...
</form>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…