2013-11-02 39 views
-1

我想如果有作为http://bloxhotel.nl/video?watch=YxIiPLVR6NA隐藏c_box当没有输入

没有输入使得框不会弹出

<?php 
ob_start(); 
include 'includes/inc.bootstrap.php'; 
$page = Array('title' => ((isset($user)) ? $user->username : ''), 'onload' =>  ((isset($_GET['utm_source']) && $_GET['utm_source'] == 'welcome') ? 'Pixel.View.OpenUrlOverlay(\'/pixlett/Video.php\');' : ''), 'tab' => Array('me', 'home'), 'access' => Array(true, false)); 
include 'content/header.php'; 
include 'content/menu.php'; 
?> 
<center> 
<div class="c_box" style="overflow: hidden; width: 58%; height: 10%;"> 
<div class="heading blue">Ga naar Video</div> 
<tr style="padding: 4px;"> 
<html> 
<body> 

<form action="welcome_get.php" method="get"> 
Youtube Link: <input type="text" name="link"><br> 
<input type="submit"> 
</form> 

</body> 
</html> 

</div> 
<center> 
<div class="c_box" style="overflow: hidden; width: 58%; height: 10%;"> 
      <div class="heading blue">Video</div> 

<?php 
$watch = $_GET['watch']; 


$embed = '<embed src="http://bloxhotel.nl/Player7.swf" flashVars="video_id='.$watch.'"  style="width: 100%; height: 57%;" allowScriptAccess="always" autoplay="false" allowFullscreen="true" type="application/x-shockwave-flash" wmode="transparent"   id="player_demo"></embed></object>'; 

echo $embed; 
?> 
</div> 
</center> 

<?php 
$watch = $_GET['watch']; 


$embed = '<embed src="http://bloxhotel.nl/Player7.swf" flashVars="video_id='.$watch.'" style="width: 100%; height: 57%;" allowScriptAccess="always" autoplay="false" allowFullscreen="true" type="application/x-shockwave-flash" wmode="transparent" id="player_demo"></embed></object>'; 

echo $embed; 
?> 

需要显示不出来 所以如果视频中没有输入的话,手表=盒子需要保持隐藏

谁能帮

回答

0

你期待这样的事情?

<?php 
    $watch = trim($_GET['watch']); 
    if($watch!=""){ 
?> 

    <div class="c_box" style="overflow: hidden; width: 58%; height: 10%;"> 
     <div class="heading blue">Video</div> 

     <?php 
     $embed = '<embed src="http://bloxhotel.nl/Player7.swf" flashVars="video_id='.$watch.'"  style="width: 100%; height: 57%;" allowScriptAccess="always" autoplay="false" allowFullscreen="true" type="application/x-shockwave-flash" wmode="transparent"   id="player_demo"></embed></object>'; 

     echo $embed; 
     ?> 
    </div> 

<?php } ?> 
+0

谢谢你是最好的 –

0

只需检查

if(!empty($_GET['watch']) {echo $some_other_text; //or echo '';} else {echo $embed} 

这样一来,它会检查天气手表为空。

你也可以检查是否添加表或不如下:?

if(!isset($_GET['watch'])||!empty($_GET['watch'])) {//do not echo your box} 

else {//echo your box} 
+0

不工作我的屏幕一直是白色 –

+0

不过它停留白色 –

+0

我看到您的网站的来源,甚至没有显示一个标签。我正在检查没有任何输入的代码 –