Jump to content

[SOLVED] If empty? (code help)


ayok

Recommended Posts

Hi, I have a question with php script for "if" statement.

 

I have this php code for a news with image in it:

<?php
echo "$data[day_news], $data[date_news], $data[time_news]<br><b>$data[by]</font></b><br><br>";
echo "<h1>$data[title]</h1>";
echo "<a href=detail_news.php?id=$data[news_id]><img align='left' src='images/$data[image]'></a>";
echo "$data[body]";	

 

But if there is no image uploaded, it has a cross box where the image should be there.

What should I write if I don't want any image if I didn't upload the image?

 

Thank you,

 

ayok

Link to comment
https://forums.phpfreaks.com/topic/78663-solved-if-empty-code-help/
Share on other sites

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.