|
Posted by Jerry Stuckle on May 9, 2009, 8:38 am
Please log in for more thread options ela wrote:
show/hide quoted text
> I wrote the following codes,
>
>
> and expected $_POST["pid"] has something in it after clicking "Submit"
> button on an HTML page but the whole $_POST is in fact empty (the php works
> and echo other things normally but only fails to work with any variables
> related with $_POST).
>
It should work just fine. Ensure you don't have any typos in your HTML
(or PHP code) and you only have the one form. I am, of course, assuming
you have the normal html headers, etc. in there. Dikkie's comments
about using Firefox's Live HTTP Headers is great for problems like this.
show/hide quoted text
> There are other styles of coding form & PHP and I'm not trying to dump all
> the contents in http://www.codingforums.com/archive/index.php/t-142973.html
> here. Another friend says it's due to php.ini that post_max_size is changed
> from 8M to 10MB, and sigh, it's not due to php.ini.
PHP does not control the maximum post size. The web server and browser
do. PHP does have limits on how much memory it will use, but that's not
a problem here.
show/hide quoted text
> Who else has encountered this similar problem before? The saddest thing,
> that I've mentioned many times before, the codes used to work... it's often
> a disaster that whenever new linux release is installed, some old programs
> no longer work and it usually takes days to identify the config problem...
>
>
>
When code fails to work because of an upgrade, it's typically a case
that the code was bad in the first place and just happened to work. But
in the upgrade some hole was closed or similar. Note the problem can be
in the HTML, also - it doesn't have to be in PHP.
Enable all errors in your php.ini file and display them:
error_reporting=E_ALL
display_errors=on
Also beware that if B1 is the item to be deleted, this is very insecure
code. A hacker can easily delete anything in your database.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
|
<input type="hidden" name="pid" value="B1">
<input type="submit" value="Delete item">
</form>