The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Problem with $_POST METHOD
Discuss Problem with $_POST METHOD in the PHP Development forum on Dev Shed. Problem with $_POST METHOD PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 27th, 2012, 12:15 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 2 h 30 m 35 sec
Reputation Power: 0
|
|
|
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
POST.PHP
PHP Code:
<html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="fname"/> <input type="submit" value="Submit"/> </form> </body> </html>
welcome.PHP
PHP Code:
<html> <body> <?php echo $_POST["fname"]; ?> </body> </html>
PHP 5.2.0
|

November 27th, 2012, 12:57 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
|
Hi,
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
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 2 h 30 m 35 sec
Reputation Power: 0
|
|
|
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
|
 |
Lost in code
|
|
|
|
|
What is the value of the address bar in your browser after you submit the form?
|

November 27th, 2012, 10:53 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 2 h 30 m 35 sec
Reputation Power: 0
|
|
|
after submit
file:///C:/xampp/htdocs/welcome.php
|

November 28th, 2012, 03:32 AM
|
 |
Square Peg in a Round Hole
|
|
Join Date: Oct 2007
Location: North Yorkshire, UK
|
|
|
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
http://localhost/POST.PHP
to start with; then, hopefully, you'll end up at
http://localhost/welcome.PHP
oh, and as a general rule, make your file names and extensions lower case
|

November 30th, 2012, 11:33 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 2 h 30 m 35 sec
Reputation Power: 0
|
|
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
|
 |
Lost in code
|
|
|
|
|
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.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|