I am learning php. I have some code where I am trying to post 2 variables and 2 arrays from one php page to another page, the recieving page works fine but the first page is cropping data after a few characters (it hasnt reached max lenght or anywhere close)-
Here, $array_name and $array_qty are two dynamic arrays. I have verified that echo $c gives me exactly what I want.
<?php
$serialized_name=serialize($array_name);
$serialized_qty=serialize($array_qty) ;
$c="count=".$count ."&&Sum=" . $a . "&&serialized_name=". $serialized_name . "&&serialized_qty=". $serialized_qty;
echo $c;
?>
echo $c gives me-
count=6&&Sum=45.91&&serialized_name=a:7:{i:0;s:7:"vanilla";i:1;s:7:"vanilla";i:2;s:21:"very berry strawberry";i:3;s:7:"vanilla";i:4;s:7:"vanilla";i:5;s:7:"vanilla";i:6;s:7:"vanilla";}&&serialized_qty=a:7:{i:0;s:1:"2";i:1;s:1:"1";i:2;s:1:"1";i:3;s:1:"1";i:4;s:1:"1";i:5;s:1:"3";i:6;s:1:"3";}
However, this gives me cropped output of $c=
<p><a href="Checkout.php?<?php echo $c ?>" >Checkout</a> </p>
The cropped output that i get from the above line is-
http://localhost/myRestaurant/Checkout.php?count=6&&Sum=45.91&&serialized_name=a:7:{i:0;s:7:
I think I should have gotten this-
http://localhost/myRestaurant/Checkout.php?count=6&&Sum=45.91&&serialized_name=a:7:{i:0;s:7:%22vanilla%22;i:1;s:7:%22vanilla%22;i:2;s:21:%22very%20berry%20strawberry%22;i:3;s:7:%22vanilla%22;i:4;s:7:%22vanilla%22;i:5;s:7:%22vanilla%22;i:6;s:7:%22vanilla%22;}&&serialized_qty=a:7:{i:0;s:1:%222%22;i:1;s:1:%221%22;i:2;s:1:%221%22;i:3;s:1:%221%22;i:4;s:1:%221%22;i:5;s:1:%223%22;i:6;s:1:%223%22;}
I know get is not the best most secure way but I think this should have worked. Any tips on what I am doing wrong and how to fix it will be appreciated.
Your quotation mark will end the attribute prematurely. Escape your quotation marks: