I'm very new to PHP (Learning it at CodeAcademy) and I wanted to make a web browser kind of thing using an
iframe. This is what I have so far:
<!DOCTYPE html> <html> <body> <?php $url = $_GET['url']; print $url; ?> <form name="input" method="get"> Url: <input type="text" name="url" action="<?php echo $url; ?>"> <input type="submit" value="Go"> </form> <iframe src="<?php echo $url; ?>"> <p>Your browser does not support iframes.</p> </iframe> </body> </html>
The block of code above is a .php file. My problem with this is that the iframe leads to the URL of my domain slash the URL you enter. A little better explanation is here.
I tried using a
$partial = substr($url, x, y) and making the iframe lead to
echo $partial so that the original domain is cut out and only the URL you entered is in the iframe URL. That didn't work. How can I fix this?