FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Associative Array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Associative Array [message #176161 is a reply to message #176160] Mon, 28 November 2011 10:33 Go to previous messageGo to previous message
Jesolo Sun is currently offline  Jesolo Sun
Messages: 8
Registered: November 2011
Karma:
Junior Member
Hi,

You can solve this in different ways.
The easiest is probably sending the values for ProductID and "Product
variant".

So in your form add:
<INPUT type="hidden" name="productid"
value="<?php echo $usedproductid; ?>">
<INPUT type="hidden" name="productvariant"
value="<?php echo $usedproductvariant; ?>">

Of course, use something sensible for $usedproductid and
$usedproductvariant.

Next, from your receiving script:
$productid = (int)$_POST["productid"];
$productvariant = (int)$_POST["productvariant"];

and use them by replacing the 99 and 300 in the original (form Jerry's
example):

$val0 = $_POST['product_data'][$productid ][$productvariant]['prezzo0'];
// 2.20
$val1 = $_POST['product_data'][$productid ][$productvariant]['prezzo1'];
// empty string

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens


Hi
is not possible because in the first page i use this values in Javascript
functions for example : calculate(numero_99_300, 99, 300);
this input
<INPUT style="width: 130px;" id="99_300_numero0" onChange="if (this.value <
min_numero_per_calcolare) { $(window).humanMsg('Minimal, total quantity of
products has to be: ' + min_numero_per_calcolare + ' pcs.'); this.value =
''; return
false }change_colour('99','300','0',this);document.getElementById('99_300_il0').v alue
= this.value;cambio_pagamento('99','300');calculate(numero_99_300, 99,
300);"
class="formfield"
name="product_data[99][300][numero0]" type="text">
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Order/Timing of Execution of PHP
Next Topic: Browser doesn't support
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 08:36:18 GMT 2024

Total time taken to generate the page: 0.03617 seconds