Results 1 to 3 of 3

Thread: Taken over old site

  1. #1
    Join Date
    Jul 2010
    Posts
    2

    unsure Taken over old site

    hello...I've taken over an old site to look after; which has 1000's of html links (no I'm not exagerating)
    these pages are like index_a.html, index_b.html & on those pages are hundreds of links to documents stored in another folder.
    I'm trying to retrieve the list of links from the index pages; display them on a page with pagination (700+ links is a lot of scolling)
    This however is as far as I've got ( after many hours of searching)

    $fcontents = file( 'http://localhost/harriet/harriet/public/index_author_o.html' );
    while ( list( , $line ) = each( $fcontents ) ) {
    while ( eregi(
    '(href[[:space:]]*=[[:space:]]*"?[[:alnum:]:@/._-]+"?)(.*)', $line,
    $regs ) ) {
    echo "Got '$regs[1]'<br>\n";
    $line = $regs[2];
    }
    }
    this outputs as :
    Got 'href="review/moon_boy"'
    Got 'href="review/the_agree"'
    Got 'href="review/sword_of_oban"'
    etc...omiited the remaining links ...lol
    whereas what I need to display is
    <a href="review/dining_with_devils">DINING WITH DEVILS</A> by Gordon Smith<BR>'
    as a normal html link

  2. #2
    Join Date
    Dec 2007
    Posts
    1,736

    Re: Taken over old site

    You will have to use regular expressions to get the list of links from an HTML page, something like for example:

    <?
    $fcontents = file( 'http://www.techarena.in/news/' );
    while ( list( , $line ) = each( $fcontents ) ) {
    while ( eregi(
    '(href[[:space:]]*=[[:space:]]*"?[[:alnum:]:@/._-]+"?)(.*)', $line,
    $regs ) ) {
    echo "Got '$regs[1]'<br>\n";

    $line = $regs[2];
    }
    }
    ?>

    Taken fron the PHP List, only change i made to the script was the removal of "news/" path.

  3. #3
    Join Date
    Jul 2010
    Posts
    2

    Re: Taken over old site

    Thanks for your post.JAMES_911..but that still just gives me the same as I already have
    a list of results in the form of
    <a href="review/dining_with_devils"
    the actual pages display a list of links
    If I was to write it in html it would be

    <a href="review/dining_with_devils">DINING WITH DEVILS</A> by Gordon Smith<BR>'
    & a visitor would see DINING WITH DEVILS by Gordon Smith..with
    DINING WITH DEVILS being an active link
    so maybe a more accurate question is how do I obtain all the information & then display it as active links...as I see it the address is in 3 parts
    $link=review/dining_with_devils
    $name=DINING WITH DEVILS
    $rest_of _stuff=by Gordon Smith<BR>
    I am trying to display it on a page as
    <a href=\"$link\">$name</a>$rest_of _stuff

Similar Threads

  1. Posting images from other site to own site and keep it legal?
    By Mahalingam in forum Technology & Internet
    Replies: 4
    Last Post: 08-06-2011, 07:56 AM
  2. Replies: 4
    Last Post: 27-01-2011, 10:15 PM
  3. Airtel.com site redirects to a Vodafone site!
    By Tamonashh in forum India BroadBand
    Replies: 6
    Last Post: 17-11-2010, 12:25 AM
  4. Site Map of SharePoint site in Visio 2007
    By GusFraba in forum MS Office Support
    Replies: 1
    Last Post: 18-06-2009, 09:26 AM
  5. SITE-To-SITE VPN using Windows Server 2003 Standard
    By S H A R I Q U E in forum Windows Server Help
    Replies: 9
    Last Post: 03-01-2009, 10:55 PM

Tags for this Thread

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
  •  
Page generated in 1,727,228,165.94360 seconds with 17 queries