Answer the question
In order to leave comments, you need to log in
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.
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
https://codepen.io/topicstarter/pen/BOJjOz it's not entirely clear where you're having trouble...
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' /.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question