Welcome Guest, Not a member yet? Register   Sign In
URL as query segment
#3

[eluser]BnoL[/eluser]
I got an idea. You can check if it works for you Smile

Firstly, you have to define a route for your URL:

for example: http://localhost/get_thumbnail/{url_here}

so, if the request URL is: http://www.some-domain.com/index.php?ada...dasd=gvddf for example.

the URL to your site must be: http://localhost/get_thumbnail/http://www.some-domain.com/index.php?ada...dasd=gvddf

and now we'll get the request URL:

Code:
if($this->uri->segment(1) == "get_thumbnail") // if the 1st segment is "get_thumbnail"
        {
            $url = "";
            for($i=2;$i<=$this->uri->total_segments();$i++)
            {
                $url .= $this->uri->slash_segment($i,'leading');
            }
            
            $url = $url."?".$_SERVER['QUERY_STRING'];
            
            if(strstr($url,"/http:/")) // rebuild for long URL, ex: http://www.some-domain.com
                echo str_replace('/http:/','http://',$url); // or return...
            elseif(strstr($url,"/www.")) // without "http://", ex: www.some-domain.com
                echo "http://".str_replace('/www.','www.',$url); // or return...
        }

I've tested, and it works fine for me Smile

There are might be better solutions =]. Storm your brain! Tongue


Messages In This Thread
URL as query segment - by El Forum - 06-27-2009, 07:48 PM
URL as query segment - by El Forum - 06-27-2009, 09:08 PM
URL as query segment - by El Forum - 06-27-2009, 09:51 PM
URL as query segment - by El Forum - 06-27-2009, 11:56 PM
URL as query segment - by El Forum - 06-28-2009, 05:23 AM
URL as query segment - by El Forum - 06-28-2009, 06:33 AM
URL as query segment - by El Forum - 06-28-2009, 07:02 AM
URL as query segment - by El Forum - 06-28-2009, 07:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB