shmnsw
shmnsw

Reputation: 649

output won't shown up php

can someone please tell me why nothing is shown when opening this page?

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

Upvotes: 0

Views: 62

Answers (3)

Fabio
Fabio

Reputation: 23510

I would rather use if isset directly and remove style='display:none' otherwise you will assign as property to not display to the form

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>";
}

Upvotes: 1

draxxxeus
draxxxeus

Reputation: 1523

<form style = "display:none">

This is preventing it from displaying.. Remove the style or replace it with style = "display: block" or whatever is your need.

Upvotes: 1

anon
anon

Reputation:

Maybe you are looking for something like this:

if (!empty($action)) 

Upvotes: 0

Related Questions