2013-05-19 68 views
0

有人可以告诉我为什么在打开此页面时什么都没有显示?输出不会显示出来php

<?php 

include_once("functions.php"); 
// Process 
$action = isset($_POST["action"]) ? $_POST["action"] : ""; 
if (empty($action)) 
{ 
    // Send back the contact form HTML 
    $output = "<form action='#' style='display:none'> 
       <label for='image'>upload: </label> 
       <input type='file' id='image' name='image' maxlength=50>"; 
} 
echo $output; 
?> 
+2

'$ action'为空吗? – billyonecan

+2

为什么不直接使用if(isset($ _ POST [“action”])){...}? – Aquillo

+0

也许$ _POST ['action']它的设置 – Sam

回答

0

也许您正在寻找这样的事情:

if (!empty($action)) 
1

我宁愿用if isset直接删除style='display:none'否则会指定为财产不显示的形式

include_once("functions.php"); 
// Process 
if(!isset($_POST["action"])) 
{ 
    // Send back the contact form HTML 
    echo "<form action='#'> 
      <label for='image'>upload: </label> 
      <input type='file' id='image' name='image' maxlength=50>"; 
} 
1
<form style = "display:none"> 

这是防止它显示..删除样式或替换它与style = "display: block"或任何您需要的。