Solved

General design idea for survey entry screen

Posted on 2004-03-29
4
185 Views
Last Modified: 2006-11-17
We have an online survey that consists of several categories and with radio buttons for each category

Eg:

Main Category 1
   Option 1            R   R   R  R
   Option 2            R   R   R  R
   Option 3            R   R   R  R
Main Category 2
   Option 1            R   R   R  R
   Option 2            R   R   R  R
   Option 3            R   R   R  R

and so on where R is a radio button.

The categories, options and responses are stored in a database and retrieved/saved as needed.  Currently my php page loops through all the rows from the database and does an echo to build the form elements. This is all working fine, but is there a better way to do it? I need to save the responses and allow for modification too.

Any ideas on preferred approaches are appreciated.
Thanks!
0
Comment
Question by:svid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:duerra
ID: 10705637
It seems like a good setup to me.  Provided that it's logical, and that you know what you're expecting in the event that you want to add more options later on, dynamically, I tend to think your setup should work well.
0
 
LVL 5

Author Comment

by:svid
ID: 10705720
Thank you.

To be a little more specific I would like to know is using a series of echo statements to build the tr /td/ <input type="radio" tags a good way to do things? One approach I was looking at was to create the xml in place of echo's and have a stylesheet attached to it to display the output. Another approach was using templates like Smarty (I don't know if it makes sense in this case)  - but I am new to PHP and its all a little overwhelming.

So any help would be great.

0
 
LVL 11

Assisted Solution

by:Paul S
Paul S earned 40 total points
ID: 10707444
if the survey is always the same (static) then you can build it in xml or css or whatever you want, but for retrieving the data enterned i would use php it is the easiest. if the survey is not static then php combined with css/xml would probably be the best.
0
 
LVL 4

Accepted Solution

by:
duerra earned 35 total points
ID: 10707741
If you're new to PHP, a templating engine would probably be a little deep to get into.  It would be pretty easy to simply loop over the values that you want to put in, if you embed some PHP into your HTML page, however.  I don't know exactly how you're doing it right now, so it's difficult to come up with a specific example, but do whatever queries you need to, and then loop through an echo statement that prints out a <input type="blah" value="more blah">, or something along that line.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question