473,756 Members | 5,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p hp".

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

abc.php
========

<form action="TestChe ckbox.php" method="POST" name="TestCheck ">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="100">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="200">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="300">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="400">
<INPUT Type="CHECKBOX" Name="RecordNum ber" 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.p hp" only.

Thanks,

Mar 23 '06 #1
3 2059
ni*******@gmail .com wrote in news:1143148573 .335848.147620
@i40g2000cwc.go oglegroups.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.p hp".

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

abc.php
========

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


Use:
Name="RecordNum ber[]"
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="TestChe ckbox.php" method="POST" name="TestCheck ">
<INPUT Type="CHECKBOX" Name="RecordNum ber[]" Value="100" />
<INPUT Type="CHECKBOX" Name="RecordNum ber[]" Value="200" />
<INPUT Type="CHECKBOX" Name="RecordNum ber[]" Value="300" />
<INPUT Type="CHECKBOX" Name="RecordNum ber[]" Value="400" />
<INPUT Type="CHECKBOX" Name="RecordNum ber[]" Value="500" />
<input type=submit name="submit">
</form>
In TestCheckbox.ph p

$recordNumbers = $_POST['RecordNumber'];

//Displays all checked values
foreach($record Numbers 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.p hp".

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

abc.php
========

<form action="TestChe ckbox.php" method="POST" name="TestCheck ">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="100">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="200">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="300">
<INPUT Type="CHECKBOX" Name="RecordNum ber" Value="400">
<INPUT Type="CHECKBOX" Name="RecordNum ber" 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.p hp" 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
2332
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 2.for month 3.for year the value selected is to be placed in the db and after that to be retrieved to the page with selected values.
1
19329
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> <br><br> <input type="button" value="Select" onClick="go()">&nbsp;&nbsp;&nbsp; <input type="button" value="Cancel" onClick="cancel()"> when user choose any one and click "select" button, the value will be transfered to original window:
9
15110
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 hoping this would solve my problem trying to update a gridview without datasource. Here's the code ((TextBiox)grid.Rows.Cells.Controls).Text Thanks for any help on this.
0
2530
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
1095
by: guddi | last post by:
Retrieve integer values in textboxes through session variable in asp.net.plz help me out of it.
14
6201
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 table called cars. It has a column for car vin and a column for brand and a column for price. I just want to retrieve the column for the price and use these numbers to plot a bar graph. So the X-axis shows bar 1, 2, 3 ... and the bar length shows the...
2
5924
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 that textboxes after a button click with in a loop. Really I cant move from here. Can anyone plz help me.. Part of the my code is given below <html> <table> <?php // i hav an array "assocArray" and its count is "countarray" for($i = 1; $i <...
1
1785
by: jammula chiranjeevi | last post by:
sir can u please tell code to how to retrieve null values into textbox usong c#.net?
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.