0

the data from the form is not entered, what did I do wrong?

https://code.sololearn.com/wH4lG5YnYsO0/?ref=app

5th Dec 2018, 10:11 PM
Kirill Shlenkin
Kirill Shlenkin - avatar
4 Respostas
+ 6
Hey Kirill, let me explain, print_r($_GET) was supposed to dump the $_GET array content onto screen, in order that we can observe its content, and verify whether the value we want was there. But if you're doing this on Code Playground, unfortunately you can't, the form needs to be submitted before we can see the values in $_GET array. Yet, Code Playground doesn't support form submission, that is why you only see "Array ()" in the output, because there is nothing in $_GET until form is submitted. When I said empty string for the form 'action' attribute, I actually meant that it should be written like this: <form method="GET" action=""> √ Alternative: If you have PC/Laptop you can install XAMPP (https://www.apachefriends.org) with which you have web server, database server and PHP ready to play with. Or if you are on Android phone/tablet, you can search Google Play Store for some app that serve the same purpose (contains web server, PHP and MySQL or MariaDB). Hth, cmiiw
6th Dec 2018, 10:36 PM
Ipang
+ 5
If you are submitting the form data to the same file you can omit the 'action' attribute (set it as empty string). Also try to do print_r($_GET); Just to see if there was any data sent in. Let me know how it goes ... P.S. FYI, In case you didn't know, SoloLearn Code Playground does not support form submission test. Hth, cmiiw
6th Dec 2018, 4:03 AM
Ipang
+ 1
thanks for the detailed answer all the proposed methods do not give a result P.S. FYI, In case you didn't know, SoloLearn Code Playground does not support form submission test. oops, what to do?
6th Dec 2018, 7:41 PM
Kirill Shlenkin
Kirill Shlenkin - avatar
+ 1
I see. I'll get to the big computer, I'll try again. thanks for the detailed explanation
7th Dec 2018, 8:23 PM
Kirill Shlenkin
Kirill Shlenkin - avatar