Welcome Guest, Not a member yet? Register   Sign In
passing url variable


I would like to pass a variable from my index page to my form page in the url.

I have always used page.php?id=1 but now with CI when I try to pass the variable that way I get this error:

404 Page Not Found

The page you requested was not found.

I appreciate any help.


Take a look at the use of segment in the uri class user guide.


This is how I reference the link:

<a href="&lt;?php site_url('special_deals/form');?&gt;?d=1" class="roll">

This is my Controller:


class Special_deals extends Controller

var $data = array();

function Special_deals()
$this->data['current_menu_tab'] = "special_deals";
$this->data['message'] = '';

function index()


function page($page)

function form()


/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */


so do I just add a var to the beginning

$var = $this->uri->segment(n)

do I need to call anything in my constructor

Thanks that worked


Theme © iAndrew 2016 - Forum software by © MyBB