Click here to get back home

$post array has nothing in it

 HomeNewsGroups | Search

comp.lang.php - PHP programming language discussions 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
$post array has nothing in it ela 05-09-2009
Posted by ela on May 9, 2009, 5:51 am
Please log in for more thread options
I wrote the following codes,

show/hide quoted text

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).

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.

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...




Posted by Dikkie Dik on May 9, 2009, 7:32 am
Please log in for more thread options
show/hide quoted text

If you have firefox and the "Live HTTP headers" plugin, you can see what
is really sent to the server. My guess is that you are sending a GET
request. This may be caused by another plugin: NoScript. The NoScript
plugin has an option to convert POST to GET requests.

Best regards.

Posted by ela on May 9, 2009, 8:15 am
Please log in for more thread options

show/hide quoted text

I use IE7 indeed. But after installing the plugin, i can't see any header
info in the same/new tab. Certainly I also havent' installed any NoScript
plugin before



Posted by Jerry Stuckle on May 9, 2009, 8:38 am
Please log in for more thread options
ela wrote:
show/hide quoted text

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

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

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
==================

Posted by eclipsme on May 9, 2009, 8:59 am
Please log in for more thread options
Jerry Stuckle wrote:
show/hide quoted text


Shouldn't this:
$_POST["pid"]

be this?
$_POST[pid]

Harvey

Similar ThreadsPosted
Variable passed in GET or POST array January 18, 2006, 11:17 pm
Re: Trying to change global array value with $POST September 7, 2009, 6:02 pm
Post array values (beginner's question) September 27, 2005, 5:22 pm
how does PHP5 process POST data in creating $_POST array? May 9, 2005, 7:09 pm
PHP Post, then HTML Post? November 24, 2004, 5:54 pm
How do I pass an array key from a multi-dimensional array to a new array? February 18, 2008, 6:35 pm
Array (multidimensional) help - using array like SQL tables to get round lack of Union in MySQL3. April 20, 2005, 4:32 am
"Array to String Conversion" error when constructing a multi-dimensional array January 17, 2007, 3:42 am
HELP! Selecting Array Rows based on an array of field=>value s October 21, 2006, 9:20 pm
Finding elements of an array in another multi-dimensional array February 1, 2007, 5:35 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy