Jump to content

[SOLVED] Qiuick easy one i hope


emediastudios

Recommended Posts

I want to check to see if there is a empty form varible sent.

I have this code

 

<?php
     if (isset($_POST['what do i put in here if i want to check if posted data is nothing']))
     {
       echo "N/A";
     }
     else
     {
       echo  "<a href='images/".$_POST['photo2']."' target='_blank'><img src='images/".$_POST['photo2']."'      alt='image' width='150' border='0' /></a>";
     }
     ?>

Link to comment
https://forums.phpfreaks.com/topic/71342-solved-qiuick-easy-one-i-hope/
Share on other sites

Seems strange but i used this code and it works,

Reversed it

 

<?php
     if (!empty($_POST['photo2']))
     {
       echo "<a href='images/".$_POST['photo2']."' target='_blank'><img src='images/".$_POST['photo2']."'      alt='image' width='150' border='0' /></a>";
     }
     else
     {
       echo  "";
     }
     ?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.