What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » webshop

webshop
Author: Message:
bramvandeperre
Junior Member
**

Avatar
Some random dude

Posts: 56
Reputation: 3
32 / Male / Flag
Joined: Oct 2007
Status: Away
O.P. webshop
hi all,

i have a question, i don't know it is difficult, but if you're a little bit expierenced, keep reading anyway :p

i'm making a webshop for our school, and i want to have an automatic price calculator on product select & amount-fill-in.

code:
<div id="select1" >
<select name="productadd" onChange="document.getElementById('select2').style.display=(this.options.selectedIndex>0?'block' : 'none');"
>
<option value="" selected="selected">maak uw keuze</option>
<?php $lendetta = mysql_query("SELECT * FROM `forum_shopproduct` WHERE `actief`=1");
while ($gegeven = mysql_fetch_array($lendetta)) {
$naam = $gegeven["naam"];
$id = $gegeven["id"];
echo "<option value='".$id."'>".$naam."</option>";
}
?></select><input type="text" height="1" size="20" name="aantaladd1" value="0">

<span id="prijs1"></span><br></div>


in <span id="prijs1"></span>, there has to come a price.
the price has to be calculated like this:
code:
$query = mysql_query("SELECT * FROM `forum_shopproduct` WHERE `code`='(the value of the select-menu specified in the while)'");
$dbres = mysql_fetch_object($query);
$prijs = $dbres->prijs;


i think this is it, so the script (in js) has to determine the price live.. maybe use an array with prices or something, but you're the experienced one, not me! :p
01-11-2008 01:56 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
webshop - by bramvandeperre on 01-11-2008 at 01:56 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On