There are a couple of mistakes in your code:
1. you declare $nome=$db_field['name']; on line 19 and then use value="$nsme" on line 39 (typo?)
2. you declare $cognome=$db_field['gender']; on line 20 and then use value="$gender" on line 43 (shouldn't it be value="$cognome")
3. your <'php opening tag is not followed by a ?> closing tag somewhere before html code
4. your html code is within PHP block (see 3. above) which causes errors
5. in html you must echo variables enclosed in php tags
See the example of how this code should look like:
<?php
include 'complete.php';
$user_name = "exa";
$password = "exa";
$database = "exa";
$server = "localhost";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SELECT * FROM tb_exa WERE username='$CCGuser' AND password='$CCGpassw'";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
$nome=$db_field['name'];
$cognome=$db_field['gender'];
}
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}
?>
<table style="width: 100%">
<form action="process_u.php" method="post">
<tr>
<td>Name: </td>
<td> <input type="text" name="name" value="<?php echo $nome;?>"></td>
</tr>
<tr>
<td>Gender: </td>
<td> <input type="text" name = "gender" value="<?php echo $cognome;?>"></td>
</tr>
<input type="submit" value="GO" name="Submit"> <input type="reset" name="reset" value="Reset" /></td>
<td> </td>
</form></tr>
</table>