|
-
Oct 23rd, 2014, 07:44 PM
#1
[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
-
Oct 26th, 2014, 06:35 PM
#2
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.
-
Oct 27th, 2014, 12:46 AM
#3
Re: Internal Page Links
 Originally Posted by tr333
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
-
Oct 27th, 2014, 05:53 PM
#4
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.
-
Oct 27th, 2014, 07:18 PM
#5
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
-
Oct 27th, 2014, 08:22 PM
#6
Re: Internal Page Links
 Originally Posted by techgnome
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?
-
Oct 27th, 2014, 08:23 PM
#7
Re: Internal Page Links
 Originally Posted by tr333
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
-
Dec 8th, 2014, 09:17 AM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|