View Full Version : includes include dopey hrefs?
HI,
I have a php page which basically comprises three includes. whilst the php page sits in one domain, the includes are in another.
One of these includes is the text file for the page. In it there is a hyperlink. If I set the href as /cgi-bin/nameofifle.pl. it goes to the cgi-bin of the domain where the php page is. If I set the href as http://www.theotherdomain.com/cgi-bin/nameoffile.pl it gives me a double url in the status bar, the second being http;// note the semi colon.
Why is this and more importantly, what can I do to fix it.
Bazz
mlseim
02-28-2005, 11:04 PM
Bazz...
This will be a tough one without an example.
Can you create a working example with just a simple
one line body of code. With your includes and stuff.
Make up something that will simulate the problem and
post your code.
OK Max, here's the source of the php page.
<?php include 'http://cms.mydomain.com/headers_and_footers/thechrissystem/header.html'; ?>
<div id="leftdiv">
<?php include 'http://cms.mydomain.com/headers_and_footers/thechrissystem/leftdiv.html'; ?>
</div>
<div id="rightdiv">
<?php include 'http://cms.mydomain.com/cgi-bin/thechrissystem/HTML_Editor/publicdetail.pl/path=text01a&action=View&base=text01a'; ?>
</div>
<?php include 'http://cms.mydomain.com/headers_and_footers/thechrissystem/footer.html'; ?>
the working example, (or non-working :) ) is at thechrissystem.com/ the text of the page should have a link in it at the bottom but it messes about.
Bazz
mlseim
03-01-2005, 02:20 PM
Bazz ...
I read a tutorial on "PHP includes".
Link references can ONLY be relative to the script. (/test.html)
You cannot use absolute references like (http://www.mydomain.com/test.html)
blimey, so even though the script is on my space but, called to the browers by a php file, I can't then link to another file in my space from that included text?
Hmmm. another challenge. :rolleyes:
You see, I have a script for some contact forms. What I was hoping to do was to have one program which 'knows' which site needs the form to be presented and then which appends the correct header and footer. Then all I need to do is update/monitor/amend the one single Db file. It looks like I'll just have to mkae the fomr and place it in each clients own space. Seems like a real waste of costly, file space to me. Must find another way.
Bazz :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.