<?php
$formURL = "http://spreadsheets.google.com/formResponse?formkey=dDVuRGlwQjgxSWxxUHV3dFN2TW9NdWc6MA&ifq";
function buildMultipleChoice($group, $heading, $options)
{
echo '<div>' . $heading . '</div>';
echo '<ul style="list-style-type: none;">';
foreach ($options as $option)
{
echo '<li><input type="radio" name="entry.' . $group . '.group" value="' . $option . '">';
echo $option;
echo '</li>';
}
echo '</ul>';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Google Forms</title>
</head>
<body>
<?php
echo '<form action="' . $formURL . '" method="POST">';
buildMultipleChoice(0, 'What is your favourite colour?', array('Red', 'Green', 'Blue'));
buildMultipleChoice(1, 'What is your favourite fruit?', array('Apple', 'Banana', 'Pear'));
echo '<input type="submit" name="submit" value="Submit">';
echo '</form>';
?>
</body>
</html>
Комментариев нет:
Отправить комментарий