Answer the question
In order to leave comments, you need to log in
Why does the interpreter swear at ?> in php?
There is a code:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Форма</title>
</head>
<body>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
process_form();
}
else{
show_form();
}
function show_form(){
print <<<FORM_HTML
<form method="POST" action="form.php">
<input type="text" name="name" placeholder="Введите имя"><br>
<select name="numbers[]" multiple>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<br>
<input type="submit" value="Отправить">
</form>
FORM_HTML;
}
function process_form(){
foreach ($_POST[numbers] as $value) {
print $value . "<br>";
}
}
?>
</body>
</html> //ЭТО СТРОКА 41
Parse error: syntax error, unexpected end of file in C:\OpenServer\domains\asd\form.php on line 41
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question