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 :)

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'].

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.

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 :)

Oh nice that was pretty obvious, average mistake. Please mark it solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.