hi Leute... ich hab ein Problem, ich müsste die Variablen auf mehreren seiten übernehmen? wie kann ich das am einfachsten machen? wenn ich die Datei "error.php" öffne, müsste ich auf die varibalen $thema1-12 und ergebnis 1-12 zugfreifen können.
kann mir da jemand helfen?
kann mir da jemand helfen?
Code:
<?php
if (isset($_POST["ergebnis"])) {
// Aktuelle Sperre 1 Minute
// 30 Tage Sperre time()+60*60*24*30
setcookie("abgestimmt","ja",time()+60);
}
//Vor der Installation
$thema1 = "Waren Plakate ausreichend und gut sichtbar vorhanden?";
$auswahl1 = array("Nein","Ausreichend","Ja");
$thema2 = "War die Information klar und verständlich?";
$auswahl2 = array("Nein","zum Teil","Ja");
$thema3 = "Wenn nicht, konnte dein lokaler EDV-Supporter helfen?";
$auswahl3 = array("Nein","zum Teil","Ja");
$thema4 = "Wurdest du per MEMO über die Umstellung auf ICC3 informiert? ";
$auswahl4 = array("Nein","weiss nicht","Ja");
$thema5 = "Wusstest du, dass am Samstag PC`s nur eingeschränkt zur Verfügung standen?";
$auswahl5 = array("Nein","weiss nicht","Ja");
//Nach der Installation
$thema6 = "Hast du einen ICC3 Guide erhalten?";
$auswahl6 = array("Nein","Gesehen","Ja");
$thema7 = "War der Guide hilfreich?";
$auswahl7 = array("Nein","zum Teil","Ja");
$thema8 = "Konntest du dich am PC / NC anmelden?";
$auswahl8 = array("Nein","mit Hilfe","Ja");
$thema9 = "Waren alle Applikationen installiert?";
$auswahl9 = array("Nein","zum Teil","Ja");
$thema10 = "Haben alle Programme funktioniert?";
$auswahl10 = array("Nein","zum Teil","Ja");
$thema11 = "Hast du Support benötigt? ";
$auswahl11 = array("Nein","zum Teil","Ja");
$thema12 = "War der Support ausreichend?";
$auswahl12 = array("Nein","zum Teil","Ja");
//Vor der Installation
$anzahl1 = count($auswahl1);
$anzahl2 = count($auswahl2);
$anzahl3 = count($auswahl3);
$anzahl4 = count($auswahl4);
$anzahl5 = count($auswahl5);
//Nach der Installation
$anzahl6 = count($auswahl6);
$anzahl7 = count($auswahl7);
$anzahl8 = count($auswahl8);
$anzahl9 = count($auswahl9);
$anzahl10 = count($auswahl10);
$anzahl11 = count($auswahl11);
$anzahl12 = count($auswahl12);
?>
<html>
<head>
<title>ICC3-Umfrage</title>
<link rel='stylesheet' type='text/css' href='css/umfrage.css'>
</head>
<body>
<img src='bild/itswiss.gif' width='145' height='83'></br>
<form method='post' action='<?php echo $PHP_SELF; ?>'></br>
<fieldset><legend><font color='#FF0000'><h2>Vor der Installation</h2></font></legend>
<p>
<?php
//Vor der Installation
echo "<h4> $thema1 </h4>";
foreach ($auswahl1 as $key1=>$eintrag1) {
echo "<input type='radio' name='ergebnis1' value='$key1'> $eintrag1<br>\n";
}
echo "<h4> $thema2 </h4>";
foreach ($auswahl2 as $key2=>$eintrag2) {
echo "<input type='radio' name='ergebnis2' value='$key2'> $eintrag2<br>\n";
}
echo "<h4> $thema3 </h4>";
foreach ($auswahl3 as $key3=>$eintrag3) {
echo "<input type='radio' name='ergebnis3' value='$key3'> $eintrag3<br>\n";
}
echo "<h4> $thema4 </h4>";
foreach ($auswahl4 as $key4=>$eintrag4) {
echo "<input type='radio' name='ergebnis4' value='$key4'> $eintrag4<br>\n";
}
echo "<h4> $thema5 </h4>";
foreach ($auswahl5 as $key5=>$eintrag5) {
echo "<input type='radio' name='ergebnis5' value='$key5'> $eintrag5<br>\n";
}
?>
</fieldset>
</br></br>
<fieldset><legend><font color='#FF0000'><h2>Nach der Installation</h2></font></legend>
<?php
echo "<h4> $thema6 </h4>";
foreach ($auswahl6 as $key6=>$eintrag6) {
echo "<input type='radio' name='ergebnis6' value='$key6'> $eintrag6<br>\n";
}
echo "<h4> $thema7 </h4>";
foreach ($auswahl7 as $key7=>$eintrag7) {
echo "<input type='radio' name='ergebnis7' value='$key7'> $eintrag7<br>\n";
}
echo "<h4> $thema8 </h4>";
foreach ($auswahl8 as $key8=>$eintrag8) {
echo "<input type='radio' name='ergebnis8' value='$key8'> $eintrag8<br>\n";
}
echo "<h4> $thema9 </h4>";
foreach ($auswahl9 as $key9=>$eintrag9) {
echo "<input type='radio' name='ergebnis9' value='$key9'> $eintrag9<br>\n";
}
echo "<h4> $thema10 </h4>";
foreach ($auswahl10 as $key10=>$eintrag10) {
echo "<input type='radio' name='ergebnis10' value='$key10'> $eintrag10<br>\n";
}
echo "<h4> $thema11 </h4>";
foreach ($auswahl11 as $key11=>$eintrag11) {
echo "<input type='radio' name='ergebnis11' value='$key11'> $eintrag11<br>\n";
}
echo "<h4> $thema12 </h4>";
foreach ($auswahl12 as $key12=>$eintrag12) {
echo "<input type='radio' name='ergebnis12' value='$key12'> $eintrag12<br>\n";
}
?>
</fieldset>
</p>
<?php
if(!isset($submit)) // noch nicht abgeschickt
{
echo "<input type='submit' value='Daten senden' name='submit'>";
}
if(isset($submit))
{
$test = 0;
if($test == 0)
{
for($x=1;$x<13;$x++)
{
$result = "ergebnis".$x;
$thema = "thema".$x;
if(!isset(${$result}))
{
// echo "Beantworten Sie bitte die Frage $x '${$thema}'<br>";
$test = 1;
}
}
}
if($test == 1)
{
include "error.php";
exit;
}