Dynamic Number Of Text Boxes/insert
On page one I ask 'How many boxes do you want?' and I have a simple form - the code is below:
<form action="addhouses.php" method="post">
<input type="text" name="numimages" size="3">
<input type="submit" name="submit" value="Submit">
</form>
On the next page I want to display how ever many boxes they said on the previous page.
Let's say they choose 4 - there are then 4 boxes which allow you to browse to files on your computer. Clicking submit on this page takes you to the third page which uploads the files and inserts the filenames into the database. Currently the code I have on the third page works fine for a static number of defined boxes. It is: PHP Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Text Boxes
I have a form where field techs can close out service calls, Time in, time out, work done, who the tech is....ect... Currently I have 20 fields for parts..... Part1 / Part1QTY....and so on to Part10 / Part10QTY.... the form emails, and it also feeds data into MySQL... so everything is working fine... What I would like to do, is stream line it...so there is only 2 fields...part_number and qty....and when techs needs to enter more parts then click on a button that creates 2 new sets of text boxes for input.... thus allowing me to have them enter more the just 10 parts and qty's. I thought about, maybe having a secondary form on my HTML page, with different sets of submit buttons, and they can enter 1 part at a time... but I could not get the secondary form Submit button to not clear the data in the primary form...so that didn't work for me.! I'm am basically stuck here... there maybe one or two other issues I have...but those are not so critical. I do have a great deal of MS Access experience but this PHP is a totally different monster. For those who know access, it's very easy to add a new record in a subform and just keep adding records...which is sort of what I'm trying to do here.
Dynamic Text Boxes With While Loop?
Basically I have a dynamic number of categories. Each of these categories requires a text box, therefore I have a dynamic number of text boxes. My question is if there is anyway using a while loop that this can be done? <? while ($nextcat = array.php($categories)) { echo $nextcat; $varname = $strip_tags($nextcat) ?> <input type = textarea name = <? $varname ?>> <? } ?>
Dynamic Combo Boxes
i have a problem with creating some dynamic combo boxes. i have a form and the user enters the number of printers required, on the recieving page i display that many combo boxes ready for their input...but the problem is its not generating the correct number of combo boxes for some reason. i think i'ts because i need to reset the cursor on the result set so it can whip through the printers again but am not sure. please see following code:
Dynamic Listy Boxes
we are trying to buid some dynamic list boxes. Our code that generates the listbox creates a string containing the list box definition and the last line of the file is echo $outstr. When we execute this, the list box works fine. Now when we embed it into am html page in this way: <?php include statuslistbox.php ?>, we get errors that say "constant statuslistbox.php not defined" The listbox define file has the php brackets top and bottom. The embeding html has no brackets other than the ones show above. It seems to make no difference if the calling file is a php extension html extension.
Dynamic Dependent Drop Down Boxes
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP?
Dynamic Drop Down Boxes With Php Query
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP? The above question is already answered by many people and they want me to use Javascript. My doubt is the second box shoud query the list from a table in mysql using php. How do i do that?
Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table. The first thing that I'm trying to do is pull the field LastName from the table Faculty. Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database. However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:
Keep Text In Text Boxes After Form Is Rewritten
I'm trying to make a form that does the following: (1) the user answers a question by typing in a text box (2) a response is then written below the form, saying whether the answer is right or wrong and, perhaps making a comment of some kind (3) the user's answer remains visible in the original text box I've managed to write some code that does the first two things, but despite many attempts and much searching for code examples, I've failed to find a way of getting the answer to reappear in the text box when the page is rewritten. This is my code:
An Array Of Text Boxes
I have the full code in a php script where I essentially display a form with checkboxes, and 2 text boxes associated with each checkbox to record grades ( marks and remarks ). The form displays correctly and the checkboxes I select do pass the correct id numbers for the students to be graded, also the numeric data in the first textbox is correctly transmitted HOWEVER the data in the second textbox gets randomly truncated. e.g, if the "remarks" textbox has 'hello', it gets truncated to 'o'. It seems I'm not resetting something or there is another simple oversight somewhere, perhaps the script treating the data as a string rather than as an array Code:
Spaces In <input Text> Boxes.
When I submit a form where a user has typed a space into the input box, then check that value in the action .php file, only the text before the first space is displayed. How can I get all of the text sent? eg Code: <form name="form2" method="post" action="temp.php"> <input type="text" name="name"> <input type="submit" name="Submit" value="Submit"> </form> Then in temp.php Code: echo "Username = $name"; If the user enters "Greg Bennet" into the text field, I get back "Username = Greg".
Passing Values From Text Boxes
what I'm trying to do is pass some values from text boxes, yes it may sound simple, but let me explain more... I've got a form, and what I want to do is that when you enter a new question and select a existing category from the drop down box, it then inserts the values into the database no problem. However if enter a new question, and a new category, then submit the info, I get a null value. The Code...
Punctuation Marks In PHP Text Boxes
I am not a PHP user; I manage the server/ network for our business. We've employed web developers (chosen because they're friends of the MD) to build us a site and they've used PHP & MySQL to do it. The problem we have is that if we use an apostrophe when writing a product description or product title in the back office of our site, when that data is then used or carried through to another part of the site eg. a live product page or an order summary page, the apostrophe has a backslash before it. We have run into other issues with the use of various punctuation marks in the text fields of the back end of the site and have always been told by the developers that it is a fault of PHP and is common with PHP text fields. Now, as I said, I'm not a PHP user and certainly no expert. But I have installed and used Mambo Server, Wordpress, phpBB and a couple of other PHP MySQL products through my own curiosity and have done so successfully and have never experienced any of the issues we seem to be facing with these text boxes. I am growing increasingly suspicious of the level of competence of the developers and feel that they are making excuses for their inability. Can anyone tell me, from what I've said here, whether my suspicions are justified or is it the case that PHP is limited in these areas?
How Can I Print Out Multiple Text Input Boxes?
How Can I Print Out Multiple Text Input Boxes. The function below prints out three text boxes. The code below is static, cannot accept user input, and therefore cannot be changed. What I need to do is write a function or maybe a class that can accept user input and print or echo a different number of text boxes, depending on the user input. The name variable for each of the textboxes needs to have a different name. For example, the name for the first text box would be something like "name=textfield1", the second would be "name=textfield2", and so forth. PHP Code:
Select Menu OnChange To Update Text Boxes
I've a select menu filled from mySql, So when I change the selection.. I want to change 3 text boxes also by the same row of database that is = to the row of the select menu. So i tried a lot but failed.. cuz I cant send to javascript the updated values when the selected menu change.
Get Auto Number On Insert
i need to implement it in PHP so im posting this here. i have a table that auto numbers each row, and i need to get the primary key of each now row as it is added for further use.... for example: PHP Code:
Dynamic Update/insert Statement?
I'm hoping to build a dynamic sql statement for inserts and updates based on FORM values. I've done this in ASP but not sure about PHP syntax. Right now I just output the form entry results, but here's what I'm thinking for an update: PHP Code:
Insert Character Specified Number Of Times
im looking for a function that will create a string of a certain character a specified number of times. ex. $newstring = unknownfunction("*",5) //resulting in $newstring being ***** I know how to create a loop to do this, just wondering if such a function exists.
Dynamic Insert Of POST Data Into Database
I have two tables one with game data ie visitor team home team so on and so forth and one with team name and team id, this info is pulled into a dynamic form. I can get the data from the form ok foreach($_POST as $key => $value){ echo "$key:$value"; } when I echo the info it gives me the correct output game1:7 game1id:513 game2:14 game2id:514 I have columns in the database that correspond to the form var fields What my question is is how do I get the info into the database through each iteration in one row? This is an example I have tried and I know doesn't work $sql = "INSERT INTO teampicks ($key) VALUES('". $value ."')"; $res = mysql_query($sql);
Insert New Row In Table After 5 Lines - Detect Whole Number?
I have a script that loops through an image directory to create a table of thumbnails. I want to start a new row after every fifth thumbnail. I assumed there was a function which identified whole numbers, but alas, there doesn't seem to be. How do I produce a short version of my long, working version below. PHP Code:
How Do I Truncate Text? + How Do I Insert <BR>?
How do I truncate text with PHP + MySQL? I am making a categories table to store information for a store, here is an example: Name: Computer Software Shorthand-name: computer Description: Stuff you put on your computer Category number: 01 How do I take the input "computer software" and truncate it so it is just "computer"? Also, let's say someone types the folllowing description for this new category: Quote: This is my description for computer software. I like softeware, and I also like new lines! That is why I keep hitting the enter key. See? Anyway--how do I insert a <BR> (HTML break) after each line? I currently have my description column set to text, and I want my form to check if the user inserted a new line ()... If they did insert a newline, I want to make a new line in HTML.
Using PhpMyAdmin To Insert A Text File
I've checked the phpMyAdmin documentation that describes the error message I keep getting: Error MySQL said: The file '/tmp/phpkvpp60' must be in the database directory or be readable by all . I think I've set up everything correctly, i.e. file permissions are correct; mysqld is running on my machine; I own the file...Any ideas as to why this still isn't working?
Insert Text, Ms Word Document
i've hit a wall regarding php and ms word. what i want is to open a document containing bookmarks, insert text where the bookmarks are, and save. it's working, unless the bookmark is in the header part of the page (re header/ footer). in that case i get an error saying the bookmark wasn't found/ doesn't exist. anyone got any tip on how to get into the header part of a word document using php? the following, simple code works when bookmark is in the main part of document: $empty = new VARIANT(); $word = new COM("word.application") or die ("some explanation"); $word->Documents->Open("C:PathDocument with bookmark.doc"); $word->Selection->GoTo(wdGoToBookmark, $empty, $empty, "bookmark"); $word->Selection->TypeText("text to be inserted"); $word->Documents[1]->SaveAs("C:Pathwith inserted text.doc"); $word->Quit(); $word = null;
Text To Date And Insert To Mysql...
Kindly break out the 4x2 and bring me to my senses. I seem to have gotten myself totally confused with php.net, mysql.org pages on dates etc, as well as groups.google. Could someone explain, even using pseudo code, how to take a text input I have set up as YYYY-MM-DD using php, and convert to a value mysql will insert into a Date (not timestamp, not datetime) field.
Text Field, Dates And Insert
The user types a date (dd-mm-YYYY) in to a text field, the date is checked against a regex and if it passes, is then inserted to a database. For some reason inserting the date ($this->input->post('date')) directly in to the database gives the default for the field (0000-00-00). I've tried doing date("d-m-Y", $this->input->post('date')) but get 1970-01-01 or something like that. Do you have any advise for converting the text field input in to a format that can be inserted in to the database?
Dynamic Text Area
how do I create a dynamic text area that whenever I select a value from a dropdown list it will automatically fill up the form of my html. the dropdown list contains dynamic values from mysql database. Whenever I click a value, it automatically fills up say for example the name, address, email, etc...
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?
Looping & Reference To Db - Insert Pics At Intervals In Text
I have a page that displays an article from a table named articles -- clever, huh? -- and the relevant fields are text, photo1, photo2, photo3 etc (up to 6). What I'm doing is breaking up the text by line breaks into an array and then printing the items but after an interval of 3 line breaks, an image is inserted from the fields photo2, photo3 etc as long as the photo field is not empty. The first photo field is auto-entered in the HTML so is skipped for this code. Now everything is going OK except that for some reason, the reference to the photo fields are ignored and nothing is printed. I've tried the following code as well as another version where the array of photo fields is created outside this loop, however, either way, the call to the db does not work from within the loop for some reason. Code:
Format Number And Text
I want to format my id's in a sertan way however i am not sure how t approatch this problem. i want to write a function that formats a 0 to D000000. However i alsow wat to be eable to convert them back from D000000 to 0 to make calculations with it. For exaple adding 1 to create D100000.
Problem With Dynamic Text Fields
My goal is this: A user logs into the site and is presented with a directory listing (this is done, check). He then clicks on the directory, each which has their own amount of text files within them, and a page loads up presenting either text areas or text fields depending on the type of text file (some only hold one number, others just hold text). The text will already be entered into the text field, so no re-typing will be necessary, and if editing needs to be done, it can be. There is currently a map made in Macromedia Flash which relies directly on these text files to output certain information. I want to be able to alter the text files, and in turn, alter the Macromedia Flash. I understand that all of this can be done easier with databasing, but that's not the goal. A word on the directories and text files: There are the same number of directories as there are buildings on the map. Each building has 2 text files, some have 4 if there are two buildings too close together to tell them apart. The first text file is totalBuildingName.txt, and this holds the number of pictures there are of that building, just one number. The second file holds text, and is just BuildingName.txt, and it holds the description of the building. The main directory where ALL of the PHP files are stored is called final. it then goes up to directories, then up to the building name. So if you're in admissions, the directory is: ./directories/admissions/ As for the code: It all works fine. Of course it doesn't work completely fine, or I wouldn't be posting here. It does everything I want it to do, and possibly more, however, I can't seem to open the text files within the directory. No matter how hard I try. The permissions ARE set on the folders and files, so that shouldn't be an issue, and if placed in the same directory as the text file, fopen can be used to file the text file, and then implode it to print it out. This leads me to believe that $TheFile isn't looking in the right place, but to be honest, I can't figure out what is the correct direction. I'll be extremely thankful to anyone who can point me in the remotely correct direction. Thank you so much.
String Of Text (Number Of Pixels / Pixel Size / Pixel Length)
If I'm putting together a list of links and I want to get add each item one at a time inside a foreach($aNames as $sName) loop, is there an easy way to get the number of pixels that the $aName takes up? For instance, in creating a set of links... foreach($aLinks as $sLink) { if ((pixelsize($sLink, $sFont, $iFontSize) . pixelsize($sHTML . " ", $sFont, $iFontSize)) < 400) { $sHTML .= " " . $sLink; } else { $sHTML .= "<br /> " . $sLink; } } The goal is to keep the whole link on one and only one line letting the browser automatically break up any given link..
Check Boxes
I have a very little problem with check boxes. How can I write a simple PHP code to tell me when a check box has been checked, and then use the name of the checkbox in a function.
Reading POP Boxes
I've been looking round for something that will read the contents of a pop box and populate a MySQL table. The e-mails will all be of a fixed format and include a jpeg as an attachment. I need to put the following columns in: sender subject body filename (possibly appended to the date to mitigate the risk of The script would also need to save the attachment to a predetermined folder. Does anyone know of anything that would do this? Alternatively, how much would it cost for someone to get this working for me?
Alert Boxes
do u know the alert box in javascript? when u write alert("somthing"); well i need that in php what is the alternative function for that in php?
Combo Boxes Question
I am wondering how I can make the whole array appear in the code that is below with the database entry to be selected. At the moment it just displays the database entry.
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).
Multiple Drop Down Boxes
I want to create two multiple drop down boxes, the first will display all the company names, once this has been selected all the stock information for that company will appear in the second drop down boxes.
Printing Colored Css-boxes
I've got a page with a couple of tables inside a couple of colored boxes(css-style), but when I try to print the page I end up with a copy without colors.
Form Drop Down Boxes
I have a bunch of products i want to add to a database, i have a form to submit the products to the database. What i need to crack is to have a drop down box for category 1 (beer or wine) and then automatically populate the drop down box for category 2 depending on the first selection if cat1 = beer then cat2 options = Lager, Malt, Stout. if cat2 = Stout then cat3 = Guiness, london, Old boot. if cat3 = Guiness then cat4 = Bottle, Can. I have four sub categories so need this to work on the fly before adding all info to the database ...
Conditional List Boxes
I am attempting to create a list box that is dynamically populated based on the selection of another list box. I am in way over my head..only way to learn I guess. The code below has a year listbox and then based on the year selection, the page should either show another listbox (show industry selection when year <> 2005) or it should render the main form (when year=2005). I cannot get the main form to appear. Code:
If Statement And Check Boxes.
I have a database full of different articles/stories. I would like to have a publish check box so that if it is checked, that story appears on the homepage, I know how to do this. HOWEVER, i need ot be able to limit this so that only one can ever be checked off... Code:
Drop Down Answer Boxes
how to insert drop down answer boxes (like the oes you get in questionnaires) into my cong, i can't seem to get the coding right or make anything appear in the box.
Replace Hex Number Or Decimal Number In A String ?
String may contain alphanumeric values. What is the bestway to replace a hex number such as 0x122aaa and decimal number such as 5678 with a string "blah" Example: I want to replace below-- wr_thru1 data or mask mismatch!! for addr=0x00000b73a0540 & mdfid:11 with wr_thru1 data or mask mismatch!! for addr=hexVal & mdfid:decVal
Generating Drop Down Boxes From Mysql
i'm using php with mysql. i need to be able to extract items out of my database and put them into a drop down box so that the data is dynamic. In this example, i need to get all of the names from the name.office field into a drop down box to be used in further scripts/processess. <html> <head> </head> <body> <? $db = mysql_pconnect ("localhost", "XXXX", "XXXXX"); if (!$db) { echo "error: could not connect to database. please try again later"; exit; } mysql_select_db("XXXXXXX"); $query = "select name from office"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); ?> </body> </html>what goes here??? i have tried many things and not been able to get it to work.
|