S
stephen10998
Guest
There are several different scripts here. It's for a test that a person takes and then it accesses a RTF document and puts in the name and date of the user.
information.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<h1><p align="center">
<img src="red_rose2.jpg" alt="" scr="" />
Certification
<img src="red_rose2.jpg" alt="" /></p>
</h1>
<p>You too can earn your highly respected coolness certification from the world famous University of Capt. Dickweed</p>
<p>Simply answers the questions below</p>
<form action="score.php" method="post">
<p>Your name <input type="text" name="name" /></p>
<p>What is being cool all about?</p>
<ol>
<li><input type="radio" name="q1" value="1" />
Strutting.</li>
<li><input type="radio" name="q1" value="2" />
Chewing gum.</li>
<li><input type="radio" name="q1" value="3" />
Pelvic thrusting. </li>
</ol>
<p>Why is being cool so important?</p>
<ol>
<li><input type="radio" name="q2" value="1" />
Because vanilla ice was cool and look how good he turned out. </li>
<li><input type="radio" name="q2" value="2" />
Because being cool is the only way you can compensate for your very small penis. </li>
<li><input type="radio" name="q2" value="3" />
Because I'm a deadbeat. </li>
</ol>
<p>What is the most important thing to you?</p>
<ol>
<li><input type="radio" name="q3" value="1" />
Family. This is the wrong answer</li>
<li><input type="radio" name="q3" value="2" />
Yourself. </li>
<li><input type="radio" name="q3" value="3" />
Milkshakes. </li>
</ol>
<p align="center"><input type="image" src="certify.jpg" border="0" /></p>
</body>
</html>
score.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>scoring test...</title>
</head>
<body>
<?php
$q1 = $_POST['q1'];
$q2 = $_POST['q2'];
$q3 = $_POST['q3'];
$name = $_POST['name'];
if(($q1=='') || ($q2=='') || ($q3=='') || ($name=='')) {
echo "<h1>
<p align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Sorry:
<img src=\"red_rose2.jpg\" alt=\"\" /></h1>
<p>You need to fill in your name and answer all questions stupid.</p>";
} else {
$score = 0;
if ($q1 == 3) {
$score++;
}
if($q2 == 3) {
$score++;
}
if($q3 == 2) {
$score++;
}
$score = $score / 3 * 100;
if($score < 50) {
echo "<h1>
<p align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Sorry:
<img src=\"red_rose2.jpg\" alt=\"\" /></p></h1>
<p>You need a score at least 50% to pass the exam.</p>";
} else {
$score = number_format($score,1);
echo "<h1 align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Congrats!
<img src=\"red_rose2.jpg\" alt=\"\" /></h1>
<p>Well done ".$name.", with a score of ".$score."%, you have passed the exam. </p>";
echo "<p>Click here for the certificate.</p>
<form action=\"rtf.php\" methods=\"post\">
<div align=\"center\">
<input type=\"image\" scr=\"certificate.gif\" border=\"0\">
</div>
<input type=\"hidden\" name=\"score\" value=\"".$score."\"/>
<input type=\"hidden\" name=\"name\" value=\"".$name."\"/>
</form>";
}
}
?>
</body>
</html>
rtf.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RTF document</title>
</head>
<body>
<?php
$name = $_POST['name'];
$score = $_POST['score'];
if(!$name || !$score) {
echo "<h1>Error:</h1>
<p>There was a problem with your test</p>";
} else {
header('Content-type: application/msword');
header('Conetent-Disposition: inline, filename=cert.rtf');
$date = date('F d, Y');
$filename = 'certificate.rtf';
$fp = fopen ($filename, 'r');
$output = fread( $fp, filesize($filename));
fclose ($fp);
$output = str_replace('<<NAME>>', strtoupper($name), $output);
$output = str_replace('<<name>>', $name, $output);
$output = str_replace('<<score>>', $score, $output);
$output = str_replace('<<mm/dd/yyyy>>', $date, $output);
echo $output;
}
?>
</body>
</html>
information.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<h1><p align="center">
<img src="red_rose2.jpg" alt="" scr="" />
Certification
<img src="red_rose2.jpg" alt="" /></p>
</h1>
<p>You too can earn your highly respected coolness certification from the world famous University of Capt. Dickweed</p>
<p>Simply answers the questions below</p>
<form action="score.php" method="post">
<p>Your name <input type="text" name="name" /></p>
<p>What is being cool all about?</p>
<ol>
<li><input type="radio" name="q1" value="1" />
Strutting.</li>
<li><input type="radio" name="q1" value="2" />
Chewing gum.</li>
<li><input type="radio" name="q1" value="3" />
Pelvic thrusting. </li>
</ol>
<p>Why is being cool so important?</p>
<ol>
<li><input type="radio" name="q2" value="1" />
Because vanilla ice was cool and look how good he turned out. </li>
<li><input type="radio" name="q2" value="2" />
Because being cool is the only way you can compensate for your very small penis. </li>
<li><input type="radio" name="q2" value="3" />
Because I'm a deadbeat. </li>
</ol>
<p>What is the most important thing to you?</p>
<ol>
<li><input type="radio" name="q3" value="1" />
Family. This is the wrong answer</li>
<li><input type="radio" name="q3" value="2" />
Yourself. </li>
<li><input type="radio" name="q3" value="3" />
Milkshakes. </li>
</ol>
<p align="center"><input type="image" src="certify.jpg" border="0" /></p>
</body>
</html>
score.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>scoring test...</title>
</head>
<body>
<?php
$q1 = $_POST['q1'];
$q2 = $_POST['q2'];
$q3 = $_POST['q3'];
$name = $_POST['name'];
if(($q1=='') || ($q2=='') || ($q3=='') || ($name=='')) {
echo "<h1>
<p align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Sorry:
<img src=\"red_rose2.jpg\" alt=\"\" /></h1>
<p>You need to fill in your name and answer all questions stupid.</p>";
} else {
$score = 0;
if ($q1 == 3) {
$score++;
}
if($q2 == 3) {
$score++;
}
if($q3 == 2) {
$score++;
}
$score = $score / 3 * 100;
if($score < 50) {
echo "<h1>
<p align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Sorry:
<img src=\"red_rose2.jpg\" alt=\"\" /></p></h1>
<p>You need a score at least 50% to pass the exam.</p>";
} else {
$score = number_format($score,1);
echo "<h1 align=\"center\">
<img src=\"red_rose2.jpg\" alt=\"\" />
Congrats!
<img src=\"red_rose2.jpg\" alt=\"\" /></h1>
<p>Well done ".$name.", with a score of ".$score."%, you have passed the exam. </p>";
echo "<p>Click here for the certificate.</p>
<form action=\"rtf.php\" methods=\"post\">
<div align=\"center\">
<input type=\"image\" scr=\"certificate.gif\" border=\"0\">
</div>
<input type=\"hidden\" name=\"score\" value=\"".$score."\"/>
<input type=\"hidden\" name=\"name\" value=\"".$name."\"/>
</form>";
}
}
?>
</body>
</html>
rtf.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RTF document</title>
</head>
<body>
<?php
$name = $_POST['name'];
$score = $_POST['score'];
if(!$name || !$score) {
echo "<h1>Error:</h1>
<p>There was a problem with your test</p>";
} else {
header('Content-type: application/msword');
header('Conetent-Disposition: inline, filename=cert.rtf');
$date = date('F d, Y');
$filename = 'certificate.rtf';
$fp = fopen ($filename, 'r');
$output = fread( $fp, filesize($filename));
fclose ($fp);
$output = str_replace('<<NAME>>', strtoupper($name), $output);
$output = str_replace('<<name>>', $name, $output);
$output = str_replace('<<score>>', $score, $output);
$output = str_replace('<<mm/dd/yyyy>>', $date, $output);
echo $output;
}
?>
</body>
</html>