Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
<?php
$saving = $_REQUEST['saving'];
if ($saving == 1) {
$data1 = $_POST['school'];
$data2 = $_POST['computer'];
$data = $data1 and $data2;
$file = "poll.txt";
$fp = fopen($file, "a","<br>") or die("Couldn't open $file for writing!");
fwrite($fp, $data) or die("Couldn't write values to file!");
fclose($fp);
echo "Saved to $file successfully!";
}
?>
<?php
$saving = $_REQUEST['saving'];
if ($saving == 1) {
$data1 = $_POST['school'];
$data2 = $_POST['computer'];
$data = $data1 .' '. $data2;
$file = "poll.txt";
$fp = fopen($file, "a") or die("Couldn't open $file for writing!");
fwrite($fp, $data) or die("Couldn't write values to file!");
fclose($fp);
echo "Saved to $file successfully!";
}
?>
$data = $data1 .' '. $data2;
<?php session_start(); ?>
<?php
$saving = $_REQUEST['saving'];
if ($saving == 1) {
$data1 = $_POST['school'];
$data2 = $_POST['computer'];
$data = $data1 ."\n". $data2 ."\n";
$file = "poll.txt";
$fp = fopen($file, "a") or die("Couldn't open $file for writing!");
fwrite($fp, $data) or die("Couldn't write values to file!");
fclose($fp);
echo "Saved to $file successfully!";
}
?>
<html>
<head>
<title> Ênquete </title>
</head>
<body>
<?php
If (isset($_POST['send'])) {
$school = $_POST['school'];
$computer = $_POST['computer'];
$email = "ruben_9363@live.nl";
$onderwerp = "Formulier";
if (mail($email,$onderwerp,$school,$computer)) print "Bedankt voor het invullen!";
} Else {
?>
<form name="form1" action="poll.php?saving=1" method="post">
<table border="1">
<tr>
<td></td>
<td> Leuk.</td>
<td> Minder leuk.</td>
<td> Saai.</td>
</tr>
<tr>
<td>Wat vind je van school? </td>
<td align="center"><input type="radio" name="school" value="Leuk" /></td>
<td align="center"><input type="radio" name="school" value="Middel" /></td>
<td align="center"><input type="radio" name="school" value="Saai" /></td>
</tr>
<tr>
<td>Wat vind je van computeren?</td>
<td align="center"><input type="radio" name="computer" value="Leuk" /></td>
<td align="center"><input type="radio" name="computer" value="Middel" /></td>
<td align="center"><input type="radio" name="computer" value="saai" /></td>
</tr>
<tr>
<td><input type="submit" name="send" value="Verzenden!" />
</tr>
</table>
</form>
</body>
</html>
<?php
}
?>
</body>
</html>
$data = $data1 ."\r\n". $data2 ."\r\n";
$data = 'School: ' . $data1 ."\r\n" . 'Computeren: ' . $data2 ."\r\n";
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.