Taking Multiple Values From Checkboxes And Passing Them To The Header On "submit"

Feb 19, 2011

This is probably very easy but im also very new to php. Im looking for a way that i can have checkboxes on a form that can be passed via the submit button to a php file that generates a Header locate based on the values. for example

Apples X
Oranges X

would result in the output php file doing a header("Location:url.com/Apples+Oranges");

Im haivng difficulty working out how to get the checkbox values as a string and secondly in doing this above the header causes the header to fail for obvious reasons so I guess i have to use some output buffer?

View 2 Replies


Passing The Values Of Checkboxes To An Array?

I am passing the values of my checkboxes to an array. I then want to put the array in to a foreach loop and then take the id number and removes the records from the database using the foreach loop

However after the passing the values from the checkboxes to the array, it just prints array and goes not further.

Here is my code beloe

PHP Code:

$id_number = array($_POST['multi_delete']);
foreach ( $id_number AS $a )
// Do database delete using id from array


View 2 Replies

Selecting Multiple Values From Multiple Tables Using Checkboxes

I've been struggling with this for a bit but cannot seem to find a simpler, cleaner way of doing this.

a. I have a Table A - Customers , Table B - Contacts .
b. I have a form where a user types the first few alphabets of a customer name and then gets a list of contacts, cities.
c. The user is supposed to select multiple options from this list and then send that data to another form for processing.

I'm able to only pass data from Table A, not from B . Could someone please have a look at the 2 snippets of code and advise? And is there a way both these php scripts could be combined in a single one ? Code:

View 2 Replies

Multiple Checkboxes - How To Insert The Values Into The DB

I have a sql sb and in one of the tables it is a field called group. This field contains some numbers, etc "2 5 4" In a form i have som checkboxes Code:

[ ] Some text (value 1)
[x] Some text (value 2)
[ ] Some text (value 3)
[X] Some text (value 4)
[X] Some text (value 5)

I want these checkboxes to be checked accordingly to the field in the db. In this case with my example above the second, fourth and fifth checkbox is selected. Also on how to insert the values into the DB. This is probably very simple, but I have a bad day, and i can't figure this out.

View 6 Replies

Inserting Multiple Values In Db Row Using Checkboxes.

I am trying to insert multiple text values into a database row using checkboxes. This is what I have. Checkboxes for each class:


Person checks all that apply and I would like the values of all inserted into a row in the db. Code:

View 1 Replies

Retrieving Multiple Values In Checkboxes?

what i wanted to do is to retrieved all the values in table per row. how do i do this?

heres my code:

echo "<td><input type='checkbox' name='enrolldis[][][]' value=''></td>";
echo "<td>$secname</td><td>$subjcode</td><td>$subjname</td><td>$schoolyear</td><td>$room</td><td>$days</td><td>$sectime</td><td>$slotavailable</td><td>$unitload</td>";echo "</tr>";

how do i put values in arrays of checkboxes?

View 5 Replies

Multiple Checkboxes Values To URL String?

Working backwards (as I usually do) my 'results' page currently functions by getting values from the URL

E.g. tagged.php?tags[]=pink&tags[]=snow

How can I make a form with checkboxes for each value generate a URL like this?

Or is there a better way of passing the values from form to result?

View 6 Replies

Multiple Values To One Field Using Checkboxes?

I'm trying to code an interface through which my administrative manager can keep track of the forms we've received in from my students, among other things. This information in turn would be displayed to parents/students when they log in. I'm having trouble storing multiple values to one field in my MySQL database. Right now the form looks like this:

Last Name: (input)
First Name: (input)
Role: (input)

View 4 Replies

Add Values Of Multiple Selected Checkboxes With Comma?

i want to insert all selected checkboxes values with a comma separator in database in one single column.

i m able to echo all the checkboxes selected through the below code

