HTML Site Problems

Discussion in 'HTML and CSS' started by strawbs, Nov 25, 2019.

  1. strawbs

    strawbs

    Joined:
    Jun 14, 2018
    Messages:
    8
    Likes Received:
    0
    hi all i'm having trouble with a site i'm building

    i didn't want the yellow color every were
    i wanted my listen live text next to my link

    also i don't want that nasty yellow were my text is, especially on the nav bar

    Code (Text):

    <!doctype html>
    <html lang="en">
    <head>
    <title> hottunez </title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    * {
      box-sizing: border-box;
    }

    body {
      font-family: Arial, Helvetica, sans-serif;
    }

    /* Style the header */
    header {
      background-color: #ccffff;
      padding: 30px;
      text-align: center;
      font-size: 55px
      color: white;
    }

    /* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
    @media (max-width: 600px) {
      nav, article {
        width: 100%;
        height: auto;
      }
    }
    </style>
    </head>
    <body>
    <body>

    <header>
    <style>


    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      width: 200 px
    background-color: #f1f1f1;
    border: 1px solid #555;

    }

    li a {
      display: block;
      color: #000;
      padding: 8px 16px;
      text-decoration: none;
    }

    li a.active {
      background-color: #ccffff;
      color: white;
    }

    li a:hover:not(.active) {
      background-color: #555;
      color: white;
    }
    </style>
    </head>
    <ul>

    <html>
    <head>
    <style>

    a {
      color: hotpink;
    }
    </style>
    </head>
    <body>


    <p> Tunein</p><a href="javascript:;" onClick="window.open('http://www.hottunez-radio.com/player.php','wimpyMP3player','width=480,height=140')">Launch Jukebox</a>

    <br>
    <br>

    </body>
    </html>
      <a class="active" href="#home">Home</a>
      <a href="#presenters">Presenters</a>
      <a href="#schedule">Schedule</a>
      <a href="#podcast&chat">Podcast&Chat</a>
    </ul>

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    h1 {
     
    }

    div {
     
    }

    p {
      background-color: yellow;
    }
    </style>
    </head>
    <body>


    <div>



    </div>

    </body>
    </html>
     
    </header>




    <p> <a name="Home"> Welcome To Hottunez Radio We Have Been Running Since 2001 it went into a virtual world called vside and second, but nower days we are streaming to the people of the word. we stream a variety of music such a pop, dance, rnb, hardstyle and many more </a> </p>

    </body>




    </html>
     
    Last edited by a moderator: Nov 28, 2019
    strawbs, Nov 25, 2019
    #1
    1. Advertisements

  2. strawbs

    sunfighter

    Joined:
    Nov 27, 2019
    Messages:
    13
    Likes Received:
    1
    Your code is horrible strawbs. You should only have one <head> and one <body> not the 6 or 8 that you have. all of your styling should be contained in ONE <style> tag and that placed in the HEAD. Here are two errors in the CSS and that changed how your site looks:
    Code (Text):

    header {
    background-color: #ccffff;
    padding: 30px;
    text-align: center;
    font-size: 55px; // added the semicolon
    color: white;
    }
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 200px; // added the semicolon and removed gap between 200 and px
    background-color: #f1f1f1;
    border: 1px solid #555;
    }
     
    This puts a yellow color behind your text and the words 'tune in':
    Code (Text):

    p {
    background-color: yellow;
    }
     
     
    sunfighter, Nov 27, 2019
    #2
    1. Advertisements

  3. strawbs

    strawbs

    Joined:
    Jun 14, 2018
    Messages:
    8
    Likes Received:
    0
    sorry i have another problem now

    i'm trying to get the nav links in the top left or top right, in my case its top right

    here's my code

    <!doctype html>
    <head>
    <title>Hot Tunez Radio</title>
    <link rel="stylesheet" href="style.css" type="text/css">
    </head>

    <center><!DOCTYPE html>
    <html>
    <body>




    </body>
    </html></center>

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    }

    li {
    float: right;
    }

    li a {
    display: block;
    padding: 0px;
    background-color: #dddddd;
    }
    </style>
    </head>
    <body>

    <!DOCTYPE html>
    <html lang="en">
    <head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    /* Style the body */
    body {
    font-family: Arial;
    margin: 0;
    }

    /* Header/Logo Title */
    .header {
    padding: 60px;
    text-align: center;
    background: #1abc9c;
    color: white;
    font-size: 20px;
    }

    /* Page Content */
    .content {padding:20px;}
    </style>
    </head>
    <body>

    <div align="left"><div class="header">
    <ul>
    <a href="http://hottunez-radio.com">Home</a></li>
    <a href="#news">News</a></li>
    <a href="#contact">Contact</a></li>
    <a href="#about">Request</a></li>
    </ul>
    </div>

    <div class="content">


    </div>

    </body>
    </html>

    <style>
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: ;
    }

    li {
    float: right;
    }

    li a {
    display: block;
    color: dark blue;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    }

    li a:hover {
    background-color: #dddddd;
    }
    </style>
    </head>
    <body>



    </body>
    </html>




    </body>



    <center><!DOCTYPE html>
    <html lang="en">
    <head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    </head>
    <body>

    <div class="container mt-3">





    <div align="right"><?php
    $test = exec('curl -X GET "http://176.9.139.122/api/nowplaying" -H "accept: */*"');
    $test2 = json_decode($test, True);
    if($test2[1]['live']['is_live']== 0)
    {
    $playing = $test2[1]['now_playing']['song']['text'];
    $img = "http://hottunez-radio.com/images/AutoDj.png";
    echo "Now Live:<br /> <img src='$img' width='160'><br />Auto DJ<br /> <br>$playing<br>";
    }
    else
    {
    $live = $test2[1]['live']['streamer_name'];
    $playing = $test2[1]['now_playing']['song']['text'];
    $img = "images/$live.jpg";
    echo "<font color='pink'>Now Live:</font><br /><img src='$img' width='200' height=\"200\"><br /> $live<br /><font color='black'> $playing</font>";

    }
    ?>

    </div>


    </body>
    </html>
    </center>
    <!DOCTYPE html>
    <html>
    <head>
    <link rel="dns-prefetch" href="//fonts.googleapis.com">
    <link rel="dns-prefetch" href="//ajax.googleapis.com">
    <title>HotTunez Requests</title>
    <meta charset="utf-8" />
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
    <style>
    <?php include 'main.css'; ?>
    </style>

    </head>
    <?php
    include 'config.php';
    include 'functions.php';
    ?>

    <body>
    <button id="toTop" title="Go to top">Top</button>

    <?php
    if (!$conn) {
    echo "<center><table class=\"table\" style=\"width: 300px; text-align: center\"><td>".$lang['OFFLINE']."</td></table></center>";
    } else {
    ?>
    <div class="content">

    <table class="table table1" style="width: 700px"><td><center><?php echo $lang['REQUESTED_TRACK_LIMITS'].''.$reqLimit.''.$lang['REQUESTED_TRACK_LIMITS1'].''.$req_wait.''.$lang['REQUESTED_TRACK_LIMITS2']; ?> </center></td></table>

    <?php

    if (!$req_event == 0) {
    echo "<table class=\"table\" style=\"width: 400px; text-align: center\"><td>".$lang['REQ_EVENT']." ".$req_event." ",$lang['REQ_EVENT2']."</td></table>";
    } ?>

    <div style="text-align: center;"><?php echo $lang['REQ_A_TRACK']; ?></div>
    <table class="table sbox" style="width: 70%">
    <tr>
    <td>

    <?php

    $targetpage = $_SERVER['SCRIPT_NAME']; //Link to this page

    $srch = "";
    $srchpath = "";
    $srcquery = "";
    $page = 1;
    $reqid = "";
    $notin = "AND id_subcat NOT IN(".$reqsubcat.")";


    if (isset($_GET['searchterm'])) {
    if ($_GET['searchterm'] != "") {
    if (!empty($reqsubcat)) {
    $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
    $srchpath = "&searchterm=$srch";
    $srcquery = "AND `enabled`= 1 AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%') $notin "; //Search artist and title not in selected subcats only enabled tracks.
    } else {
    $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
    $srchpath = "&searchterm=$srch";
    $srcquery = "AND `enabled`= 1 AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%')"; //Search artist and title only on enabled tracks.
    }
    }
    echo "<center><div id=\"notfind\">".$lang['ERROR_FIND']."<br><br>
    <A HREF=\"javascript:javascript:history.go(-1)\"><button class=\"button back\">".$lang['GO_BACK']."</button></A></div></center>";
    }

    //Get the page if it's requested
    if (isset($_GET['page'])) {
    $page = mysqli_real_escape_string($conn, $_GET['page']);
    }

    if ($page) {
    $start = ($page - 1) * $page_limit;
    } else {
    $start = 0;
    }

    if (isset($_POST['reqsubmit'])) {

    /*
    ERROR CODES:
    0 = No error
    1 = no user name
    2 = no requested track
    3 = track already in queue
    4 = request limit reached
    5 = Waiting time not over
    */

    $reqname = mysqli_escape_string($conn, $_POST['requsername']);
    $reqmsg = mysqli_escape_string($conn, $_POST['reqmessage']);
    $reqsongID = mysqli_escape_string($conn, $_POST['songID']);
    $reqIP = getRealIpAddr();


    $error = 0;
    $reccount = 0;

    if (!$reqname) {
    $error = 1;
    }
    if (!$reqsongID) {
    $error = 2;
    }

    if ($error == 0) {



    //track is already requested?
    $recheck = "SELECT COUNT(*) AS num FROM `requests` WHERE `songID`='$reqsongID' AND `played`='0' AND `song_type`='0';";
    $total_req = mysqli_fetch_array(mysqli_query($conn, $recheck));

    if ($total_req['num'] > 0) {
    $error = 3;
    }

    @mysqli_free_result($conn, $total_req);

    if ($error == 0) {
    //user has reached the request limit?
    $recheck = "SELECT COUNT(*) AS num FROM `requests` WHERE `userIP`='$reqIP' AND DATE(`requested`) = DATE(NOW());";
    $total_req = mysqli_fetch_array(mysqli_query($conn, $recheck));

    if ($total_req['num'] >= $reqLimit) {
    $error = 4;
    $reccount = $total_req['num'];
    }
    # check if waiting time is over for new request.

    $sql= "SELECT * FROM `requests` WHERE `userIP`='$reqIP' ORDER BY `requested` DESC LIMIT 1 ";
    $res = $conn->query($sql);

    if ($res->num_rows > 0) {
    while ($row = mysqli_fetch_assoc($res)) {
    $timex= $row['requested'];
    }
    $calc = strtotime($timex);
    $calc2 = date('Y-m-d H:i:s');
    $calc3 = strtotime($calc2);
    $calc4 = ($calc3-$calc) / 60;
    $min = intval($calc4);

    if ($min < $req_wait) {
    $error = 5;
    }
    }

    # check waiting time end.
    @mysqli_free_result($conn, $total_req);
    }
    }

    switch ($error) {
    case 0:
    echo "<center>";
    $queryx = "INSERT INTO `requests` SET `songID`='$reqsongID', `username`='$reqname', `userIP`='$reqIP', `message`='$reqmsg', `requested`=now();";
    $resultx = mysqli_query($conn, $queryx);

    if ($resultx > 0) {
    $nu1= $total_req['num'];
    $nu2 = $nu1+1;
    echo "<div class=\"noticediv\">" . $lang['MSG_REQSUCCESS'] . " <b>".$nu2."</b> ".$lang['MSG_REQSUCCESS_TOT']." <b>".$reqLimit."</b>";
    if ($nu2 == $req_wait) {
    echo "<center><div class=\"errordiv\">" . $lang['ERROR_LIMITREACHED2'] . "</div></center><br><br>";
    } else {
    echo "<br />".$lang['WAIT']." ".$req_wait." ".$lang['WAIT2']."</div>";
    }
    } else {
    echo "<center><div class=\"errordiv\"><center>" . $lang['ERROR_UNKNOWN'] . "</center></div></center><br /><br>";
    }

    @mysqli_free_result($conn, $resultx);
    echo '</center>';

    break;
    case 1:
    echo '<center>';
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_USERNAME'] . "</center></div></center><br />";
    echo "<div id=\"back\"><center><br><br><A HREF=\"javascript:javascript:history.go(-1)\"><button
    class=\"back\">".$lang['GO_BACK']."</button></A></center>";

    break;
    echo '</center>';
    case 2:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_TRACKID'] . " </center></div></center><br />";
    echo "<center><A HREF=\"javascript:javascript:history.go(-1)\">".$lang['GO_BACK']."</A></center><br><br>";
    break;
    case 3:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_TRACKREQ'] . "</center></div></center><br /><br>";
    break;
    case 4:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_LIMITREACHED'] . " (" . $reccount . "/" . $reqLimit . ")" . "</center></div></center><br /><br>";
    break;
    case 5:
    $wait_time= $req_wait-$min;
    echo "<br><center><div class=\"errordiv\">" . $lang['ERROR_TRACKREQ_TIME'] . " ".$wait_time." ".$lang['ERROR_TRACKREQ_TIME2']."</div></center><br>";
    break;
    }


    $reqid = "";
    }

    //Get the page if it's requested
    if (isset($_GET['requestid'])) {
    if ($_GET['requestid'] != "") {
    $reqid = mysqli_escape_string($conn, $_GET['requestid']);
    //Get track artist Name and title.
    $querysong = "SELECT * FROM `songs` WHERE `ID` = $reqid AND `enabled`= '1' AND `song_type`='0' ";
    $queryderp = mysqli_query($conn, $querysong);

    while ($row = mysqli_fetch_assoc($queryderp)) {
    $title= $row['title'];
    $artist= $row['artist'];
    }



    echo "<div class=\"selection\">".$lang['REQ_SELECTED']. " ". $artist." - ".$title."</div></td></tr>";

    echo "<table>";
    echo " <form id=\"formrequest\" name=\"formrequest\" method=\"post\" action=\"$targetpage?page=$page$srchpath\">";
    echo " <table align=\"center\" width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" class=\"nobar\">";
    echo " <tr>";

    echo "<td><div align=\"center\"><p>" . $lang['REQ_DESCRIPTION'] . "</p></div></td>";
    echo " </tr>";
    echo " <tr>";

    echo " <td><input type=\"text\" autofocus name=\"requsername\" placeholder=\"" . $lang['REQ_NAME'] . "\" /></td>";
    echo " </tr>";
    echo " <tr>";

    echo " <td colspan=\"3\"><div class=\"message\"><textarea name=\"reqmessage\" rows=\"5\" cols=\"80\" placeholder=\"" . $lang['REQ_MESSAGE'] . "\"></textarea></div></td>";
    echo " </tr>";
    echo " <tr>";
    echo " <td colspan=\"2\"><div align=\"center\"><input type=\"Submit\" name=\"reqsubmit\" value=\"" . $lang['REQ_BUTTON'] . "\" /></div></td>";
    echo " </tr>";
    echo " </table>";
    echo " <INPUT TYPE=\"hidden\" name=\"songID\" value=\"$reqid\">";
    echo " </form>";
    echo " </div>";
    echo "</td></table>";
    echo "<div id=\"back\"><center><br><br><A HREF=\"javascript:javascript:history.go(-1)\"><button
    class=\"back\">".$lang['GO_BACK']."</button></A></center>";
    echo '</td></table></center></div>';
    }
    }

    //================//

    if ($reqid == "") {


    //Get the number of items
    if (!empty($reqsubcat)) {
    $query = "SELECT COUNT(*) as num FROM `songs` WHERE `enabled`='1' $srcquery AND `song_type`='0' $notin ";
    $total_pages = mysqli_fetch_array(mysqli_query($conn, $query));
    $total_pages = $total_pages['num'];
    } else {
    $query = "SELECT COUNT(*) as num FROM `songs` WHERE `enabled`='1' $srcquery AND `song_type`='0' ";
    $total_pages = mysqli_fetch_array(mysqli_query($conn, $query));
    $total_pages = $total_pages['num'];
    }

    //Get page data (To inplant left join queuelist see)
    if (!empty($reqsubcat)) {
    $query1 = "SELECT `ID`, `artist`, `title`, `year`, `duration`, `date_played`, `artist_played`,`id_subcat` FROM `songs` WHERE `enabled`='1' $srcquery AND`song_type`='0' $notin ORDER BY `artist` ASC LIMIT $start, $page_limit";
    $result = mysqli_query($conn, $query1);
    } else {
    $query1 = "SELECT `ID`, `artist`, `title`, `year`, `duration`, `date_played`, `artist_played`,`id_subcat` FROM `songs` WHERE `enabled`='1' $srcquery AND`song_type`='0' ORDER BY `artist` ASC LIMIT $start, $page_limit";
    $result = mysqli_query($conn, $query1);
    }
    // Initial page num setup
    if ($page == 0) {
    $page = 1;
    }
    $prev = $page - 1;
    $next = $page + 1;
    $lastpage = ceil($total_pages/$page_limit);
    $LastPagem1 = $lastpage - 1;

    $paginate = '';

    if ($lastpage > 1) {
    $paginate .= "<div class='paginate'>";
    //Placeholder for previous so buttons don't move after page 1
    if ($page == 1) {
    $paginate.= "<span style\"visibility:normal;\"><a id='prev' style=\"background-color: var(--button-hover-color);cursor: default !important; opacity:0.6;\">" . $lang['NAV_PREV'] . "</a></span> ";
    }
    // Previous
    if ($page > 1) {
    $paginate.= "<a href='$targetpage?page=$prev$srchpath' id='prev'>" . $lang['NAV_PREV'] . "</a> ";
    }

    // Pages

    if ($lastpage < 7 + ($adjacents * 2)) {
    for ($counter = 1; $counter <= $lastpage; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }
    } elseif ($lastpage > 5 + ($adjacents * 2)) {

    // Beginning only hide later pages
    if ($page < 1 + ($adjacents * 2)) {
    for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }

    $paginate.= "<strong>...</strong>";
    $paginate.= "<a href='$targetpage?page=$LastPagem1$srchpath'> $LastPagem1 </a>";
    $paginate.= "<a href='$targetpage?page=$lastpage$srchpath'> $lastpage </a>";
    } elseif ($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {
    $paginate.= "<a href='$targetpage?page=1$srchpath'> 1 </a>";
    $paginate.= "<a href='$targetpage?page=2$srchpath'> 2 </a>";
    $paginate.= "<strong>...</strong>";

    for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }

    $paginate.= "<strong>...</strong>";
    $paginate.= "<a href='$targetpage?page=$LastPagem1$srchpath'> $LastPagem1 </a>";
    $paginate.= "<a href='$targetpage?page=$lastpage$srchpath'> $lastpage </a>";
    } else {
    $paginate.= "<a href='$targetpage?page=1$srchpath'> 1 </a>";
    $paginate.= "<a href='$targetpage?page=2$srchpath'> 2 </a>";
    $paginate.= "<strong>...</strong>";

    for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }
    }
    }

    // Next
    if ($page < $counter - 1) {
    $paginate.= "<a href='$targetpage?page=$next$srchpath' id='next'> " . $lang['NAV_NEXT'] . "</a>";
    }


    //Placeholder for next so buttons don't move after last page
    if ($page == $counter) {
    $paginate.= "<span><a id='next' style=\"background-color: var(--button-hover-color);cursor: default !important; opacity:0.6;\">" . $lang['NAV_NEXT'] . "</a></span> ";
    }


    $paginate.= "</div>";
    }
    if (isset($_GET['random'])) {
    if ($random = '1') {
    $query1 = "select * from songs WHERE `enabled`='1' AND `song_type`='0' ORDER BY RAND() LIMIT 0,$random_limit";
    $result = mysqli_query($conn, $query1);
    }
    }
    //Search box
    echo '<div align="center" class="sbox" style="width:50%;">';
    echo "<form name=\"input\" action=\"$targetpage\" method=\"get\">";
    echo " <input type=\"text\" value=\"$srch\" name=\"searchterm\"
    placeholder=\"" . $lang['SEARCH_TXT'] . "\"> <input type=\"submit\" value=\"" . $lang['SEARCH_BUTTON'] . "\"><INPUT class=\"random\" Type=\"BUTTON\" VALUE=\"" . $lang['REQ_RANDOM'] . "&nbsp;" . $random_limit . "\" ONCLICK=\"window.location.href='?random=$random_seed'\">";
    // echo '<br />';

    echo '</form>';
    echo '</div>';

    if ($total_pages > 0) {
    echo '<div id="paginate" $hidepages align="center">' . $paginate . '</div>';
    //Results table
    echo "<center>";
    echo '<br><table class= "tablespec" border="0" cellspacing="0" cellpadding="5" width="90%">';
    echo " <tr>" . "";
    echo " <th style='width:6%;text-align: center;'>".$lang['COL_NUM']."</th>";
    echo " <th style='width:35%;'>" . $lang['COL_ARTIST'] . "</th><th style='width:50%;'>".$lang['COL_TITLE']."</th>";
    //echo " <th style='width:40%;'>" . $lang['COL_YEAR'] . "</th>";
    echo " <th style='width:5%;'>" . $lang['COL_DURATION'] . "</th>";
    echo " <th style='width:75px;'>" . $lang['COL_REQ'] . "</th>";
    echo " </tr>" . "";

    $cnt = 1+($page_limit*$page)-$page_limit; //Results counter

    //Add results to the table
    while ($row = mysqli_fetch_assoc($result)) {
    echo " <tr>" . "";
    echo " <td style='text-align: center;'>$cnt</td>";
    echo " <td>" . $row['artist'] . "</td><td>".$row['title']."</td>";
    // echo " <td>" . $row['year'] . "</td>";
    echo " <td>" . convertTime($row['duration']) . "</td>";
    if (track_can_play($row['date_played'], $row['artist_played']) == true) {
    echo " <td class=\"entry_no\"><a href=\"$targetpage?page=$page&requestid=" . $row['ID'] . "\" title=\"" . $lang['ALT_REQ'] . "\"><button>".$lang['REQ_SELECT']."</button></a></td>";
    } else {
    echo " <td class=\"entry_no\"><center><span class=\"noreq\">".$lang['NOREQ']."</span></center></td>";
    }

    echo " </tr>";
    $cnt++;
    }

    @mysqli_free_result($conn, $result);
    echo "</center>"; ?>

    </table>
    <br />

    <?php
    if (isset($_GET['random'])) {
    echo " <INPUT class=\"random\" Type=\"BUTTON\" style=\"width: auto; display:inline-block;padding: 10px !important;\" VALUE=\"" . $lang['REQ_RANDOM2'] . "&nbsp;" . $random_limit . "\" ONCLICK=\"window.location.href='?random=$random_seed'\">";
    } else {
    //Add the bottom pagination
    echo '<div id="paginate" align="center">' . $paginate . '</div>';
    }
    } else {
    echo "<center><div class=\"errordiv\">" . $lang['MSG_NORESULTS'] . "</div></center>";
    }
    } ?>
    </td>
    </tr>
    </table>
    </center>
    </div>
    <?php
    }

    ?>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
    $(window).scroll(function(){
    if ($(this).scrollTop() > 100) {
    $('#toTop').show();
    } else {
    $('#toTop').hide();
    }
    });
    $('#toTop').click(function(){
    $("html, body").animate({ scrollTop: 0 }, 600);
    return false;
    });
    });
    </script>
    </body>
    </html>

    <canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
    Your browser does not support the HTML5 canvas tag.
    </canvas>

    </body>
    </html>

    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <body>



    <center><!DOCTYPE html>
    <html>
    <body text="green">







    </body>
    </html></center>
    <!DOCTYPE html>
    <html>
    <head>
    <link rel="dns-prefetch" href="//fonts.googleapis.com">
    <link rel="dns-prefetch" href="//ajax.googleapis.com">
    <title>HotTunez Requests</title>
    <meta charset="utf-8" />
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
    <style>
    <?php include 'main.css'; ?>
    </style>

    </head>
    <?php
    include 'config.php';
    include 'functions.php';
    ?>

    <body>
    <button id="toTop" title="Go to top">Top</button>

    <?php
    if (!$conn) {
    echo "<center><table class=\"table\" style=\"width: 300px; text-align: center\"><td>".$lang['OFFLINE']."</td></table></center>";
    } else {
    ?>
    <div class="content">

    <table class="table table1" style="width: 700px"><td><center><?php echo $lang['REQUESTED_TRACK_LIMITS'].''.$reqLimit.''.$lang['REQUESTED_TRACK_LIMITS1'].''.$req_wait.''.$lang['REQUESTED_TRACK_LIMITS2']; ?> </center></td></table>

    <?php

    if (!$req_event == 0) {
    echo "<table class=\"table\" style=\"width: 400px; text-align: center\"><td>".$lang['REQ_EVENT']." ".$req_event." ",$lang['REQ_EVENT2']."</td></table>";
    } ?>

    <div style="text-align: center;"><?php echo $lang['REQ_A_TRACK']; ?></div>
    <table class="table sbox" style="width: 70%">
    <tr>
    <td>

    <?php

    $targetpage = $_SERVER['SCRIPT_NAME']; //Link to this page

    $srch = "";
    $srchpath = "";
    $srcquery = "";
    $page = 1;
    $reqid = "";
    $notin = "AND id_subcat NOT IN(".$reqsubcat.")";


    if (isset($_GET['searchterm'])) {
    if ($_GET['searchterm'] != "") {
    if (!empty($reqsubcat)) {
    $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
    $srchpath = "&searchterm=$srch";
    $srcquery = "AND `enabled`= 1 AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%') $notin "; //Search artist and title not in selected subcats only enabled tracks.
    } else {
    $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
    $srchpath = "&searchterm=$srch";
    $srcquery = "AND `enabled`= 1 AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%')"; //Search artist and title only on enabled tracks.
    }
    }
    echo "<center><div id=\"notfind\">".$lang['ERROR_FIND']."<br><br>
    <A HREF=\"javascript:javascript:history.go(-1)\"><button class=\"button back\">".$lang['GO_BACK']."</button></A></div></center>";
    }

    //Get the page if it's requested
    if (isset($_GET['page'])) {
    $page = mysqli_real_escape_string($conn, $_GET['page']);
    }

    if ($page) {
    $start = ($page - 1) * $page_limit;
    } else {
    $start = 0;
    }

    if (isset($_POST['reqsubmit'])) {

    /*
    ERROR CODES:
    0 = No error
    1 = no user name
    2 = no requested track
    3 = track already in queue
    4 = request limit reached
    5 = Waiting time not over
    */

    $reqname = mysqli_escape_string($conn, $_POST['requsername']);
    $reqmsg = mysqli_escape_string($conn, $_POST['reqmessage']);
    $reqsongID = mysqli_escape_string($conn, $_POST['songID']);
    $reqIP = getRealIpAddr();


    $error = 0;
    $reccount = 0;

    if (!$reqname) {
    $error = 1;
    }
    if (!$reqsongID) {
    $error = 2;
    }

    if ($error == 0) {



    //track is already requested?
    $recheck = "SELECT COUNT(*) AS num FROM `requests` WHERE `songID`='$reqsongID' AND `played`='0' AND `song_type`='0';";
    $total_req = mysqli_fetch_array(mysqli_query($conn, $recheck));

    if ($total_req['num'] > 0) {
    $error = 3;
    }

    @mysqli_free_result($conn, $total_req);

    if ($error == 0) {
    //user has reached the request limit?
    $recheck = "SELECT COUNT(*) AS num FROM `requests` WHERE `userIP`='$reqIP' AND DATE(`requested`) = DATE(NOW());";
    $total_req = mysqli_fetch_array(mysqli_query($conn, $recheck));

    if ($total_req['num'] >= $reqLimit) {
    $error = 4;
    $reccount = $total_req['num'];
    }
    # check if waiting time is over for new request.

    $sql= "SELECT * FROM `requests` WHERE `userIP`='$reqIP' ORDER BY `requested` DESC LIMIT 1 ";
    $res = $conn->query($sql);

    if ($res->num_rows > 0) {
    while ($row = mysqli_fetch_assoc($res)) {
    $timex= $row['requested'];
    }
    $calc = strtotime($timex);
    $calc2 = date('Y-m-d H:i:s');
    $calc3 = strtotime($calc2);
    $calc4 = ($calc3-$calc) / 60;
    $min = intval($calc4);

    if ($min < $req_wait) {
    $error = 5;
    }
    }

    # check waiting time end.
    @mysqli_free_result($conn, $total_req);
    }
    }

    switch ($error) {
    case 0:
    echo "<center>";
    $queryx = "INSERT INTO `requests` SET `songID`='$reqsongID', `username`='$reqname', `userIP`='$reqIP', `message`='$reqmsg', `requested`=now();";
    $resultx = mysqli_query($conn, $queryx);

    if ($resultx > 0) {
    $nu1= $total_req['num'];
    $nu2 = $nu1+1;
    echo "<div class=\"noticediv\">" . $lang['MSG_REQSUCCESS'] . " <b>".$nu2."</b> ".$lang['MSG_REQSUCCESS_TOT']." <b>".$reqLimit."</b>";
    if ($nu2 == $req_wait) {
    echo "<center><div class=\"errordiv\">" . $lang['ERROR_LIMITREACHED2'] . "</div></center><br><br>";
    } else {
    echo "<br />".$lang['WAIT']." ".$req_wait." ".$lang['WAIT2']."</div>";
    }
    } else {
    echo "<center><div class=\"errordiv\"><center>" . $lang['ERROR_UNKNOWN'] . "</center></div></center><br /><br>";
    }

    @mysqli_free_result($conn, $resultx);
    echo '</center>';

    break;
    case 1:
    echo '<center>';
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_USERNAME'] . "</center></div></center><br />";
    echo "<div id=\"back\"><center><br><br><A HREF=\"javascript:javascript:history.go(-1)\"><button
    class=\"back\">".$lang['GO_BACK']."</button></A></center>";

    break;
    echo '</center>';
    case 2:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_TRACKID'] . " </center></div></center><br />";
    echo "<center><A HREF=\"javascript:javascript:history.go(-1)\">".$lang['GO_BACK']."</A></center><br><br>";
    break;
    case 3:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_TRACKREQ'] . "</center></div></center><br /><br>";
    break;
    case 4:
    echo "<br><center><div class=\"errordiv\"><center>" . $lang['ERROR_LIMITREACHED'] . " (" . $reccount . "/" . $reqLimit . ")" . "</center></div></center><br /><br>";
    break;
    case 5:
    $wait_time= $req_wait-$min;
    echo "<br><center><div class=\"errordiv\">" . $lang['ERROR_TRACKREQ_TIME'] . " ".$wait_time." ".$lang['ERROR_TRACKREQ_TIME2']."</div></center><br>";
    break;
    }


    $reqid = "";
    }

    //Get the page if it's requested
    if (isset($_GET['requestid'])) {
    if ($_GET['requestid'] != "") {
    $reqid = mysqli_escape_string($conn, $_GET['requestid']);
    //Get track artist Name and title.
    $querysong = "SELECT * FROM `songs` WHERE `ID` = $reqid AND `enabled`= '1' AND `song_type`='0' ";
    $queryderp = mysqli_query($conn, $querysong);

    while ($row = mysqli_fetch_assoc($queryderp)) {
    $title= $row['title'];
    $artist= $row['artist'];
    }



    echo "<div class=\"selection\">".$lang['REQ_SELECTED']. " ". $artist." - ".$title."</div></td></tr>";

    echo "<table>";
    echo " <form id=\"formrequest\" name=\"formrequest\" method=\"post\" action=\"$targetpage?page=$page$srchpath\">";
    echo " <table align=\"center\" width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" class=\"nobar\">";
    echo " <tr>";

    echo "<td><div align=\"center\"><p>" . $lang['REQ_DESCRIPTION'] . "</p></div></td>";
    echo " </tr>";
    echo " <tr>";

    echo " <td><input type=\"text\" autofocus name=\"requsername\" placeholder=\"" . $lang['REQ_NAME'] . "\" /></td>";
    echo " </tr>";
    echo " <tr>";

    echo " <td colspan=\"3\"><div class=\"message\"><textarea name=\"reqmessage\" rows=\"5\" cols=\"80\" placeholder=\"" . $lang['REQ_MESSAGE'] . "\"></textarea></div></td>";
    echo " </tr>";
    echo " <tr>";
    echo " <td colspan=\"2\"><div align=\"center\"><input type=\"Submit\" name=\"reqsubmit\" value=\"" . $lang['REQ_BUTTON'] . "\" /></div></td>";
    echo " </tr>";
    echo " </table>";
    echo " <INPUT TYPE=\"hidden\" name=\"songID\" value=\"$reqid\">";
    echo " </form>";
    echo " </div>";
    echo "</td></table>";
    echo "<div id=\"back\"><center><br><br><A HREF=\"javascript:javascript:history.go(-1)\"><button
    class=\"back\">".$lang['GO_BACK']."</button></A></center>";
    echo '</td></table></center></div>';
    }
    }

    //================//

    if ($reqid == "") {


    //Get the number of items
    if (!empty($reqsubcat)) {
    $query = "SELECT COUNT(*) as num FROM `songs` WHERE `enabled`='1' $srcquery AND `song_type`='0' $notin ";
    $total_pages = mysqli_fetch_array(mysqli_query($conn, $query));
    $total_pages = $total_pages['num'];
    } else {
    $query = "SELECT COUNT(*) as num FROM `songs` WHERE `enabled`='1' $srcquery AND `song_type`='0' ";
    $total_pages = mysqli_fetch_array(mysqli_query($conn, $query));
    $total_pages = $total_pages['num'];
    }

    //Get page data (To inplant left join queuelist see)
    if (!empty($reqsubcat)) {
    $query1 = "SELECT `ID`, `artist`, `title`, `year`, `duration`, `date_played`, `artist_played`,`id_subcat` FROM `songs` WHERE `enabled`='1' $srcquery AND`song_type`='0' $notin ORDER BY `artist` ASC LIMIT $start, $page_limit";
    $result = mysqli_query($conn, $query1);
    } else {
    $query1 = "SELECT `ID`, `artist`, `title`, `year`, `duration`, `date_played`, `artist_played`,`id_subcat` FROM `songs` WHERE `enabled`='1' $srcquery AND`song_type`='0' ORDER BY `artist` ASC LIMIT $start, $page_limit";
    $result = mysqli_query($conn, $query1);
    }
    // Initial page num setup
    if ($page == 0) {
    $page = 1;
    }
    $prev = $page - 1;
    $next = $page + 1;
    $lastpage = ceil($total_pages/$page_limit);
    $LastPagem1 = $lastpage - 1;

    $paginate = '';

    if ($lastpage > 1) {
    $paginate .= "<div class='paginate'>";
    //Placeholder for previous so buttons don't move after page 1
    if ($page == 1) {
    $paginate.= "<span style\"visibility:normal;\"><a id='prev' style=\"background-color: var(--button-hover-color);cursor: default !important; opacity:0.6;\">" . $lang['NAV_PREV'] . "</a></span> ";
    }
    // Previous
    if ($page > 1) {
    $paginate.= "<a href='$targetpage?page=$prev$srchpath' id='prev'>" . $lang['NAV_PREV'] . "</a> ";
    }

    // Pages

    if ($lastpage < 7 + ($adjacents * 2)) {
    for ($counter = 1; $counter <= $lastpage; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }
    } elseif ($lastpage > 5 + ($adjacents * 2)) {

    // Beginning only hide later pages
    if ($page < 1 + ($adjacents * 2)) {
    for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }

    $paginate.= "<strong>...</strong>";
    $paginate.= "<a href='$targetpage?page=$LastPagem1$srchpath'> $LastPagem1 </a>";
    $paginate.= "<a href='$targetpage?page=$lastpage$srchpath'> $lastpage </a>";
    } elseif ($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {
    $paginate.= "<a href='$targetpage?page=1$srchpath'> 1 </a>";
    $paginate.= "<a href='$targetpage?page=2$srchpath'> 2 </a>";
    $paginate.= "<strong>...</strong>";

    for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }

    $paginate.= "<strong>...</strong>";
    $paginate.= "<a href='$targetpage?page=$LastPagem1$srchpath'> $LastPagem1 </a>";
    $paginate.= "<a href='$targetpage?page=$lastpage$srchpath'> $lastpage </a>";
    } else {
    $paginate.= "<a href='$targetpage?page=1$srchpath'> 1 </a>";
    $paginate.= "<a href='$targetpage?page=2$srchpath'> 2 </a>";
    $paginate.= "<strong>...</strong>";

    for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {
    if ($counter == $page) {
    $paginate.= "<span class='current'> $counter </span>";
    } else {
    $paginate.= "<a href='$targetpage?page=$counter$srchpath'> $counter </a>";
    }
    }
    }
    }

    // Next
    if ($page < $counter - 1) {
    $paginate.= "<a href='$targetpage?page=$next$srchpath' id='next'> " . $lang['NAV_NEXT'] . "</a>";
    }


    //Placeholder for next so buttons don't move after last page
    if ($page == $counter) {
    $paginate.= "<span><a id='next' style=\"background-color: var(--button-hover-color);cursor: default !important; opacity:0.6;\">" . $lang['NAV_NEXT'] . "</a></span> ";
    }


    $paginate.= "</div>";
    }
    if (isset($_GET['random'])) {
    if ($random = '1') {
    $query1 = "select * from songs WHERE `enabled`='1' AND `song_type`='0' ORDER BY RAND() LIMIT 0,$random_limit";
    $result = mysqli_query($conn, $query1);
    }
    }
    //Search box
    echo '<div align="center" class="sbox" style="width:50%;">';
    echo "<form name=\"input\" action=\"$targetpage\" method=\"get\">";
    echo " <input type=\"text\" value=\"$srch\" name=\"searchterm\"
    placeholder=\"" . $lang['SEARCH_TXT'] . "\"> <input type=\"submit\" value=\"" . $lang['SEARCH_BUTTON'] . "\"><INPUT class=\"random\" Type=\"BUTTON\" VALUE=\"" . $lang['REQ_RANDOM'] . "&nbsp;" . $random_limit . "\" ONCLICK=\"window.location.href='?random=$random_seed'\">";
    // echo '<br />';

    echo '</form>';
    echo '</div>';

    if ($total_pages > 0) {
    echo '<div id="paginate" $hidepages align="center">' . $paginate . '</div>';
    //Results table
    echo "<center>";
    echo '<br><table class= "tablespec" border="0" cellspacing="0" cellpadding="5" width="90%">';
    echo " <tr>" . "";
    echo " <th style='width:6%;text-align: center;'>".$lang['COL_NUM']."</th>";
    echo " <th style='width:35%;'>" . $lang['COL_ARTIST'] . "</th><th style='width:50%;'>".$lang['COL_TITLE']."</th>";
    //echo " <th style='width:40%;'>" . $lang['COL_YEAR'] . "</th>";
    echo " <th style='width:5%;'>" . $lang['COL_DURATION'] . "</th>";
    echo " <th style='width:75px;'>" . $lang['COL_REQ'] . "</th>";
    echo " </tr>" . "";

    $cnt = 1+($page_limit*$page)-$page_limit; //Results counter

    //Add results to the table
    while ($row = mysqli_fetch_assoc($result)) {
    echo " <tr>" . "";
    echo " <td style='text-align: center;'>$cnt</td>";
    echo " <td>" . $row['artist'] . "</td><td>".$row['title']."</td>";
    // echo " <td>" . $row['year'] . "</td>";
    echo " <td>" . convertTime($row['duration']) . "</td>";
    if (track_can_play($row['date_played'], $row['artist_played']) == true) {
    echo " <td class=\"entry_no\"><a href=\"$targetpage?page=$page&requestid=" . $row['ID'] . "\" title=\"" . $lang['ALT_REQ'] . "\"><button>".$lang['REQ_SELECT']."</button></a></td>";
    } else {
    echo " <td class=\"entry_no\"><center><span class=\"noreq\">".$lang['NOREQ']."</span></center></td>";
    }

    echo " </tr>";
    $cnt++;
    }

    @mysqli_free_result($conn, $result);
    echo "</center>"; ?>

    </table>
    <br />

    <?php
    if (isset($_GET['random'])) {
    echo " <INPUT class=\"random\" Type=\"BUTTON\" style=\"width: auto; display:inline-block;padding: 10px !important;\" VALUE=\"" . $lang['REQ_RANDOM2'] . "&nbsp;" . $random_limit . "\" ONCLICK=\"window.location.href='?random=$random_seed'\">";
    } else {
    //Add the bottom pagination
    echo '<div id="paginate" align="center">' . $paginate . '</div>';
    }
    } else {
    echo "<center><div class=\"errordiv\">" . $lang['MSG_NORESULTS'] . "</div></center>";
    }
    } ?>
    </td>
    </tr>
    </table>
    </center>
    </div>
    <?php
    }

    ?>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
    $(window).scroll(function(){
    if ($(this).scrollTop() > 100) {
    $('#toTop').show();
    } else {
    $('#toTop').hide();
    }
    });
    $('#toTop').click(function(){
    $("html, body").animate({ scrollTop: 0 }, 600);
    return false;
    });
    });
    </script>
    </body>
    </html>

    <canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
    Your browser does not support the HTML5 canvas tag.
    </canvas>

    </body>
    </html>
     
    Last edited: Nov 28, 2019
    strawbs, Nov 28, 2019
    #3
  4. strawbs

    sunfighter

    Joined:
    Nov 27, 2019
    Messages:
    13
    Likes Received:
    1
    If your not going to fix your coding:
    Code (Text):

    Your code is horrible strawbs. You should only have one <head> and one <body> not the 6 or 8 that you have. all of your styling should be contained in ONE <style> tag and that placed in the HEAD.
     
    I'm not going to help.

    Also this
    Code (Text):

    <center><!DOCTYPE html>
     
    Claiming HTML5 and using a tag that is not supported in it.
     
    sunfighter, Nov 28, 2019
    #4
  5. strawbs

    sunfighter

    Joined:
    Nov 27, 2019
    Messages:
    13
    Likes Received:
    1
    OK sitt,ng around waiting for butter and eggs to come to room temp before making Thanksgiving Pies. Had time to kill so gave things a look see. When your asking for help with the HTML/CSS and your running a .php file you should first run the php file then right click on the webpage and select 'view page source' or something close to that instruction and post that. No one can run your php but you. When it's included in the post it just adds garbage to the page.

    After removeing all the php the extra
    <!doctype html>, <html>, <head>, and <body> tags. Combined two <style> sections. Moved things around, I found the problem The <li> tags were missing. When put back the menu is on the right.
    Code (Text):

    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hot Tunez Radio</title>
    <link rel="dns-prefetch" href="//ajax.googleapis.com">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
    <link rel="stylesheet" href="style.css" type="text/css">
    <style>
        /* Style the body */
    body {
        font-family: Arial;
        margin: 0;
    }
    /* Header/Logo Title */
    .header {
        padding: 60px;
        text-align: center;
        background: #1abc9c;
        color: white;
        font-size: 20px;
    }
    /* Page Content */
    .content {
        padding: 20px;
    }
    ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    li {
        float: right;
    }
    li a {
        display: block;
        color: darkblue;
        text-align: center;
        padding: 14px 16px;
        text-decoration: none;
    }
    li a:hover {
        background-color: #dddddd;
    }
    </style>
    </head>
    <body>
    <div class="header">
    <ul>
        <li><a href="http://hottunez-radio.com">Home</a></li> <!-- these were missing -->
        <li><a href="#news">News</a></li>
        <li><a href="#contact">Contact</a></li>
        <li><a href="#about">Request</a></li>
    </ul>
    </div>

    <button id="toTop" title="Go to top">Top</button>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
    $(document).ready(function () {
        $(window).scroll(function () {
            if ($(this).scrollTop() > 100) {
                $('#toTop').show();
            } else {
                $('#toTop').hide();
            }
        });
        $('#toTop').click(function () {
            $("html, body").animate({ scrollTop: 0 }, 600);
            return false;
        });
    });
    $(document).ready(function () {
        $(window).scroll(function () {
            if ($(this).scrollTop() > 100) {
                $('#toTop').show();
            } else {
                $('#toTop').hide();
            }
        });
        $('#toTop').click(function () {
            $("html, body").animate({ scrollTop: 0 }, 600);
            return false;
        });
    });
    </script>
    </body>
    </html>
     
     
    sunfighter, Nov 28, 2019
    #5
  6. strawbs

    strawbs

    Joined:
    Jun 14, 2018
    Messages:
    8
    Likes Received:
    0
    thanks for reply but where do i have this go

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    body {font-family: Arial, Helvetica, sans-serif;}

    /* The Modal (background) */
    .modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 50%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }

    /* Modal Content */
    .modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    }

    /* The Close Button */
    .close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    }

    .close:hover,
    .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    }
    </style>
    </head>
    <body>



    <!-- Trigger/Open The Modal -->
    <button id="myBtn">Request A Tune</button>

    <!-- The Modal -->
    <div id="myModal" class="modal">

    <!-- Modal content -->
    <div class="modal-content">
    <span class="close">&times;</span>

    <html>
    <body>



    <form action="hottunezradio@gmail.com" method="post" enctype="text/plain">
    <form action="hottunezradio@gmail.com" method="post" enctype="text/plain">
    Artist Name:<br>
    <input type="text" name="name"><br>
    E-mail:<br>
    <input type="text" name="mail"><br>
    Comment:<br>
    <textarea="text" name="comment" size="30"><br><br>
    <input type="submit" value="Dedicate It">
    </form>

    </body>
    </html>
    </div>

    </div>

    <script>
    // Get the modal
    var modal = document.getElementById("myModal");

    // Get the button that opens the modal
    var btn = document.getElementById("myBtn");

    // Get the <span> element that closes the modal
    var span = document.getElementsByClassName("close")[0];

    // When the user clicks the button, open the modal
    btn.onclick = function() {
    modal.style.display = "block";
    }

    // When the user clicks on <span> (x), close the modal
    span.onclick = function() {
    modal.style.display = "none";
    }

    // When the user clicks anywhere outside of the modal, close it
    window.onclick = function(event) {
    if (event.target == modal) {
    modal.style.display = "none";
    }
    }
    </script>

    </body>
    </html>
     
    strawbs, Nov 28, 2019
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...