0

Hey everyone,

I was randomly trying to develop a web browser that works in php.
I know this is a really small program if you look into it but I dont seem to get it to work. though I have worked it out, but I cant get it to display pages.

Please have a look at my code below and tell me what im missing.

<?php
    $address = "$address"
?>

<html>
    <head>
        <title>NeXon Web</title>
        <link href="css/style.css" type="text/css" media="all"/>
    </head>

    <body>
        <div id="header">
            <img src="images/logo.png" id="logo"/>
            <img src="images/back.png" id="back" />
            <img src="images/fwd.png" id="fwd"/>
            <form action="index.php">
                <input name="address" type="address" id="address" placeholder="Address..."/>
                <input type="submit" value="Go" id="submit"/>
            </form>
        </div>
        <div id="body">
            <iframe src="<?php $address ?>" id="frame" border="0" height="800px" width="1100px" />
        </div>
    </body>
</html>

I know most of the links are not working and only display images like the logo, back, and fwd. but over all, the main test is not working :/

Thanks in advance :)

2
Contributors
4
Replies
7
Views
4 Years
Discussion Span
Last Post by NardCake
0

Ok as far as I know there isn't a address input type, do you mean url input type?
When you define address at the top you need to set it to $_POST['address'] not just itself. That should fix your issue.
--Edit--
Add the attribute method to your form and set it to post, so it looks like this:

<form method="post" action="index.php">
    <input name="address" type="address" id="address" placeholder="Address..."/>
    <input type="submit" value="Go" id="submit"/>
</form>

Thats should fix it.
or get if you want the url visible in the url, if you do that when you define address set it to $_GET['address'].

Edited by NardCake

0

well I tried, but it still did not seem to work, I still get a blank iFrame.
I tried post and get methods. and still no help.

0

Okay got to make it work :)

the line

<iframe src="<?php $address ?>" id="frame" border="0" height="800px" width="1100px" />

was supposed to be

<iframe src="<?php echo $address ?>" id="frame" border="0" height="800px" width="1100px" />

Thanks :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.