[eluser]bluepicaso[/eluser]
Code for the new project(for which th split is not workiing is )
Code:
function searchFrnds()
{
$keywords = $this->input->post('srchfrnds');
$what = $this->input->post('what');
$tags = $keywords;
$tags=ltrim($tags);
$tags=rtrim($tags);
if(($tags == "") || ($tags == null))
{
$page = base_url()."welcome/friends";
?>
<html>
<head>
<meta http-equiv="Refresh" content="5; url=<?=$page?>">
</head>
<body>
<style>
#rsp
{
border: #b55024 1px solid;
background-color: #edbca7;
font-size: 20px;
color: #5F4412;
}
</style>
<div id='rsp'>
OOps, No keywords submitted....
<br>
<h6>
Please wait you will be redirected shortly
</h6>
</div>
</body>
</html>
<?
}
else
{
//echo $keywords."hello";
redirect("welcome/searchingFrnd/$tags/$what");
}
}
function searchingFrnd($tags, $what)
{
//echo $tags;
//$tags = $keyword;
//$tags=ltrim($tags);
//$tags=rtrim($tags);
$kt =split("_",$tags);//<---- split( not working here)
$q="";
//-----loading pagination class------
$this->load->library('pagination');
$config['base_url'] = base_url() . "welcome/searching/$keyword/$what";
//-----getting pagination as -------
if($what == "email")
{
while(list($key,$val)=each($kt))
{
if($val<>" " and strlen($val) > 0)
{
$val=ltrim($val);
$val=rtrim($val);
$q .="email like '%$val%' or ";
}
}
}
else
{
while(list($key,$val)=each($kt))
{
if($val<>" " and strlen($val) > 0)
{
$val=ltrim($val);
$val=rtrim($val);
$q .="display_name like '%$val%' or ";
}
}
}
$q=substr($q,0,(strLen($q)-3));
$config['total_rows'] = $this->db->count_all("user where ".$q);
$config['per_page'] = '20';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$config['uri_segment'] = 5;
$this->pagination->initialize($config);
if($what == "email")
{
$data['gotFrnds'] = @$this->get->getSearchedFrndByEmail($keyword, $config['per_page'],$this->uri->segment(5));
}
else
{
$data['gotFrnds'] = @$this->get->getSearchedFrndByName($keyword, $config['per_page'],$this->uri->segment(5));
}
$data['content'] = "srchdfriends";
$this->load->view('includes/user_template', $data);
}
They both are on localhost, same Ci version, and using wamp server.
Please help guys.