Below I will show you my code. The reason that I don't believe those ways will work is because I am in the middle of an "IF" statement while this is going on!
Here is the complete code::
<?php
if ($submit) :
$db=mysql_connect("localhost","xxxxx","xxxxx") or die ("cant connect");
mysql_select_db("xxxxxx_com",$db) or die ("cant change");
$result=mysql_query("select * from joborder where user='$username'",$db) or die ("cant do it");
while ($row=mysql_fetch_array($result)) {
if ($row["pass"]==$password) {
printf("Welcome " .$row['fname']." of ".$row['organization']."!");
printf("<form method=\"post\" action=\"sendmail.php\">");
printf("Email: <input name=\"email\" type=\"text\" /><br />");
printf("Work Order:<br />");
printf("<textarea name=\"message\" rows=\"15\" cols=\"40\">");
printf("</textarea><br />");
printf("<input type=\"submit\" value=\"Submit\" />");
printf("</form>");
}
}
else:
?>
<body link="#0000FF" vlink="#0000FF" alink="#0000FF">
<form method=post action="<?echo $PHP_SELF?>">
<h2 align="center"><font color="#FF0000" face="Arial, Helvetica, sans-serif">Welcome
to the EyeOpener Login!</font><font color="#FF0000"><br>
</font> </h2>
<table width="487" height="128" border=0 align="center" cellpadding=2 cellspacing=0>
<tr>
<td width="92"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Username:</strong></font></td>
<td width="235"><input type="text" name="username" size=15></td>
<td width="148" rowspan="4"><div align="center">
<p> </p>
<p><img src="logo.jpg" width="300" height="117"></p>
</div></td>
<tr>
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>Password:</strong></font></td>
<td><input type="password" name="password" size=15></td>
<tr>
<td></td>
<td valign="top"><input type="submit" name="submit" value="Log In"></td>
<tr>
<td> </td>
<td valign="top"> </td>
<tr>
<td colspan="2"><div align="center"><font size="2" face="Arial, Helvetica, sans-serif">Do
You Need To<br>
<a href="register.php">Register</a>? </font></div></td>
<td> </td>
</table>
</form>
<? endif; ?>
Do you see my dilemma?