Solved

Make poll system

Posted on 2013-05-28
4
173 Views
Last Modified: 2013-06-05
Hi!

Have this included picture.

Have 2 questions and 1 Open question.

System must call a new webpage (php)
depending of what button is pressed.

How is the best way to make this system ?
Call the same php file using parameter transfer ?

Or is the best way to have multipel pages ?

Include my php file for the picture included.

<?php // RAY_EE_login.php
require_once('RAY_EE_config.php');
?>
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<title>Test system</title>

</head>

<body>
<link rel="stylesheet" href="default.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<table summary="Services, or Links box template" class="servicesT" cellspacing="1">
<tr><td colspan="2" class="servHd">Mine kontroller</td></tr>
<tr>
	<td class="servBodL" width="92%">Vernerunde #1</td>
	<td class="servBodL" width="8%"><input type="submit" id="GULKN" name="B1" value=">"></td>
</tr>
<tr>
	<td class="servBodL" width="92%">Årskontroll #2</td>
	<td class="servBodL" width="8%"><input type="submit" id="GULKN" name="B2" value=">"></td>
</tr>
</table>
<br>
<table summary="Services, or Links box template" class="servicesT" cellspacing="0">
<tr><td colspan="2" class="servHd">Mine Åpne kontroller</td></tr>
<tr>
	<td class="TESTE" width="92%">Vernerunde 020513</td>
	<td class="servBodL" width="8%"><input type="submit" id="GULKN" name="B3" value=">"></td>
</tr>
</table>
<br><br>
<table summary="Services, or Links box template" class="servicesT" cellspacing="0">
<tr>
	<td width="100%"><input type="submit" id="LOGGUT" value="Logg ut"></td>
</tr>

</table>


</body>
</html>

Open in new window


The questions is stored in my mysql database, and it can be more then 2 questions..
Using for loop here ?
Maby store the questions in a array ?
spr1.png
0
Comment
Question by:team2005
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Ahmed Hussein earned 500 total points
ID: 39201348
You can basicly change the submit buttons to Radio buttons with different values for each answer, and you can make simple javascript code that triggers when you click on one of the radio buttons like that:

<script type="text/javascript">
function submitForm(){
    document.getElementById("form_id").submit();
}
</script>
<form id="form_id" method="post" action="url to your php page">
     <input type="radio" name="answer" value="answer number 1" onclick="submitForm();"/>
</form>

Open in new window


and inside your php code you can basically get the value of the posted radio that way

<?php
  echo $_POST["answer"];
?>

Open in new window

0
 
LVL 2

Author Comment

by:team2005
ID: 39201499
Hi!

Customer want this to be buttons
0
 
LVL 4

Expert Comment

by:Ahmed Hussein
ID: 39201514
Make it radio and style it as a button.
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 39221448
thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

777 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