954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

echoing an html table with variables included

Here is what i have a problem with. I need to display variable inside of an html table if the variable's are not empty from a form on a previous page. When the form is fully filled out it isn't displaying any of the table at all. Please help.

<? 
$makemodel=$_GET['makemodel'];
$minprice=$_GET['minprice'];
$maxprice=$_GET['maxprice'];
$year=$_GET['year'];

If (empty($minprice)or($maxprice)or($year))
echo'<p class:"error_display">Please go back and fill in your form correctly</p>';
Else echo'<table class="output_table">	
<tr>
<td>Make/Model</td>
<td>$makemodel</td>
</tr>
<tr>
<td>Minimum Price:</td>
<td>$$minprice</td>
</tr>
<tr>
<td>Maximum Price:</td>
<td>$$maxprice</td>
</tr>
<tr>
<td>Year:</td>
<td>$year</td>
</tr>
</table>';
?>
MsuDU19
Newbie Poster
2 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

oh i also need to add this to the end of the code also but I'm not sure how to code this with if else statements etc. If i can make this all one php function that would be awesome. Please be kind I am new to php and teaching myself.

<? if ($minprice>=40000)
	echo'<p>Wow $$minprice, that is an expensive car!</p>';
	if ($minprice<40000)
	echo"<p>Ok $$minprice, that is a reasonable car price.</p>";
?>
MsuDU19
Newbie Poster
2 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: