I have a one input that is used for a "Name, Surname and Family name". But I want if user enter more than 3 names, all after 3(4,5,6...) to be like family. But if you submit 2 names the Family name must be "0".
Here is my code:
<form method="POST" action="getNames.php">
Names: <input type="text" name="names" />
<input type="submit" name="submit" />
</form>
<?php
$names = $_POST['names'];
// some action here to get names
$firstName = ""; // Get first name
$surName = ""; // Get Sur name
$familyName = ""; // Get family name
?>
I will be very glad if someone help me. Thanks!