Jump to content

How to sign an initial value to something...


zelig

Recommended Posts

Okay, here's what I'm doing. It's sort of like a market script.

 

When someone wants to buy something, they choose from a drop down the item they wish to buy. However, there is a setup cost for it to be started. Then, based upon the length they choose (anywhere from 1 - 12 months), the cost will add up.

 

My questions are:

 

[*]Is it possible to assign a setup cost?

[*]How can I make it so that, while some things will be, say $2 a month, others will be $3 or other amounts?

 

Here's what I have so far, to try and figure this out. Feel free to laugh... Or if you could point me to an example of something like this, I'd be very appreciative! Thanks!!

 



function ChangeInitialCost(){
$cic = ($_POST['newpremium']);
if (($cic == "clan") || ($cic == "guild") ||  ($cic == "house") || ($cic == "militia")){

}

 

And the form I have: (I haven't entered a submit button yet...)



<table width="200" border="1">
  <form action="premium.php" method="post" name="purchase">
  <tr>
    <td>Premium:</td>
    <td><select id="newpremium" name="newpremium">
<option value="casino">Casino</option>
<option value="clan">Clan</option>
<option value="guild">Guild</option>
<option value="house">House</option>
<option value="militia">Militia</option>
</select></td></form>
  </tr>
  <tr><form action="premium.php" method="post" name="length">
    <td>Length:</td>
    <td><select id="length" name="length">
<option value="0">-----</option>
<option value="1">One Month</option>
<option value="2">Two Months</option>
<option value="3">Three Months</option>
<option value="4">Four Months</option>
<option value="5">Five Months</option>
<option value="6">Six Months</option>
<option value="7">Seven Months</option>
<option value="8">Eight Months</option>
<option value="9">Nine Months</option>
<option value="10">Ten Months</option>
<option value="11">Eleven Months</option>
<option value="12">Twelve Months</option>
</select></td></form>
  </tr>
  <tr>
  <td>Cost:</td>
  <td>SOME TYPE OF FUNCTION</td>
</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.