$_POST key name length?

I am experiencing a very odd behaviour. Say I have the following two <input type='image'> (with the src attribute equal to the name attribute):

<input type='image' name='http://farm1.static.flickr.com/224/471627793_fbda6cecbe_s.jpg'> <input type='image' name='http://farm5.static.flickr.com/4053/4501238330_c5a85162ef_s.jpg'>

My question is: why does the first input submit and the second one doesn't? I am using CakePHP and if I click on the second image, the $this->params['form'] is empty. But when I click on the first image, everything works fine: the $this->params['form'] contains the correct image name together with it's coordinates from where it was clicked.

This is a very odd behaviour and I believe that this can only happen if $_POST limit its keys' length.

Any help is highly appreciated! Thank you!

-------------Problems Reply------------

PHP itself does not limit field name length for multipart/ or -urlencoded POST requests.

But suhosin does indeed have http://www.hardened-php.net/suhosin/configuration.html#suhosin.post.max_name_length with a default of 64. And your second url is indeed 64 characters long.

Less likely, but also possible is a mod_security setup. It would however spill an error message rather than truncating.

I'm not sure that it's related to the length, according to w3.org:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

so perhaps the problem is related to illegal characters in the name.

Have you tried it in different browsers?

Category:php Views:1 Time:2011-04-30
Tags: php cakephp

Related post

  • How to pass variable as $_POST key in PHP? 2011-11-06

    How can you pass a variable as the $_POST array key value in PHP? Or is it not possible? $test = "test"; echo $_POST[$test]; Thanks --------------Solutions------------- $_POST['key'] = "foo"; echo $_POST['key']; If I understood right, you want to set

  • Trying to parse out the $_POST key names that I don't want 2010-12-30

    $post_keys = array_keys($_POST); $special_keys = array(); for($i=0;$i<count($post_keys);$i++){ if(strpos($post_keys[$i], "special") !== false){ $special_keys[] = $post_keys[$i]; } } I have numerous post vars with naming conventions such as special

  • Can extra, unneeded $_POST keys harm the system? 2011-08-16

    Lets imagine for where are inputs like: <input name="x" /> <input name="y" /> <input name="z" /> Can there be any harm if user manually, for example, by using FireBug creates more inputs with different names? I'm asking this because

  • Override openAboutPanel: NSDictionary key/value length limit? 2012-04-13

    There seems to be an arbitrary (~238 characters, it seems) limit to the length of any value in the NSDictionary used in this method provided by Apple to programmatically implement an "About Panel" in an OS X Cocoa app. Is there a way to override this

  • How do I return specific keys from the $_POST array? 2010-06-07

    I would like to check to see if there are any keys in $_POST that contain a string. The string will not be the full key, only part of the key. (ie. search string = "delRowID", $_POST key = "delRowID_16"). I have tried to use array_keys($_POST,"delRow

  • PHP foreach($_POST as $key => $value) windows server 2003 IIS 6 problem 2010-08-08

    In my database connection include I use the code foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } foreach ($_GET as $key => $value) { $_GET[$key] = mysql_real_escape_string($value); } This runs fine on my

  • PHP - sort hash array by key length 2010-10-17

    I've found a few answers to sorting by value, but not key. What I'd like to do is a reverse sort, so with: $nametocode['reallylongname']='12'; $nametocode['shortname']='10'; $nametocode['mediumname']='11'; I'd like them to be in this order reallylong

  • AES encryption: InvalidKeyException: Key length not 128/192/256 bits 2010-12-10

    I'm trying to encrypt a string on Android with AES. The symmetric key is determined previously with the Diffie-Hellman algorithm and seems to be ok (Key Length is 128 Bit, see below). Nevertheless, I get a InvalidKeyException: "Key length not 128/192

  • Searching for Array Key in $_POST, PHP 2011-01-27

    I am trying to add commenting like StackOverflow and Facebook uses to a site I'm building. Basically, each parent post will have its own child comments. I plan to implement the front-end with jQuery Ajax but I'm struggling with how to best tackle the

  • MySQL VARCHAR(255) UTF8 is too long for key, but max length is 1000 bytes 2011-05-30

    I know there have been plenty of questions about this, but I think my math is right. MySQL reserves 3 bytes per UTF8 character. MyISAM allows keys of length 1000 bytes. My UTF8 VARCHAR(255) should be 255 * 3 = 765 bytes Unless UNQUE requires an extra

  • Getting length of an array inside a Dictionary Key 2011-07-01

    I'm sure this is a very obvious question but I'm not getting anywhere with it and I've been trying for half an hour or so now. I have an NSMutableDictionary which has keys & values, obviously. Each key stores an array of objects. What I need to d

  • getting all the keys for a map such as $_POST 2011-07-03

    For example, say I post some data to a php file, but I don't know what the names of those values are. Where I would normally perform $_POST["username"] or something similar. How would I go about getting a list of all the key/value pairs within $_POST

  • Use of specifying lengths for surrogate keys 2011-08-19

    In one of my database class assignments, I wrote that I specifically didn't assign lengths to my NUMBER columns acting as surrogate keys since it would unnecessarily limit the number of records able to be stored in the table, and because there is lit

  • array length with key-value, js 2011-12-16

    I wrote this piece of code, that should parse the given paramUnparsed (which should be an array in the form: [key1=val1, key2=val2, .., keyn=valn]). function parseParams(paramUnparsed){ var params = []; for ( var j = 0; j < paramUnparsed.length; j

  • Check whether $_POST-value is empty 2012-02-06

    if(isset($_POST['submit'])) { if(!isset($_POST['userName'])) { $username = 'Anonymous'; } else $username = $_POST['userName']; } I cannot get the $username to be "Anonymous"? It is either blank or the value of $_POST['userName']. --------------Soluti

  • Turning $_POST variables in MySQL Query 2012-04-08

    I trying to create a MySql Query from the $_POST values trouble is i don't want to use all the $_POST values as some are used for other things so i am trying to compare the value names against an array to see if they are actual filed in the DB then i

  • Length of a JavaScript object (that is, associative array) 2008-08-07

    If I have a JavaScript associative array, say: var myArray = new Object(); myArray["firstname"] = "Gareth"; myArray["lastname"] = "Simpson"; myArray["age"] = 21; Is there a built-in or accepted best practice way to get the length of this array? JavaS

  • Getting the array key in a foreach loop 2008-09-12

    I'm trying to get the key of the current element in a foreach loop? For example: PHP foreach($array as $key => $value) { echo("$value is assigned to key: $key"); } What I'm trying to do in C#: int[] values = { 5, 14, 29, 49, 99, 150, 999 }; foreac

  • How to efficiently count the number of keys/properties of an object in JavaScript? 2008-09-24

    What's the fastest way to count the number of keys/properties of an object? It it possible to do this without iterating over the object? i.e. without doing var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++; (Firefox did provide a m

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.167 (s). 11 q(s)