jeudi 29 octobre 2015

url rotator with divs in php+html5 (no js+no iframe)

I made an url rotator with only php and html5 so not used iframe and trying to do without using js. Urls from db will be shown with next button and open web page in div object.How should i define variable to put inside object data ?

    <!DOCTYPE html>
<html>
<head>
</head>
<?php
$servername = "xxxxxxxxxx";
$username = "xxxxxxx";
$password = "xxxxxx";
$dbname = "db";

    $conn = mysql_connect($servername, $username, $password);
    $vt_sec=mysql_select_db("db",$conn);


    if ($_GET['orderby']=='timer') {
    $get= mysql_query ("select * from urllist order by timer asc");
    }
        else {
         $get= mysql_query ("select * from urllist order by id desc");
     }
    $list= mysql_fetch_array($get);
    $url = $list['url'];
    ?>
<body style="background-color: lightgray;margin: 0px">
        <div class="menu" style="height: 50px">
            <div class="menuin" style="float:left"><a href="index.php">Home</a></div>                           
            <div class="menuin" style="float:right"><a href="<?php $url['url']?>">NEXT</a></div>


        </div>
        <div style="background-color: green;margin:0px ">
    <object name="main" data= '<?php $url ?>' type="text/html"style="position:fixed;width:100%;height:100%;margin:0px"></object>
        </div>
</body>
</html>




Aucun commentaire:

Enregistrer un commentaire