November 27th, 2012, 12:15 AM
Problem with $_POST METHOD
Hi, I'm using Xampp Server but I have problem with form & $_POST method
I create two files (POST.PHP) and (welcome.php)
my problem I can't get any data in second file (welcome.php)
empty page >>> why
<html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="fname"/> <input type="submit" value="Submit"/> </form> </body> </html>
<html> <body> <?php echo $_POST["fname"]; ?> </body> </html>
November 27th, 2012, 12:57 AM
in the developer tools of your browser, open the "Network" tab and then the "Headers" tab to see what gets posted where. If you don't know where to find this, google for it or read the manual of your browser.
You should also avoid CaSe SeNsItiVe FiLe NaMeS. As pretty as they may be, they lead to all kinds of problems (this also applies to names in databases).
November 27th, 2012, 01:27 AM
Thank you Jacques1 for your reply
this what i get for first file
[10:23:11.391] A form was submitted in the windows-1252 encoding which cannot encode all Unicode characters, so user input may get corrupted. To avoid this problem, the page should be changed so that the form is submitted in the UTF-8 encoding either by changing the encoding of the page itself to UTF-8 or by specifying accept-charset=utf-8 on the form element. @ file:///C:/xampp/htdocs/post.php
& second file
[10:23:11.483] The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. @ file:///C:/xampp/htdocs/welcome.php
I'm using Firefox version 17.0
November 27th, 2012, 10:03 PM
What is the value of the address bar in your browser after you submit the form?
November 27th, 2012, 10:53 PM
November 28th, 2012, 03:32 AM
And there's the problem
In your set up PHP will not be executed unless it is run through a web server
try going to
to start with; then, hopefully, you'll end up at
oh, and as a general rule, make your file names and extensions lower case
November 30th, 2012, 11:33 PM
There is Problem in php.ini file configrution with Xampp Server , when i run my script on apache server it's work after active register_global
Apache Server version 2.5.10
Thanks Jacques1 ,E-Oreo , Northie
December 1st, 2012, 10:30 AM
Do not enable register_globals. You should not be using or writing any code that uses it. It has been deprecated for over 3 years, and 6 months ago it was completely removed from PHP. If you use it, your scripts will break permanently as soon as you upgrade PHP and the only way to fix them will be to rewrite the code so it doesn't use register_globals.