I am trying to create a fullname out of first and last name fields. Am I better to do this inside of constructing the PHP $query string? My current method isn't working for me.
[HTML] <tr>
<td class="label">F irst name:</td>
<td class="field">
<input type="text" name="first_nam e" size="20" maxlength="50" value="<?php if (isset($_POST['first_name'])) { echo htmlChars($_POS T['first_name']); } ?>">
</td>
</tr>
<tr>
<td class="label">L ast name:</td>
<td class="field">
<input type="text" name="last_name " size="20" maxlength="50" value="<?php if (isset($_POST['last_name'])) { echo htmlChars($_POS T['last_name']); } ?>">
</td>
</tr>
<tr>
<td class="field" name="fullname" value="<?php $first_name. " ".last_name ?>">
</td>
</tr>
[/HTML]
My $query string is constructed
[PHP]
..........
$query .= "'" . prepareData($_P OST['fullname']) . "'" . ',';
$query .= "'" . prepareData($_P OST['first_name']) . "'" . ',';
$query .= "'" . prepareData($_P OST['last_name']) . "'" . ',';
[/PHP]
I would appreciate some clues.
[HTML] <tr>
<td class="label">F irst name:</td>
<td class="field">
<input type="text" name="first_nam e" size="20" maxlength="50" value="<?php if (isset($_POST['first_name'])) { echo htmlChars($_POS T['first_name']); } ?>">
</td>
</tr>
<tr>
<td class="label">L ast name:</td>
<td class="field">
<input type="text" name="last_name " size="20" maxlength="50" value="<?php if (isset($_POST['last_name'])) { echo htmlChars($_POS T['last_name']); } ?>">
</td>
</tr>
<tr>
<td class="field" name="fullname" value="<?php $first_name. " ".last_name ?>">
</td>
</tr>
[/HTML]
My $query string is constructed
[PHP]
..........
$query .= "'" . prepareData($_P OST['fullname']) . "'" . ',';
$query .= "'" . prepareData($_P OST['first_name']) . "'" . ',';
$query .= "'" . prepareData($_P OST['last_name']) . "'" . ',';
[/PHP]
I would appreciate some clues.
Comment