A form sends name, topic, email, and blurb to MySQL db. Email is not a required field, but if it is !empty I want to include it as the name and echo the row data.
This is my idea so far:
if (!empty($_POST['email']))
{
$row['name'] = "<A href='mailto:' . $_POST['email'] . '>' . $_POST['name'] . '</A>";
}
else
{
$row['name'] = $_POST['name'];
}
I am having trouble sorting out the coding for the email/name any help please. And the rows will be:
while($row = mysql_fetch_array( $result )) {
echo "<tr>";
echo '<td><Posted by : ' . $row['name'] . ' on ' . $row['date'] . '<br />
Topic : ' . $row['topic'] . '<br />Thoughts : ' . $row['thoughts'] . '</td>';
echo "</tr>";
Not very well sorted yet, help please :-) thanks.