Newbie link question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Loke111
Forum Newbie
Posts: 2
Joined: Fri Nov 07, 2003 12:25 am

Newbie link question

Post by Loke111 »

Hi,

I am using a simple php script to generate the structure of a site; header, menu, main, footer. The essense of the code is like this (I have removed the table stuff):

<body>
<?php include ("head.html"); ?>
<?php include ("menu.html"); ?>
<?php include ("mainpage.html"); ?>
<?php include ("footer.html"); ?>
</body>

It works fine when the included pages are pure html. However, one of the menu options shows a page from another site in the main area, like this:

<?php
include ("http://www.be.no/FMPro?-DB=foretak&-Lay ... 2833&-find");
?>

The page shows up as expected, but some of the data base links (such as SØK.040.1) on the external page cause problems. When I hover the cursor over this link the start of the URL
http://www.be.no/FMPro?-DB=Omrader&-lay ... 2833&-Find
(i.e. http://www.be.no/) is replaced with http://www.mysite.com/. The probels is obviously caused by my PHP script, as when the page is shown non-embedded all links on it work fine.

Any ideas how this could be dealt with?

Ragards.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

If you go to the webpage you are trying to include on your site (which is illegal by the way) you will probably find that the offending links start with a "/" forward slash. Because of this they will be pointing to your website's root directory when they are include in your website.
Loke111
Forum Newbie
Posts: 2
Joined: Fri Nov 07, 2003 12:25 am

Post by Loke111 »

The offending links start like this:
http://www.be.no/FMPro?-DB=Omrade...

So, what you are saying is that the page cannot be embedded?

>> (which is illegal by the way)
It is illegal in which country?
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Loke111 wrote:The offending links start like this:
http://www.be.no/FMPro?-DB=Omrade...

So, what you are saying is that the page cannot be embedded?
>> Check the actual source code of the website page (view source) and check the links that way... checking them by rolling the mouse over them won't work because they will still display the root directory of the website they are on if they start with "/".
Loke111 wrote:(which is illegal by the way)
It is illegal in which country?
>> In any country.... it's a breach of (c)opyright unless you have written permission from the copyright owner of the material you are using (in this case a website page).
Post Reply