?
Solved

Make poll system

Posted on 2013-05-28
4
Medium Priority
?
177 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
[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
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Ahmed Hussein earned 2000 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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Suggested Courses

762 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