Jump to content

[Ask] [CodeIgniter] [Ion_Auth] uri segment


Orasion

Recommended Posts

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 : orasionseis@gmail.com

 

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: :confused:

 

thanks in advance

:)

Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.