<input type="checkbox" value="Battery" name="checkbox[]" id="checkbox[]" />
for ($i=0; $i<count($_REQUEST['checkbox']);$i++) {
echo "chosen<br />$i. ".$_REQUEST['checkbox'][$i];

ouput is

0. battery
1. rocket
2. pineapple

i want to insert all selected checkboxes values with a comma separator in database in one single column.

so what should i write in my query

$query = "insert into checkbox table (checkboxes) values()"

View 3 Replies

Send Multiple Checkboxes Values Using Scriptaculous

I have some checkbox array like these code. What I am trying to do is to send the values of all the checked checkboxes to reload.php on click. It doesn't work and I can not find useful things in google. Does anyone have any ideas how I can do this?


View 1 Replies

Foreach Error - Multiple Checkboxes Values Into An Array

I have a table where multiple checkboxes are ticked and values put into an array. These values echo ok but when i use the foreach part of the script, it doesnt get processed. Could someone please have a look at the script and see what mistake i am making ? Code:

View 3 Replies

MySQL Insert Values From Multiple Checkboxes Into One Column In Table

I have a form that a user would fill out while creating a ticket for a bug they have found on our website. In the form there is currently an input field where the user would enter in the designs that the bug is affecting (ex., "Design1, Design2, Design3, Design4" ...etc). When the form is submitted the value is stored in a table column named affectedDesigns. What i am wanting to do is create several checkboxes (one check box for each design we have) that a user would select instead of using the input field. They would be able to select all that apply.

If possible i would still like to store all of the values into the affectedDesigns column in one record. I'm thinking that i can gather the selected checkboxes values and create an array or some comma delimited value that contains all of the selected items and submit that to the databasein the one record in the affectedDesigns column. How can i achieve this? Also, how would i then pull that data and re-populate the checkboxes if they would like to go back later and edit the ticket?

View 6 Replies

Dynamically Create - Store And Retrieve Values From Multiple Checkboxes

i am using a MySql database and i need to create a dynamic HTML table with one of its columns as checkboxes.so i have to create multiple checkboxes.but these checkbox values are to be stored in a mysql table and then later retrieved when form reloads.and depending on previous state when form was submitted, the newly created checkboxes have to be checked in the same manner.so how do i store multiple checkbox values in my table and also how do i retrieve them?

View 5 Replies

Passing Multiple Selected Checkboxes From Form To SQL "search Engine"?

I've built a press cuttings database which allows users to categorise press cuttings with various select-one-option attributes (i.e. journalist, publication etc.) and also tag them with multiple communication theme tags (mentions sponsor, mentions CEO, review, good quotes etc.) (many to many relationship).

I've got the add new cutting/edit existing cutting front-end forms all under control, and the search functionality is all working perfectly, apart from the tags. If you select multiple checkboxes for multiple tags in the search form (e.g. tags=2 and tags=3), it only searches on the last one selected (e.g. tags=3) and ignores cuttings with which are tagged with tags=2.

I'm still a bit of a newbie to all this - however, my limited knowledge is telling me that even though I can see both tag values are being sent through the $_GET form (since I can see them both in the URL) the first value assigned to the variable (tags=2) is being overwritten by the second value (tags=3) therefore it only searches on the second value. Therefore I think that means I need to do one of two things: (1) turn the selected checkboxes being submitted into an array, but I'm not sure whether it is best to do that at the form end or at the back end. or (2) alter the SQL somehow to select cuttings based on an 'equal-to-any-of-the-following' list of values returned..I've stripped back a lot of the code/database so it just shows the stuff relevant to what I'm talking about.

Here's the SQL for a stripped back version of the database:

SQL Code:
USE press;
CREATE TABLE cutting (
cutting_text TEXT


View 14 Replies

Get Values From Multiple Forms And Submit Them?

I have several forms inside DIVS on my page.

I have one form which contains a text field and is always visible, and this is where the user hits 'enter' key and submits...

I want to get values selected in the other forms on the page, and submit them all together, not one by one, so that my PHP code can use "ALL VALUES" and search a mysql database...

Is this possible by javascript using the "<form onsubmit>" to call a javascript?

View 4 Replies

Submit Multiple Form Values At Once?

I have a form as follows

echo '<form action = "test.php" method="pos">';
echo 'name:<input name ="id" type="text">';
echo '<input name="Submit1" type="submit" value ="submit"/>';
$name = $_POST["id"];
// then do some table insert

How would I do multiple values at once. Can I use an array somehow and then use a foreach to loop through?

View 3 Replies

Use Array To Submit Multiple Values In Form - Getting Values Inserted And The "hashing" Of The Passwords?

i am working on a project to capture students' data for an educational institution. I want to have a form that allows multiple student records to be filled in at once..e.g(this is the form):


for the code to insert it into the database..this is what i came up with:

include 'poly_connect.php';
foreach ($_POST['reg_no'] as $row=>$reg_no)


...problem is its not inserting anything..i need help on getting these values inserted and also the "hashing" of the passwords.

View 4 Replies

Passing Multiple Table Values

I have a products table that I have created from a query, but I need to update the information based on quatity. What I am confused about is how to pass the multiple values to another page when they have the same variable names. Code:

View 1 Replies

Passing Multiple Values Through Query String?

How to pass multiple values through query string in php. i want to pass values to more than one page...

View 5 Replies

Multiple Form Values In One Field To Submit To Scripts?

I need to have a form field that holds two values instead of one to get the following accomplished:

Let's say I'm selling blue, red, and green widgets. I have a radio button that chooses which one you want to purchase. What I need to happen, is when the form posts to a PHP script, is to have a variable available for both the name of the product chosen, as well as the price of that product. Code:

View 1 Replies

Send Multiple Values With An Input Type=submit Form?

Some background: I'm working on a member directory page which displays member information gathered from a MySqL database. I have a loop set to display name, id#, title, etc from each member - one member per row. The displayed member list can be searched and sorted so will be anywhere from 0-20 entries long (20 max per page).Each member's name can be clicked and more information pertaining to them is displayed. For example, if the user clicks on "John Doe"'s name, an "individual info" page for John is included, splitting the list of names (the info is included directly after his name's listing, but before the next member's listing - ["John Doe, #333" / "Jane, #777"] turns into "John Doe, #333 / {John is a graduate from...}" / "Jane, #777"])I currently populate my page with PHP so the list is inside of a form and their names are displayed as inputs so when the user clicks them, the form action ($self) is run. I have the form value set to the member's name so that users can see readable names. I have the input's name set to the member's id# and run a if(isset($_POST['userID']) inside my loop to determine which member's individual information is displayed. So, the loop runs through the MySQL query, displaying name,id... for each member and if curID# == $_POST['userID'], it also displays the corresponding individual information.My Issue: The problem I'm encountering is that my list is rather long on the page, especially with individual information displayed so I want to be able to jump to the member's info on the page using anchors corresponding to their ID#. I have the anchors set up, I can manually navigate to memList.php#ID333, but I want to navigate there when the user clicks on the name.I can set up my form action to navigate to $self#$curID, but $curID is the variable name for the member's name input, not the value of it.What Hasn't Worked: I've attempted hidden fields with their ID as the value and curiD as the name, but they do not work because my loop resets it for every member (hence, $_POsT['curid'] is always set to the bottom-most member, not the one the user clicked).I've had the names as href links, but then my search and sort $POST values are not resent (the page is basically refreshed from the start).

View 1 Replies

Jquery - Grab Multiple Input Radio Values And Submit To Script?

I want to learn how to grab multiple input type button value compare to original value and last submit to php script! How can I do that with Jquery?

<div id="leftDiv" class="container">
<form action="" method="get">

View 2 Replies

Passing Radio Button Values To A Submit Button (gif)

How do i pass the value of the radio button to be put of the action
that includes the value as part of the URL being submitted - "/
picked.php?pick_num=". Any help with be appreciated. Thanks

<form method="post" action="/picked.php?pick_num=".<php? $value ?
<input type="hidden" name="cmd" value="0">

<table width="100%">
<td align="center">
<INPUT TYPE='RADIO' NAME='pick_1' VALUE=&#391;'>Day;
<INPUT TYPE='RADIO' NAME='pick_2' VALUE=&#392;'>Week;
<td align="center"><input type="img src="/images/pick_now.gif"
BORDER="0" name="send"></td>

View 2 Replies

Taking Values From URL?

I have managed to get a variable into the URL: .nts.php?table=tester1 But how do I get the value of table out of it?

View 6 Replies

Header Function Redirect Argument Passing / Error Header('Location: ReservationConfirmation.php?confirmationNum='?

I want to redirect to some other page and pass multiple argument from header in PHP.I can pass one argument,but when i start adding more parameters it gives error.I think most probably there is something syntax error.But i can't get around it.

This is when i have one argument it works fine.

header('Location: ReservationConfirmation.php?confirmationNum=' . mysql_insert_id());

I want to add additional parameters here,but it gives error.

header('Location: ReservationConfirmation.php?confirmationNum='. mysql_insert_id()'&dtTimeSlot='$dtTimeSlot'&iTheatreId='$iTheatreId);

View 1 Replies

$_SESSION Array Not Taking It's Values

if (isset($_POST['scheck'])) {
foreach ($_POST as $key => $val) {
$_SESSION['$key'] = $val; ...?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

here is the session data but everytime I check the session values the array allways stays empty.

View 1 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved