Jump to content

abeamreach

New Members
  • Posts

    9
  • Joined

  • Last visited

abeamreach's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Found this code that works well: <?php // integer starts at 0 before counting $i = 0; $dir = 'ebayimg/ipod/'; if ($handle = opendir($dir)) { while (($file = readdir($handle)) !== false){ if (!in_array($file, array('.', '..')) && !is_dir($dir.$file)) $i++; } } // prints out how many were in the directory echo "There were $i files"; ?>
  2. Thanks! Do I put my folder path (ebayimg/ipod) in place of: " __FILE__ "? What do I write to echo the value?
  3. How would I write PHP code to echo the number of pictures I have in a folder on my hosting account? Thanks in advance.
  4. Thank you. . . I have a bunch to learn! My web form is password protected and only for my use to build templates. Because it is password protected, and I am the only one with the code, can I be confident that directory traversal is unlikely without the measures you suggest? I ask because I have many forms that I will need to update if not. Thanks again for you huge help!
  5. Thank you for all your help. . . for my learning / edification why should I not just use: <? $logo =$_POST['logo']; echo '<img src="http://www.gbamedical.com/ebayimg/logos/'.$logo.'" />' ?> and finally. . . Is there a way to add a blank option in the drop down? In my current page when nothing is inputted into the text box. . . I have code to ignore the logo. But with the drop box there is no way, currently, to return an empty result. There are times I don't want a logo at all. Thanks for your patience with me!
  6. Thanks again for your help. I'm not trying to be pain but now the problem is the result at extension_test2.php is: <img src="$logo_image" /> see this live test here: http://www.gbamedical.com/extension_test.php I've tried to figure it out on my own. . but I'm missing something.
  7. Thank you, This solution will work well for me. However, on the code for the drop down. . . I am getting the following error: Parse error syntax error, unexpected $end in /home/content/l/a/w/lawson/html/extension_test.php on line 14 any ideas?
  8. Thanks Jacques1. . .. . Could I ask you to help me flesh this out a bit? I am a novice and I can't figure out how to implement your suggestions. Can you help me with the code in my example? Thanks in advance, Trevor
  9. 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?
×
×
  • 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.