Welcome Guest, Not a member yet? Register   Sign In
Counting outgoing clicks.
#5

[eluser]Michael Wales[/eluser]
@PauloBr
That only really works for links to domains, otherwise you have to do a lot of funky segment counting and concatenating
Code:
// URL is: http://www.domain.com/redirect/http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/
// Redirect to: http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/
$url = '';
for ($i = 2; $i <= $this->uri->total_segments(); $i++) {
    $url .= $this->uri->segment($i) . '/';
}

// Now determine if the original URL had a trailing slash or not
// If not, rip off the one we added
if (substr($this->uri->segment($this->uri->total_segments), -1) == '/') {
    $url = substr($url, 0, -1);
}

// Now redirect to $url;


Messages In This Thread
Counting outgoing clicks. - by El Forum - 11-28-2007, 12:57 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 01:02 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 01:08 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 01:27 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 04:45 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 04:47 PM
Counting outgoing clicks. - by El Forum - 11-28-2007, 05:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB