0

I am submitting a form on the url http://example.com/test.php and this form references itself so the url should stay when the form is submitted the same. Except when the form is submitted, the url becomes example.com/test.php/test.php How does my php file become a folder for another php file?? I checked my files and I do not have any folders called test.php.

Thanks to anyone that can help

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
James Dorfman
  • 1,740
  • 6
  • 18
  • 36
  • possible useful answers in this question: [14093316/why-use-serverphp-self](http://stackoverflow.com/questions/14093316/why-use-serverphp-self-instead-of) – Ryan Vincent Mar 13 '14 at 01:52

2 Answers2

0

If you leave the action as

action=""

I believe that the form will now post to itself.

Additionally, you could use an absolute url in your action. It would be helpful to see what the action being generated in the HTML is and what PHP (if any) you are using to generate the form with

Jonnny
  • 4,939
  • 11
  • 63
  • 93
-2

Or better yet...

   <form action="<?php $_SERVER['php_self']; ?>" method="post">

.....

  </form>
st15jap
  • 91
  • 1
  • 2
  • 11