You are here: Re: form with dynamic questions « All PHP « IT news, forums, messages
Re: form with dynamic questions

Posted by Jerry Stuckle on 10/07/06 02:51

toffee wrote:
> Hi all,
>
> I've a mysql table where i stored a list of questions. My php script
> executes a query which yields a different number of questions every time; i
> used the loop function to create an input field for each question in the
> form; and dynamically referencing each input name with the question number
> i.e. question 1 is called q1, question 2 named q2, and so on.
> The data is submitted using POST. I then try to retrieve all the answers by
> doing a loop and using something like echo '$_POST['q'.$n.'']'; except the
> syntax doesnt seem to work.
> Can anyone please tell me what am doing wrong - or a better way of doing
> this.
>
> Many thanks
>
> T
>
>

Why not use an array? Then you can use $_POST["q[$n]"];

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация