A
A
alexandrtym2017-05-29 20:37:13
css
alexandrtym, 2017-05-29 20:37:13

Can't see value. How to correctly pass a value to $_POST?

Hello. Just started learning php. It is not possible to correctly pass the id value that I get by clicking on the link in the table. d22578fc477244ca8124204840d043b8.png
0b3c23c515ab4f959bb644d6ca070037.png
7db6bc5f666a49aea2ba6372ab0127b0.png
How to pass this value correctly? Thanks in advance for the provided answers.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
A person from Kazakhstan, 2018-09-09
@LenovoId

https://codepen.io/topicstarter/pen/BOJjOz it's not entirely clear where you're having trouble...

S
Sergey Sobko, 2017-05-29
@alexandrtym

In general, Comrade Alexander Shapoval is right - you should look for some other material to master. You get used to bad things quickly, but then it's hard to get out of the habit.
Personally, I did not really understand one point. In the following code, you are trying to get the value of $_REQUEST["id"] and put it in the value of the "idi" field
But change the hidden attribute to text and you will see that instead of the value from the request, the string $_REQUEST["id"] flaunts in the field.
To do what you want, put $_REQUEST["id"] between the opening and closing <?= ?> tags (This is shorthand for the echo tag. More about tags in PHP here ).
Now the input field will look like this
Also, do not forget that you still write data to the field attribute, and any data should be wrapped in
quotes.
In fact, it's okay, if in your case there is something in this $_REQUEST["id"] itself, then it will fall into value without problems. But if suddenly $_REQUEST["id"] is empty, then the value will contain the entire text of the tag to the right of the value attribute, after the = sign, up to the > sign. And in this case, instead of the expected value, value will contain name='idi' /.

R
RidgeA, 2017-05-29
@RidgeA

Specifically, in your case, I do not know what the problem is, but usually such a problem is due to the small size of post_max_size in the php settings. But your form doesn't have a lot of data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question