pattox2k1
05-20-2002, 07:30 AM
first of all i have this number guessing game i made and this is the code i have:
<?php
$num_to_guess=73;
$message="";
if(!isset($guess))
$message="Welcome to the number guessing game, please type in a guess in the box below. All numbers are between 1 and 100 and will change evry week. HINT: This number is over 50 and under 80.";
elseif ($guess>$num_to_guess)
$messgae="$guess is too high, try a lower number";
elseif ($guess<$num_to_guess)
$message="$guess is too low, try a higher number:;
else//must be equivalent
$message="Well done!";
?>
<html>
<head>
<title>The Number Guessing Game</title>
</head>
<body>
<h1>
<?php print $message ?>
</h1>
<form method="POST">
Thye in your guess here: <input type="text" name="guess">
</form>
</body>
</html>
and the server gives me this error:
Parse error: parse error in /mnt/host-users/homeworkhh/guess.php on line 11
i can't find any errors..... and my second problem is on my upload script, my code is:
<HTML>
<HEAD>
<TITLE>Your Site Uploader</TITLE>
<?php
$file_dir= "/path/to/fokder/uploads";
$file_ url= "http://www.yoursite.com/uploads";
foreach( $HTTP_POST_FILES as $file_name => $file_array ) { print "path: ".$file_array['tmp_name']."<BR>\n"; print
"name: ".$file_array['name']."<BR>\n"; print "type:
".$file_array['type']."<BR>\n"; print "size: ".$file_array['size']."<BR>\n"; if
( is_uploaded_file( $file_array['tmp_name;] ) && $file_array['type'] ==
"image/gif' ) { move_uploaded_file( $file_array['tmp_name'],
"$file_dir/$file_name") or die ("Couldn't copy"); print "<IMG
src='\"$file_url/$file_name\"'>
<P>\n\n"; } } ?> </P>
<FORM method=post encType=multipart/form-data>
<P><INPUT type=hidden value=100024 name=MAX_FILE_SIZE> <INPUT type=file
name=fupload><BR><INPUT type=submit value="Upload" name="Upload File">
</P>
<P> </P>
<P> </P>
<P> </P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD>
and the server gives me this error (when all variables are filled in):
Parse error: parse error in /mnt/host-users/homeworkhh/mtuploader.php on line 6
and again, i cant find any errors.....i have even sent that one to others and they cant find anything wrong with it :( can someone PLZ help me???
<?php
$num_to_guess=73;
$message="";
if(!isset($guess))
$message="Welcome to the number guessing game, please type in a guess in the box below. All numbers are between 1 and 100 and will change evry week. HINT: This number is over 50 and under 80.";
elseif ($guess>$num_to_guess)
$messgae="$guess is too high, try a lower number";
elseif ($guess<$num_to_guess)
$message="$guess is too low, try a higher number:;
else//must be equivalent
$message="Well done!";
?>
<html>
<head>
<title>The Number Guessing Game</title>
</head>
<body>
<h1>
<?php print $message ?>
</h1>
<form method="POST">
Thye in your guess here: <input type="text" name="guess">
</form>
</body>
</html>
and the server gives me this error:
Parse error: parse error in /mnt/host-users/homeworkhh/guess.php on line 11
i can't find any errors..... and my second problem is on my upload script, my code is:
<HTML>
<HEAD>
<TITLE>Your Site Uploader</TITLE>
<?php
$file_dir= "/path/to/fokder/uploads";
$file_ url= "http://www.yoursite.com/uploads";
foreach( $HTTP_POST_FILES as $file_name => $file_array ) { print "path: ".$file_array['tmp_name']."<BR>\n"; print
"name: ".$file_array['name']."<BR>\n"; print "type:
".$file_array['type']."<BR>\n"; print "size: ".$file_array['size']."<BR>\n"; if
( is_uploaded_file( $file_array['tmp_name;] ) && $file_array['type'] ==
"image/gif' ) { move_uploaded_file( $file_array['tmp_name'],
"$file_dir/$file_name") or die ("Couldn't copy"); print "<IMG
src='\"$file_url/$file_name\"'>
<P>\n\n"; } } ?> </P>
<FORM method=post encType=multipart/form-data>
<P><INPUT type=hidden value=100024 name=MAX_FILE_SIZE> <INPUT type=file
name=fupload><BR><INPUT type=submit value="Upload" name="Upload File">
</P>
<P> </P>
<P> </P>
<P> </P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD>
and the server gives me this error (when all variables are filled in):
Parse error: parse error in /mnt/host-users/homeworkhh/mtuploader.php on line 6
and again, i cant find any errors.....i have even sent that one to others and they cant find anything wrong with it :( can someone PLZ help me???