Welcome Guest, Not a member yet? Register   Sign In
interesting problem with domain.com/username with reserved routes.
#1

[eluser]new_igniter[/eluser]
Hello,
I am working on a twitter application where we have a domain.com/username scenario. The application is using oAuth through Twitter, so my user clicks sign in on my app, goes to Twitter.com and logs in, then comes back to my domain/signin controller. However, twitter returns to me a variable via the url I need. However, since the url has a variable attached, it is not a perfect match with the "signin" listed in the reserve route array below.

How do I overcome this? Is there a way to so a wildcard match on the !in_array?

Code:
$url_parts = explode('/',$_SERVER['REQUEST_URI']);
$reserved_routes = array("splash","movies","actors","feeds","api","user","signout","signin");

if (!in_array($url_parts[1], $reserved_routes)) {
    $route['([a-zA-Z0-9_-]+)'] = "profiles/index/$1";
}




Theme © iAndrew 2016 - Forum software by © MyBB