-1

我想如果没有输入,例如http://bloxhotel.nl/video?watch=YxIiPLVR6NA

不会弹出一个框

    <?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;
?>

不需要显示所以如果视频中没有输入?watch=该框需要保持隐藏

有人可以帮忙吗

4

2 回答 2

0

只需检查

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

这样,它将检查手表是否为空的天气。

您还可以检查是否添加了 ?watch 如下:

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

else {//echo your box} 
于 2013-11-02T09:03:34.223 回答
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 } ?>
于 2013-11-02T09:06:35.677 回答