i dont know what am i doing wrong but i am just messed a bit
i have a a href thats calling a controller
<a href="<?php echo base_url();?>mailing/index/?club=<?php echo $club_info[0]['club_title'];?>"><img src="<?php echo base_url();?>assets/front_assets/images/button_joinclub.png" width="180" height="44" border="0"></a>
now the function is this
class mailing extends CI_Controller{
private $pagesize = 20;
function __construct() {
parent::__construct();
@session_start();
}
function index()
{
echo $_REQUEST['club'];
}
}
but it gives me error
A PHP Error was encountered
Severity: Notice
Message: Undefined index: club
Filename: controllers/mailing.php
Line Number:12
EDIT
i need to call the mailing/index from different pages, and sometimes i need to pass parameter and sometimes not
if i use
function index($club)
{
//function body;
}
then i always need to send some parameter
sometimes the calling href can be like this also
<a href="<?php echo base_url();?>mailing"><img src="<?php echo base_url();?>assets/front_assets/images/button_joinclub.png" width="180" height="44" border="0"></a>
so it will call for an error since in function definition i have issued the presense of a parameter, and i am not passing any parameter through this link
so thats why i need
a href="<?php echo base_url();?>mailing/index/?club="<?php echo $club_info[0]['club_title'];?>"
so that i can use isset($_REQUEST['club'] to check if present or not.