943,840 Members | Top Members by Rank

Ad:
Dec 29th, 2008
0

Linking

Expand Post »
Hello,

In dreamweaver, i'm trying to do something on my website. Now whenever someone clicks on a link like forums, i want to be www.forums.central-forums.net, but at the moment, that won't work....

how do i do it...

This is my current script:

 <li><strong><a href="www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="forums">Forum</a></strong></li>
					<li><strong><a href="about">About</a> </strong></li>
					<li><strong><a href="donate">Donate</a></strong></li>
					<li><strong><a href="contact">Contact </a></strong></li>

Whenever someone clicks on the homepage link, it will not work.

How do i get it to work??

I need this done urgently!

Thanks,

Cohen
Similar Threads
Featured Poster
Reputation Points: 46
Solved Threads: 45
Practically a Posting Shark
cohen is offline Offline
819 posts
since Nov 2008
Dec 30th, 2008
0

Re: Linking

Why won't it work? Does it lead to a 404 error or does it not open at all?
 <li><strong><a href="http://www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="forums">Forum</a></strong></li>
					<li><strong><a href="about">About</a> </strong></li>
					<li><strong><a href="donate">Donate</a></strong></li>
					<li><strong><a href="contact">Contact </a></strong></li>

These links should lead to pages at the very least. Something like forums.php or forums.html...
If you have directories in [icode]http://www.central-forums.net[/code] then they should have index.php or index.html for this kind of linking to work. The problem is when you're in a directory (say /forums/) the about link is linking to http://www.central-forums.net/forums/about
So I suggest that you do this instead:

 <li><strong><a href="http://www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/forums">Forum</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/about">About</a> </strong></li>
					<li><strong><a href="http://www.central-forums.net/donate">Donate</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/contact">Contact </a></strong></li>

But that's tedious if you have many links! If you have a variable/constant for holding http://www.central-forums.net/ --- now is the time to use it. =)

 <li><strong><a href="<?php echo $base_url;?>">Homepage</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>forums">Forum</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>about">About</a> </strong></li>
					<li><strong><a href="<?php echo $base_url;?>donate">Donate</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>contact">Contact </a></strong></li>
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: Linking

<li><strong><a href="http://www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/forums">Forum</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/about">About</a> </strong></li>
					<li><strong><a href="http://www.central-forums.net/donate">Donate</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/contact">Contact </a></strong></li>

i do this and i get the 404 Error.

Now, what do i do with this code

<li><strong><a href="<?php echo $base_url;?>">Homepage</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>forums">Forum</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>about">About</a> </strong></li>
					<li><strong><a href="<?php echo $base_url;?>donate">Donate</a></strong></li>
					<li><strong><a href="<?php echo $base_url;?>contact">Contact

where do i put the links etc???

Thanks,

Cohen
Last edited by cohen; Dec 30th, 2008 at 1:46 am.
Featured Poster
Reputation Points: 46
Solved Threads: 45
Practically a Posting Shark
cohen is offline Offline
819 posts
since Nov 2008
Dec 30th, 2008
0

Re: Linking

When you're in the forums, the links are pointing to http://www.forums.central-forums.net/forums/ and http://www.forums.central-forums.net/about --- which is probably wrong!

Your homepage, however, is working now. Meaning the links are pointing to the proper places http://www.central-forums.net/forums and http://www.central-forums.net/about etc.

The code I gave you is correct. You have to double-check your pages (specially the topmenu in your forums) because you're still 'relative-linking' to the about, donate, forums pages on the url http://forums.central-forums.net.

<li><strong><a href="http://www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/forums">Forum</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/about">About</a> </strong></li>
					<li><strong><a href="http://www.central-forums.net/donate">Donate</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/contact">Contact </a></strong></li>

Copy and paste that code. When we've got the html working, I'll help you with the $base_url too.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: Linking

Click to Expand / Collapse  Quote originally posted by kanaku ...
When you're in the forums, the links are pointing to http://www.forums.central-forums.net/forums/ and http://www.forums.central-forums.net/about --- which is probably wrong!

Your homepage, however, is working now. Meaning the links are pointing to the proper places http://www.central-forums.net/forums and http://www.central-forums.net/about etc.

The code I gave you is correct. You have to double-check your pages (specially the topmenu in your forums) because you're still 'relative-linking' to the about, donate, forums pages on the url http://forums.central-forums.net.

<li><strong><a href="http://www.central-forums.net">Homepage</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/forums">Forum</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/about">About</a> </strong></li>
					<li><strong><a href="http://www.central-forums.net/donate">Donate</a></strong></li>
					<li><strong><a href="http://www.central-forums.net/contact">Contact </a></strong></li>

Copy and paste that code. When we've got the html working, I'll help you with the $base_url too.
It worked! Thanks!!!!

Cohen
Featured Poster
Reputation Points: 46
Solved Threads: 45
Practically a Posting Shark
cohen is offline Offline
819 posts
since Nov 2008
Dec 30th, 2008
0

Re: Linking

Ok. So have you used the $base_url? This will help you save time when transferring the site or when editing links...

Just define the constant in your header (or somewhere up there) then you can echo it anywhere in your document.
<?php
define ("BASE_URL", "http://www.central-forums.net");
?>
...
...
...

<p>This is <a href="<?php echo BASE_URL; ?>">a link to my homepage</a>. This is <a href="<?php echo BASE_URL;?>/forums">the forums</a>.

... and so on.
Last edited by kanaku; Dec 30th, 2008 at 3:16 am. Reason: made the code 'purtier'
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: Linking

oh, nice, thanks!
Featured Poster
Reputation Points: 46
Solved Threads: 45
Practically a Posting Shark
cohen is offline Offline
819 posts
since Nov 2008
Mar 31st, 2009
0

Re: Linking

what is it that you actually work looking for??

I think I have an understanding of what is it you are requesting.

Or, atleast I had a great idea to implement. PHP - Chmod - New Directory - Click the link it builds a new directory; specifically for the person that clicked it? No?
Reputation Points: 10
Solved Threads: 1
Newbie Poster
KHNT2X3 is offline Offline
12 posts
since Mar 2009
Mar 31st, 2009
0

Re: Linking

Done, and solved.

Marked as Solved.

Cohen
Featured Poster
Reputation Points: 46
Solved Threads: 45
Practically a Posting Shark
cohen is offline Offline
819 posts
since Nov 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Configuring Readymade Scripts Forum Timeline: Add 'in-page' links to wordpress blog posts
Next Thread in Configuring Readymade Scripts Forum Timeline: phpbb integration





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC