echo statements in php?

  • Thread starter Thread starter mpielichowski
  • Start date Start date
M

mpielichowski

Guest
What I am trying to do is to have the have the php statement and the text on the same EXACT line.
Age: * Required <== This is how it should look.

Age: <==
* Required <== This is how it looks now.

<?
$Age = $_POST['_Age'];
if($Age == '')
{
$error = "* Required";
echo '<span class="d" style="font:9pt Arial; color:red">'.$error.'</span>';
}
else if(!is_numeric($Age))
{
$error = "* Incorrect Character";
echo '<span class="d" style="font:9pt Arial; color:red">'.$error.'</span><br />';
}
?>
<input name="_Age" type="text" id="_Age" size="20" value="<?php if ( isset ( $Age ) ): echo $Age; endif; ?>" />


<?
$First_Name = $_POST [ '_First_Name' ] ;
print '<div class = "E" align = "left">'."First Name".'</div>';
if($First_Name == '')
{
$error = "* Required";
print '<span class="d" style="font:9pt Arial; color:red">'.$error.'</span><br />';
}
?>
<input name="_First_Name" type="text" id="_First_Name" size="20" value="<?php if ( isset ( $_POST['_First_Name'] ) ): echo $_POST['_First_Name']; endif; ?>" />
btw, I showed two examples of different ways to accomplish this, but wasn't successful.
I actually moved the </div> before the input, and got exactly what I wanted. Thanks!
 
Back
Top