473,837 Members | 1,579 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 2061
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
2336
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
19332
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
15114
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
2533
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
1099
by: guddi | last post by:
Retrieve integer values in textboxes through session variable in asp.net.plz help me out of it.
14
6204
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
5926
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
1788
by: jammula chiranjeevi | last post by:
sir can u please tell code to how to retrieve null values into textbox usong c#.net?
0
9851
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
9695
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10902
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10583
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
9420
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
7824
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
7013
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4481
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
3
3128
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.