| | |
get data from a dynamic form
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2008
Posts: 12
Reputation:
Solved Threads: 0
hallo,
i ve created a dynamic form. A user can select The number of fields he d like to fill in (test creation)
Now in createxml.php i want to get the values in order to write them inside xml file. i have tried a lot but i can not do it. the last code i used which caused unfinishing loop with empty values was this
can u help me??????
i ve created a dynamic form. A user can select The number of fields he d like to fill in (test creation)
php Syntax (Toggle Plain Text)
echo '<form method="post" action="createxml.php">'; for ($i =1; $i <=$number; $i+=1){ // THE $NUMBER CONTAINS //VALUE -ok- echo '<fieldset width ="20%">'; echo '<legend class = "login">WRITE A QUESTION</legend>'; echo ' <blockquote align="center">'; echo 'QUESTION '.$i.' (DESCRIPTION):<br>'; echo '<textarea name="q".$i rows="3" cols="50"></textarea><br><br>'; echo 'ANSWEAR 1:<textarea name="q".$i."a1" rows="1" cols="50"></textarea><br>'; echo 'ANSWEAR 2:<textarea name="q".$i."a2" rows="1" cols="50"></textarea><br>'; echo 'ANSWEAR 3:<textarea name="q".$i."a3" rows="1" cols="50"></textarea><br>'; echo 'ANSWEAR 4:<textarea name="q".$i.a4" rows="1" cols="50"></textarea><br>'; echo '<input type="submit">'; echo '</form>';
Now in createxml.php i want to get the values in order to write them inside xml file. i have tried a lot but i can not do it. the last code i used which caused unfinishing loop with empty values was this
php Syntax (Toggle Plain Text)
echo "$number";//ok for ($i =1; $i <=$number; $i+=1){ $q.$i = $_POST['q'.$i]; echo "$q.$i";// empty echo "<br>"; $a.$i= $_POST["q".$i."a1"]; $a.$i= $_POST["q".$i."a2"]; $a.$i= $_POST["q".$i."a3"]; $a.$i= $_POST["q".$i."a4"]; echo "answear=".$_POST["q".$i."a4"];// empty echo "<br>"; }
can u help me??????
Last edited by peter_budo; Jan 18th, 2009 at 2:13 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: May 2007
Posts: 81
Reputation:
Solved Threads: 1
hey I see you posted this on www.devnetworkforums.net.. what the hell... check your answer there
•
•
Join Date: Jan 2009
Posts: 11
Reputation:
Solved Threads: 1
Try to fix this line
missing quote
PHP Syntax (Toggle Plain Text)
echo 'ANSWEAR 4:<textarea name="q".$i.a4" rows="1" cols="50"></textarea><br>';
echo 'ANSWEAR 4:<textarea name="q".$i."a4" rows="1" cols="50"></textarea><br>';missing quote
Last edited by peter_budo; Jan 18th, 2009 at 2:14 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- updating multiple rows with one form (PHP)
- How can show/view Infopath dynamic files(xml) without infopath in a computer (XML, XSLT and XPATH)
- Creating a dynamic query using MSSQL and PHP (PHP)
- PHP Dynamic Form HELP! (PHP)
- dynamic form filling (PHP)
- Storing dynamic form values in Arrays for display & insert (PHP)
- Insert Data in to Db from the Dynamic Rows (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: Can I use a variable from..........
- Next Thread: External JavaScript and PHP Problem
| Thread Tools | Search this Thread |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql startup stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend





