I
I
Ivan Pogorelov2014-10-19 13:01:56
PHP
Ivan Pogorelov, 2014-10-19 13:01:56

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>

And that's how it works.
<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>

I might want another entry page, with a different submit method. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2014-10-19
@toxa82

In php.ini look at the parameter request_order = "GP"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question