General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 15th, 2002, 09:54 PM
suzila suzila is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 5 suzila User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
collect data

hi there,

My project is about questionnaire. Sorry if you can't understand it very well.
After user select a questionnaire title, it will appear the questionnaire question in HTML format.
My problem is how to collect the data after the user have answer te question? because i want the data to
generate a bar chart just like a "POLL". Thank You very much.

Below is my coding to appear a questionnaire question after user had select the questionnaire title.
----------------------------------------------------------------------
<html>
<body >
<form method="post" action="" name="vq">
<?
$connection = mysql_connect("localhost","","");
$pd = mysql_select_db("myEsurvey", $connection);

$vqsql = "SELECT * from questionnaire WHERE title='$poll' ";
$vqresult=mysql_query($vqsql,$connection);

$i=1;
while($row=mysql_fetch_object($vqresult))
{
echo "<br><br><font face=verdana color=#000000 size=1><b>Soalan-$i :</b><br>$row->question<br><br></font>";
echo "<font face=verdana color=#000000 size=1><b>Jawapan:</b><br><br></font>";
echo "<input type=\"radio\" name=\"A\" value=\"$row->A\">";
echo "<font face=verdana color=#000000 size=1><b>A.</b>$row->A<br></font>";
echo "<input type=\"radio\" name=\"B\" value=\"$row->A\">";
echo "<font face=verdana color=#000000 size=1><b>B.</b>$row->B<br></font>";
echo "<input type=\"radio\" name=\"C\" value=\"$row->A\">";
echo "<font face=verdana color=#000000 size=1><b>C.</b>$row->C<br></font>";
echo "<input type=\"radio\" name=\"D\" value=\"$row->A\">";
echo "<font face=verdana color=#000000 size=1><b>D.</b>$row->D<br></font>";
$i++;
}
mysql_close();
?>
<input type="submit" name="submit" value="POLL">
</form></body></html>

------------------------------

Reply With Quote
  #2  
Old August 16th, 2002, 02:19 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
inside your <form> tag, you have a action pram, you need to set that to a file, that will process the data.

<form method="post" action="process_poll.php" name="vq">

then in the process_poll.php page, you have access to the variables created by the form

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > collect data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT