User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,655 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,136 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1715 | Replies: 1
Join Date: Jan 2005
Posts: 3
Reputation: EPierre is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
EPierre EPierre is offline Offline
Newbie Poster

Parsing variabls to texbox

  #1  
Jan 25th, 2005
Morning all,

I don't know how to solve this problem Here it is:
$price_unit = "20.45"
$qty = 'qty';
$net = 'net';
$net = $qty * $price_unit ;
as: 0<$qty<10 to parse in a textbox.
I do that :

if
($qty =0)
{
$net =0;
}

elseif
($qty =1) {
$net = $price_unit * 1;
}

elseif
($qty = 2) {
$net = $price_unit * 2;
}
....
else{echo "Message...."}
In form html
.....
<input type = "text" name = "qty" value = "<?php echo $qty ?>" size = "6">
<input type = "text" name = "gross" value = "$qty * $price_unit" size = "6">

Result: qty value: 1

When I change qty to 0, 1, 2, 3, 4, etc.. gross value stay ar 20.45.

What is wrong in my code ?

Regards to all.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 10:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC