Forums
This topic is locked
show region if posted form varible in not empty
Posted 29 Sep 2007 16:41:02
1
has voted
29 Sep 2007 16:41:02 Ross Gardner posted:
I have a full details page that is populated from hidden fields posted from a browse property file as form varibles.Confusing??
How do i hide that region if the posted form varible is empty?
This is the image field <pre id=code><font face=courier size=2 id=code> table width="150" border="0">
<tr>
<td><a href="images/<?php echo $_POST['photo2']; ?>" target="_blank"><img src="images/<?php echo $_POST['photo2']; ?>" alt="image" width="150" border="0" /></a><br /></td>
</tr>
</table>
</font id=code></pre id=code>
Replies
Replied 10 Oct 2007 12:04:23
10 Oct 2007 12:04:23 dg coder replied:
<tr>
<td>
<?php
if(!empty($_POST['photo2']))
{
$tmp_var = $_POST['photo2'];
echo "<a href=\"images/$tmp_var\" target=\"_blank\"><img src=\"images/$tmp_var\"></a>";
}
?>
</td>
</tr>
<td>
<?php
if(!empty($_POST['photo2']))
{
$tmp_var = $_POST['photo2'];
echo "<a href=\"images/$tmp_var\" target=\"_blank\"><img src=\"images/$tmp_var\"></a>";
}
?>
</td>
</tr>