Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Posting Checkboxes From Forms To An Array In New Page


what is missing or wrong in my statements from page1 to page2 becoz the values for the checkbox or hidden fields in an array from page1 doesnt get transferred. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Posting Error With Checkboxes On My Web Form.
I am getting a peculiar error with checkboxes on my web form. The error that appears is:

Notice: Undefined index in chkOther...

Code for checkbox in the form:

<INPUT type="CheckBox" value="Other" Name="chkOther">

Scripting code for posting:

if ($_POST['chkOther'])
{$msg = $msg."
".($_POST['chkOther']);}

View Replies !
Forms And Checkboxes
I need some help with manipulating form vars, in particular checkboxes. I currently have a form setup that dynamically creates X number of checkboxes, all named "accept_check_X" where X is the index # of that record from the DB.

When I submit I want to be able to check the status of each checkbox to see if it's set to on or off. Right now I'm using $_POST, but it doesn't seem to contain the checkboxes that were left unchecked. It just has the checkboxes that were checked and submitted.
Is there anyway I can check the status of all the checkboxes from the previous page?

View Replies !
Checkboxes In Web Forms
I had to make a web form for user to fill in. my form has many textfields and a lot of checkboxes too. how to store checkboxes data into database? i have 2 type of checkboxes group named 'Type of Accident' and 'Location of the Accident'. currently i'm using wamp5 server to create table. i have only one table named Report(1 form). is it possible to store all data in one table?

View Replies !
A Lot Of Checkboxes And Forms
I am making a messaging system for my website. I want to be able to check a box for each message and do group editing stuff like delete the checked messages. The checkboxes are added in and have a number for their name value.

There will be a variable number of checkboxes depending on the ammount of messages that user has. So, when I submit the form I want it to POST all the checkbox data. Once I do that, how do I determine which checkbox was checked and the value attached to it?

Basically when I add in the checkbox there is a big loop that cycles through the users messages. Here is how I add a checkbox in:

<input type='checkbox' name='c".$Row['ind']."' value='ON'>

View Replies !
Posting Forms
I am kind of new to PHP so this might be a stupid question, but here it
is anyway. If there is a form, let's say somewhere on the web with a
couple of input fields and a submit button. Can I pull that .html (or
whatever extension it is) in a PHP object and then post it with the
input fields filled with what I want? And then show the result to the
user? How would that be done?

View Replies !
Forms POSTing
Sorry for the cross post into multiple newsgroups on this, but html forms processing is supported across all three groups so I was hoping someone might know.

I did a check with Google and found dated 1996 and 1997. This is a bit too old for me to rely on.

Thus Does anyone know if there is a limit when POSTing? I think a FORM METHOD of GET has a standards limit of 1024 though most browsers ignore this limit. However I can't recall a limit when posting data.

View Replies !
Forms Not Posting
I had the following code up on a site, it was working fine, now all the forms on the site are not posting, i told the techs there and they are telling me its a coding problem, how ever i did not change anything on any of the servers.

The problem occurs on two servers for me, does anyone know why things would not work. the code never reaches the validation part. The form will work and post if i have it pass through to a seperate page though ie in stead of post="#" i have post="proccessdata.php"

But i have a two whole sites i would have to redo and things were working and not modified at all. Code:

View Replies !
Posting Variables From Forms
With a form, I have two buttons.

One of them says:
- pay here

The other says
- pay somewhere else

Now, can I change the location to which the variables from the Form are
posted, depending on the button that they click? or am I always restricted
to the location specified in the action (e.g. <form method="post"
action="mynewpage.php">)

View Replies !
Logging/Posting Of Forms
if there was any known pre-made scripts that log data entered from a form into some sort of database(could be a text file) which is then searchable and able to be displayed. I wanted this to be a searchable database so users to my site can view individual listings for 'reviews' of said items.

View Replies !
Forms Not Posting Data
I have a problem with one of my servers.. the forms dont post the data in a normal form..

One server it works fine, the other it doesnt.. eg. Try these forms (ignore the content, and it wont get sent anywhere).. on the first one it will post and display your details after you submit the form, but on the second hosting it doesnt Code:

View Replies !
Posting To Remote Forms With Curl
I am trying to write a script to take a search string from my own form and post it to a remote form and have the results retreived then displayed on my page the examples of curl i found showed ways to add a string to the remote url. I need to insert a string into the remote form, im new to php but know i need to make a variable from my form and post it to the remote form can anyone give an example?

View Replies !
$_POST And Selection, Checkboxes, Radio Buttons On Forms
I'm creating a web form that has a number of radio boxes and drop down selection boxes and I can't get the $_POST global variable to hold the value if the person makes a mistake and has to go back and make corrections! It will work for normal text boxes and text areas but not the above! below is a snipit of my code PHP Code:

View Replies !
Posting Multiple Variables To $_POST Using HTML Forms
This is my code :

<FORM ACTION="php_steptwo001.php" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="duration" VALUE=3>
<INPUT TYPE="HIDDEN" NAME="banner" VALUE="test">
<INPUT TYPE="SUBMIT" VALUE"3 DAYS">
</FORM>

Only the 1st Variable 'duration' gets passed!

View Replies !
IE Trying To Save The Php Page When Posting From Another Page
After installing Apache, and the newest PHP, I find that when i open a php page explorer reads it but if i press a submit button that posts to another page or performs any pho script internet explorer immediately says the file type was unrecognised e.g. stage_2.php was unrecognised would you like to save?

I'm unsure why this is happening, perhaps my php.ini file isnt set correctly?

View Replies !
Array Of Checkboxes
i have a datagrid (several columns of arrays). submitting values from textboxes is fine, as submitted values are related to each row (i.e. for row1 if text entered is "boo" then that is what is returned for row1.) however i have tried to implement checkboxes and have discovered that if you tick the box for row 5 and non of the four preceding rows, then what is returned says row1 has the box ticked. this i gather is from the checkbox not submitting a value if it is not ticked.

View Replies !
Php Page Without Posting
I have a page (a.php) that accepts input from the user via text boxes. The action of the form is set to the same page (a.php). The When the select button is clicked the following is set <input type=hidden name="updating" value="1">. This is used to update information to a database during the repost of a.php. Is there a way to load a confirmation page after the update and pass data to it on the fly without usine the <form name="arm" method="post" action="a.php">?

View Replies !
Posting To Same Page
I have a script that pulls data from a db. I need a user to be able to update the form info and then have the from refresh or post back to it self with the updated info. I can't seem to get this to work.

View Replies !
Posting Array
I am setting up a page on which users select a number of checkboxes: Code:

View Replies !
Array Posting
I have an array being assigned values by a loop:

if ($myrow = mysql_fetch_array($result)) {
do { $ip_country = 'United States' //This value is actually being taken from the database, just trying to keep it simple for here.

$countries[] = $ip_country;
} while ($myrow = mysql_fetch_array($result));
}

I would like to print out the values on the Array, whatever they may be, and how many times each value is placed into it.

View Replies !
Getting List Of Checkboxes And Value In Next Page
Problem is that On the first page I display all other user
with checkbox and give user option to select only two user which he
wants to send message. Tell me please how I'll get those checkboxes
value and name on the next page and send message to only those two
selected user.

View Replies !
Displaying Array In Checkboxes
Objective:
User have a multi (20) checkboxes ($notif_empr_city) to select his preferences regarding being informed of new events in cities selected. If user selects one or more cities, the result is imploded into an array($ned_array) stored in the database in the field (notif_empr_city (varchar 255 NOT NULL)). Untill here, no problems with this.

Problem:
The problems start when trying to get this array out of the database in order to check or not (depending if the condition exists) the respective checkboxes again. This to enable the user to select more or unselect his preferences. The code I was using for displaying this array was the following, and isn't displaying any data that exists in the database. What is preventing from checkboxes to get checked ?
Code:

View Replies !
Checkboxes In A Multidimensional Array
I found this nice code online that does exactly what I want it do to: Emails a form that includes the posted values. I can get the text boxes, text areas, and radio buttons to send; however I cannot for the life of me figure out how to get checkboxes to send. It will only send the last-checked value. I have searched the internet and seen that this is a common problem, but I have not found anything similar to the code that I am using. Code:

View Replies !
Make Array Out Of Checkboxes?
I did a Web search, and a deja.com search on this...and I'm finding
how to make checkboxes act like radiobuttons, and other interesting
behaviors, but nothing that quite answers my question. If someone has
a link or thread they know about, even just that would be great!

What I have is a page that generates a list of items from a
database...a list of rows.
I'm having each row in the WHILE array create a checkbox, so that
someone can put checks in any row they want to delete on submitting
the form.

Now, how do I set up where it collects which checkboxes were selected?
I'm sure if I can get that far, I can figure out an EACH method of
then deleting each id from the table.

Here's what I'm doing so far with the checkboxes:
while ($row = mysql_fetch_array($result)) {
echo "<tr ".$bgcolour."><td><input name="del"
type="checkbox" value="$iid"></td><td>" . $quantity . "</td><td>"
.. $typename . "</td><td>" . $typesize . "</td><td>$" . $amount .
"</td><td></td><td></td><td>$".round(($amount*$taxmult),2)."</td></tr>";

The $iid is the table.id mentioned in the SELECT statment before this.
So that each checkbox, when checked, will have a value of that row's
ID.

View Replies !
Lost In Array For Checkboxes
I have a form with checkboxes named GradeLevel[0] - GradeLevel[7]. As such...

<input name="GradeLevel[0]" type="checkbox" tabindex="5" value="Elementary">

On my process page I build an array Code:

View Replies !
Associative Array And Checkboxes
I've created a list of email addresses from my database and I want to add a checkbox next to each email address to be able to subscribe or unsubscribe them from a mailing list.

I've successfully created the list and checkboxes (checked if they're subscribed otherwise unchecked), but I'm stuck on how to create the correct array and process it. Code:

View Replies !
Passing Array Using Checkboxes
As you know, when we name checkboxes as name[], PHP thinks the values are forming an array.

<input type="checkbox" name="fruits[]" value="Apple" checked>
<input type="checkbox" name="fruits[]" value="Orange" checked>
<input type="checkbox" name="fruits[]" value="Kiwi" checked>

Is this only valid with checkboxes? Why can't we do the same with text boxes?

<input type="text" name="fruits[]" value="Apple" readonly>
<input type="text" name="fruits[]" value="Orange" readonly>
<input type="text" name="fruits[]" value="Kiwi" readonly>

View Replies !
Hyperlink And Posting To New Page!
I have a page where I have done a successful query and get search results displayed. Now I would like a link activated so that they can click on the name and go to new page with further details about that company like address hours etc.

View Replies !
Posting Back To The Same Page
I have a website that uses user authentication. The login does a post back to itself to check set usernames and passwords.

<?php echo $_SERVER['PHP_SELF']?>
sample url:  .../admin/login/index.php

This is working on a linux box where the end of the php code sends the page off to a ccc.php page for access checking. So after logging in on the index.php page, you eventually get returned to admin/ccc.php.

I reused the same code on a windows box and the .../admin/login/index.php takes me to .../admin/login/index.php/admin/login/index.php

does anyone have a clue as to what might cause this?

View Replies !
Posting Many Times To Page
I have a situation where I need to post alot of data to a legacy system we have and it takes a long time for the system to do the inserts.

I was wondering if there is a way to post without waiting for the response, so I could do say 15 posts one right after another and it would open 15 connections but not wait for them or put them in the background. Preferably without forking if its possible.

View Replies !
Posting To The Current Page
Is it possible to post a value to the current page and display it when the page reloads?. For example if I am on 'page1.php' and usign a form to post a variable to 'page1.php', would this be possible. Possible code below: Any other suggestions if this wouldn't work? This is code for page1. php

<?php
echo $_POST['selection'];
?>
<form action="page1.php" method="post">
<select size=1 name="selection" onchange="this.form.submit();">
<option value="goalkeeper">Goalkeeper</option>
</select>
</form>

View Replies !
Adding Data To An Array Using Checkboxes
I'm using PHP to create a list of options with checkboxes from a MySQL database. Making the checkboxes appear with their names is no problem, but I can't figure out how to use the checkboxes to add data to an array. That is to say, the page initially displays just fine, but if I click submit, nothing happens.

I've put a bunch of places where I print out what's going on with the page, and the only real problem seems to be that $myarray stays empty. I've seen so many different ways to do this that I can't figure out which way would apply to my very simple case. Code:

View Replies !
Uses An Array Of Checkboxes That Can Use The $_GET Approach.
I have developed an approach (see code below) that uses an array to list items which the user can choose. Their choice then executes a query which lists corresponding values to that choice. My question is how do I adapt this approach so it uses an array of checkboxes that can use the $_GET approach.

I will have three seperate checkbox arrays the user chooses from- qualitysystem, expertise and activities. The user checks any number of items they wish from each list and a list of corresponding organisations that meet the criteria selected are shown- here is my current approach Code:

View Replies !
Dealing With Checkboxes And $_POST Array
I'm doing a form checking script. It loops through the $_POST array and checks what's needed. It does it based on how many elements are in the array.

The form contains checkboxes and if they are not submited it throws the count off. Is there a way to account for the checkboxes? Code:

View Replies !
Posting Array To An External Php File
I do use JPGraph for ploting some data. I compute the data and generate to sets of DATA.
$X and $Y. I have also written a plot.php file where run my plot.

What I want to do is something like below? Dos anyone know it is possible? Cause I cannot post the Array values. <img src=plot.php?X=$X&Y=$Y> The plot.php sends the header as a PNG file and generate the plot.

View Replies !
Posting Data From MySQL Into An Array
I am extracting usernames and emails addresses from a DB. I now need to add these into an array called $emailList.

$sql = "SELECT username,email FROM table";
$result = mysql_query($sql);
while($row = mysql_fetch_object($result)){
  // What do I need to put here in order to add the results into the array called $emailList?
}


the array must look something like so

Array
(
    [username1] => email1@domain.com
    [username2] => email2@domain.com
)

View Replies !
Checkboxes, $_POST Array, And Switch Statement
I'm having problems with a switch statement that is wrapped in a
foreach statement so that each index in an array is evaluated against
the switch statement. The switch/case will then return some output for
display.

I have a long list of classes for the upcoming semester. Each one has a
checkbox to the right that has the following code. <input
type="checkbox" name="course[]" value="i"> where i increases linearly
with each class, i.e. first class value="1" second value="2". There are
41 classes for the semester. Upon submission of the form (Yes, I have a
<form> tag with all the necessary parameters.), display.php (the action
of the form) should loop through each key in the course array and
evaluate the value against a switch statement. Here is what my PHP code
looks like so far:

if(isset($_POST['course']) {
foreach ($_POST['course'] as $key => $value) {
switch($value)
case 1:
echo 'foo'
break;
case 2:
echo 'bar'
break;
default:
echo 'Please select a course'
break
.............

I tried putting the case numbers in quotes like

case "1":

but that didn't make any different. What this will eventually do is
pull book information for each class that is selected from Amazon and
enable the user to quickly add the books to a shopping cart and check
out. I shortened the code (leaving out the other 39 cases!) and I
omitted the html that the PHP page contains. Can anyone explain what I
am doing wrong with my switch statement and/or array?

View Replies !
POSTing Data To A Page Without Using A Form Submit.
I'm trying to send data to a remote script (a credit card processing
third party) from my site using POST.

Currently, I'm doing it using the ususal form dynamically built with
my values.

This is less than ideal because I want to perform local processing
(updating order status in the local database) and then to proceed to
the remote script, with resultant values, without relying on the user
pressing a [submit] button. Code:

View Replies !
Syntax For Passing Array Data From Checkboxes In A Form
If I have a list of checkboxes saved in an array,when I submit (POST) the form data, do I need to use $HTTP_POST_VARS in the target document, or can I just use the following code:

for ($i = 0; $i < count($selectedmessages); $i++){
$checkbox_value = "$selectedmessages[$i]";}

If I need to use $HTTP_POST_VARS, what would the syntax be if my array is called selectedmessages[]?

View 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 Replies !
2 Forms On One Page
I have two forms on one page. I need my page to beable to perform different functions when a certain form is used. So far, I have the following... but it only works for 1 form. So... how would I go about making this work for 2 forms?

-----------------------------------------
if ($submit) {
require "./needed.inc";
MYSQL_CONNECT($hostname, $username, $password);
mysql_select_db("$db");
header ("location: clientdb/techview.php3");
$result=MYSQL_QUERY("INSERT INTO manu
(name)".
"VALUES('$manuname')");
$id= mysql_insert_id();
MYSQL_CLOSE();

} else {

View Replies !
2 Forms On The Same Page?
Im trying to upload images and then to pass the url details of the image to a form. Dont seem to be having too much fun with the posting in the second forms, doesnt want to exit the page and post to a new page.

View Replies !
Multi-page Forms With Php?
I need to make a multi-page form with php? I am looking for some
tutorials on how to do this in a simple way, but I need to store the
result of the multiform in sessions registered variables.

So a bunch of links to tutorials will do the trick..

The tuturials I have found is a litle over the top for my project,
security is not an isue, the data passed is not sensitive. I am trying
with something along these lines.

<?php
session_register("BoatID");
session_register("SailID");
?>
<?php
echo "GUIDE -1-<br>";
echo "sailidname".$sailidname."<br>";
echo "BoatID".$SailID."<br>";
echo "boatidname".$boatidname."<br>";
echo "BoatID".$BoatID."<br>";
echo "
<form method=post action='guide2.php'>
<input type="radio" name="boatidname" value="0"
checked="checked">
<input type="radio" name="boatidname" value="1">
<input type="radio" name="boatidname" value="2">
<input type="radio" name="boatidname" value="3">
<input type="radio" name="boatidname" value="4">
<input type="radio" name="boatidname" value="5">
<input type="radio" name="boatidname" value="6">
<input type="radio" name="boatidname" value="7">
<input type="radio" name="boatidname" value="8">
<input type="radio" name="boatidname" value="9">
<input type=submit>
</form>
";
?>

View Replies !
Multiple Forms In 1 Page
im having a bit of trouble with my form, its for an invoice system

I have 2 tables:
Invoices - invoice_id*, cust_id and date
invoice_items - invoice_item_id*, invoices_invoice_id(links to invoice_id in invoices table) item_item_id(links to item_id in item table) description, weight, price

I am trying to create the form for the page so that all the information can be entered at once, but i dont think its possible, because an invoice must be created first then invoice_items added using that invoice id.
how can i get my form to do this? i need it to insert the invoice into the database then take that invoice_id and add it to the item details on the page?

this is what ive written so far but now im stuck on the invoice_id bit Code:

View Replies !
Can 2 Forms Coexist On The Same Page?
I have 2 forms on a single page both processed by separate php code. The forms are somewhat independent: the first form is simply a question with several radio buttons and a submit button whose action is to change the question every time its clicked (question is pulled from a local database in sequential order by id). Code:

View Replies !
Lots Of Forms On One Page
I'm writing a PHP shopping cart. I have a number of items (sometimes as much as about 200) on a page and I want each item to have an "add to cart" button (or link or whatever). The user should also be able to specify a quantity before pressing the "add to cart" button, and sometimes other options too.

To me it seems that I want each item to have it's own form with a text box for quantity and the "add to cart" button being the submit button. What I want to know is if it's OK to have hundreds of forms on one page, or will that cause problems (e.g. slow it down)?If it's not OK, can you suggest a better way to do this?

View Replies !
Array Creation Via Forms
Ok, this is a simple problem, but for some reason I can't manage to figure it out. school burnout, maybe? Anyway, I have something along the lines of this: PHP Code:

View Replies !
Multiple Forms, Different PHP Documents, Same Page?
In a PHP file 'main.php' I have

<?php
include 'header.php';
include 'login.php';
include 'body.php';
include 'footer.php';?>

Login.php has a form on it to allow the user to log in to the site.

Body.php has a form on it to allow a user to post a message.

What I'm finding is that the 'submit' button on 'body.php' actually calls the form from 'login.php'. Does PHP have issues when there are 2 separate forms doing 2 saperate things displayed on the same page - is there anything I need to look out for?

View Replies !
2 Forms On One Page Submitting Same Time
I have a website with a "join our mailing list" form that shows up on all pages of the website.  It has input for just someone's email address.  It is inserted on each web page via an include file.

In this website is a contact page that has it's own feedback form with name, email address and comments inputs.  Both forms are coded very much the same.

The problem is that when the submit button is pressed for either of the forms, it also triggers the processing of the other form.

I am very new to php so I am not sure how to distinguish one form from the other so that only one form gets processed upon pressing the submit button.  I don't know if it's done with $_POST or the submit button or what.  I am hoping that this is an easy problem to solve and that someone out there is quite familiar with it.

View Replies !
Mysql, Dynamic Forms To Array
I have been working on a small project where information from a database is displayed (while command and mysql query), one of these is a form which can be changed to different value (in this case its for quantity).

Basically what i want it to do is put all the new quantities and also the id's into an array (done that) then after its done, validate them with the database values and if they need to be updated they can be. Code:

View Replies !
Email Forms - Put As Many Fields Without Having To Change The Php Page
I have a php form emailer that simply emails the website owner and also the customer when they fill in the form. at the moment I have to specify what all the fields are named in the form for it to be send off. I want to be able to put in as many fields as I like without having to change the php page as well as the html form. PHP Code:

View Replies !
Transfer Data From Several Differnet Forms On One Page
In php how could i transfer data from several differnet forms on one page. The forms would have different names/ids

View Replies !
Multiple Forms - Use A Session Variable That Is An Array?
Let's say I have a page with 10 questions. But I don't want one form, I want 10 forms so the user can answer any of the questions in any order they want and get an answer back immediately. Once the question is answered, it will display the correct answer and whether it was correct/incorrect. Then another question in the page can be answered, and the questions answered previously will still be displayed.

Does anybody know if this is possible? Would I use a session variable that is an array? Or would each question have it's own session variable?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved