473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sending Check Box Value to Database

There r 3 checkbox . .. first check box value = 2 , second check box value = 4 , third check box value = 6 . now if i check 1st one it will send 2 to the database field, if check the first and second it will send the value ( 2*4) =8 to the database, if check the first second and third it will send the value ( 2*4*6) =48 to the database, ...

Now how will i solve the problem
Nov 26 '06 #1
4 2761
ronverdonk
4,258 Expert 4TB
Now what is the problem? Please elaborate because I don't understand what you are asking.

As I understand you want the values of all checkboxes that are checked to be multiplied with each other and the result must be stored in the database??

Ronald :cool:
Nov 26 '06 #2
swandi
13
Please try this code :
[PHP]
if(isset($_POST['first_check']))
{
if(isset($_POST['second_check']))
{
if(isset($_POST['third_check']))
{
$value = $_POST['first_check'] * $_POST['second_check'] * $_POST['third_check'];
}
else
{
$value = $_POST['first_check'] * $_POST['second_check'];
}
}
else
{
$value = $_POST['first_check'] ;
}

insert_to_db($value);
}

[/PHP]
Nov 27 '06 #3
[php]
$first_check = $_POST['first_check'] ? $_POST['first_check'] : 1;
$second_check = $_POST['second_check'] ? $_POST['second_check'] : 1;
$third_check = $_POST['third_check'] ? $_POST['third_check'] : 1;

//total
$value = $first_check * $second_check * $third_check;
[/php]
Nov 27 '06 #4
Thank u for ur reply.. yes u' ve understand my problem . Yes I want to send the checkbox value to the database by multiplying .....
Nov 28 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael | last post by:
I know that in order to send an e-mail using Perl there must be a '\' in front of the '@' symbol. For example department\@company.com. And it works. The problem that I am having is that we have...
2
by: Dknight | last post by:
Hi, all! I have a problem, how can I check a form data before sending it to server. I have the example below, but first data is sent to server, but after JavaScript checks the data :( I need...
3
by: Beryl Small | last post by:
Hi, I have a third party software that needs to send information to an .aspx page for processing to communicate with an SQL database. The software sends the information something like this: ...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
6
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
1
by: amatuer | last post by:
i used a check box in a loop: <input type="checkbox" name="Inv" id="Inv" value="<%= rstMain("TR_ID") %>"> n transfered the value to the next page...wats the best way to transfer the data to a...
0
by: sanjaygupta11 | last post by:
I am using httpwebrequest and httpwebresponse objects for sending data to remote appication by post and receiving the response from there. I am using this code in my windows application which will...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
1
maliksleo
by: maliksleo | last post by:
hi i am using the following class for email sending but getting this error "Failure sending mail" Imports System.Net.Mail Public Class MailHelper ''' <summary> ''' Sends an mail...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.