tarun Posted December 11, 2006 Share Posted December 11, 2006 when i use this code[code]<?phpif (strstr($file, '.jpg')){echo ('<img src="$file">');}else {echo ('Unknown File Type');}?>[/code]it literrily outputs <img src="$file">lk here to see : http://filehost.awardspace.com/test.php?file=http://www.phpfreaks.com/images/logo_main.jpgwhat wrong wid it???? Link to comment https://forums.phpfreaks.com/topic/30266-wtf-help-me-plz/ Share on other sites More sharing options...
kenrbnsn Posted December 11, 2006 Share Posted December 11, 2006 Switch your use of single and double quotes. Or use concatenation.[code]<?phpif (strstr($file, '.jpg')) echo "<img src='$file'>"; // parenthesis are not needed on an "echo" statementelse echo 'Unknown File Type';?>[/code]or[code]<?phpif (strstr($file, '.jpg')) echo '<img src="' . $file . '">';else echo 'Unknown File Type';?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/30266-wtf-help-me-plz/#findComment-139202 Share on other sites More sharing options...
tarun Posted December 11, 2006 Author Share Posted December 11, 2006 thnx it works now Link to comment https://forums.phpfreaks.com/topic/30266-wtf-help-me-plz/#findComment-139204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.