Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAayush Masiwal
Courses Plus Student 895 Pointswhy we create extra <tr> with display none
<?php
if($_SERVER["REQUEST_METHOD"]=="POST"){
$name = trim(filter_input(INPUT_POST,"name",FILTER_SANITIZE_STRING));
$email = trim(filter_input(INPUT_POST,"email",FILTER_SANITIZE_EMAIL));
$details = trim(filter_input(INPUT_POST,"details",FILTER_SANITIZE_SPECIAL_CHARS));
echo "<pre>";
if($name == "" || $email == "" || $details == ""){
echo "Please fill input correctly";
exit;
}
if($post["address"]!= ""){
echo "Bad input";
exit;
}
$mail_info = "";
$mail_info .="Name : ". $name . "\n";
$mail_info .= "Email : ".$email. "\n";
$mail_info .= "Details : ".$details. "\n";
echo $mail_info;
echo "</pre>";
//sending mail
header("location:suggest.php?status=thanks");
}
$p_title = "Want to Suggest";
$sections = "suggest";
include("include/header.php");?>
<div class="section page">
<?php if(isset($_GET["status"])&& $_GET["status"]=="thanks"){
echo "<p>Thank You for sharing suggestions...</p>";
} else { ?>
<h1>Give your suggestions</h1>
<p>If you think I missed anything here,send me mail</p>
<form action="suggest.php" method="post">
<table>
<tr>
<th><label for="name">Name</label></th>
<td><input type="text" id="name" name="name"></td>
</tr>
<tr>
<th><label for="email">Email</label></th>
<td><input type="text" id="email" name="email"></td>
</tr>
<tr>
<th><label for="details">Suggest Item Details</label></th>
<td><textarea name="details" id="details" ></textarea></td>
</tr>
<tr style="display:none"> //why we using this with display:none
<th><label for="address">Address</label></th>
<td><input type="text" id="address" name="address"></td>
</tr>
</table>
<input type="submit" value="send">
</form>
</div>
<?php } ?>
<?php include("include/footer.php");?>
1 Answer
tobiaskrause
9,160 Pointsnone: This value causes an element to not appear in the document. It has no effect on layout.
Source: https://www.w3.org/wiki/CSS/Properties/display
Seems the address should be hidden
Aayush Masiwal
Courses Plus Student 895 PointsAayush Masiwal
Courses Plus Student 895 Pointsi want to know why we set that <tr> tag property to display:none; what was the reason behind that ?