Welcome Guest, Not a member yet? Register   Sign In
Don't want users to use this
#1

[eluser]Unknown[/eluser]
Okay, so I am using codeigniter, and I want to know:

Code:
class Home extends Controller {

    function __construct()
    {
        parent::Controller();    
        $this->load->helper('form');
    }

    
    function index()
    {
        $this->load->view('home_view');
    
    }

    function login() {
    $this->load->view('login_view');
    }

I have that code, now, as you can see, I have a class named "Home"

If users type "home" in the url, they will see that page, is there anyway I can stop this from happening?

I don't want users to type /home,

Thanks guys!


(Oh wow, new here, and I think I posted in the wrong forum :red:, sorry about that)
#2

[eluser]SpooF[/eluser]
What exactly are you trying to do? When do you want that controller to be seen?
#3

[eluser]jedd[/eluser]
Hi Invsioncode and welcome to the forums.

With these kinds of questions, try to think in terms of what you want to happen, and what actually does happen - in other words, intent, expectation and divergence.

You might find something like this answers your question:

Code:
function index()
{
    redirect ("home/login");    
}
#4

[eluser]Unknown[/eluser]
I was thinking of a redirect to another page

Is that the only way to do it?

(what I am getting at is that you could have the same url in twice)

www.example.com/home/home

if you have a class of home, and an function of index.

Because the first /home is the INDEX
The second is the CLASS name.
#5

[eluser]jedd[/eluser]
List each URL and describe what you want to happen on each one.
#6

[eluser]Craig A Rodway[/eluser]
[quote author="Invsioncode" date="1261190984"]If users type "home" in the url, they will see that page, is there anyway I can stop this from happening?[/quote]

Delete Home.php?


Wink




Theme © iAndrew 2016 - Forum software by © MyBB