Welcome Guest, Not a member yet? Register   Sign In
Getting a URL segment and calling a function inside a Controller
#1

[eluser]Unknown[/eluser]
Hello gentlemen's. I'm new here and I started using CI a few days ago and I'm having a few troubles.

Sorry for my bad english and sorry if this thread is already in this forum. I've made a simple search and haven't solved my questions yet. Well, here we go!

What I want to do is to get a segment in my URL and call a function inside a Controller. So, in my case I have the URL: http://localhost/CI_Project_A/call/990

In my URL, the last number (990) will be the ID that I'll use to perform a search in my database. So, that last number is the call ID in my database. Ok, I've used $this->uri->segment and now I can pass that segment for a variable. That's not the problem.

But now, I wanna call a function to perform my search. Look what I've done until now: http://pastebin.com/xSAECRRf

And It's working for now, but when I access the URL http://localhost/CI_Project_A/call/990, I get a 404 Page Not Found, but I also get the text that I've performed in my DB.

I'm probably doing this wrong. If anyone here can help, I'll appreciate.
Thank's!


Messages In This Thread
Getting a URL segment and calling a function inside a Controller - by El Forum - 06-21-2012, 10:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB