Jump to content

Check extension for php output


phpbeginner

Recommended Posts

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

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.