Results 1 to 8 of 8

Thread: [RESOLVED] Internal Page Links

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Resolved [RESOLVED] Internal Page Links

    Hi,

    It has been awhile since I have created a html website and the internal page to page links are causing me no end of trouble. On the index page I have

    HTML Code:
    <a href="php/enter.php" title="Enter Data">Enter Data</a><a href="php/view.php">View Data</a><a href="php/browse.php" title="Browse Data">Browse Data</a><a href="php/search.php" title="Search">Search</a></body></html>
    and all those pages are located in the php folder, yet, the only links that redirects correctly are those for the entry and browse pages. Both the view page and search page report this as the address as oppose to "view.php" and "search.php".

    HTML Code:
     URL /job1/php/index.php 
    Also, on the sub pages located in the php folder I have

    HTML Code:
    <a href="../index.php" title="Home">Home</a><a href="../php/enter.php" title="Enter Data">Enter Data</a><a href="../php/browse.php" title="Browse Data">Browse Data</a><a href="../php/search.php" title="Data Search">Search</a>
    Yet, the only "Home" link that works is the "Enter Data" page despite all the sub pages having the same links... Also, the across page links do not work either so I ca not browse from sub page to sub page despite trying both the above code and also

    HTML Code:
     <a href="../index.php" title="Home">Home</a><a href="enter.php" title="Enter Data">Enter Data</a><a href="browse.php" title="Browse Data">Browse Data</a><a href="search.php" title="Data Search">Search</a>
    Thanks,


    Nightwalker
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  2. #2
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Internal Page Links

    Check your directory structure. Based on your post, I see it as this:
    Code:
    .
    ├── index.php
    └── php
        ├── browse.php
        ├── enter.php
        ├── search.php
        └── view.php
    Is that correct?

    For your subpages, I'm assuming they are in the php subfolder. You should be able to remove the "../php/" from the links in that case.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  3. #3

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Internal Page Links

    Quote Originally Posted by tr333 View Post
    For your subpages, I'm assuming they are in the php subfolder. You should be able to remove the "../php/" from the links in that case.
    As I mentioned above I have already tried that however, now for some of the pages it appears to be working as it would but for others I receive

    Not Found

    The requested URL /job1/php/index.php was not found on this server.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  4. #4
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Internal Page Links

    Hmmmm...

    without looking at the files I can't say much. The 404 error is just saying that the webserver can't find the file index.php at http://example.com/job1/php/index.php. I can only suggest checking the webserver/php logs, and re-checking the directory structure against your links. Perhaps you could also try putting the full URL into the href and go from there?

    Sorry I can't be of more help than that.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Internal Page Links

    doesn't ".." mean the current folder?... so a file in the php folder should only be going ../file.php ... OR if you want to include the php directory, start from the root: /php/file.php

    your hrefs should look like this:
    /index.php
    /php/browse.php
    /php/enter.php
    /php/search.php
    /php/view.php

    this is why I try not to use relative links unless anchored to the root...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Internal Page Links

    Quote Originally Posted by techgnome View Post
    doesn't ".." mean the current folder?... so a file in the php folder should only be going ../file.php ... OR if you want to include the php directory, start from the root: /php/file.php

    your hrefs should look like this:
    /index.php
    /php/browse.php
    /php/enter.php
    /php/search.php
    /php/view.php

    this is why I try not to use relative links unless anchored to the root...

    -tg
    Single . is current directory, while double .. is the previous directory going up the tree.

    I agree that relative links just cause too many problems. I don't know much about php but I would be surprised if it didn't have some function/feature to write out full links for a given relative url?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  7. #7

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Internal Page Links

    Quote Originally Posted by tr333 View Post
    without looking at the files I can't say much.
    At the moment I am just using WAMP to view the files.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  8. #8

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Internal Page Links

    I think it was because I didn't immediately save the pages after creating them but edited them then saved them after a while! I created a new new and saved it straight away and it worked without problems.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

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



Click Here to Expand Forum to Full Width