Orasion Posted July 31, 2011 Share Posted July 31, 2011 Hi again all. I have an annoying bug and cant seem to solve it for past 5 days. So, here I am, asking all of you for a help I want to fetch 3rd uri segment and use it as username then show his/her profile from. In my controller, I do this $usercheck = str_replace($this->data['revsearch'], $this->data['revreplace'], $this->uri->segment(3)); $this->data['usercheck'] = str_replace($this->data['revsearch'], $this->data['revreplace'], $this->uri->segment(3)); $sql = "select email from users where username = $usercheck ;"; $email = mysql_query($sql); $this->data['email'] = mysql_query($sql); $user = $this->ion_auth->get_user_by_email($email); note : I make $email for production purpose (real code) and make $this->data['email'] for debug purpose This is my view code <div id="myprofile"> <h2>Personal Information</h2> <p><?php echo $usercheck ?></p> <p><?php echo $email ?></p> <p>Name : <?php echo $user->first_name; ?> <?php echo $user->last_name; ?></p> <p>Email : <?php echo $user->email; ?></p> </div><!-- myprofile end --> <div id="push"></div> </div><!-- wrapper end --> And it return this Personal Information administrator Name : Ndaru Aji Email : [email protected] As you can see, $usercheck return my 3rd URI segment but my $email did not return any result, so the next commands return the result that I did not want. Can you give me a hint to solve this ? :confused: thanks in advance Link to comment https://forums.phpfreaks.com/topic/243344-ask-codeigniter-ion_auth-uri-segment/ Share on other sites More sharing options...
cassey071 Posted September 8, 2011 Share Posted September 8, 2011 $res_ar = $this->Contents->getProduct($this->uri->segment(4),$this->uri->segment(3)); Link to comment https://forums.phpfreaks.com/topic/243344-ask-codeigniter-ion_auth-uri-segment/#findComment-1266670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.