1
votes

I'm quiet basic user of php & sql and wanted to do a shopping cart system I need your help for this script.

The result is all the list from the table is displayed from the page and i wanted to to have a popup page where if you click one of the product it will display from the popup

If you notice i added an anchor tag as this is the link which leads to a popup page the popup information is still under one page:

`

    

<table width="800px" border="0" cellpadding="0" cellspacing="7">
<? $result=mysql_query("select * from argentina");
while($row=mysql_fetch_array($result)){ ?>
<tr>
<td align="center" valign="top"><img src="../user/<?=$row["picture"]?>" height="130" /></td>
<td align="right" valign="top" bgcolor="#E0E0E0">
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>
<td width="78%" valign="top"><a class="inline" href="#inline_content"><strong><?=$row["name"]?></strong></a><br />
Variety: <?=$row["variety"]?> <br />
Apellation: <?=$row["apellation"]?> <br />
<td width="22%" valign="top"><?=$row["content"]?><br /><br /><br />
<a href="../../contactus.php"> <input type="button" class="button-order" value="Order Now" href="contactus.php" /></a>
//windpoppup
<div style="display:none">
<div id="inline_content" style="padding:10px;background:#fff;">
<p>

//Please provide code here
</div>
</p>
</div></div>

<p>&lt;/td&gt; &lt;/tr&gt;<br> &lt;/table&gt;<br> &lt;/td&gt;&lt;/tr&gt;<br> &lt;tr&gt;&lt;td colspan=&quot;0&quot;&gt;&lt;/td&gt;&lt;? } ?&gt;<br> &lt;/table&gt;</p> </pre>

`

Thanks.

1
Your markup is totally messed up. please, paste your HTML, and use the editor's curly-bracket-icon {} to highlight your code properlyRoko C. Buljan
@Pete, Hi I tried <? $result=mysql_query("select * from argentina"); while($row=mysql_fetch_array($result)){ ?> and show <?=$row["name"]?> the first product name appears and when i clicked on the other products the first product still on the popup.Herbert
@roxon the first query runs properly it's just that the first product name appears everytime i clicked even from different productsHerbert
@Herbert because your page doesn't reload so it cannot process php script.you must use ajax for thisAshraf Kamarudin

1 Answers

0
votes

I would suggest you take a look at Codeigniter's Cart Class which is already well written. There is not much need to keep reinventing the wheel, but you can do so by reading their core if you wish :)

Cart Class (Obviously, you can do shopping cart with it, lots tutorial available if you do some research