The action
attribute will default to the current URL. It is the most reliable and easiest way to say “submit the form to the same place it came from”.
There is no reason to use $_SERVER['PHP_SELF']
, and #
doesn’t submit the form at all (unless there is a submit
event handler attached that handles the submission).
Related Posts:
- navigate back with PHP form submission
- laravel updateOrCreate method
- Why use $_SERVER[‘PHP_SELF’] instead of “”
- Why php tag is not working in html file?
- PHP $_POST not working?
- How to run a PHP function from an HTML form?
- POST an array from an HTML form without javascript
- PHP “or” Syntax
- What are namespaces?
- Get the full URL in PHP
- Invalid column count in CSV input on line 1 Error
- How to check if a string starts with a specified string?
- mysqli_real_connect(): (HY000/2002): No such file or directory
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- phpMyAdmin: secret passphrase?
- PHP how to make URL something like product.php?id=1
- Mixing a PHP variable with a string literal
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- How to insert an item at the beginning of an array in PHP?
- PHP Deprecated: Methods with the same name
- How do I pass JavaScript variables to PHP?
- Call to undefined function curl_init().?
- How to verify password against database?
- what is a good method to sanitize the whole $_POST array in php?
- Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)
- Difference between $_SERVER[‘DOCUMENT_ROOT’] and $_SERVER[‘HTTP_HOST’]
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- “Cannot send session cache limiter – headers already sent”
- Refresh a page using PHP
- Unable to locate package libapache2-mod-php7
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
- PDO closing connection
- “Valid CSRF Token Required” in Osticket After login?
- Child theme css not overriding parent
- Convert timestamp to readable date/time PHP
- Creating a php search bar
- What does ‘=' mean in PHP?
- Parsing domain from a URL
- PHP class not found but it’s included
- How to fix the session_register() deprecated issue?
- How to convert string to boolean php
- Are There Any Cron Jobs Alternative?
- How to Create Multiple Where Clause Query Using Laravel Eloquent?
- PHP: How to get referrer URL?
- Warning: A non-numeric value encountered
- Proper Format of iframe in PHP?
- How to find the last day of the month from date?
- Getting ’ instead of an apostrophe(‘) in PHP
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- WooCommerce action hooks and overriding templates
- Updating php version on mac
- Composer: Command Not Found
- Undefined variable: $_SESSION
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- The character encoding of the HTML document was not declared
- Notice: Undefined offset: 0 in
- How to Sort a Multi-dimensional Array by Value
- How to get time difference in minutes in PHP
- How to write a link like which link to the same page in PHP?
- Resetting MySQL Root Password with XAMPP on Localhost
- PHP – syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
- how to write javascript code inside php
- Insert string at specified position
- PHP + JQuery – How to use these two together? Please see my example
- Data extraction from /Filter /FlateDecode PDF stream in PHP
- How to use data-saferedirecturl in a tag in PHP?
- PHP date yesterday [duplicate]
- Clear cache in Symfony: `cache:clear` or `rm -rf`?
- create php live clock
- Converting a UNIX Timestamp to Formatted Date String
- PHP Call to undefined function
- Formatting a number with leading zeros in PHP
- add_filter the_content str_replace after shortcode
- Using a custom plugin to capture input data via Ajax and PHP
- How to pre populate a form field with a link of a current user’s author profile?
- Why Won’t My Inputs in a form with a Get method work together?
- How to insert HTML/JavaScript form into WordPress page? [closed]
- wp_mail file attachment not being placed in upload folder?
- Why does my user not get added to the database on custom registration?
- How to add post meta in while loop?
- How to set cookies
- Simple php in wordpress widget [closed]
- Echo out element to another page.
- Display multi-select box choices in a bullet list [closed]
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- Custom PHP form needs refresh to load page correctly
- Confuse between forms and tables
- Insert data from form to database
- not able to access $_POST on backend profile update
- Custom Plugin Develoment, Form Action
- get/show Last ID
- Trouble with checked() for array of multiple checkboxes
- Custom HTML form using PHP – help with ajax/username validation
- Form not working as it should in WordPress, but in a normal HTML site it does
- Saving custom form fields