Answer the question
In order to leave comments, you need to log in
Why doesn't $_REQUEST fire a second time?
I'm sorry for the not very smart question, I'm learning php for the second day. I sat down to do the task, and found such a thing that in the $_REQUEST code, it simply gives nothing. I change to $_POST and everything works. What is it, and how to deal with it?
<html>
<head>
<meta charset="utf-8">
<title>
echo
</title>
</head>
<body>
<center>
<h1>
текстовое поле
</h1>
<form method="post" action="text2.php">
введите ваше имя
<input name="name" type="text" pattern="^[А-Яа-яЁё\s]+$">
<br>
введите ваш номер телефона
<input name="phone" type="tel" pattern="[0-9]{10}">
<br><br>
<input type="submit" value="ok">
</form>
</center>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>
echo
</title>
</head>
<body>
<center>
<h1>
чтение данных из текстового поля
</h1>
ваше имя
<?php
$im = $_REQUEST ["name"];
$im = strip_tags($im);
$im = trim($im);
echo "ваше имя {$im} <br>";
$ph = $_REQUEST ["phone"];
$ph = strip_tags($ph);
$ph = trim($ph);
echo "ваш телефон {$ph}";
?>
</center>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>
echo
</title>
</head>
<body>
<center>
<h1>
чтение данных из текстового поля
</h1>
ваше имя
<?php
$im = $_REQUEST ["name"];
$im = strip_tags($im);
$im = trim($im);
echo "ваше имя {$im} <br>";
$ph = $_POST ["phone"];
$ph = strip_tags($ph);
$ph = trim($ph);
echo "ваш телефон {$ph}";
?>
</center>
</body>
</html>
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