This question already has answers here: PHP POST not working (10 answers) Closed 7 years ago.
I have the simplest form possible and all I want to do is echo whatever is written in text box.
HTML:
<form action="" method="post"> <input type="text" name="firstname"> <input type="submit" name="submit" value="Submit"> </form>
PHP:
if(isset($_POST['submit'])){ $test = $_POST['firstname']; echo $test; }
The problem is it’s not working on my server (it works on another server). Does anyone has an idea what could be wrong? There are other forms on the server and are working fine.
Related Posts:
- POST an array from an HTML form without javascript
- navigate back with PHP form submission
- Why php tag is not working in html file?
- How to read if a checkbox is checked in PHP?
- How to fix ‘Notice: Undefined index:’ in PHP form action
- xajax expanding list query
- Why use $_SERVER[‘PHP_SELF’] instead of “”
- Email Not Sending from Byethost Hosting
- Send email with PHP from html form on submit with the same script
- laravel updateOrCreate method
- HTML Element Array, name=”something[]” or name=”something”?
- Why use $_SERVER[‘PHP_SELF’] instead of “”
- what does a .php?id=&value=value means?
- Creating a search form in PHP to search a database?
- How do you parse and process HTML/XML in PHP?
- What is the difference between the ‘www’ folder and ‘htdocs’ folder?
- curl POST format for CURLOPT_POSTFIELDS
- PHP mail function doesn’t complete sending of e-mail
- The character encoding of the HTML document was not declared
- What is wrong in chrome “net : Failed to load resource: net::ERR_SPDY_PROTOCOL_ERROR”?
- Notice: Undefined offset: 0 in
- Sending POST data without form
- PHP Redirect with POST data
- How to run a PHP function from an HTML form?
- Do I need a !DOCTYPE declaration in a php file with html?
- Redirecting to a page after submitting form in HTML
- Generate PDF from HTML PHP
- add_filter the_content str_replace after shortcode
- Upload Image in a WordPress page using PHP
- How to trigger $_GET request within admin plugin page?
- My form action url is being prepended with a directory that does not exists
- How to store data from multiple forms using ajax and php
- Why Won’t My Inputs in a form with a Get method work together?
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Search WordPress using static html page
- How to execute html code inside php?
- How to add post meta in while loop?
- File Uploader – Upload without adding to Media Library
- Adding attribute to the post.php form tag in wp-admin
- WordPressUser Submission Form
- Custom forms with HTML
- Cascading dropdown select search based on Parent Page & Child Page
- HTML Form Question
- Why is my form going to frontend on html form submission present on the php files inside my custom plugin?
- wordpress form action page not found
- Custom HTML form using PHP – help with ajax/username validation
- PHP “or” Syntax
- mysqli_real_connect(): (HY000/2002): No such file or directory
- How to listen messageSent event in laravel 5.5
- pdo – Call to a member function prepare() on a non-object
- Compare given date with today
- Multi-line strings in PHP
- Commands out of sync; you can’t run this command now
- cURL error 60: SSL certificate: unable to get local issuer certificate
- Simple PHP calculator
- Convert from MySQL datetime to another format with PHP
- php foreach with multidimensional array
- Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:
- PHP “&” operator
- What is ?
- Connection reset by peer: mod_fcgid: error reading data from FastCGI server
- Proper Format of iframe in PHP?
- How to find the last day of the month from date?
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- Composer: Command Not Found
- Undefined variable: $_SESSION
- FormData append not working
- how to write javascript code inside php
- 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
- How to use SRCSET with get_the_post_thumbnail()?
- Javascript code inside “” in core WordPress files .php
- Multiple options not staying selected after saving
- How to remove ?wp-mce-4103-20162941
- How to pre populate a form field with a link of a current user’s author profile?
- parts of url disappear when using # inside href=”” [closed]
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Noscript not working as it should in wordpress site
- Wrapping a Sidebar within
- HTML Form Submit to table in same page
- Displaying images outside the content
- WordPress User Meta value variable into Google Gauge Chart
- PHP function for horizontal Woocommerce thumbnails and badges
- separate list of programs in html/javascript coming from php
- Drop down question
- How to override html codes in wordpress?
- Insert data from form to database
- not able to access $_POST on backend profile update
- Create html tree sitemap
- Category – “No content found”
- WordPress – Image href for home menu nav not working
- How to get all the terms of a post
- how to show selected options drop down menu values in attributes field in after saving post.php
- How to modify default tags in wp_head()
- Can’t insert into a database wordpress