Entering Mutiple Value With Checkbox Into Mysql
My form only seems to select one value when i may have selected 1 or more values from checkbox.
I want to be able to insert none or all selected from checkbox into mysql database....
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Entering Data From A Form To A Mysql Database
I'm trying to enter data from a form with the fields name and email into a mysql database called newsletter, as you guess it's a newsletter sign up. this what I have at the moment: Code:
Entering/checking Info Into Mysql Database
I have set up a client database where one can view, add, edit and delete entries. I ran into a problem setting up the add page. On this page i have set up forms to add info into the DB, and it works fine, but i dont want duplicate clients. Is there a way to set it up so that when you submit the form with the info it checks for duplicates and if there is one returns "sorry this record exists?"
Problem With ""s Entering Stuff Into A MySQL Database
I have a database which is going to be used partly to store articles, which will basically be free-flowing text. So what if someone puts a single comma ' in? Because I am using the PHP: $query = "INSERT INTO quasimodo VALUES ($iNum,'$area','$sec1','$sec2','$sec3','$name','$phone','$email','$body')"; So surely when someone types the words it's or something like that with an apostrophe in the middle, it'll screw everything up? The stuff will be entered through a form. Please, how can I get around this problem? A similar problem would arise if i used "$body" instead of '$body' because someone might put a word in "inverted commas".
Checkbox In Mysql Fields
PHP selects and shows a list of records. Next to each record is a check box. If user checks the box the record(s) is selected and appended to another 2nd DB....when the user finally presses a button Basically I hope you get my drift, pretty normal but powerful stuff... Are there any tutorials or snips on how I'd do this?
Checkbox Forms, Php & Mysql
I'm about to add some checkboxes to a form, and then store the data in a column on a MySQL database. Just wanted to know best practice, at the moment I'm writing and thinking .. God that's ungly code ... <input type="checkbox" name="delta" <?php if ($delta==1) { echo "checked"; }?>> Delta<br> <input type="checkbox" name="mastercard" <?php if ($mastercard==1) { echo "checked"; }?>> Mastercard<br> <input type="checkbox" name="solo" <?php if ($solo==1) { echo "checked"; }?>> Solo<br> <input type="checkbox" name="switch" <?php if ($switch==1) { echo "checked"; }?>> Switch<br> <input type="checkbox" name="visa" <?php if ($visa==1) { echo "checked"; }?>> Visa<br> MySQL database fields ... delta binary(1) No 0 mastercard binary(1) No 0 solo binary(1) No 0 switch binary(1) No 0 visa binary(1) No 0 When I output the fields, I get "on" or empty, and am wondering whether I am making a good decision to do the code this way. Now I need to figure out how to update the database based on the forms output.
Declaring A Checkbox In A Mysql
I have a html form that consists of drop down menus, text boxes and two checkboxs. I can get all the data to be sent to a mysql db via php. But when i try to insert the checkboxes into the db i get an error stating the following: Could not insert data: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('6','a1','b1','3','c1','1234','1234','1234@1234.com Code:
How To Remove A Row In Mysql Table With A Checkbox ?
I'm having trouble writing the code for deleting a row with a checkbox. My page allready contains an update and a insert form, which works great, but removing rows with a checkbox.This is my php code. <?php require_once('../../Connections/fisherintranet.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO licenties (company, license) VALUES (%s, %s)", GetSQLValueString($HTTP_POST_VARS['company'], "text"), GetSQLValueString($HTTP_POST_VARS['license'], "text")); mysql_select_db($database_fisherintranet, $fisherintranet); $Result1 = mysql_query($insertSQL, $fisherintranet) or die(mysql_error()); } if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "form3")) { $updateSQL = sprintf("UPDATE licenties SET company=%s, license=%s WHERE license=%s", GetSQLValueString($HTTP_POST_VARS['company'], "text"), GetSQLValueString($HTTP_POST_VARS['licupdate'], "text"), GetSQLValueString($HTTP_POST_VARS['license'], "text")); mysql_select_db($database_fisherintranet, $fisherintranet); $Result1 = mysql_query($updateSQL, $fisherintranet) or die(mysql_error()); $updateGoTo = "licenties.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } if ((isset($HTTP_POST_VARS["MM_remove"])) && ($HTTP_POST_VARS["MM_remove"] == "form2")) { $removeSQL = sprintf("Delete from licenties WHERE 'ID'==???????????"); mysql_select_db($database_fisherintranet, $fisherintranet); $Result1 = mysql_query($removeSQL, $fisherintranet) or die(mysql_error()); $removeGoTo = "licenties.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $removeGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $removeGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $removeGoTo)); } session_start(); if ($HTTP_SESSION_VARS["statusCheck"] != "Admin") header("Location: menu.php"); $colname_licenties = "1"; if (isset($HTTP_SESSION_VARS['companyCheck'])) { $colname_licenties = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['companyCheck'] : addslashes($HTTP_SESSION_VARS['companyCheck']); } mysql_select_db($database_fisherintranet, $fisherintranet); $query_licenties = sprintf("SELECT license FROM licenties WHERE company = '%s' ORDER BY license ASC", $colname_licenties); $licenties = mysql_query($query_licenties, $fisherintranet) or die(mysql_error()); $row_licenties = mysql_fetch_assoc($licenties); $totalRows_licenties = mysql_num_rows($licenties); $colname_alles = "1"; if (isset($HTTP_SESSION_VARS['companyCheck'])) { $colname_alles = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['companyCheck'] : addslashes($HTTP_SESSION_VARS['companyCheck']); } mysql_select_db($database_fisherintranet, $fisherintranet); $query_alles = sprintf("SELECT * FROM licenties WHERE company = '%s' ORDER BY license ASC", $colname_alles); $alles = mysql_query($query_alles, $fisherintranet) or die(mysql_error()); $row_alles = mysql_fetch_assoc($alles); $totalRows_alles = mysql_num_rows($alles); ?> This is my code of my form : <form name="form2" method="post" action="<?php echo $editFormAction; ?>"> <table width="30%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#999966"> <tr> <td colspan="2" bgcolor="#999900"><div align="center"> <font color="#FFFFFF" face="Times New Roman, Times, serif"><strong>licenses</strong></font></div></td> </tr> <?php do { ?> <tr> <td><div align="center"> <p> <input name="<?php echo $row_alles['ID']; ?>" type="checkbox" id="<?php echo $row_alles['ID']; ?>" value="<?php echo $row_alles['ID']; ?>"> <font color="#FFFFFF"> </font></p> </div></td> <td><div align="center"> <p><font color="#FFFFFF"><?php echo $row_licenties['license']; ?></font></p> </div></td> </tr> <?php } while ($row_licenties = mysql_fetch_assoc($licenties)); ?> </table> <p align="center"> <input name="MM_remove" type="hidden" id="MM_remove" value="form1"> <input type="submit" name="Submit" value="Remove selected license"> </p> </form>
Adding Checkbox Input To Mysql Db
how to pass a value from a form with a checkbox on a html page to a mysql database. I've preloaded some data and can populate a box if the data is already present in the db. But I would like to be able to check the box or uncheck the box and pass that value to the db (being able to change the value depending on whether it's checked or not). Code:
Passing A Checkbox Variable To A MySQL Db
Im the webmaster for a boxers website, and rather frequently, the publicist sends me links to articles about the boxer that I need to post. So, I set up a form that allows me to pull the information as needed and post it. Basically I have it set up to post the Article Title, Article URL, and Article Date, and I call that information from the db. However, on occassion, one of these links will be a press release, and the only thing that changes is that the text Press Release: is added in front of the article title. I was thinking about creating an extra field in the table called article_pr, and referencing that on the page, and if the row is empty, it would just pull up a space, and if its marked it just pulls up whatever is in there. However, on the form, I need to have a check box that asks if it is a press release. If so, I would need it to print this in the code Press Release:<br> Is there a way to have the check box indicate whether it will put that code in the db field?
Checkbox Values Stored In Mysql
I have a series of checkboxes and need to store their values in a MySQL table. I'm wondering what data type people recommend: varchar or text, exp. "True/False", "Yes/No" tinyint, exp. "0/1" Maybe it depends on the usage or maybe it doesn't matter and/or is a choice of personal preference.
Comparing PHP Array From Checkbox To MySQL Table
My problem involves updating a MySQL table using checkbox input. I'm relatively new to both PHP and MySQL so I'm looking for a little direction on the smartest way to accomplish my goal. When a user goes to a project page, they are able to categorize their project by area. The user checks a series of checkboxes and the results are stored in an arrays called $category_ids. I'll called the project id $project_id. What I want to do is compare the array $category_ids to entries in a MySQL table for $project_id. Then I want to add the links that aren't already in the table and delete the ones that need to be deleted. The table has these fields: projects_cat_link (table) ---------------------- category_id ¦ project_id (fields) Does anyone have any tips on how to do this? I've gathered that maybe there's a way to get the MySQL data into a similarly formed array and then use functions like array_diff to compare. But then I'm not sure how to use the comparison in a MySQL query to add/edit/delete the links.
Deleting Mutiple Rows
I have this Code: echo "<td>"; echo "<input type='checkbox' name='id' value='"; echo $row["id"]; echo "'></td>"; etc etc etc ect.... The above code works for 1 record at a time. I can't change the name of the form field to del[] cause I need that id in there.
Session - Mutiple Variables
it says that a session can register multiple variables. how does it work? i think it's like this, but i'm not sure.. session_register($name, $blah, $stuff); $name = "bob"; $blah = "blob"; $stuff = "ok"; and the three values should be saved in a session along with the same 3 variables?
Mutiple Submit Error
I have two search functions, one that searchs the options before bringing down the selected form, and the other to actually submit the data into the database. What happens is that if I search, it will bring the selected form down, however without the first search values (name, label) being shown if typed in; then when I do search it, I can submit the form with either pressing the search again or with pressing the submit button. I've tried doing the (if(isset($_POST['send'])) also, but it does the same thing (submit with either send/search being pressed). I just need the form to send when the submit button is pressed and keep the values in the search part to stay there instead of disappearing on me. Code:
Pesky Checkbox Arrays And A MySQL Song Database
I'm not one who likes to ask for help, so for the last three days my brain has been turning to mush while I try to create a DJ Request Song Wish List. Anyone who can help me out will be saving me from severe insanity. :) My goal is to: 1. Display search results for song title, artist and genre. (accomplished) 2. Allow the user to add songs to their Wish List. This is done by displaying checkboxes with the corresponding value equal to the songID. (working on it) 3. Allow the user to update their wishlist by adding/deleting songs. So far I have a form that retrieves the song info from a database in a repeating region. In Dreamweaver: <input name="songID[]" type="checkbox" id="songID[]" value="<b><?php echo $row_RecordsetSearchResults['Title'];?></b> by <?php echo $row_RecordsetSearchResults['Artist'];?>"> This puts the corresponding songID number into a checkbox value, which in turn is submitted by form POST action to the following page as an array. To process this array I have: if(isset($_POST['songID'])) { $songID = $_POST['songID']; print '<p>Song IDs:</p>' // process items $n = count($songID); for($i = 0; $i <= $n; $i++) { //See if the values are being passed from POST echo $songID[$i]; echo '<br>' } $songsInsert = '*'.implode('*',$_POST['songID']).'<br>' $insertSQL = sprintf("INSERT INTO wishlist (Username, Title) VALUES (%s, %s)", GetSQLValueString($MM_Username, "text"), GetSQLValueString($songsInsert, "text")); mysql_select_db($database_ToneDeaf, $ToneDeaf); $Result1 = mysql_query($insertSQL, $ToneDeaf) or die(mysql_error()); } The problem is, I'm using implode. It does store the songs, but only as one long block of text. So if the user picks "New York by Frank Sinatra" and "Hot In Here by Nelly" it is stored as "*New York by Frank Sinatra*Hot In Here by Nelly*" Obviously this gives me no options to make this actually readable, let alone allow the user to remove one of those songs from their list (both would be have to be removed.) Also, referencing only the songID number as stored in the music database doesn't seem a good option, since the song database will be changing frequently and song data may be overwritten. Not sure if there's a viable workaround there. Originally I wanted to store Title, Artist, Genre under seperate columns so I could link them to something like "See more songs from this Artist." However the more I read about arrays and multidimensional arrays, I realize I'm not ready to go there yet. (I just started learning PHP two weeks ago.)
Sending Extracted Array Data From MySQL To Checkbox
I have a list of checkboxes set up as a form that stores the data to a database cell in a comma separated string: For example: "12,13,18,110,118,21,28,31" Each checkbox has a name of "categories" with different values. What I'd like to do is the following: 1) Extract the data from the database 2) Separate each number it into an individual array value 3) Make the checkboxes in categories.php reflect the selected or non-selected state, based upon the results from the database (selected being the numbers in the database) Step 1 - I know how to do. Step 2 - I assume I need to use the explode function, no? Step 3 - Not a clue.... Code:
Selecting Data From Mutiple Tables
what i have is two tables, one with tours and one with courses, why i didnt use one table to begin with is a mystery to me and might eventually happen, but until then i need to select data from both tables to show in a combo box in a form. im going to be using php to show them in the form, hopefully a while statement to show the selections available. what im wondering is how do i do this? what sort of query would it be? would i need to use two queries? im pretty confident at using while loops and selecting data from databases but not two tables at the same time.
Store Mutiple Sessions Simultaneously?
I've run into an issue with sessions. I create a session from a GET request like this: $_SESSION['categoryID'] = $_GET['categoryID']; What happens is that, when I open multiple browser windows/tabs from different categoryID's, the session variable gets overwritten with the newest value. Sessions allow me to validate stuff at the beginning and all is good later. I understand the concept of 1 session = 1 browser window/tab. If I open a category where the categoryID=1 and then open multiple windows or tabs where categoryID=2 and categoryID=3 etc then, the $_SESSION variable is = 3. Is there any possible way to tie the session to the newly opened browser window or tab. In this case, even if the user were to open new categories/windows, the older browser windows would still retain the session data. I am looking for ideas on how to handle this issue when multiple windows are opened.
Split Variable With Backslashes Into Mutiple Vars
Im store a date into a databast table like mm/dd/yyyy. I was wondering this simple question, How can I split that up. So the date is $date (mm/dd/yyyy), and I want to split it like month is a var, day is a var year is a var.
Preparing Mutiple Values For Hidden Input To Form
I have a requirement to enter values in a form in the following format. <input type="hidden" name="item_name_1" value="Item_name_1"> <input type="hidden" name="amount_1" value="1.00"> <input type="hidden" name="item_name_2" value="Item_name_2"> <input type="hidden" name="amount_2" value="2.00"> In my application the item name = $title and amount=$price I have code which extracts the title and price but I cant figure out how increment the item_name_x and amount_x by 1, starting from 1, for each item purchased. Code:
Entering Each Array Value Into DB
I need to enter an array of values into a database, having each value be inserted as it's own row. I've searched for how to do it and the best I found was the foreach() function. So, would: foreach ($array as value) { $result = mysql_query("INSERT INTO some_table (value1, value2) VALUES ('$value', '$someOtherValue')"); } work, or is there a better way to do it?
Entering Data Into A Second Table:
Using a script, I able to insert the data into the first table of my mysql db, but when I try to insert the same into second table(duplicate, so same vars, etc.. no prob at that level), it doesn't go through. It doesn't even make an empty row(which would mean wrong vars) Someone told me to check in the logs of both PHP and mySQL. How do I do this?
Exiting/Entering A Function
I've always been told that a function should have one exit and one entrance. Lately, I've been seeing code like this: function foo($temp) { if ($temp >= 0) return true; else return false; } Nothing really wrong with that only I've been told to do it like this: function foo($temp) { $status = false; if ($temp >= 0) $status = true; return $status; } Is there really any significant difference between the two? Any security risks?
Entering Hidden Value To Db Through Form
I'm entering my text input like this: <input type="text" name="title" value="<?php echo $title?>" size="30"> How can I enter a hidden value into the DB through the form via a hidden type? <input type="hidden" name="title" value="ccccc@cd.net" size="30"> ?
Entering A Big String As A Block...
There was some PHP built in syntax method to enter huge strings as blocks of text. I don't remember exactly how it goes and not many people use it, thus, google search was unsuccessful to me: $a = [MYKEY] text text text [/MYKEY];
Entering Data From One Table To Another
does anyone know how to write a statement where you are able to transfer data from one table to another? I have got one table with user details. and I have another table for creating bulletins. is there a statement which will put the ID of the user from user details to bulletins everytime they create a bulletin?
String With ' Not Entering To The DataBASE
Am working on a WYSIWYG editor, and while entering some data's containing ' it is not entering into the data base giving me this error message... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's and would be able to supply a smooth professional service for workers on work' at line 1" In my SQL table the field type is BLOB I changed it in to text but the problem exists!!!! My charset is UTF-8!!! Is this the problem behind it?
Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might tell how? I'm using the following html code and trying to get the time to default into the text box. thanks html code <tr> <td><b>Date:</b></td> <td align="left"><input type="text" name="date" size="8" maxlength="8"></td> </tr> php code <? print strftime("%m/%d/%Y"); ?>
Page Reloads Keep Entering Data In Db
The problem is I have a small form that allows a user to input data into a database. Everything works fine, after a successful submission, the user get a message saying that their info was accepted. The problem is that if that page is reloaded, it enters the info again. There is only going to be one person doing the submitting so I could explicitly say...DO NOT RELOAD the page, but that seems kinda half as**d.
Ok Problems Entering Data Into Database
i am having problems if you look at the script below you will see that it the query has 4 values to insert but the actual values only contain title entry and now() for the date. well i have made the database and the blog_id is a primary auto interger what ever table bascly look below the the insert code block to find the code block that makes the table in the database, // Define the query. $query = "INSERT INTO blog_entries (blog_id, title, entry, date_entered) VALUES ('{$_POST['title']}', '{$_POST['entry']}', NOW())"; // Execute the query. if (@mysql_query ($query)) { print '<p>The blog entry has been added.</p>' } else { print "<p>Could add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>"; } --------------------------------------------------------------------------------------------------------------------------------------------------- // Define the query. $query = 'CREATE TABLE blog_entries ( blog_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(100) NOT NULL, entry TEXT NOT NULL, date_entered DATETIME NOT NULL )' // Run the query. if (@mysql_query ($query)) { print '<p>The table has been created.</p>' } else { die ('<p>Could not create the table because: <b>' . mysql_error() . '</b>.</p><p>The query being run was: ' . $query . '</p>'); } Quote:
Protection Against People Entering Code In Inputs
Just made my login page, but i am worried about people putting code in their usernames or when they enter anything into an input in a form. How can i combat this? i have already made the fields all lowercase to make my life easier in the database.
Checkbox
I am trying to make a form with 16 different checkboxes that pass on to an email. Someone got me started with the form but I'm not sure how to incorporate it into my php file. <INPUT name=other_needs[] type=checkbox id="other_needs[]" value=reception>Reception<TD> <TD><INPUT name=other_needs[] type=checkbox id="other_needs[]" value=Lunch>Lunch</TD> How do I refer to the checkboxes in my php file to include the results in the email the script sends?
Checkbox And SQL
What im stuck with at the moment is how to update the SQL database with the new information acquired from a set of check boxes. What i´ve done so far is to create the checkboxes and got the information from a table which checkboxes is needed and pre check it if it is already enabled. i have two rows in the database 1. Module_Name (name of a module) 2. is_enabled (is the module enabled 1 or 0). Code:
Checkbox Value
if i have 10 checkbox for customer interest.. how do i save that to database?? need to create 10 fields in the database?? after save.. how to display back when customer view his data.. if i choose swimming.. next time when i view back.. how to show swimming in the checkbox being checked
Checkbox
I have a database column which either holds the value 1 or 0. Now if there is a 1 in this column I want to produce a checkbox button that is ticked, and if a 0 then nothing ticked. So I thought it would work like this: <input name="dayTwo[]" type="text" id="dayTwo" value="<?php echo $databaseArray['d2']?>" size="6" /> However, it does not seem to work?
Checkbox
I am creating an email form with checkbox included. And I need the checkbox to be ticket when I enter the form though links. IE List of checkbox's checkbox 1 checkbox 2 checkbox 3 checkbox 4 say I was another page and I click on a link (call the link checkbox 1) I would like the checkbox to be ticked automatically. I know this makes no sense but I hope you get the idea.
Checkbox
i have a checkbox array of some unknown size.its a dynamic array created. i want to know out of all checkboxes how many r selected and which are they? and then insert the data in the table based on that. i hav written the code as follows:- <? $no=0; $friendname= $_POST['friendname']; $storecount=$_POST['storeid']; while($no<$storecount) { if($friendname[$no]) { $sql = "INSERT INTO groupfriends (groupid, username) VALUES ('$stid[$no]', '$friendname[$no]')"; $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); } $no=$no+1; } ?> i dont think this will work.it will add all the checkoxes data to the table. i want to insert only of those which r selected.
Checkbox Values
Basically, I have 2 checkbox's which are printed out for each record within my table. On the next form, each checkbox is tested for being "checked" and the database is updated accordingly. This is fine. My problem is that I dont want users to be able to select both check-box's at the same time. After talking to "andnaess" on an earlier post and doing some reading, I decided upon using some javascript to do what i wanted. I have found a script which does exactly what i want, and i am now incorporating it into my original php script. I am having problems assigning a name and value variable with an array to my checkbox's. Is this possible, or have i got the wrong idea?
Checkbox Confusion!!!!
I have page1.php that displays some articles from a database by the condition 'on' What I want to do is have checkboxes so that the articles you check won't be displayed on the web page the next time it's brought up. Essentially turn the articles checked to the 'off' condition and leave the articles that are not checked to the 'on' condition. When you hit the submit button I want it to go to a page2.php to run an update query to change the 'on' condition to the 'off' condition for the specific articles that were previously checked. (My Primary Key in the database is Article_Number) I think i have page1.php correct (don't quote me on this!) <input type='checkbox' name='Display_Article' value='off'>"; But I'm completely lost on what to do for the page2.php if($submit) { for ($i=0; $i<count($Display_Article); $i++) { //echo "<li>".$Display_Article[$i]."</li>"; $sql="Update articles set Display_Article='$Display_Article[$i]' where Article_Number='$Article_Number'"; $result=mysql_query($sql) or die ("Update Query Failed"); }
Checkbox Problem?
I am having trouble with checkboxes. How do you have a checkbox that it it is not checked it will still allow the form to be submitted. I am using checkboxes now, and if all the checkboxes are not checked, then it says that each of the ones that aren't checked are undefined variables why?
Problem With Checkbox
When i click on submit then the table wont be updated. I wanted to try to update the colom aw with the desired awardsid but i also wonder what happens if i have selected 2 or more checkboxes and whats entered then in the table aw, 1 & 2 or ? PHP Code:
Retain Checkbox Value
Just a quick question regarding the way to do something rather than the actual code :- I have a page which has some links that go through to a HTML form and each link will check a certain checkbox. I want the form to retain the checked status of any checkboxes that are set to checked when the user goes back to the previous page. Would this be best done using sessions or is there another way I could use? I don't mind using sessions as I have used them before. I would like to avoid using cookies but I don't really have any strong objections to using them, it's just that they're not 100% reliable (but then, what is?).
CheckBox Question
i started a php site in dreamweaver and i try fill data into MySql database. i set up a page with a form and i can fill in all the fields. just for one field, i like to have several checkboxes. every checkbox has a value, and they should fill the same field with their vale when checked. i also want to keep my text box, so i can write additional information. at the moment, when i click more than one checkbox, only the value of the first checkbox appears in the database. also, if there is already some data in this cell, it delete previous data, but i would like to keep it. preferably it should just add to information allready in the database.
Disable Checkbox
I have a checkbox that I set by php code to be either "checked" or "". I want to disable the ability of the user to check or uncheck it. I tried "readonly", but that didn't work.
Checkbox Problem !
I try to display the multiple checkbox in my form and the quantity of this are depends on how many records in my database (usually the record is more than 500). So how big space it takes to display. And to solve the spaces problem, i thing i better display with horizontal scrollbar to save the space. But i don't know to do it.
Checking A Checkbox
Is it possible to preset the values of form elements with php - so that when the client gets the page certain boxes are checked or completed - on the fly - based on their HTML id. Javascript has a way of doing this - but i need the functionality of PHP too - so if i can move the whole thing over to php it owuld be better . javascript example - document.forms['form1'].elements['radiobuttonno'].checked = true;
|