Welcome Guest, Not a member yet? Register   Sign In
Get data based on the URL but using the same function
#1

[eluser]Dannymx[/eluser]
Well, basically what I am looking to do is something like this:

The user will be able to type an URL like:

Quote:example.com/list/schoolname1
and the user will see data from the School 1

or

Quote:example.com/list/schoolname2
and here the user get data from school 2

etc.

So I have a function called index

Code:
function index(){
//loads data from a database and then displays it in view
}

The function will be used with any school that is typed since the functionality is the same.

I used routing to remove the index from the URL '(/list/(:any)', but what I want to know is how to make the function to identify what school was typed in the URL and then get the data based on that segment, and also even if they type SchOoLNamE1 (case insensitive).

Thanks in advance.


Messages In This Thread
Get data based on the URL but using the same function - by El Forum - 05-15-2011, 11:40 PM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:13 AM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:31 AM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:37 AM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:37 AM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:39 AM
Get data based on the URL but using the same function - by El Forum - 05-16-2011, 12:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB