| | |
Linking
Please support our Existing Scripts advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
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:
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
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
Why won't it work? Does it lead to a 404 error or does it not open at all?
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
So I suggest that you do this instead:
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="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>
<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.
When you're in the forums, the links are pointing to
Your homepage, however, is working now. Meaning the links are pointing to the proper places
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.
Copy and paste that code. When we've got the html working, I'll help you with the $base_url too.
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.
•
•
•
•
When you're in the forums, the links are pointing tohttp://www.forums.central-forums.net/forums/andhttp://www.forums.central-forums.net/about--- which is probably wrong!
Your homepage, however, is working now. Meaning the links are pointing to the proper placeshttp://www.central-forums.net/forumsandhttp://www.central-forums.net/aboutetc.
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.
Cohen
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.
... and so on.
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.
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.
![]() |
Similar Threads
- Linking Error In C (C)
- need help linking a pc to a mobile phone(nokia,alcatel) (Networking Hardware Configuration)
- Linking "park" ERROR (C)
- Linking errors of socket functions (C)
- Problem with foreach when using linking (PHP)
- Error Linking KeyLogger.exe (C++)
Other Threads in the Existing Scripts Forum
- Previous Thread: Add 'in-page' links to wordpress blog posts
- Next Thread: phpbb integration
| Thread Tools | Search this Thread |





