Jump to content

BoNfiRe

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BoNfiRe's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have been trying to get a row of catagories to display more rows to stop the content going off the page. Here is the code mentioned.. $c=@mysql_data_seek($catquery,0); if($c) { echo "<div class='tableborder'><table><tr>"; while ($c = mysql_fetch_array($catquery)) { echo "<td width='5%' align='center' class='arcade1'><a href='Arcade.php?cat=$c[0]'>$c[1]</a></td>"; } echo"</tr></table></div>"; echo "<br />"; } I have read a few tutorials but finding it tricky to get it to work but to no avail Any help would be greatly appreciated. TY BoN
  2. [!--quoteo(post=384449:date=Jun 16 2006, 04:30 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 16 2006, 04:30 AM) [snapback]384449[/snapback][/div][div class=\'quotemain\'][!--quotec--] As to the OP's question... I hope you realize that you PHP code will just generate the Javascript code which then gets executed after the PHP is done. Remember PHP executes on the server while Javascript executes on the client. If you want Javascript and PHP to interact, you need to use AJAX and start PHP scripts asynchrously. Ken [/quote] Yes I did read that. Damn I thought there may have been a way to execute the java clientside after the php has been processed. Ahh well anybody know any good tutorials in changing js to ajax ? Thanks for your time BoN
  3. Hi all. I'm trying to add a form to my current template. But for some unknown reason it won't load the js. If I go to the page in question directly it works fine. However, when I try it through the main site I just get js errors. I have tried all I know and all I can get from google is to use the js as a php function but that kinda lost me and using $GET or whatever it is lost me even more [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] This is the dreded code in question: [code] <?php include_once("configs/aa_config.php"); // define ('TITLE', 'Americas Army'); // define ('shop', '" onLoad="doPricing()" id="holdall" "'); ?> <script type="text/javascript"> function doPricing() {   no = 0; yes = 1;   // work out player cost   sPlayerValue = document.forms.form.players.options[document.forms.form.players.selectedIndex].value;   var arrPlayerValue = sPlayerValue.split("|");   sPlayerCost = arrPlayerValue[1];   // work out months   sMonthValue  = eval(document.forms.form.months.value);   sDebrandCost = eval(document.forms.form.debranding.value)*$cost_debranding;   sMonthCost   = (sPlayerCost * 1) + sDebrandCost;   sTotalCost   = sMonthCost * sMonthValue;   // set default discount   sDiscount = 100; <? foreach ($arr_discounts as $key => $value)     { echo "if (sMonthValue == $key) { sDiscount = ". (100 - $value)." }\n"; } ?> sTotalCost   = (sTotalCost * sDiscount)/100; totalcosteur = Math.round(sTotalCost*1.5); document.forms.form.cost.value     = sTotalCost; document.forms.form.total.value    = "\u00A3"+sTotalCost; document.forms.form.totaleur.value = "\u20AC"+totalcosteur; } </script> <? echo "<div class='ocontainer'>\n"; echo "<form name='form' method='POST' action='order.php?game=server_details'>\n"; echo "<div class='oleft'><b>Gametype:</b></div>\n"; echo "<div class='oright'>\n"; echo "    <select name='mod' onChange='doPricing()'>\n"; foreach ($arr_games as $key => $value)     { echo "<option value='$key'>$value</option>"; } echo "        </select>\n"; echo "    </div>\n"; echo "<div class='oleft'><b>Players:</b></div>\n"; echo "<div class='oright'>\n"; echo "    <select name='players' onChange='doPricing()'>\n"; foreach ($arr_players as $key => $value)     { echo "<option value='$key|$value'>$key</option>"; } echo "      </select>\n"; echo "    </div>\n"; echo "<div class='oleft'><b>Debranding: </b></div>\n"; echo "<div class='oright'>\n"; echo "      <select name='debranding' id='debranding' onChange='doPricing()'>\n"; echo "          <option value='no'>No</option>\n"; echo "          <option value='yes'>Yes</option>\n"; echo "      </select>\n"; echo "      </div>\n"; echo "<div class='oleft'><b>Months:</b></div>\n"; echo "<div class='oright'>\n"; echo "      <select name='months' onChange='doPricing()'>\n"; foreach ($arr_discounts as $key => $value)     { echo "<option value='$key'>$key Month/s ($value"."%"." discount)</option>"; } echo "      </select>\n"; echo "      </div>\n"; echo "<div class='oleft'><b>Payment Method:</b></div>\n"; echo "<div class='oright'>\n"; echo "      <select name='method' id='method' onChange='doPricing()'>\n"; echo "          <option value='pp'>PayPal</option>\n"; echo "      </select>\n"; echo "      </div>\n"; echo "<div class='oleft'></div>\n"; echo "    <div class='oright'>\n"; echo "    <input name=cost type=hidden>\n"; echo "    </div>\n"; echo "<div class='oleft'><b>Total:</b></div>\n"; echo "     <div class='oright'>\n"; echo "<input name=total type=text onFocus='doPricing()' size='6' maxlength='6' readonly>&nbsp;&nbsp;or&nbsp;&nbsp; <input name=totaleur type=text onFocus='doPricing()' size='6' maxlength='6' readonly>\n"; echo "     <font color=#006600>*</font>conducted in GBP (&pound;)\n"; echo "     </div>\n"; echo "<div class='oleft'></div>\n"; echo "    <div class='oright'>\n"; echo "    <input type='CHECKBOX' name='terms'> I agree to the <a href='terms.php'>Terms And Conditions</a>\n"; echo "    </div>\n"; echo "<div class='oleft'></div>\n"; echo "    <div class='oright'>\n"; echo "      <input name='button' type='submit' value='Order Now'>\n"; echo "  </div>\n"; echo "</form>\n"; echo "</div>\n"; ?> [/code] Any help would be much appreciated. ty BoN
×
×
  • 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.