Dynamic Multiple Input Processing
I am creating a simple "or so I thought" php/mysql survey.
There are 3 types of Surveys, with different questions. 1 for Clients,
1 for Employees, 1 for Peers.
Questions for each survey are created, editable, removable, and drag/
drop sortable.
Options to these questions are dynamic themselves.
Basically, everything works except when I try to Insert the data into
the answers table.
The one question I'm looking for is how would one process the data
based on the respective question_id's?
Sending it to another page would require an excessive amount of _POST
variables, and like i said before, there are different questions for
each survey.
or would this work? (it doesn't seem to process)
if($submit){
for($i=$start; $i<=$end; $i++){
$query[$i] = "INSERT INTO answer(ansresult, ansdesc, idquestion,
idsurvey) VALUES('q_$i','exp_$i','$idquestion','$surveyType' )";
$result[$i]= mysql_query($query[$i]);
if($result[$i]){$success++;}
}
$msg = sprintf("Success: %d, Questions: %d",$success,$end-$start);
echo($msg);
}
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Form Processing With Input Validations
I am creating a form Form1.php that posts to the another form Form2.php. I have input validations on the first form. I need the user to go to the next form ONLY if the inputs from the user are valid. I have not been able figure out how to do this since the first form always posts to the next form no matter what. I would really appreciate if somebody can share their php knowledge and give me some idea on how this is done in php.
Processing Dynamic Forms
I have a form that is generated with the result of a query, each row returned from the query is used in the form and a checkbox is added. I want the user to check off multiple records to be modified and process the form. I have a line that generates the form like so: print "<tr><td>$id</td><td>$action</td><td>$request_dt</td><td><input type=checkbox name=request$id></td></tr>n"; I want to be able to loop through and get the $id and $action and perform my query actions for that record and move on. I know I have seen this used in many web sites but have never needed to do it myself. I have toyed with using REs to get the $id from the name and process it but seems to me there must be a better way.
Dynamic Form Processing
Im writing a script for processing a form created by a csv file. this form is created through a loop, where $num is the place in the loop. Code:
Form Processing - Select Multiple
I'm trying to process a form that contains a SELECT with the MULTIPLE qualifier, but PHP only seems to be receiving the last selected entry in the list rather than all selected entries. I tried parsing as an array (because the HTML definition says it should pass key pairs) but that gives me a run-time error saying the appropriate named variable isn't an array. I've tried submitting to a script that displays php_info and the _POST vars entry lists just the single value. I know that SELECT MULTIPLE is rarely used, but has anybody tried this before and encountered similar problems. any pointers on how to retrieve all the selected options gratefully received.
Multiple Form And Processing With A Process.php File
I got a multiple result form from dhtmlgoodies.com that looked like it was working great, but for some reason it will not send the multiple selected results to the process file. Below is the actual form file and a screen capture of what it is. then below that will be the example basic process file that should grab the arrays and echo them back. Code:
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:
Processing Data From Multiple Multi-line Textareas Into A Multi-dimensional Array
I know that this sounds like something overly complex - because it is. However, if I can keep the user interface the way it is, my users will be ultra happy! That is the goal... In general, this is an inventory receiving piece of an overall larger web-based ERP system. What I have is a form in which I have a dynamic number of multline textareas for inputting (possibly barcode scanning in) many serial numbers per line item recieved. For example: lineitem01 = widget01; qtyReceived = 2; lineitem02 = widget02; qtyReceived = 3; lineitem03 = widget03; qtyReceived = 10; This would display a form that will generate 3 textarea elements (1 per lineitem received). Inside each textarea element will be input the serial numbers for each of the widgets received per lineitem. i.e. 2 serial numbers will be entered for widget01; 3 for widget02; and 10 for widget03; So, what I am trying to do is pass this data over, possibly as a multi- dimensional array to another form ( or possibly $_SERVER['PHP_SELF'] ) to update a MySQL database to store the widget/serial numbers.
Multiple Dynamic Drop Down Population
I have a table with 3 pieces of data that I would like to use to dynamically populate 3 drop downs using javascript. The fields are state, orgname, office. If it's not already obvious, I'd like orgname drop down to change when a state is selected and I would like office drop down to change when an orgname is selected. I can do this with multiple tables but am having difficulty getting it to work when the data is in the same table. Below is the code to get state and orgname from separate tables(the code reflects one table and is broken in the below state). It's the best I can come up with and I can see why it doesn't work but I know there must be a way to pull all the pieces from a single table. <code> $list=$_SESSION['list']; if(isset($list) and strlen($list) 0){ $quer=mysql_query("SELECT DISTINCT orgname,org_id FROM organization WHERE state=$list ORDER BY orgname"); }else{$quer=mysql_query("SELECT DISTINCT orgname FROM organization ORDER BY orgname"); } $quer2=mysql_query("SELECT DISTINCT state FROM organization ORDER BY state"); //first drop down echo "<select name='state' onchange="reload(this.form)"><option value=Ɔ'>Select one</option>"; while($state = mysql_fetch_array($quer2)) { if($state['org_id']==@$list){echo "<option selected value='$state[state]'>$state[state]</option>"."<BR>";} else{echo "<option value='$state[state]'>$state[state]</option>";} } echo "</select>"; //next drop down echo "<select name='org'><option value=''>Select one</option>"; while($org = mysql_fetch_array($quer)) { echo "<option value='$org[org_id]'>$org[orgname]</option>"; } echo "</select>"; </code>
Selecting Multiple Dynamic Checkboxes From A Database
I have dynamic checkboxes with values populated from a database table and want to set the boxes to selected based on values from another table. Basically, I have a table of users, a table of categories (populates the checkboxes) and a table that is populated when multiple categories are selected per user (the table used to set the checkboxes to selected)..hope this is clear..Its for an 'Edit user' page, displaying the info for the user. Code:
$_POST Behavior From Input=submit Vs Input-type=button
I have been trying to solve an annoying behavior with PHP (I think). Maybe some of you have encountered the same and have some ideas. I have an html form and I use an <input type="button"> element with the onClick event that calls a javascript funtion. Once the script's content has been processed, I execute the form.submit() directive. I would like to combine the html form and the PHP script into one, and use action="<?php echo($PHP_SELF) ?>". When the html form has <input type="button" name="theButton" value="thisisthetrigger" onclick="doThis(this.form)">but PHP cannot 'read' the value of $_POST["theButton"] after form.submit(). If I substitute the <input type="button"> for <input type="submit"> then PHP reads the value just fine. Some may argue to just use the latter option, but that will cost me a trip back to the server to basically do a lot of validation that can be very easily accomplished on the client side.
Multiple File Upload From Client Pc To Server Without Using <input Type="file"> Cont
I am working on a application which requires me to upload the contents of all the files from a particular folder in clent pc to the server. In my code i just want to mention the folder name which may contain any number of files.Folder name will always be fixed. I dont want to use <input type=file > control. Is there any way i can achieve this using FTP or any other way in PHP.Any help will be greatly appreciated.
Dynamic Form Fields/multiple Page Form?
It is for a friends out of print booksite, where visitors can request multiple books to be searched by adding one at a time to a cart (javascript), then once all added they submit to another form where they enter their personal details and all is sent through. The problem is at the moment they cannot change whats in the cart without refreshing the browser window and losing everything. 1) present for asking how many books they want to search for 2) display multiple rows of the same input fields depending on how many books they say they want to have searched for?i.e title|author|publisher|etc title|author|publisher|etc title|author|publisher|etc 3) when these are submitted they could see these above the next part of the form where they enter their details with the option to go back and delete/amend. 4) send all the info to my colleague. if so has anyone seen a similar script that I could take a look @ to see if I can hack it to suit my needs?
Processing
What I want to do is when a page loads I want my scripts to excute/finish and once that is done, I want to display a button that will tell the user to continue. How can I do this ?
Background Processing
What is the technique you use for background processing? Like when user submit a task, the user could then wait for the result by email or through a result page. I'm wondering how would they do that?
Xml File Processing
I have a site where another computer has uploaded files to my ftp domain an included an XML file with metadata about those files. What I'd like to do is scan through the XML files, insert the data nito a database and then moved the files to a 'Processed' folder so that they are not scanned on the next run. What I'm worried about is that if at any stage of this process, something goes wrong, then it will have inserted data without moving the files, or moved the file without inserting data, etc. Is there a way to rollback the transaction in MySQL? I am comfortable monitoring for errors within my PHP script.
Graphics Processing ?
can php do a graph by loading some integar values. i want to have a year on the x axis and percentage from 0 to 100 on the y axis.
Processing SMS Application
I want to write an application that can accept and process sms messages sent to it from cell phones. But I have no idea how to setup and link a specific phone number to my application. I searched this group and found numeous posts about how to send out sms messages but not how to accept them.
Order Processing:
i tried to make a order processing script using php but I'm having difficulty getting it to process this code: 1 long sleeve shirt $32, 1 short sleeve shirt $27, buy 2 short sleeves get both for $50, buy 3 or more $23 each this is the process order i tried to create: PHP Code:
Form Processing
I created a form and after submission it is checked if the user filled out certain field. If not he/she kan try a Try Again button and is returned to the page with the form. I constructed the form so the different textfields after the user clicks Try Again still contain the details she previously filled out. This works fine with ordinary text input fields, but not at all with checkboxes and a textarea, presumably because these fields do not have a 'value' attribute that could contain the $textarea or $checkbox variables. Hope I made myself clear.
Image Processing
* how can i detect the "motion through image processing " * how can i detect the "direction of motion through image processing " * how can i detect the "size of the object through image processing " * using visual basic * or any idea which help to make it easy
Processing Video With PHP
Is there a Linux PHP module so that I can process web cam video with Linux PHP from multiple USB ports? (I'm working on a video surveillance idea since I found out that my office spent a whopping $30K on their 8 camera system and were told it would cost $13K for 3 more cameras to be added. If that inspires you to do your own system, please do so -- I love it when people can make big cash with Linux!) For discussions here, realize that I'm talking about wired, not wireless, video cams. Many big corps don't allow wireless video traffic because it can be jammed with sophisticated tools. I'm also interested in only non-motion activated video because that's what the security guard needs to see. (That is, unless I use motion activated video stream for what gets written to disk, but non-motion activated video stream goes straight to the security guard. I could combine the two cameras under a single camera bubble in the ceiling.) Here's some questions about this if you happen to have ideas. 1) How do I not only record the video to hard drive, but serve it up to a monitor that the security guard can watch? 2) How do I provide real time video to the security guard, yet for what gets written to disk, record only time slices with lossy compression so that it uses less disk space? 3) So, if you answer the separation question in #2, how do I use PHP to convert video input on USB into time-sliced, lossy compression recordings to disk? 4) Is it possible to have a single Linux PC process the video from multiple USB ports, simultaneously? 5) Any ideas on the cheapest way to run USB over very long distances in an office? I hear I can use ordinary, powered hubs to repeat the signal, but this requires that I get an electrician to wire me an AC plug in the drop ceiling somewhere. Has anyone used ordinary CAT 5 to carry the signal longer? 6) Using this API, how much can I realistically write to disk in a usual office setting? I'm trying to figure out how much disk space I'll need. The idea would be that the Linux PC would store the video data on disk up to about x number of months, making nightly backups to a DVD-RAM drive that ejects automatically every week. The IT Operations Manager would then replace the DVD-RAM disc on Friday and store the other offsite for long-term retention.
Form Processing
I have a file (index.html) and this file will be submitting some information to a PHP file (file1.php). In file1.php, there will be a few tests on the data submitted, and depending on weather or not the data is acceptable or not, it will eather forward the data to another PHP file (file2.php) or return to index.html with an error. My problem is I don't know of any way to forward the data submitted to file1.php, to file2.php. Adding to the original problem is that file2.php is located on a different server, and its contents will not be given out.
Processing Checkboxes
If I choose more than one item in a checkbox list, PHP feeds back only the last choice. Why? For example, I select 'dogs', 'cats' and 'mice', it sets the variable to 'mice' only.
Array Processing
How may I concatenate the index respective questions and answers into one string per index using ONE foreach loop? I do not want to use numerical indexes just the named ones as below. In other words, in one foreach loop, if possible, I want to have the results as question0+answer0 and question1+answer1 in 2 separate strings entered into an array. Array ( [0] => Array ( [0] => question0 [1] => question1 ) [QUEST] => Array ( [0] => question0 [1] => question1 ) [ANSW] => Array ( [0] => answer0 [1] => answer1 ) [1] => Array ( [0] => answer0 [1] => answer1 ) )
Form Processing
i am currently building a site that will provide a free e-mail service hosted by bigmailbox.com. i am also providing a community area, where users can sign-up and post messages. i was wondering if there would be a way to combine the form for the e-mail program with the form for the community and add the same username and password to both programs. here's what i would like to do: have one form that would include several different fields. upon submitting the form, i would like for some of the variables to be posted into my mysql database, and other variables (some of the same ones posted to the database) be passed to a cgi script on bigmailbox.com's servers.
Word Processing
I use forms (inside php scripts) for adding or changing text on my homepage. I wonder if there is some simple freeware word processing program that I can install on the remote server instead of forms. Which could do simple tasks like change font size or font color and choosing different styles. Or even better a php scrip that do that and is easy to integrate in ones code.
Validate Without Processing
i wanna validate my form before the process operation i don't wanna let my visitor see the error before the page load again i tried this with javascript but it has alot of errors i wanna simple php code for this .
Urdu Processing
i am working on a project in which i m developing a large urdu database, i m using EasyPHP(PHP4.3.10 and mysql4.1.9).for the database developed in mysql i developed a search module that is working correctly with the data in english language. but when i tried to retrieve records of Urdu language the same module didn't worked for the urdu language. i have searched a lot on internet for this but m not getting any solution to this problem. that the same module which works for english language but not for Urdu however with PHP and Mysql supports unicoded data.either it returns a blank page or it shows groups of question marks.but not the urdu data.
Image Processing
is there a way to convert jpg to tiff ?.. i googled about this and i can see only the coversion from tiff to jpg.. can anyone please help me on this ?
Form Processing
Been working on this for weeks and am quite frustrated that none of my varied modifications have made much of a difference. Is anybody able to help me out with this? I have abbreviated the code to highlight the problem areas. When the form data is emailed, if more than one checkbox (each with a distinct name & value), is checked, the info output in the email of selections #2 and #3 are repeated 2 - 3 times. Other than that small glitch, everything works perfectly. Code:
Processing Using Javascript?
Lets suppose I have a form running on my website. It is a 2-3 step wizard which calculates the price of a product based on the options chosen. I want this form to be available for use on other websites (affiliates). I think this is done in Javascript - a javascript code is given to the affiliates which pulls the form from the main site and displays it on the affiliate site. I also want the whole process to take place on the affiliate website, and results to be displayed there. What do I need to search for? Any pointers? I need to learn how to do this, and I have very little idea on how to proceed.
Form Processing
I'm trying to build a registration form. I have the form completed and everything. The action of the form is currently on _Server['PHP_Self'] so I can view if the script is working without actually inserting anything in a database. I currently new to PHP, so I can't understand everything on why it's not working properly. I have 6 input fields , for the user to put in. Here is the code I currently have. The problem I'm having is I have this certain line in the code if ( eregi('^[[:alnum:].'-]$', stripslashes($name) ) ) to check for openspaces or anyother character. Now I have it saying that if it is true, echo a line, so I can see it is currently working. The problem is even is there is only letter in it, it still does the 'else' function. I don't understand why. Code:
Form Processing
I have a MS Access database which holds my products. On my products.php page i use PHP to access the products and output them in a list on the page. As well as displaying the results i echo out a text field after each record displayed called 'code', which is for the user to enter the product code of the item they wish to buy into. Because text field will appear after every record in the database i have called it 'code' in order for me to then have some php code submit all of the fields which the user has filled out and place them in a single field within my database and have each order nuber separated by a comma. Code:
Image Processing In Functions.
I have script (main.php) that calls a secondary script (image.php) that produces a graphic. The invocation in main.php is like this... print "<img src=" . chr(34) . "image.php?option=$draw" . chr(34) . ">" What I would like to do is incoporate all the code contained in image.php into my main.php as a function. As it currently stands if I do this, I get an error message saying that the headers already sent.
Credit Card Processing...
I would like my users on my site to be able to pay with credit cards and I need an "immediate" validation and transfer... Can anyone recommend from experience any good and affordable way? Coding PHP is not a problem.....
Processing Html Forms
I am using php to insert values from an HTML <form> into a mySQL database. I am sending the data using method=post as some of the data may be quite large. Everything works 100% fine except for 1 thing values from the form that are hidden e.g. (<input name="auth" type="hidden" value="105"> ) are passed ok to the php script, but the mySQL insert query fails! I know this because an echo $auth; produces 105, but no data is entered into the mySQL table. If I change the form to: <input name="auth" value="105">, the mySQL insert query works fine! Data is inserted into the mySQL table! I have searched high and low to figure out what is going on. I am thinking that it is a fairly simple problem about how hidden values need to be passed, but I simply can't find the answer ;
String Processing Question
Given a string: 'aaa bbbb cccc' or a string: 'aaaa bbb cc' I want to find and delete any word within a string with 3 or less chars. so I would get: 'bbbb cccc' 'aaaa' as results after processing. How would I do this in PHP?
XML String Processing Problem
I have to retrive the Time value from the following xml tag. <test Time="8/23/2006 06:39:31 PM" /> I have written the following code for reading time: $testRecord->get_attribute("Time"); I am able to read time value as "8" instead of Ǝ/23/2006 06:39:31 PM" from the xml string. The entire string after the character "/" is discarded
Perl DBI/XML Processing Versus PHP ?
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl XML, a Perl data munging book and so on. Alot of the PHP books seem to be mainly on building sites and connecting to databases, but I haven't checked them all and I have most of the Perl books. One problem is that some of the Perl stuff is hard to get on Activestate Perl for windows, so I may have to try to explain to them why I think it should be done in Perl and why I need a linux login to do it, etc. I'm not that familiar with PHP, but am looking for comments on this.
Word Processing Function
i've been wanting to design a simple for that allows users to input data and then allows me to seperate the data into individual words so that i can seperate last name and first name and with java i could use the tokenizer class but am unsure if there is a similar PHP function in its library, could anyone help me out?
Processing GET And POST Variables
Below is a function adapted from one found in phpMyEdit.class.php http://platon.sk/projects/release_l...hp?project_id=5 phpMyEdit is a form generator for PHP/MySQL. I think this function works great, especially for forms where data is redisplayed due to failed validation of user input. I wonder what the opinion of other PHP users would be. function get_cgi_var($name, $default_value = null) { // From the phpMyEdit project // Usage: $name = get_cgi_var('name'); static $magic_quotes_gpc = null; if ($magic_quotes_gpc === null) { $magic_quotes_gpc = get_magic_quotes_gpc(); } global $HTTP_GET_VARS; $var = @$HTTP_GET_VARS[$name]; if (! isset($var)) { global $HTTP_POST_VARS; $var = @$HTTP_POST_VARS[$name]; } if (isset($var)) { if ($magic_quotes_gpc) { if (is_array($var)) { foreach (array_keys($var) as $key) { $var[$key] = stripslashes(trim(strip_tags($var[$key]))); } return $var; } else { $var = stripslashes(trim(strip_tags($var))); } } } else { $var = @$default_value; } return $var; // If data is displayed/posted using htmlspecialchars($var) // return @$HTTP_POST_VARS ? html_entity_decode($var, ENT_QUOTES) : $var; }; $name = get_cgi_var('name');
Processing Strings As Code
I'm trying to make a generic form processor, but I have several spots whre I need to include custom code (validation, UPDATEs, etc), now I could have four seperate files to include the necessary code but I think that would be messy. Is there a way I can define a bunch of strings with stuff like: $validate="if ($list_data = 5) { $err = "Data Sould be 5."; }"; and then insert in so that becomes part of the running code and not a string...
Processing Dyn. Form When I Don't Know How Many Rows
I build a form dynamically from a mysql database, and then name each record to build a form. How do I "display" it once it is submitted if I don't know beforehand hand many rows, and therefore, how many IDs there are going to be? Code:
Processing Data Using A Web Interface
I have a script that processes a lot of data. Ideally it would be run from the CLI, however I want to run it from a browser, but I don't want the browser hanging on me forcing me to restart from scratch. My question is, how do I output data to the browser when something is processed when it is processed instead of having all the output come at once when the script is done? Is there a set amount of time where the page processing the data might time out? If so, how do I change this timeout to when the script is done?
Form Processing Within PHP_Self
I am running forms from one script, posting at PHP_Self... So, whenever I want to process some submitted data, I use PHP Code:
Processing Form Data
I've just built a form that enables users to pick a city from a pull down menu. On the processing page i want to assign the city picked to a variable. So lets say the name of the form is "city" and i want to assign the city picked to a variable. $citychosen = ******** What do i use to get the chosen city there. I want to use the variable in the next part of the page which uses an SQL query to show info about the city chosen. So the SQL query would look like this Select * from table1 Where city=$citychosen .
|