3

The web page I'm working on has an embed video with caption text under it. I have the embedded video and the caption text store in a MySQL database. using CSS, I have made the embed video responsive so users can watch the video using their mobile phones. For some reason, the caption text under the responsive video is not displaying. The caption is displayed under the video when I view it on my desktop computer, but however, the caption text disappear when the video is responsive. And also, the responsive video is cropped and do not show the full video. Is there a way I can fix that? How do I get the text to display under the video when it's responsive. Responsive video but caption is missing Thank you for you time.

This is the code:

<!DOCTYPE html>
<html>
  <head>
    <link type='text/css' rel='stylesheet' href='style.css'/>
    <title>PHP!</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px; height: 0; overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


.another-container {
    max-width: 600px;
    display: block;
    margin-left: auto;
    margin-right: auto
}

</style>
  </head>
  <body>  
      <?php
      @$id=$_GET["id"];
if(isset($_GET['id'])) {
   $id=intval($_GET['id']);
} else {
   echo '<p>The page you were looking for isn\'t where you thought it was. Sorry about that. &nbsp; &nbsp; <a href="gallery.php">Go back to gallery </a> </p>';
} 
      ?>
     <?php
        if (isset($_GET['id'])) { 
        $id=intval($_GET['id']); 
        $con=mysqli_connect("localhost","root","","image_display");
        $result=mysqli_query($con,"select * from table1 WHERE id=$id");
        if (mysqli_num_rows($result ) > 0) {
            $row=mysqli_fetch_array($result,MYSQLI_ASSOC);
            echo '<div class="another-container">';
            echo '<div class="video-container">';
            echo '<iframe src="'.$row["video"].'" frameborder=0 width=560 height=315 scrolling=no allowfullscreen mozallowfullscreen webkitallowfullscreen sandbox="allow-same-origin allow-scripts allow-forms"></iframe> <br>';
            echo '<h2>' . $row['caption'].'</h2>';
            echo '<p><a href="gallery.php">Back to gallery </a></p>';
            echo '</div>';
            echo '</div>';
            echo '</div>';
        }
        else{
            echo '<p>No Image Found &nbsp; &nbsp; <a href="gallery.php">Back to gallery </a> </p>';
        }
    } 
      ?>
  </body>
</html>
Carl Max
  • 125
  • 1
  • 1
  • 10
  • im still looking in the Q and the code , but everytime i see someone who is trying to echo html code using PHP echo , i have to advice them using this way that exist in the link : http://stackoverflow.com/questions/1100354/how-can-i-echo-html-in-php , still looking in your Q . – Laith Sep 08 '16 at 05:09
  • Do you have a example website for this? – Patrick Mlr Sep 08 '16 at 05:10
  • 1
    I removed the ` – Parziphal Sep 08 '16 at 05:17
  • The code did not work for me. – Carl Max Sep 08 '16 at 17:40

0 Answers0