So this is the php file that i need to work but cant figure out what is wrong wiv it
<!doctype html><html><head><title>abc</title></head>
<body>
<?php
for ($i = 1; $i <= 50; $i++) { // Repeat the process 50 times
$sequence = ""; // Initialise variable to hold the sequence
for ($x = 1; $x <= 3; $x++) {
$randnum = rand(1,3); // Assign a random number to $randnum
if ($randnum == 1) { // Find the value of $randnum
$letter = "A";
} elseif ($randnum == 2) {
$letter = "B";
} elseif ($randnum == 3) {
$letter = "C";
} else {
echo "Random number was not between 1 and 3.";
}
$sequence = $sequence . $letter; // Concatenate the letter on to the sequence of letters
}
echo $sequence . "<br/>"; // Output the sequence and take a new line
if ($sequence == "ABC") { // Check if the sequence is ABC and if so increment the counter by 1
$ctr++;
echo "Sequence found! Total count: " . $ctr . "<br/>";
}
?>
</body>
</html>
this is the html file that is attached to it
<html>
<head>
<title>Guess</title>
</head>
<body>
<form action= "abc.php" method="post">
<h1>Enter Your Guess<h1>
<br>
grade:<input type="text" Size="16" maxlength = "3" Name= "randum">
<p>
<input type ="submit" value="click to submit">
</p>
<p><input type="reset" value="erase and restart">
</p>
</form>
</body>
</html>
but i keep getting an error message saying:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\abc.php on line 31
i am running the files through xampp on windows 7
<!doctype html><html><head><title>abc</title></head>
<body>
<?php
for ($i = 1; $i <= 50; $i++) { // Repeat the process 50 times
$sequence = ""; // Initialise variable to hold the sequence
for ($x = 1; $x <= 3; $x++) {
$randnum = rand(1,3); // Assign a random number to $randnum
if ($randnum == 1) { // Find the value of $randnum
$letter = "A";
} elseif ($randnum == 2) {
$letter = "B";
} elseif ($randnum == 3) {
$letter = "C";
} else {
echo "Random number was not between 1 and 3.";
}
$sequence = $sequence . $letter; // Concatenate the letter on to the sequence of letters
}
echo $sequence . "<br/>"; // Output the sequence and take a new line
if ($sequence == "ABC") { // Check if the sequence is ABC and if so increment the counter by 1
$ctr++;
echo "Sequence found! Total count: " . $ctr . "<br/>";
}
?>
</body>
</html>
this is the html file that is attached to it
<html>
<head>
<title>Guess</title>
</head>
<body>
<form action= "abc.php" method="post">
<h1>Enter Your Guess<h1>
<br>
grade:<input type="text" Size="16" maxlength = "3" Name= "randum">
<p>
<input type ="submit" value="click to submit">
</p>
<p><input type="reset" value="erase and restart">
</p>
</form>
</body>
</html>
but i keep getting an error message saying:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\abc.php on line 31
i am running the files through xampp on windows 7