+ 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
23 Antworten
+ 9
Thanks to all who answered my question!!!
+ 6
So it seems the problem cannot be resolved
+ 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.
+ 5
in http://www.example.com /test_form. php
+ 5
I can't find and see test_form. php
+ 5
I've corrected errors but the problem exists.
+ 5
No, I Cannot verify if $_SERVER ["REQUEST_METHOD"] is available on my server.
+ 5
Yes, I try this code Work on another server.
+ 5
I don't know.I suppose it is a verification with "if" loops may be.
+ 5
I tried with the code in coment/**/... PHP_SELF as you have seen, but nothing came of it.
+ 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.
+ 1
where does "test_form.php" exist?
+ 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.
+ 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.
+ 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?
+ 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.
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"])
0
EGO @eg what's the code inside test_form.php?