Problem in Calling Function in PHP
Posted: Mon Mar 09, 2009 11:06 am
My code is like this :
<?php
$A=$_GET['name'];
$B=$_GET['memberno'];
$C=$_GET['member'];
$D=$_GET['points'];
function display()
{
echo "<b>Customer Name :</b> $A<br>";
echo "<b>Membership No. :</b> $B<br>";
echo "<b>Membership Type :</b> $C<br>";
echo "<b>Point in hand :</b> $D<br>";
echo "<b>Additional Point :</b> $addpoint<br>";
echo "<b>Total point :</b> $total<br>";
}
echo "<b><u>Online Shopping Point</u></b><br><br><br>";
if($C=='Basic')
{
if($D>=0 AND $D<=250)
{
$addpoint = 0.05 * $D;
$total = $addpoint + $D;
display();
}
else
{
if($D>250 AND $D<501)
{
$addpoint = 0.075 * $D;
$total = $addpoint + $D;
display();
}
}
}
?>
THE PROBLEM IS...when I call the funtion...the value did not come out.
How to make it comes out?
<?php
$A=$_GET['name'];
$B=$_GET['memberno'];
$C=$_GET['member'];
$D=$_GET['points'];
function display()
{
echo "<b>Customer Name :</b> $A<br>";
echo "<b>Membership No. :</b> $B<br>";
echo "<b>Membership Type :</b> $C<br>";
echo "<b>Point in hand :</b> $D<br>";
echo "<b>Additional Point :</b> $addpoint<br>";
echo "<b>Total point :</b> $total<br>";
}
echo "<b><u>Online Shopping Point</u></b><br><br><br>";
if($C=='Basic')
{
if($D>=0 AND $D<=250)
{
$addpoint = 0.05 * $D;
$total = $addpoint + $D;
display();
}
else
{
if($D>250 AND $D<501)
{
$addpoint = 0.075 * $D;
$total = $addpoint + $D;
display();
}
}
}
?>
THE PROBLEM IS...when I call the funtion...the value did not come out.
How to make it comes out?