phpbeginner Posted June 25, 2007 Share Posted June 25, 2007 I have an upload form where a user can upload either 1 .jpg or 1 document for each section of a webpage and the database is storing a link while the file is uploaded to a folder. The form will only allow to upload one or the other, not both. On my output I want to distinguish wether the file is .jpg for some coding for an image. If it is not a .jpg extension then it will go into another area. Is there an easy way to do this ? Below is my code that I tried for the output..... <?php if($row[6]!=".jpg") { echo("<p> <img src='??????/" . $row[6] . "' align='left' hspace=10 vspace=5 width=100></p><p>" . $row[5] . "</p><br><br><br>"); } else { echo("<p>" . $row[5] . "</p>"); echo("<p><a href='??????" . $row[6] . "'>READ MORE</a></p>"); ?> Link to comment https://forums.phpfreaks.com/topic/57139-check-extension-for-php-output/ Share on other sites More sharing options...
phpbeginner Posted June 26, 2007 Author Share Posted June 26, 2007 Does anyone have any tips for me on this ? Again, I just need to distinguish if $row[6] is a .jpg extension or not. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/57139-check-extension-for-php-output/#findComment-282997 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.