ITmembers.net 아카이브 · 2002–2009

질문과 답변

전혀 달라지지 않는데요?

수정하라는대로 한 소스입니다
어디를 잘못 한건지 전혀 달라지지가 않네요
카운트(클릭횟수) 나타내주는 텍스트 박스도 안 보이구요

<?php

############################################################################
############################################################################
##                                                                        ##
## This script is copyright Rupe Parnell (Starsol.co.uk) 2003.            ##
##                                                                        ##
## Distribution of this file, and/or any other files in this package, via ##
## any means, withour prior written consent of the author is prohibited.  ##
##                                                                        ##
## Starsol.co.uk takes no responsibility for any damages caused by the    ##
## usage of this script, and does not guarantee compability with all      ##
## servers.                                                               ##
##                                                                        ##
## Please use the contact form at                                         ##
## http://www.starsol.co.uk/scripts/contact.php if you need any help or   ##
## have any questions about this script.                                  ##
##                                                                        ##
############################################################################
############################################################################

$version = "v1.01";
require("number_variables.php");

// ENTER ALL HTML YOU WANT ABOVE THE NUMBER GUESS BETWEEN THIS LINE ?>
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>제목 없음</title>
<meta name="generator" content="">
<script language="javascript">

function check_submit() {

if (document.myForm.guess.value < 0) {
alert('0보다 큰 숫자를 입력하세요');
document.myForm.guess.focus();
return;

} else if (document.myForm.guess.value > 100) {
alert('100보다 작은 숫자를 입력하세요');
document.myForm.guess.focus();
return;

} else {
document.myForm.action = "<?=$PHP_SELF?>";
document.myForm.submit();
}

}

</script>

</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p></p>
</body>

</html>

<hr>

<?php // AND THIS LINE

echo"<p align='center'>";
echo"<font face='$fontface' size='4'><b>";
echo"Number Guess";
echo"</b></font>";
echo"</p>";

echo"<p align='left'>";
echo"<font face='Verdana' size='3'>";

if ($to_do != "play") {echo"Enter a number between 1 and $max to play.";}

if ($to_do == "play" ){

        $number = rand(1,$max);
        $guess = HTMLSpecialChars($guess);
        if ($guess>$max) {
                echo "Sorry, the number you entered was more than $max. Please enter a number between 1 and $max. ";
                echo "The correct number this time was <b>$number</b>. You guessed <b>$guess.</b>";
        }
        elseif ($guess>$number) {
                echo "Sorry, your guess is too high.<br>";
                echo "The correct number this time was <b>$number</b>. You guessed <b>$guess.</b>";
        }
        if ($guess=="") {
                echo"You forgot to enter a number. If you had entered <b>$number</b>, you would have won. ";
        }
        if ($guess<$number) {
                echo "Sorry, your guess is too low.<br>";
                echo "The correct number this time was <b>$number</b>. You guessed <b>$guess.</b>";
        }
        if ($guess == $number) {
                echo "Congratulations! You guessed correctly! The number was <b>$number</b>.";
                won();
        }
}

echo"</font></p>";

echo"<form name='myForm' method='post'>";
echo"<input type='hidden' name='to_do' value='play'>";

echo"<p align='center'>";
echo"<font face='$fontface' size='3'>";

if ($to_do == "play") {echo"Play again?";}
if ($to_do != "play") {echo"Enter your guess:";}

echo"<br><br>";
echo"<input name='guess' type='text' value='$guess'><br>";
echo"<input type='submit' value='Play!' onclick='javascript:check_submit();'>";
echo"</font></p>";

echo"</form>";

starsol();

// ENTER ALL HTML YOU WANT BELOW THE NUMBER GUESS BETWEEN THIS LINE ?>

<hr>

<?php // AND THIS LINE

function won(){

        global $fontface;

        echo"<font face='$fontface' size='3'><b>Congratulations! You guessed correctly!</b></font>";
        include('number_won.php');

        return;
}

function starsol(){

        global $fontface, $version;

        echo"<br><br><center><font face='Verdana' size='1' color='#888888'>Powered by: <a href='http://www.starsol.co.uk/scripts/' target='_blank'>Starsol</a> Number Guess $version</font></center>";

        return;
}

?>

댓글 1