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
Solved

Make poll system

Posted on 2013-05-28
4
174 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

790 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