Thread Solved

Join Date: Nov 2008
Posts: 816
Reputation: cohen is an unknown quantity at this point 
Solved Threads: 42
Featured Poster
cohen's Avatar
cohen cohen is offline Offline
Practically a Posting Shark

Linking

 
0
  #1
Dec 29th, 2008
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
Cohen's Site www.cohenl.com

Do not PM me for support!!!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: Linking

 
0
  #2
Dec 30th, 2008
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>
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 816
Reputation: cohen is an unknown quantity at this point 
Solved Threads: 42
Featured Poster
cohen's Avatar
cohen cohen is offline Offline
Practically a Posting Shark

Re: Linking

 
0
  #3
Dec 30th, 2008
<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.
Cohen's Site www.cohenl.com

Do not PM me for support!!!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: Linking

 
0
  #4
Dec 30th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 816
Reputation: cohen is an unknown quantity at this point 
Solved Threads: 42
Featured Poster
cohen's Avatar
cohen cohen is offline Offline
Practically a Posting Shark

Re: Linking

 
0
  #5
Dec 30th, 2008
Originally Posted by kanaku View Post
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
Cohen's Site www.cohenl.com

Do not PM me for support!!!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: Linking

 
0
  #6
Dec 30th, 2008
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'
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 816
Reputation: cohen is an unknown quantity at this point 
Solved Threads: 42
Featured Poster
cohen's Avatar
cohen cohen is offline Offline
Practically a Posting Shark

Re: Linking

 
0
  #7
Dec 30th, 2008
oh, nice, thanks!
Cohen's Site www.cohenl.com

Do not PM me for support!!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 10
Reputation: KHNT2X3 is an unknown quantity at this point 
Solved Threads: 1
KHNT2X3's Avatar
KHNT2X3 KHNT2X3 is offline Offline
Newbie Poster

Re: Linking

 
0
  #8
Mar 31st, 2009
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?
<? KHNT2X3() ?>
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 816
Reputation: cohen is an unknown quantity at this point 
Solved Threads: 42
Featured Poster
cohen's Avatar
cohen cohen is offline Offline
Practically a Posting Shark

Re: Linking

 
0
  #9
Mar 31st, 2009
Done, and solved.

Marked as Solved.

Cohen
Cohen's Site www.cohenl.com

Do not PM me for support!!!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC