@storm-coder

При отправке формы (index.html) данные не передаются на страницу index.php? В чем может быть проблема?

index.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Сказка</title>
</head>
<body>
	
	<h1>Story</h1>
	<h3>Please, fill in the blanks bolow, and i'll tell you a story</h3>

	<form method="post" action="index.php">
		
		<table border = 1>
			<tr>
				<th>City:</th>
				<th>
					<input type="text" name="city" value=" ">
				</th>
			</tr>

			<tr>
				<th>Tailor name:</th>
				<th>
					<input type="text" name="tailorName" value="">
				</th>
			</tr>

			<tr>
				<td colspan = 2>
					<center>
						<input type="submit" value="tell me the story">
					</center>
				</td>
			</tr>
		</table>

	</form>

</body>
</html>


index.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

    <h1>Alladin</h1>   
    <h3>Values from the story page</h3>
    
    <table border=1>
        <tr>
            <th>Variable</th>
            <th>Value</th>
        </tr>

        <tr>
            <th>city</th>
            <td><?php print $city ?></td>
        </tr>

        <tr>
            <th>Tailor name</th>
            <td><? print $tailorName ?></td>
        </tr>
    </table>

</body>
</html>
  • Вопрос задан
  • 115 просмотров
Решения вопроса 1
EllPro
@EllPro
вроде пишу какой-то код elsevar.de
<?=$_POST['city']?>
<?=$_POST['tailorName']?>

Или
<?php echo $_POST['city']?>
<?php echo $_POST['tailorName']?>
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
Eridani
@Eridani
Мимо проходил
В том, что вы не принимаете ушедший на Ваш php файл POST
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы