• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best Method for passing arrays to URL

#1
[eluser]Shiju S S[/eluser]
I think this is the best method for passing multiple values to URL.

Array Encoding

Code:
<div class="titile_bar">Premium Listing</div>
&lt;?php
for($i=1;$i<=10;$i++)
{
$data = array(
          'prdid'  => 'quickbharat.com',
          'exeid'    => 'Search Products',
          
    );
$serialized = rawurlencode(serialize($data));
?&gt;

<div id="add_small">
<a href="&lt;?Php echo base_url() ?&gt;frontpage/loadprddetails/&lt;?Php echo $serialized ?&gt;"><img src="&lt;?Php echo base_url() ?&gt;images/logo.jpg" align="left" width="136" height="60" /></a> <br />

</div>
  


  &lt;?Php } ?&gt;
</div>
</div>

Array decoding:
Code:
public function loadprddetails($prd)
{
  $var = unserialize(rawurldecode($prd));
  $data['message'] = "Product id is".$var['prdid']."Userid is ".$var['exeid'];
  $this->load->view('frontarea/header', $data);
  $this->load->view('frontarea/success_messages', $data);
  $this->load->view('frontarea/footer', $data);
}
[/code]


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.