+ 7

email, name and Web url doesn't appear, Why? How is the correct code?

May be the problem is REQUEST_METHOD https://code.sololearn.com/wWnWcLmk5nr7/?ref=app

25th Aug 2020, 8:26 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
23 odpowiedzi
+ 9
Thanks to all who answered my question!!!
19th Sep 2020, 12:35 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 6
So it seems the problem cannot be resolved
25th Aug 2020, 6:16 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 6
I've corrected action ="" and empty display is appeared because in the form I filled in wrong url address above . That 's why I wrote www.sololearn. com/Playground /form_val. php but empty display is appeared again.
27th Aug 2020, 1:24 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
in http://www.example.com /test_form. php
25th Aug 2020, 9:27 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
I can't find and see test_form. php
25th Aug 2020, 10:50 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
I've corrected errors but the problem exists.
25th Aug 2020, 12:44 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
No, I Cannot verify if $_SERVER ["REQUEST_METHOD"] is available on my server.
25th Aug 2020, 1:52 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
Yes, I try this code Work on another server.
25th Aug 2020, 2:11 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
I don't know.I suppose it is a verification with "if" loops may be.
25th Aug 2020, 2:17 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 5
I tried with the code in coment/**/... PHP_SELF as you have seen, but nothing came of it.
25th Aug 2020, 2:33 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
25th Aug 2020, 4:38 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 2
EGO Code Playground doesn't support form submission, you cannot test form submission code in Code Playground. You have to use local host, or (as you said before) try in your own server.
27th Aug 2020, 4:46 AM
Ipang
+ 1
where does "test_form.php" exist?
25th Aug 2020, 9:10 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
test_form.php has to exist in the same directory or provide a path to it, so when you click on submit it gets executed to process the data.
25th Aug 2020, 9:37 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
action = ".../test_form.php" This doesn't look like a valid relative path. A triple dot in the beginning of the path string disqualifies the path. The PHP script block starting at line 49 begins with <? only.
25th Aug 2020, 12:20 PM
Ipang
+ 1
A note from http://php.net/manual/en/reserved.variables.server.php Says that there are no guarantee that elements of $_SERVER are always similarly available between systems. It says it depends on web server. Can you verify $_SERVER["REQUEST_METHOD"] was available for your server?
25th Aug 2020, 1:39 PM
Ipang
+ 1
I guess in this case we're stuck with checking whether if `isset($_POST["submit"])` check yields true. Upon which we can *assume* a submission is there for us to work with. But I once read somewhere that such approach is not considered as good practice.
25th Aug 2020, 2:01 PM
Ipang
+ 1
Ipang the issue with his code is, the action of the submit button is to execute test_form.php, and it does not exist. the php code is supposed to be in that file. here he has everything in one page (file) EGO are you trying to make this work on an other server or just SoloLearn playground?
25th Aug 2020, 2:06 PM
Bahhaⵣ
Bahhaⵣ - avatar
0
Bahha🐧 I thought so too, but earlier he said it's in http://www.example.com/test_form.php. So I thought of other possibilities (invalid path and $_SERVER["REQUEST_METHOD"])
25th Aug 2020, 2:11 PM
Ipang
0
EGO @eg what's the code inside test_form.php?
25th Aug 2020, 2:14 PM
Bahhaⵣ
Bahhaⵣ - avatar