Forums

PHP

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"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="images/&lt;?php echo $_POST['photo2']; ?&gt;" target="_blank"&gt;&lt;img src="images/&lt;?php echo $_POST['photo2']; ?&gt;" alt="image" width="150" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</font id=code></pre id=code>

Replies

Replied 10 Oct 2007 12:04:23
10 Oct 2007 12:04:23 dg coder replied:
&lt;tr&gt;
&lt;td&gt;
&lt;?php

if(!empty($_POST['photo2']))
{

$tmp_var = $_POST['photo2'];

echo "&lt;a href=\"images/$tmp_var\" target=\"_blank\"&gt;&lt;img src=\"images/$tmp_var\"&gt;&lt;/a&gt;";

}

?&gt;
&lt;/td&gt;
&lt;/tr&gt;

Reply to this topic