Hey all
since I am learning on how to use serialize, I am facing a hiccup where after I used the below code which is the Jquery post
jQuery.post("d_in.php",jQuery("#myform").serialize(), function(data){
alert("Data Loaded: " + data);
and let's say I have 2 inputs which names are Small$item_id, where each input name follows the items itself,
whenever I try
echo $_POST['Small'.$item_id]
I get both in one
let's say 1 for small102-s and 3 for small1055-a
when I print the result I get as follows : 13
even when it comes to more items
how can I split the number?
Update #1:
i tried using explode("&", $_POST['Small'.$item_id]
i am getting null, it seems the data is sent without the &
it is sent together without any split.
Update#2:
here is whats in d_in.php
foreach ($cart->get_contents() as $item)
{
$item_id = $item['id'];
$item_name = $item['name'];
$item_price = $item['price'];
$item_qty = $item['qty'];
$item_ids = explode("-",$item_id);
for($i = 0; $i < count($item_ids); $i++){
$item_idn = join("",$item_ids);
}
echo $_POST['Small'.$item_idn];
$item_idn = "";
}