Gegen Bilderklau - Das Original

Registrierung Mitgliederliste Teammitglieder Suche Häufig gestellte Fragen Statistik Chat Karte Zur Startseite

Gegen Bilderklau - Das Original » Design, Website, Copyright » Homepagehilfe » Homepagehilfe - Archiv » [PHP & MySQL] PHP Quiz » Hallo Gast [Anmelden|Registrieren]
Letzter Beitrag | Erster ungelesener Beitrag Druckvorschau | Thema zu Favoriten hinzufügen
Zum Ende der Seite springen PHP Quiz
Beiträge zu diesem Thema Autor Datum
 PHP Quiz *on*the*run* 03.06.2009 21:32
 RE: PHP Quiz cll 04.06.2009 08:50
 RE: PHP Quiz .Senseless 04.06.2009 14:21

Autor
Beitrag « Vorheriges Thema | Nächstes Thema »
*on*the*run* *on*the*run* ist weiblich
Mitglied


Dabei seit: 06.04.2007
Beiträge: 192

PHP Quiz Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

Hallo,

ich hab ein Dodos Quiz erstellt, aber das funktioniert nicht, die Seite ist absolut weiß und ich weiß nicht warum, wird nichts angezeigt...

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
<?
/****************************************************
// Dodo's Quiz Script
// Copyrighted by Ying Zhang
// http://regretless.com/scripts
// No redistribution without authorization
// Script released under linkware
// that means LINK ME if you use it for your website
/****************************************************/


/***********************************************************
// With this script you should able to make multiple quizzes
// Just call your quiz with its number.
// For example: dodosquiz.php?n=1 will include your quiz_1.php
// No changes below this unless you REALLY KNOW what you are
// doing.
/***********************************************************/

/************************************************************
// Email function added Jan 30, 2003
// Made it compatible with PHP5 April 1, 2008
/************************************************************/

if(!$_GET['n'])
	exit;
require("quiz_".$_GET['1'].".php");
include("header.php");

if($_GET['action'] == "results") {
	$choices = $_POST['choices'];
	$total_choices = count($choices);
	if($total_choices == 0) {
		echo "<div class="rings">Error</div><div class="just">None of the questions is answered! Please <a href="javascript:history.back(1)">go back</a> and answer them!";
	} else {
		if($all_questions_answer && ($total_choices != count($questions_array))) {
			echo "<div class="rings">Error</div><div class="just">You didn't answer all the questions. Please <a href="javascript:history.back(1)">go back</a> and answer them!";
			footer();
			include("footer.php");
			exit;
		}

		/*********************
		 MATH QUIZ RESULT
		**********************/
		if($math_quiz) {
			// calculate the results

			// declare an array the same size as choices with only 0
			$total_results = count($results_array);
			for($j=1; $j <= $total_results; $j++) {
				$int_results_array[$j]=0;
			}
		
			
			for($i=1; $i <= $total_choices; $i++) {
				$num = trim($choices[$i]);
				// if the quiz taker has choosen the correct answer
				if($num == $correct_result)
					$int_results_array[$correct_result]=$int_results_array[$correct_result]+1;
			}


			$max_value = max($int_results_array);

			// if max_value is the same as the total number of questoins
			if($max_value == count($questions_array)) {
				$right = 1;
			}

			if($right)
				$final_result=$results_array[$correct_result];
			else {
				if($math_quiz_show_correct) {
					$total = count($questions_array);
					$final_result = $results_array[$math_quiz_show_correct_before]." It seems you have gotten <b>$max_value</b> out of $total correct.".$results_array[$math_quiz_show_correct_after];
				} else {
					$final_result=$results_array[$wrong_result];
				}
			}

			echo $final_result;

			email_admin($final_result);
			footer();
			include("footer.php");
			exit;
		}
		/*********************
		 END OF THE MATH QUIZ
		**********************/


		/*********************
		 TYPE 2 QUIZ RESULT
		**********************/
		if($quiz_2) {

			// test to make sure the level array is the same size as the result array
			if(count($level_array) != count($results_array)) {
				echo "<div class="rings">Error</div><div class="just">The quiz maker didn't provide valid info for this quiz. If you are the quiz maker, please make your level array the same size as your result array in order for the type 2 quiz to work!</div>";
				footer();
				include("footer.php");
				exit;
			}
			// calculate the results
			$total_num_correct = 0;
			
			for($i=1; $i <= $total_choices; $i++) {
				$num = trim($choices[$i]);
				// if the quiz taker has choosen the correct answer
				if($num == $correct_result)
					$total_num_correct++;
			}

			// now $total_num_correct should contain how many problems did the quiz taker get right.
			if($total_num_correct <= $level_array[1]) {
				$final_result = $results_array[1];
				echo $final_result;

				footer();
				email_admin($final_result);
				include("footer.php");
				exit;
			}

			$total_levels = count($level_array);
			for($j=1; $j < ($total_levels-1); $j++) {
				$k=$j+1;
				if(($total_num_correct > $level_array[$j]) && ($total_num_correct <= $level_array[$k])) {
					$final_result = $results_array[$k];
					echo $final_result;

					footer();
					email_admin($final_result);
					include("footer.php");
					exit;
				}

			}

			// else the final result must the be the last
			$final_result = $results_array[count($results_array)];

			echo $final_result;

			footer();
			email_admin($final_result);
			include("footer.php");
			exit;
		}
		/*********************
		 END OF THE QUIZ II
		**********************/
			// calculate the results

			// results array
			//print_r($results_array);
			// declare an array the same size as choices with only 0
			$total_results = count($results_array);
			for($j=1; $j <= $total_results; $j++) {
				$int_results_array[$j]=0;
			}
		
			//print_r($choices);
			for($i=1; $i <= $total_choices; $i++) {
				$num = trim($choices[$i]);
				$int_results_array[$num]=$int_results_array[$num]+1;
			}

			//print_r($int_results_array);

			$max_value = max($int_results_array);

			$total_int_results_array = count($int_results_array);
			for($i=1; $i<=$total_int_results_array; $i++) {
			   if($int_results_array[$i] == $max_value) {
					$max_key = $i;
					break;
			   }
			}

			//echo "the max key is $max_key";
			//print_r($int_results_array);
			//echo "max key is  $max_key";
			$final_result=$results_array[$max_key];
			echo $final_result;

	} // end of else


} // end of the result function

