Jump to content

product page Help!!


icefire

Recommended Posts

<table border="0" cellpadding="2px" width="600px">
	<?php
		$result=mysql_query("SELECT * FROM products");
		while($row=mysql_fetch_array($result)){
	?>
    	<tr>
        	<td><img src="<?php $row['picture'] ?>" /></td>
            <td>   	<b><?php $row['name'] ?></b><br />
            		<?php $row['description'] ?><br />
                    Price:<big style="color:green">$
				<?php $row['price'] ?></big><br /><br />
               <input type="button" value="Add to Cart" onclick="addtocart(<?php $row['serial']?>)" /> 
		</td>
	</tr>
        <tr><td colspan="2"><hr size="1" /></td>

 

You should either use the notation <?php=$row['price']?> or use echo $row['price'], because all this does is reference the variable $row with a key, but not do anything with it. Whatever is echo'd or print'd to the user is what is displayed as HTML. Everything else is processed before the page loads.

 

So yea. Replace those with something sensible!

Link to comment
https://forums.phpfreaks.com/topic/203739-product-page-help/#findComment-1067078
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.