# PHP in URLs



## jayhusky (Jul 22, 2010)

Question.
I've seen this on various websites I can't remember the name of and wondered if it was possible.

Is it possible to take the parameter from the end of a URL:
An example being www.example.com/link.php?q=http://example2.com , and use it as a source in an iframe?

Basically, is it possible to take the http://example2.com portion of the url and using PHP write the code to have it as the source of the iframe..

If this was possible then changing the url after the ?q= would allow for any wesbsite to be loaded into the Iframe.


----------



## SnowFox (Jul 22, 2010)

Wouldn't something like this do it?


```
echo "<iframe src=\"".$_GET['q']."\"></iframe>";
```


I dread to think why you'd want to though


----------



## jayhusky (Jul 22, 2010)

Thanks, I hadn't really wanted to use it for anything major, just wondered if it was at all possible.


----------



## LizardKing (Jul 22, 2010)

SnowFox said:


> Wouldn't something like this do it?
> 
> 
> ```
> ...


 
No, wait, nevermind. That doesn't work.

DISREGARD THAT I SUCK LOCKS


----------



## SnowFox (Jul 22, 2010)

LizardKing said:


> Getting around school filters


 
That would actually work? Must be one hell of a crappy filter.

EDIT: oh ok, nevermind then!


----------



## LizardKing (Jul 22, 2010)

SnowFox said:


> That would actually work? Must be one hell of a crappy filter.
> 
> EDIT: oh ok, nevermind then!


 
It made sense for a brief moment, then my brain woke up and slapped me.


----------



## SnowFox (Jul 22, 2010)

This probably would

```
if(($fp = fsockopen("www.furaffinity.net", 80, $errno, $errstr, 30)))
{
	$out = "GET / HTTP/1.1\n";
	$out .= "Host: www.furaffinity.net\n";
	$out .= "Connection: Close\n\n";

	fwrite($fp, $out);
	while(!feof($fp)) echo fgets($fp, 128);
	fclose($fp);
}
```


----------



## LizardKing (Jul 22, 2010)

SnowFox said:


> This probably would
> 
> ```
> if(($fp = fsockopen("www.furaffinity.net", 80, $errno, $errstr, 30)))
> ...


 
That's better.

We used shit like that in college. Good times.


----------



## SnowFox (Jul 22, 2010)

LizardKing said:


> That's better.
> 
> We used shit like that in college. Good times.


 
I barely knew anything in school or college. So much fun I could have had 
It's probably just as well, I might have got kicked out.


----------

