Reputation: 649
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
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
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