CodeIgniter Forums
Cannot get the data in another page in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: Cannot get the data in another page in CI (/thread-814.html)



Cannot get the data in another page in CI - Thamaraiselvam - 01-20-2015

I have form and when i submit that data are passed to next page i can see that in url. but i when i get and print that it shows nothing , here i have attached my coding

<form action="addfilters/add"><input type="hidden" name="id" value=<?php echo $filters->id ?> > <input type="submit" value="Add New"></form>

my controller

<?php
class AddFilters extends Admin_Controller
{
function add(){
echo $this->input->post('id');
}
}

URL

http://localhost/code/index.php/admin/addfilters/add?id=1

but when i print ,it shows nothing , please help me


RE: Cannot get the data in another page in CI - scorpioniz - 01-20-2015

(01-20-2015, 12:36 AM)Thamaraiselvam Wrote: I have form and when i submit that data are passed to next page i can see that in url. but i when i get and print that it shows nothing , here i have attached my coding

<form action="addfilters/add"><input type="hidden" name="id" value=<?php echo $filters->id ?> > <input type="submit" value="Add New"></form>

my controller

<?php
class AddFilters extends Admin_Controller
{
function add(){
echo $this->input->post('id');
}
}

URL

http://localhost/code/index.php/admin/addfilters/add?id=1

but when i print ,it shows nothing , please help me

maybe it's because you getting your data in GET parameter beacause you didn't set your method in form like
<form action="your_url" method="POST">


RE: Cannot get the data in another page in CI - scorpioniz - 01-20-2015

maybe it's because you didn't set method in your form like <form action="your_url" method="POST">
if you don't set it and if I remember good default value of method is GET Smile