2 commands, 1 file.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

2 commands, 1 file.

Post by Aaron »

I have to inserts...

<? echo "<img src="".$img."">"; ?>

<? readfile($display . '');?>


How would I make it so I could only use 1 at a time in one php file, without the other one doing an error like this;

Warning: readfile("") - Inappropriate ioctl for device in /home/www/unknownz/test.php on line 4

http://www.unknownzone.org/test.php?img ... alight.jpg
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Post by Aaron »

<?php
if ($display) {
readfile($display);
}
else if (!$display && $img) {
echo "<img src="$img" border="0" alt="" />";
}
else { echo "nothing to display"; }
?>


Works fine, thx to none of you, hehe
Post Reply