Solved

General design idea for survey entry screen

Posted on 2004-03-29
4
180 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now