.php?id=sample // ?> \n", $message); } ?> アンケート情報が指定されていません\n"; } $idfil = ereg_replace("/$bn", "/$id.txt", $myscript); if ((!$errmsg) && (!file_exists($idfil))) { $errmsg .= "
  • アンケート情報ファイルがありません\n"; } @ $fd = fopen($idfil, "r"); if ((!$errmsg) && (!$fd)) { $errmsg .= "
  • アンケートファイルを開くことができません\n"; } // タイトルをチェック $title = 'タイトルが指定されていません'; if (!$errmsg) { $line = fgets($fd, $maxline); list($key, $title) = split("[\t ]+", $line, 2); if ($key != "TITLE") { $errmsg .= "
  • 先頭行にタイトルがありません\n"; } } $mailto = ''; $mailfrom = ''; $sendvalues = ''; $commentvalues = ''; while ((!$errmsg) && (!feof($fd))) { $line = fgets($fd, $maxline); list($directive, $reminder) = split("[\t\n ]+", $line, 2); if ($directive == "MAILTO") { $mailto = chop(ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line)); } else if ($directive == "MAILFROM") { $mailfrom = chop(ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line)); } elseif ($directive == "SUBJECT") { $subject = chop(ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line)); } elseif ($directive == "SENDVALUES") { while (list($key, $val) = each ($_REQUEST)) { $sendvalues .= '$_REQUEST['; $sendvalues .= "$key"; $sendvalues .= '] = "'; $sendvalues .= "$val"; $sendvalues .= '"'; $sendvalues .= "\n"; } reset($_REQUEST); while (list($key, $val) = each ($_SERVER)) { $sendvalues .= '$_SERVER['; $sendvalues .= "$key"; $sendvalues .= '] = "'; $sendvalues .= "$val"; $sendvalues .= '"'; $sendvalues .= "\n"; } reset($_SERVER); } elseif ($directive == "COMMENTVALUES") { while (list($key, $val) = each ($_REQUEST)) { $commentvalues .= '$_REQUEST['; $commentvalues .= "$key"; $commentvalues .= '] = "'; $commentvalues .= "$val"; $commentvalues .= '"'; $commentvalues .= "\n"; } reset($_REQUEST); while (list($key, $val) = each ($_SERVER)) { $commentvalues .= '$_SERVER['; $commentvalues .= "$key"; $commentvalues .= '] = "'; $commentvalues .= "$val"; $commentvalues .= '"'; $commentvalues .= "\n"; } reset($_SERVER); } elseif ($directive != "") { break; } } // $pageno = 0 + intval($_REQUEST['pageno']); ?> enquete - <?php print($title); ?>

    "> \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "MESSAGE1") { print("

    \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "RADIO") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "radio"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); print("
    \n"); } elseif ($directive == "CHECK") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "checkbox"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); print("
    \n"); } elseif ($directive == "SUBTEXT") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; printf("%s", $msg); printf("\n"); } elseif ($directive == "VALUE") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; printf("%s", $msg); } else { printf("NAME=\"q%d\" ", $qno); printf("VALUE=\"%s\">%s", $value, $msg); } } elseif ($directive == "VALUE+") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; printf("%s", $msg); } else { printf("NAME=\"q%d\" ", $qno); printf("VALUE=\"%s\" checked>%s", $value, $msg); } } elseif ($directive == "TEXTBOX") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "textarea"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); printf("\n"); } elseif ($directive == "SUBMIT1") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); printf("\n", chop($msg)); } elseif ($directive == "RESET1") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); printf("\n", chop($msg)); } } fclose($fd); ?> \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "MESSAGE2") { print("

    \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "RADIO") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "radio"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); print("
    \n"); $valname = sprintf("q%d", $qno); printf("\n", $_REQUEST[$valname]); } elseif ($directive == "CHECK") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "checkbox"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); print("
    \n"); } elseif ($directive == "SUBTEXT") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; printf("%s: ", $msg); $valname = sprintf("q%dt%d", $qno, $value); print(htmlspecialchars($_REQUEST[$valname])); printf("\n", htmlspecialchars($_REQUEST[$valname])); } elseif (($directive == "VALUE") || ($directive == "VALUE+")) { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; if ($type == "checkbox") { $valname = sprintf("q%dc%d", $qno, $value); printf("\n", $_REQUEST[$valname]); if ($_REQUEST[$valname]) { print("●"); } else { print("○"); } } else { if ($value == $_REQUEST[$valname]) { print("●"); } else { print("○"); } } print("$msg"); } elseif ($directive == "TEXTBOX") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "textarea"; $value = 0; ++$qno; printf("Q%d: %s", $qno, $msg); $valname = sprintf("q%d", $qno); print("

    --\n");
    			print(htmlspecialchars($_REQUEST[$valname]));
    			print("\n--
    \n"); printf("\n", htmlspecialchars($_REQUEST[$valname])); } elseif ($directive == "SUBMIT2") { print("

    \n"); $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); printf("\n", chop($msg)); } elseif ($directive == "RESET2") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); printf("\n", chop($msg)); } } fclose($fd); ?> \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "MESSAGE3") { print("

    \n"); while (!feof($fd)) { $line = fgets($fd, $maxline); if (ereg("^END-OF-MESSAGE", $line)) { break; } print($line); } } elseif ($directive == "RADIO") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "radio"; $value = 0; ++$qno; $answer .= "\n"; $answer .= sprintf("Q%d: %s", $qno, strip_tags($msg)); $valname = sprintf("q%d", $qno); $answer .= sprintf(" %s:", $_REQUEST[$valname]); } elseif ($directive == "CHECK") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "checkbox"; $value = 0; ++$qno; $answer .= "\n"; $answer .= sprintf("Q%d: %s", $qno, strip_tags($msg)); } elseif ($directive == "SUBTEXT") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; $valname = sprintf("q%dt%d", $qno, $value); $answer .= sprintf(" %s %s:", $valname, chop($msg)); $answer .= "「" . $_REQUEST[$valname] . "」" ; $answer .= "\n"; } elseif (($directive == "VALUE") || ($directive == "VALUE+")) { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); ++$value; if ($type == "checkbox") { $valname = sprintf("q%dc%d", $qno, $value); if ($_REQUEST[$valname]) { $answer .= sprintf(" %s:", $valname); $answer .= "●"; $answer .= strip_tags($msg); } } else { if ($value == $_REQUEST[$valname]) { $answer .= "●"; $answer .= strip_tags($msg); } } } elseif ($directive == "TEXTBOX") { $msg = ereg_replace("^[^\t\n ]+[\t\n ]+", "", $line); $type = "textarea"; $value = 0; ++$qno; $answer .= "\n"; $answer .= sprintf("Q%d: %s", $qno, strip_tags($msg)); $valname = sprintf("q%d", $qno); $answer .= $_REQUEST[$valname]; } } fclose($fd); print("

    \n");
    	print(htmlspecialchars($answer));
    	print("\n
    \n"); // if ((strlen($mailto) > 0) && (strlen($mailfrom) > 0)) { $mailbody = $answer; if (strlen($sendvalues) > 0) { $mailbody .= "\n----\n"; $mailbody .= $sendvalues; } mb_language('Japanese'); mb_send_mail($mailto, $subject, $mailbody, 'From:' . $mailfrom); } else { print("\n"); } ?>
    \n", ereg_replace(">", ">", $commentvalues)); ?>