php - Text is not being echoed at all when CSS and file_get_contents are being used -


<html> <?php $url = "http://www.youtube.com/embed/ftgnauppqpu"; $str = "title of video here"; $css = <<<eot <style type="text/css">  body    {    background: #eeeeee;    width:560px;     height:315px;    } </style> eot; $data = file_get_contents($url); $data = str_replace('</body>', $css.'</body>', $data); echo '<div style="overflow:scroll;">'.$data.'</div>'; echo $str ?> </html> 

when $url has variable stored in (mainly being youtube video) not echo $str @ when $url nothing $str echo's , don't know why? video appear @ top , use $str title video.

your video container , body height equal content after div hidden see if works:

<html> <?php $url = "http://www.youtube.com/embed/ftgnauppqpu"; $str = "title of video here"; $css = <<<eot <style type="text/css">  body    {    background: #eeeeee;    width:560px;     height:315px;    color:#000;    } </style> eot; $data = file_get_contents($url); $data = str_replace('</body>', $css.'</body>', $data); echo '<div style="overflow:scroll; height:300px;">'.$data.'</div>'; echo $str; ?> </html> 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -