How to make a HTML form post its variables to itself

The Issue

You have a PHP page which generates a HTML form.  When the user submits the form, you want the same PHP page to process the data.

Solution

I've seen a lot of people write CGI requests but if you left the action attribute blank, this would do the same thing:

 

copyraw
<form method="post" action="">
...
  1.  <form method="post" action=""> 
  2.  ... 

 

Category: Hypertext Markup Language :: Article: 767