function email_admin($final_result) {
	global $admin_email, $email_notify, $HTTP_USER_AGENT, $REMOTE_ADDR, $HTTP_REFERER, $quiz_question;
	// email admin if it's enabled
	if($email_notify) {

		if($final_result != "") {

			$final_email_result = str_replace("<div class="header">", "", $final_result);
			$final_email_result = str_replace("<div class="just">", "", $final_email_result);
			$final_email_result = str_replace("</div>", "\n\n", $final_email_result);
			$final_email_result = str_replace("<br />", "\n", $final_email_result);
			
			// get the quiz taker's info
			$date = date("Y-m-d H:i:s");
			$ip = $_SERVER['REMOTE_ADDR'];
			$browser_info = $_SERVER['HTTP_USER_AGENT'];
			$host = gethostbyaddr($ip);
			$referer = $_SERVER['HTTP_REFERER'];

			// from info
			$from_info = "
This is the result of the test taker:

$final_email_result
	
------------------------------------------------------------------------------------------
	IP: $ip
	HOST: $host
	Browser: $browser_info
	Time: $date
	Referred by: $referer
------------------------------------------------------------------------------------------";


			$subject = "Someone has taken $quiz_question quiz";

			//echo "in footer, trying to send mail: $admin_email, $final_result, $from_info, $subject";

			mail($admin_email, $subject, $from_info, "From: Test_Taker");
		} // end of if final result is not empty


	} // end of if
}
function footer() {
	echo "<div style="font-family: Verdana; font-size: 10px;">Quiz made possible with <a href="http://regretless.com/scripts/" target="_blank">Dodo's Quiz Script</a></div>";
} // end of footer function

if(!$_GET['action']) {
	echo "<div class="header">".$quiz_question."</div>\n<div class="just">".$quiz_description."</div>";
	echo "<form action="dodosquiz.php?n=".$_GET['n']."&action=results" method="post">";
	for($i = 1; $i <= count($questions_array); $i++) {
		echo "<div class="rings">".$questions_array[$i]."</div>\n";
		// find the answers
		$this_answers = explode("\n", $answers_array[$i]);
			// print the answers and modify the results
			echo "<div class="just">\n";
			for($k = 0; $k < count($this_answers); $k++) {
				$this_particular_answer = explode("|", $this_answers[$k]);
				echo "<label><input type="radio" name="choices[".$i."]" value="".trim($this_particular_answer[1])."">".$this_particular_answer[0]."</label><br /> \n";
			}
			echo "</div><br />\n";
			//print_r($this_answers);
	} // end of for
	echo "<input type="submit" value="".$submit_button."" class="form"></form>";
} // end of if not action
footer();
email_admin($final_result);
include("footer.php");
?>




und die andere Datei:

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
<?php
/****************************************************
// Dodo's Quiz Script
// Copyrighted by Ying Zhang
// http://regretless.com/scripts
// No redistribution without authorization
// Script released under linkware
// that means LINK ME if you use it for your website
/****************************************************/

/********************************************************************************
Remember if you name this file quiz_1.php it will be quiz no. 1!
You will have to call this script by using
quiz.php?n=1
*********************************************************************************/
// Would you like to get get an email when someone takes this particular quiz?
$email_notify = 0;  // 1 = yes 0 = no
// if so
$admin_email = "you@domain.com";

