Advanced Search

Results 1 to 4 of 4

Thread: Directory hyperlinks

  1. #1
    Join Date
    Dec 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Directory hyperlinks

    Can anyone help me out with this?

    I have a website where I post results from races in .html or .pdf.

    Every time I post the results in a directory, I have to manually create a hyperlink

    I want a php script that will scan the directory and then create a list of hyperlinks ordered by the date of the file. I also would also like the links to not have the .pdf or .html extension on the end. I also do not want the underscore in the hyperlink but a space instead.

    Thanks for any help

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,621
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by phrozen1 View Post
    Every time I post the results in a directory, I have to manually create a hyperlink
    I want a php script that will scan the directory and then create a list of hyperlinks ordered by the date of the file.
    You should look at the glob() function. How much experience do you have with PHP? Do you know the basics? Do you know how to write hyperlinks with PHP, for example?

    Quote Originally Posted by phrozen1 View Post
    I also would also like the links to not have the .pdf or .html extension on the end. I also do not want the underscore in the hyperlink but a space instead.
    If you're talking about the link text, that's not a problem. you can use something like str_replace() for making such changes.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  3. #3
    Join Date
    Dec 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have a basic understanding of PHP, but would consider myself a beginner. Would this require a lot of coding?

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    This shouldn't be too hard for you to figure out. You'll need to take it step by step and look up tutorials (or just functions) for the individual steps. For example, the last step will be how to choose to display the text of the link itself, which is unrelated to the rest of the process. Breaking it down like that will make it seem easier (and is necessary anyway).

    A great reference, if you're not already familiar with it, is php.net for the extensive information about all of the functions-- you can look up glob() and str_replace() there to start. There are also short code examples with these functions, so you can start with those and adjust them for your purposes.

    If you try this and have more specific questions feel free to ask here, but at the moment it's a little unclear what to suggest-- try something and let us know how it goes. Starting with glob() is fine. There's also another route of using fopen(), fread() and fclose(), all with examples on php.net.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Similar Threads

  1. Replies: 4
    Last Post: 06-04-2010, 03:24 AM
  2. Hyperlinks in XML
    By lasko in forum Java
    Replies: 0
    Last Post: 05-10-2010, 02:28 PM
  3. redirecting all hyperlinks?
    By shraga18 in forum Looking for such a script or service
    Replies: 4
    Last Post: 04-24-2008, 06:00 PM
  4. Please help with hyperlinks
    By rjain in forum HTML
    Replies: 4
    Last Post: 04-25-2006, 05:57 PM
  5. Replies: 2
    Last Post: 11-19-2005, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •