Page 1 of 1

how to make operation

Posted: Sat Jun 06, 2009 12:06 am
by kamsmartx
hi :P

i have this code by php

Code: Select all

<?php
session_start();
 
if(isset($_GET["n1"]))
$_SESSION["n1"]=$_GET["n1"];
if(isset($_GET["n2"]))
$_SESSION["n2"]=$_GET["n2"];
if(isset($_GET["n3"]))
$_SESSION["n3"]=$_GET["n3"];
 
$sum=intval($_SESSION["n1"])+intval($_SESSION["n2"])+intval($_SESSION["n3"]);
$pers=($sum*20)/100;
?>
 
this code for sum which i select type from list on here

Code: Select all

               <select name="ctl00$ContentPlaceHolder$DL_01_0100" id="ctl00_ContentPlaceHolder_DL_01_0100" class="DLClass" onChange="showUser('add.php?n1='+this.value)" size="1" dir="ltr">
                  <option value="0">none</option>
                  <option value="185">1st choice</option>
                  </select>
 
                <select name="ctl00$ContentPlaceHolder$DL_01_0101" id="ctl00_ContentPlaceHolder_DL_01_0101" class="DLClass" onChange="showUser('add.php?n1='+this.value)" size="1" dir="ltr">
                  <option value="0">none</option>
                  <option value="370">1st choice</option>
                </select>
 
 
 
                <select name="ctl00$ContentPlaceHolder$DL_01_0102" id="ctl00_ContentPlaceHolder_DL_01_0102" class="DLClass" onchange="showUser('add.php?n1='+this.value)" size="1" dir="ltr">
                  <option value="0">none</option>
                  <option value="235">1st choice</option>
                  <option value="333">2nd choice</option>
                </select>
 
 
and the result print here when i select

Code: Select all

            <td id="SubTotalTD" style="border: 1px dashed #C0C0C0;" dir="rtl" width="155" height="25">
            <p dir="rtl" id="txtHint"><? echo $sum; ?></td>
but there are not output ??

why