473,783 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How-to select items from a list

I'm trying to do something and I'm sure there is a good technique for
it, but I just can't figure it out.

I have some member records in a database. I want to display a list of
them, and have a checkbox next to each member. One can then click in
the checkboxes for one or more members and the next page should then
take action on the selected members.

I know how to get the members from the database, I know how to create
the form to display each member with a checkbox next to their name.

What I can't figure out is a good method to name/identify the
checkboxes so that the values passed to the next URL can be
programatically processed in a loop.

I'll try and demonstrate:

List:
<form action="sendsms .php">
<table>
<!-- I'm outputting this in a while loop -->
<tr>
<td><input type=checkbox name=?? value=$mem_id></td>
<td>$member_nam e</td>
</tr>
<!-- end while loop -->
</table>
<input type="submit" value="Submit">
</form>

I assume that the $id (unique member id) would be a good value for the
checkbox to have, but I don't know what to name the checkbox so that
in the action URL I can loop through the values to process those
selected?

Thanks for any help.
Jun 27 '08 #1
3 1404
On Jun 12, 12:31 pm, MikeB <MPBr...@gmail. comwrote:
I'm trying to do something and I'm sure there is a good technique for
it, but I just can't figure it out.
[snip]
>
Thanks for any help.
I've made some progress with this (Google is good!), but I've got a
little problem I can't figure out. Is there somewhere that I can post
some php code to for people to look at and tell me what I'm doing
wrong? Thanks!

I found some information that indicates that if the name of the
checkbok has square braces ([]) it should be able to get the data from
the $_POST variable with a statement like:

$sendlist=$_POS T['sendid'];

However, I come up with nothing in the resulting array.

I can post a sample program if anyone would tell me where and would be
willing to look at it.

Thanks again.
Jun 27 '08 #2
MikeB wrote:
On Jun 12, 12:31 pm, MikeB <MPBr...@gmail. comwrote:
>I'm trying to do something and I'm sure there is a good technique for
it, but I just can't figure it out.
[snip]
>Thanks for any help.

I've made some progress with this (Google is good!), but I've got a
little problem I can't figure out. Is there somewhere that I can post
some php code to for people to look at and tell me what I'm doing
wrong? Thanks!

I found some information that indicates that if the name of the
checkbok has square braces ([]) it should be able to get the data from
the $_POST variable with a statement like:

$sendlist=$_POS T['sendid'];

However, I come up with nothing in the resulting array.

I can post a sample program if anyone would tell me where and would be
willing to look at it.

Thanks again.
Just post it here. If it's large, trim it down to a manageable size
that shows the problem.

But if you have:

<input type=checkbox name='sendid[]' value=$mem_id>

$_POST['sendid'] will be an array with one element for each checked
checkbox. Unchecked boxes will not send their value.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '08 #3
On Jun 12, 2:52 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
MikeB wrote:
On Jun 12, 12:31 pm, MikeB <MPBr...@gmail. comwrote:
I'm trying to do something and I'm sure there is a good technique for
it, but I just can't figure it out.
[snip]
Thanks for any help.
I've made some progress with this (Google is good!), but I've got a
little problem I can't figure out. Is there somewhere that I can post
some php code to for people to look at and tell me what I'm doing
wrong? Thanks!
I found some information that indicates that if the name of the
checkbok has square braces ([]) it should be able to get the data from
the $_POST variable with a statement like:
$sendlist=$_POS T['sendid'];
However, I come up with nothing in the resulting array.
I can post a sample program if anyone would tell me where and would be
willing to look at it.
Thanks again.

Just post it here. If it's large, trim it down to a manageable size
that shows the problem.

But if you have:

<input type=checkbox name='sendid[]' value=$mem_id>

$_POST['sendid'] will be an array with one element for each checked
checkbox. Unchecked boxes will not send their value.
Finally figured this out. A really dumb (newbie?) mistake.

I was using "Get" as the method for the form, so that I could see the
parameters being passed in the URL. Obviously $_POST doesn't see those
parameters, but $_GET does.

So it's all fixed now.

Jun 27 '08 #4

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

Similar topics

4
2982
by: Tom Szabo | last post by:
Just wandering how can you close a browser remotely. In some web applications the browser closes or refreshes periodically. How is that done and how can it be done through PHP? TIA, Tom
15
16338
by: Reid Nichol | last post by:
Hello, I was wondering if I could control how many bytes are in an int and the byte order. In C/C++ I can use int32 but how do I do this in python? How can I control byte order?
0
1827
by: v I n O | last post by:
hI Geeks Please do let me know how do i find how many instances sql server running on the single machine. or in the n/w my objective should with help of C#/vb.net
2
2584
by: Frances Del Rio | last post by:
http://www.emol.com/especiales/cocina_chilena/comida.asp this page is so neat (goes in pop-up..) how was this done? how do you give a layer (or div, I guess) a semi-transparency so you can still see img under it? (and how do you do the scroll for the div?) I know HTML very well, I also CSS and JavaScript, but am a bit mystified here... PLEASE respond by e-mail, fdr58@yahoo.com, my access to usenet is very limited.. thank you..
4
1984
by: | last post by:
Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft I'm very interested in how the developing/build/testing workflow @ Microsoft looks like. I think Microsoft as world leader in software developing business must have a very good workflow. Does anyone know how the development flow @ Microsoft looks like?
3
1926
by: dba2adm | last post by:
The SNAPSHOT_STATEMENT table function gives the CPU used rows read etc information. How do I know the total number of time the particular statement was executed (as in snapshot_dyn_sql's num_executions)? Also, is the value "STMT_USR_CPU_TIME_S" etc cumulative? Thanks.
2
3064
by: flywave | last post by:
hi,who can help me ?i came into a problem that how can i get a packet which was send in the LAN.in a word ,how the sniffer works. I once used the rawsocket in win2000 or xp,and it do catch. but the packet is IP packet,not including the MAC address. then how can i catch a packet include the MAC address from the linking layer.in what ways? thanks every one.
7
2582
by: anushhprabu | last post by:
#define q(k)main(){ return!puts(#k"\nPRABUq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");}) guys i'm working on this code.. i got it fromnet.. how this is working.. anyone pls.. it is printing the same content on screen.. how ya.. how it is.. how how how?? please...................
0
1988
by: candra | last post by:
Learn What Hackers Know? -General Hacking Information -Password Security -Scanning, Fingerprinting And Similar Techniques -How Hackers Attack Numerous Internet Services -How Hackers Attack Web Servers, Cgis, PHP, ASP, Etc -How Hackers Attack IRC, Instant Messaging, And Multiplayer Games -Vulnerabilities Found In Platforms With Smaller Market Share -How Hackers Attack Novell And Networks
2
1617
by: belred | last post by:
i just read this blog about how many objects (types) are loaded for a hello world program in C#. http://blogs.msdn.com/abhinaba/archive/2008/09/15/how-many-types-are-loaded-for-hello-world.aspx how can you find out how many are loaded for a python program: print 'hello'
0
9643
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
10313
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
10147
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...
1
10081
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
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
8968
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...
0
6735
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();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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

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.