Jump to content

Stumped on a search issue


Xianoth

Recommended Posts

Ok.. After getting my code working and all, I am going through the refining process after the feedback I am getting..

 

So, if you check out my previous post: http://www.phpfreaks.com/forums/index.php/topic,156919.msg682259.html#msg682259

 

You will see the synopsis of my project.

 

Now however I need to tweak the code on the backend of the user interface.

 

 

$input = $_POST['ext'];

$file_dir="./files";

$dir=opendir($file_dir);

while ($name=readdir($dir))

{

          if ($name != "." && $name != "..")

            if (strstr(strtolower($name), $input))

{

          echo "<a href=\"get.php?name=$name\" target=_blank>".$name."</a>";

          echo "<br />";

}

}

 

 

Now this works.. What I need to do is to add a character to the $name value. The inputs are extension numbers, and the filenames are saved with a "-" before the number in the filename. So say ext 111 would actually be -111 in the filename.  What would I have to do to modify my script to include a simple "-" ?

 

Any help is appreciated!  Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.