arigoh afnan arigoh afnan - 1 year ago 36
PHP Question

combining input from form into 1 rows

i want to combine

into a one input

$fname = trim($_POST['fname']);
$lname = trim($_POST['lname']);

and i want input this result into my sql table

function random_username( $length = 4 ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$password = substr( str_shuffle( $chars ), 0, $length );
return $usercode;

how about that combining code?

NOTE: *Sorry for my bad english

Answer Source

Hi if you want to concate firstname and lastname then simply use concatnation

$fname = trim($_POST['fname']);
$lname = trim($_POST['lname']);

$userfullname = $fname." ".$lname; // this will give use your fullname