Populating Rad Chk Inputs
How do you populate input elements other than text inputs with posted data?
View Complete Forum Thread with Replies
Related Forum Messages:
Populating An Array Depending On The User Inputs
i am populating an array depending on the user inputs and displaying the contents to the user. The user wants to print the same information. I want to pass that array without using sessiond through a link to another page so that everytime i need not query the database.
View Replies !
Security For Inputs
I've been notified that the script I've been learning to use for form input is out of date and does not provide adequate security relative to user inputs and PHP inclusiveness. Is there a user input checking script out there that is already tested that checks user inputs from HTML forms and confirms that there are no monkey-shines being introduced? A link to something with some documentation or at least good commenting relative to what is going on.
View Replies !
Dynamic Text Inputs
I'm generating dynamic text inputs on basis of database records. while ($row = mysql_fetch_array($query)){ ?> <?=$row["product_name"]?>: <input type="text" name="quantity[<?=$row["id_product"]?>]"><br><? Then I try to write quantities in a database: $frm = $HTTP_POST_VARS; foreach ($frm["quantity"] as $quantity){ $id_product = key($frm["quantity"]); $query = mysql_query("INSERT INTO quantities(product_id, quantity) VALUES ('$product_id', '$quantity')");} But this doesn't work. When I browse the table "quantity" all product IDs have the same ID. What am I doing wrong?
View Replies !
Forms With Dynamic Inputs
I have a php page with a form in it, that is along the lines of: <form...> item with id 234 <input type=submit ... NAME=add234 ID=add234> <input type=hidden NAME=add234 ID=234> item with id 235 <input type=submit ... NAME=add235 ID=add235> <input type=hidden NAME=add235 ID=235> [....etc....] </form> In the PHP code at the top of the document, I want to: a. intercept any submit from the form b. get the related ID number At the moment, I have only one add button, so I use code like this: if($HTTP_POST_VARS[add]){ ... ..... } So my questions are: A. how can I change if($HTTP_POST_VARS[add]){ to make it intercept any submit button that starts with add B. how can I get the corresponding ID number
View Replies !
2 Submits Useing The Same Inputs....?
I have a page that has like 50 inputs... (to create an image) so many that I want a preview button and a submit button the submit will add the info to the database like it should but the preview button will make a pop up with a new page my problem is that i need all the info sent to both pages....if they click preview i need all the inputs send to preview.php and if the user clicks submit i need all the inputs to go to generate.php how do i do this?
View Replies !
Validating Text Inputs
I have a forum which i made and i wish to check the input to stop any SQL injections being made. IN the db i have the column set to TEXT. How can i make sure that what the user inputs is safe... i know i could ereg or ctype it but if i write the text then press enter it doesnt allow it. Without the enter it works fine but with a enter space it doesnt...
View Replies !
Re-display Users' Inputs
Guys: I have created a site that allows users to submit data. I made some fields mandatory so that if one of these fields is left blank, users will be prompted with a note that "You must complete contact information in order to submit comments". They will then be directed back to the submission page to fill out the missing fields (instead of filling out the entire form again; which can be frustrating). I have used session to record the entered data; for example: $_SESSION['phone'] = $_POST['phone']; but I don't know how to re-display this information on the input fields, I mean: where should I echo ($_SESSION['phone'])?
View Replies !
Doubling Forms/ Inputs
I'm not to sure how I should start this. Nor do I have an example that I can show you, so I will just try my best to explain. Here's what I need to do. How many input boxes would you like ? [ 1-10 ]now accorind to what was entered in the { } that number of boxes shows up on the screen. This would be used for extra upload input boxes and extra lines in a form. I just want to copy the fields and have then have their own out puts.
View Replies !
Form With Multiple Image Inputs
I have a problem that I cannot seem to find a solution. I'd appreciate any insight on it. I have a form with inside a dynamically created table of Images and 3 inputs of type image: echo "<form method=post action='http://localhost/processplay.php?$counter' >"; echo "<table align=center border=10>"; $counter = 1; for($i=0;$i<5;$i++) { echo "<tr>"; ..... echo "<img src=$source width=30 height=30>"; ...... echo echo "<input name=$counter type=image height=30 width=30 src=$source>" ...... ..... How can I pass to the processplay.php (the action of this form) which input was pressed? (remember that the name of the input is unknown to me before the form is created so I cannot write it explicitly).
View Replies !
Storing Form Inputs Appended To A .txt
Can I have people input an email address, check it that it is an email address form (something@something.something) and then add it to the end of a .txt file without modifying anything else about the text file? How can this be done? What settings do I have to place on the text file (I am on win2k iis).
View Replies !
Visual Validation Of Form Inputs
Is there a way of having a form post it's fields to a validation page so the user can see what they have submitted, and then click a button to submit the information to email? Instead of having validating fields in the form, I would like to just submit them to a validation page, so if the information is correct the user can then click a 'submit' button or something. At the moment I have the information from the form being submitted to email, and the validation page coming up after that. The problem here is that if the information is incorrect the form has to be submitted to email again and I recieve 2 emails instead of just one.
View Replies !
Logged In User-detection And Inputs?
I have an installation of the database-less blog service Text Rider that I wish to take public, but I want to polish it off, make it prettier, and dumber for the average user before doing so. I want it to be a system where anyone can register and post to the home page, but users can only modify their own posts, whereas administrators can, of course, modify anything. I realize how incredibly stupid this idea is, but I want to go through with it anyways, to learn programming techniques and user habits. Code:
View Replies !
Collecting User Inputs Into An Array
I understand how to create an array and use the push function to add variables onto the end of the array. My main question is how do you create an array from user inputs AFTER the page has been generated but BEFORE the next page is displayed? Do I have to pass all of the individual user form inputs to the next page as a variable with $_Post, or can I process the array before the next page displays?
View Replies !
Auto Fill Form Inputs
I have the drop down menu that list the person's name from the MySQL query. Next to the drop down menu I have 3 text boxes...user's name, user's sex, user's age. I want 3 text boxes to display the information that is already in the Database when I choose the user I want to see. I have the DB table that houses users information already with the information already entered. Once I click user 2 I want that user 2's name, sex, & age to be displayed in those 3 text boxes that I already have. Then if I choose user 10 I want user 10's information to populate in those 3 text boxes.
View Replies !
Keeping Values In Form Inputs After Validation.
How do you put posted values back into form inputs if validation fails. I've tried this: <input type='text' name='title' size='30' maxlength='70' value='<?php echo $_SERVER['title']; ?>' /> This causes ' ' to appear in the input box though. I have no idea why. I figure this is an easy question. I'm not the only one who doesn't want their users to have to fill in a whole new for because of one mistake and not be able to see the mistake.
View Replies !
Script Where The User Inputs The $show_name Through A Form
I'm not the best as mysql, but I know my way around. have a script where the user inputs the $show_name through a form, and the database goes to check if anything like that name is present. But " like %$show%" only pulls up if the show entered is part of a string, I need to pull up somthing where if "Charmed" is entered, then "Charmmed", "Charmer", "Charmedd" pops out as the result. Kind of like a mini search engine for a single simple field.
View Replies !
$_FILES Fill In The File Inputs Without Browsing Again
I have a form with some required fields and some file submission fields as well. I do some form validation after submission and if they miss a field that is required I want to fill in the fields that they did fill out to save them some time. Is there any way to fill in the file inputs or do they have to browse for them again? From what I can tell, the path of the file doesn't get passed with the form, but I just wanted to confirm that.
View Replies !
HTTP Header Response For Invalid Form Inputs?
Is it necessary or is there any standard to send HTTP header status for form inputs ? Say, the user is entering invalid password in login form and now all the applications I have seen are just displaying error messages above the form (with HTTP status 200); is it necessary to send 401 status in this case?
View Replies !
Error Message Causing Form Inputs To Clear
My problem is this: I built a simple form that connects to a sql database and inputs the information. I made it so it puts the error message at the top of the page, when the user leaves a required field blank, password is too short and so on. The problem is that it clears all the fields when it displays these error messages. Is there a way to prevent this so it doesn't all have to be entered again. Am I just going about this the totally wrong way? I really haven't been working with php that long, about a week really, so excuse me if this is a total noob question. Code:
View Replies !
Sets Several Session Variables Based On The User Inputs
i am making a sign-up form.. to cut the story short... Thes signup form sends all the variables via POST to a "register.php" script.. the register.php script sets several session variables based on the user inputs on the first form.. The weird thing is, the whole script works perfectly, untill i have the following lines PHP Code:
View Replies !
Populating A Select Box
What I want to do for members of my website is to allow them to click a button that will add their name to a list that populates a select box. I can do this on my own, but I was curious if I have to use a database in order for this to be possible.
View Replies !
Populating Drop Down
How do I do this drop down box ? Making an edit page. I have 2 tables groups id || categoryname program id || cateogry_id I need to populate the groups in it at same time show the selected choice from program. Not showing id but needs to show categoryname with of course the values being the id of groups.
View Replies !
Populating Dropdown Box.
I have been looking around the internet for an example of what I need to do but cant find anything was wondering if someone here might be able to help. What I need to do is to connect to a mysql db select a table and then a field from that table and put all the contents of that field into a dropdown box.
View Replies !
Populating A Webpage
I am trying to create a webpage that will allow me to view my 'email' website whilst I'm at work. The firewall blocks the page and I was hoping that there was some surreptitious way to get around this problem. My thoughts for a solution to this would be to create a variable with the website's name in pieces. Then send it to a function that opens it in a frame or something.
View Replies !
Populating Tables
I'm trying to populate an HTML table using the data in MySQL. "how to do format it to where I can make shipping labels?" There will be three lines of text for each label but I will have three columns of labels X 10 rows. Code: line A1 line B1 line C1 line A2 line B2 line C2 line A3 line B3 line C3 line D1 line E1 line F1 line D2 line E2 line F2 line D3 line E3 line F3 ....
View Replies !
Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).
View Replies !
Populating Dropdown List
I am wanting to know how to populate the <SELECT> dropdown menu with all existing values from the DB and also have the value associated with that id selected. This is an updating area of my admin. Any ideas? Here's the code so far. At the moment it only retrieves the value assigned to that id. PHP Code:
View Replies !
Populating A Drop Down Menu
How would I go about populating a Drop Down menu from data in MySQL? If you can show me wither a URL to learn this, or if you feel like telling me here, that would be great.
View Replies !
Dymanic Populating Checkboxes
i like to retrieve a value from DB, accordingly i like to display the checkbox, either checked or not. Now im able to retrieve the value from DB, i can show even show the checkbox, but i cant make it checked???? the Code i used to display as follows, #Require the database class require_once('../dbinfoinc.php'); #Get an array containing the resulting record $query = "SELECT * FROM event"; $result = mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { if(($i % 2) == 0) { $c = '"TableDetail"' } else { $c = '"TableDetail2"' } $event_id=mysql_result($result,$i,"event_id"); $event_name=mysql_result($result,$i,"event_name"); $event_publish=mysql_result($result,$i,"publish"); // if(($event_publish) == 0) { $event_publish = 'No' } // else { $event_publish = 'YES' } $take_action = 'Delete' echo "<tr> <td Class='navText' align='center' class=$c>$event_id</td> <td class='navText' class=$c>$event_name</td> <td class='navText' align='center' class=$c><input type='checkbox' name='publish' if($event_publish==1){'CHECKED'}?></td> <td class='navText' align='center' class=$c><a href='delete_event.php?event_id=$event_id'>$take_action</a></td></tr>"; $i++; } ?>
View Replies !
Re-populating A Form If Errors
I am learning php. I have created a simple Web page with a form. After receing the POST request, I do some error checking. In case of errors, I would like to re-post the page, but with the current values for each field. I have organized my files like this: 1) Webpage with the form (all in html, form action points to a php file) 2) php file that receives the request.
View Replies !
Populating Form Text Box.
I have a PHP form for entering data on-line into a mySQL table.. Because of the intended search facility, I require one field in the form to be completed with exact and precise item names and spelling. In testing, I had achieved this with look-up tables. Ideally I would like the selected item from one of five drop-down lists to autopopulate the form text field when selected. Alternatively at least the option of copy and paste. Copy and paste - for some reason will not work. Autofill worked fine on a test form with no database connection and in standard HTML and javascript, however, once the PHP is added to the page neither method works. Could anyone please point me in the direction of how to get the autofill to work?
View Replies !
Populating A Select Box From A Database
I have a subscription database that allows you to edit a subscribers data. For example, you enter a search term like "Bob" and it returns a list of everyone named Bob. You click the one you want and it goes to a subscriber detail page, where all of his data is populated to a form. You can directly edit this form and click save to overwrite it. The only issue is the select boxes (drop downs) - say I have four options in the drop down box, red, blue, green and black. On my details page for bob I end up with five, I have those four PLUS whatever was saved for his color, so it shows up twice. If Bob is green, my select box looks like: Green Red Blue Green Black How can I make it so that Green only shows up once?
View Replies !
Populating Drop Down And Table
I have a database with the following fields. Name | Company | Date values in each column could be repeated, or not. as in there could be several same names with the same company with different dates, or different names with same company. How do I populate a table with this info and have drop down boxes, so that I can narrow down the search? For example: Name | Company | Date 12 | 1 | 1929 13 | 1 | 1929 14 | 1 | 1929 12 | 2 | 1929 12 | 4 | 1929 13 | 1 | 1941 12 | 6 | 1929 So if in the drop down I select '12' under name, only those entries with 12 are shown, and then I can further sort it by selecting only '1' under Company. Hope I'm clear, I manage to complicate things when I post them.
View Replies !
Populating An Auto_increament Attribute
I have just designed a BD. there are companies with auto increament which are integer. When I try to populate it after i tool value from another form and try to insert it into a table i recieve an error! I don't ask the companyID value from user as it is auto increament. Don't tell me to put NULL for that entry as it didn't work as well! Code:
View Replies !
Auto Populating A Drop Down Box
Basically I'm setting up a website which needs an populated drop down box made up from all fields in a specific column of a table in a mysql db.... Here's the code I've made up using various tutorials.... <?php $user = ""; $host = "" $password = "" $dbName = "" /* make connection to database */ mysql_connect($host, $user, $password) OR DIE( "Unable to connect to database"); mysql_select_db($dbName); //did you forget this line? $sql = "SELECT model FROM usedVehicles"; $query = mysql_query($sql) or die(mysql_error() . "<br>$sql"); //use the or die(...) part ONLY IN DEVELOPMENT ?> <form action="action" method="post"> <select name="option"> <?php while ($row = mysql_fetch_array($result)) { echo "<option value="" . $row['model'] . "">" . $row['model'] . "</option> "; } ?> </select> <input type="submit"> </form> I've left out the connection details for obvious reasons... When I upload and try to test this, jus a blank drop down appears... there are definately fields in the column as I have tried the query on phpMyAdmin.
View Replies !
Populating Fresh Data
Im building a live web chat using php, mysql, javascript, ajax I am fine with sending and retreiving data in real time using ajax as the transfer protocol However, my problem, which is becoming a nightmare, is how to I display it !! Lets say the below is the chat screen, <div id="messages"> Jamie - Hello Peter = Hi Jamie = Nice Day Peter = I know </div> Lets say Jamie's next message is "What are you doing today". I can send that off to the database no problem and I can get peters live chat to pull that message in, however, how do I get it to display underneath Peter = I know As a practice I was using document.getelementbyid('messages').innerHTML = document.getelementbyid('messages').innerHTML + "<BR>What are you doing today" That works, but, lets just say the chat gets to 1000 lines, for each new message those 1000 lines have to be pulled out via javascript, a new line written to it and then printed back in the div Im not sure but I'd take a good guess at this not being optimal and will cause CPU load on the users machine What is the best way to do this! Chat messages are deleted after 1 minute, but that doesnt matter because by then they have already been sent the the users chat. Just incase you are thinking of completely repopulating there chat with every message they have sent since the chat started..
View Replies !
Populating A Dropdown From A Database
I have put together a script that populates a dropdown menu from a database. My database contains a table called casinocredit, and it contains records that have been enterend over 2 different months (may and june). There is a field in the database that contains the date in this format: 2006-05-12 00:00:00 So The drop down is currently showing a month for each of those records. I was hoping that it would only display one. (the plan is when a user selects a month (say May) and hits submit, then I would display all of Mays records on a different page) See the image i have attached for a view of what is happening. Code:
View Replies !
Populating A Drop Down List With Php
I am trying to get a drop down list to populate vbia php. What I have a is a script that allows a airline/user to enter airfare and price for tickets. It dumps them into a database and then allows the user to view/delete/add. I want the user to be able to edit the airfare. I have a drop down list that is set as a variable $ticket_from, $ticket_to. The list contains around 400 cities. When the user clicks 'edit' I have the price population but no the drop down list. How do you go about something like that? I have this right now: Code:
View Replies !
Populating Drop Down Lists
Could anyone help me on populating database driven drop down menus. I am trying to populate a second drop down list based on the selection of the first drop down list. I have the first drop down list running. Not sure about getting the second now.
View Replies !
Populating Combo Box Dynamically
when I click on a Country name in the first combo box the name should be checked on the database and the name of the respective states. should be populated in the next combo box dynamically. please give us the basic code and the way to go ahead to develop the code. We are new to PHP ,we have read the basics but how to develop now?
View Replies !
Populating Form Fields
I have a online order form that does not require a user to be logged in to use, but if the user is logged in I am attempting to get certain fields to populate with information stored in the database for the user. If the user is not logged in I need the information to be sent to the database.
View Replies !
Re-populating Text Fields
When a user submits a form on my page and there are errors, the page returns the errors and re-populates the correct fields - So the user doesnt have to complete them again. I using the below code to do that... <input style="width:200px; "Â name="userfile" type="file"Â id="menu_textbox" value="<?print $file_path; ?>" /> However, for the file upload field above it doesnt seem to work and the user must select the file they wish to upload from there computer again. Should the code for this be a little different or is there something I am missing?
View Replies !
|