// Your quiz question:
$quiz_question = "I-Kuh-Test";

// What you want your submit button to say?
$submit_button = "Auswerten";

// Your quiz description:
$quiz_description = "";

// Do you want to make sure that all of your questions are answered before the results are calculated?
$all_questions_answer = 1; // 1 = yes 0 = no

// Now for each result, give it a description. Please make sure you put \ in front your quotations or you will get parse error!
// Put them as the result name => result description
// For example: "not_the_one" => "You are definitely not the one for Dodo. Too bad :(";
// WARNING: it's always possible to get the same two results so watch the order of these.
$results_array = array(

1 => "<div class="header">THE ONE</div><div class="just">You are THE ONE! WOW.. you are my soulmate! <br /><br />Add more your description here. blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah </div>",
2 => "<div class="header">EEK...</div><div class="just">You are definitely not the one for me. Too bad :(<br /><br /> Add more your description here. blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah blah blab blah </div>",
);

// Now your questions
$questions_array = array(
1=> "Wieviele Euterviertel besitzt eine Kuh?",
2=> "Welche Farbe hat das Braunvieh?",
3=> "Wer hat, durch die Einführung der Käseherstellung, das Original Braunvieh im Allgäu etabliert?",
4=> "Warum tragen Kühe Kuhglocken (Kuhschellen) auf den Alpen?",
5=> "Was machen Kühe in ihrer Freizeit?",
6=> "in den 60er Jahren wurde das Original Braunvieh eingekreuzt mit:",
7=> "Allgäuer Kühe schwärmen für:",
);

// your answers. MAKE SURE it's the same order as the questions. also gives which of the results is the answer corresponding to separated by the symbol |. One unique answer per line!

$answers_array = array(
1=> "zwei|2
vier|2
sechs|1",

2=> "schwarz-weiß|2
lila|2
braun|1",

3=> "Andreas Hofer|1
Carl Hirnbein|2
Franz-Josef Strauß|2",

4=> "damit man sie leichter wiederfindet|1
um Touristen auf Abstand zu halten|2
um sich untereinander besser verständigen zu können|2",

5=> "sie liegen im Gras|2
sie fressen Gras|1
sie rauchen Gras|2",

6=> "Brown Swiss|1
Swiss Airline.|2
Charlie Brown.|2",

7=> "Bulle von Tölz|1
Pamela Anderson|2
Red Bull|2",



/*******************************************
 I hope you get the idea now.
 Just add more if you have more questions.
 Make sure to change the index numbers.
 For example, the next one should begin with
 3=> "blah|1
 blah|2
 blah|3",
 always end with a quotation and a comma!
 *******************************************/

);

######### END OF QUIZ 1 DATA ##################################################
?>


Kann sich jemand erklären, woran es liegt? header, footer und css Datei ist hochgeladen...


Liebe Grüße
03.06.2009 21:32 *on*the*run* ist offline E-Mail an *on*the*run* senden Beiträge von *on*the*run* suchen Nehmen Sie *on*the*run* in Ihre Freundesliste auf
cll cll ist weiblich
Hafifan in Action ->www.hafifieber.com


images/avatars/avatar-52953.png

Dabei seit: 12.02.2005
Beiträge: 1.887
Herkunft: Bayern

Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

ich schätze mal wegen
if(!$_GET['n'])
exit;

mach mal davor ne Ausgabe, obs die noch anzeigt!

__________________

04.06.2009 08:50 cll ist offline E-Mail an cll senden Homepage von cll Beiträge von cll suchen Nehmen Sie cll in Ihre Freundesliste auf Fügen Sie cll in Ihre Kontaktliste ein
.Senseless
dima & sascha!


images/avatars/avatar-48682.png

Dabei seit: 26.01.2009
Beiträge: 2.244

Auf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden       Zum Anfang der Seite springen

Im FF kann man unter Extras -> Fehlerkonsole schauen, da steht meistens der Fehler samt Zeile. smile

__________________
    "Bei leichten Depressionen empfehle ich ein heißes Bad mit ätherischen Ölen, bei schweren Depressionen ein heißes Bad mit Föhn!"

04.06.2009 14:21 .Senseless ist offline E-Mail an .Senseless senden Beiträge von .Senseless suchen Nehmen Sie .Senseless in Ihre Freundesliste auf Fügen Sie .Senseless in Ihre Kontaktliste ein
Baumstruktur | Brettstruktur
Gehe zu:
Gegen Bilderklau - Das Original » Design, Website, Copyright » Homepagehilfe » Homepagehilfe - Archiv » [PHP & MySQL] PHP Quiz

Impressum

Forensoftware: Burning Board, entwickelt von WoltLab GmbH