473,408 Members | 1,982 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,408 software developers and data experts.

Retrieve Checked values in php

Hi All,

I have a php page say "abc.php" generating the following HTML. I am
posting the form action to another php page say "TestCheckbox.php".

How do I retrieve in "TestCheckbox.php" which checkboxes are checked in
"abc.php"?

abc.php
========

<form action="TestCheckbox.php" method="POST" name="TestCheck">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="100">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="200">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="300">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="400">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="500">
<input type=submit name="submit">
</form>

Note: I do not want to use any javascript in abc.php. Any new code
should be present in "TestCheckbox.php" only.

Thanks,

Mar 23 '06 #1
3 2030
ni*******@gmail.com wrote in news:1143148573.335848.147620
@i40g2000cwc.googlegroups.com:
Hi All,

I have a php page say "abc.php" generating the following HTML. I am
posting the form action to another php page say "TestCheckbox.php".

How do I retrieve in "TestCheckbox.php" which checkboxes are checked in
"abc.php"?

abc.php
========

<form action="TestCheckbox.php" method="POST" name="TestCheck">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="100">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="200">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="300">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="400">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="500">
<input type=submit name="submit">
</form>


Use:
Name="RecordNumber[]"
This will insert the values into an array.
--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com

Accessibility Discussion List: http://smallerurl.com/?id=6p764du
Mar 23 '06 #2
Try this,
In abc.php
<form action="TestCheckbox.php" method="POST" name="TestCheck">
<INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="100" />
<INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="200" />
<INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="300" />
<INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="400" />
<INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="500" />
<input type=submit name="submit">
</form>
In TestCheckbox.php

$recordNumbers = $_POST['RecordNumber'];

//Displays all checked values
foreach($recordNumbers as $number) echo $number . "<br />";

HTH,
Hemanth
ni*******@gmail.com wrote: Hi All,

I have a php page say "abc.php" generating the following HTML. I am
posting the form action to another php page say "TestCheckbox.php".

How do I retrieve in "TestCheckbox.php" which checkboxes are checked in
"abc.php"?

abc.php
========

<form action="TestCheckbox.php" method="POST" name="TestCheck">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="100">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="200">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="300">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="400">
<INPUT Type="CHECKBOX" Name="RecordNumber" Value="500">
<input type=submit name="submit">
</form>

Note: I do not want to use any javascript in abc.php. Any new code
should be present in "TestCheckbox.php" only.

Thanks,


Mar 23 '06 #3
Thanks Guys.This worked out fine :)

Mar 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Micela | last post by:
Hi, Please help me out in this task. I have a filed in the database of datetime. and 3 dropdown lists in the page. Im using Asp.net with VB coding. The three dropdown lists are 1.for date...
1
by: ykong1214 | last post by:
In my project, there is a single select tag, <html:select property="userName" size="7"> <html:options collection="UserList" property="value" labelProperty="label" /> </html:select> ...
9
by: Haleigh | last post by:
It doesn't look like its possible to retrieve new values if there is a gridview without datasource. Can someone please translate this for me from C# to VB. I can't get this to work and I was...
0
by: adelscott | last post by:
Hi, I'm using an autocomplete extender and I would like to retrieve the ID that goes with the label. IE: Label, ID "Mr John","CLIENT0001" "Mr Doe","CLIENT0002" etc..
1
by: guddi | last post by:
Retrieve integer values in textboxes through session variable in asp.net.plz help me out of it.
14
by: zionlion | last post by:
I want to only retrieve the values of one column in mysql and use these values to plot a graph. I know how to echo these values. However, I am unable to write them seperately. Let's say I have a...
2
by: phpachu | last post by:
Hi, I hav created a group of textboxes using a loop and its names are unique and names are assigned using variable ( like <input type=text name=$name1>). Then How can i retrieve the values in...
1
by: jammula chiranjeevi | last post by:
sir can u please tell code to how to retrieve null values into textbox usong c#.net?
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.