I have a page using forms to help build listing templates for eBay. I have a folder where I have hundreds of logos stored. I know the logo names but not their extensions. . . . I have to test each potential (jpg, jpeg, gif, png, etc.) until I guess right. Here is an example code for the web form:
<form action="extension_test2.php" method="post"> <p>Logo: <input name="e" value="" type="text" size="15" maxlength="30" /><p> <input name="Submit" type="Submit"/> </form>
and the form's result:
<? $e =$_POST['e']; if(!empty($e)) { echo '<img src="http://www.gbamedical.com/ebayimg/logos/'.$e.'">'; }; ?>
Here is a link to the example: http://www.gbamedical.com/extension_test.php Use "olympus.jpg" for test.
I am looking for code that can determine the file type and dynamically add the extension. Can it be done?