PC Pals Forum
Technical Help & Discussion => Website Design & Programming => Topic started by: DJ on April 24, 2004, 20:23
-
Hi All,
I host a website in Force9's servers, I've got a php script (that produces a calander) on my cgi server and the main web pages on another normal 'homepages' server.
How do I embed the php script into the HTML page.
I tried the following in the HTML file,
<script language="php" src=http://cgi.blahblahblah.force9.co.uk/php/cal.php></script>
but it didn't work.
Any Ideas?
Cheers :thumb:
DJ
-
Hi All,
I host a website in Force9's servers, I've got a php script (that produces a calander) on my cgi server and the main web pages on another normal 'homepages' server.
How do I embed the php script into the HTML page.
I tried the following in the HTML file,
<script language="php" src=http://cgi.blahblahblah.force9.co.uk/php/cal.php></script>
but it didn't work.
Any Ideas?
Cheers :thumb:
DJ
<script language="php"> src=http://cgi.blahblahblah.force9.co.uk/php/cal.php></script>
try that
-
Thanks Jonah, I tried
<script language="php"> src=http://cgi.blahblahblah.force9.co.uk/php/cal.php</script>
and
<script language="php"> src="http://cgi.blahblahblah.force9.co.uk/php/cal.php"</script>
None worked. Should it have done ??? Can you actially embed php direct in html?
DJ
-
Try
<? include 'http://cgi.blahblahblah.force9.co.uk/php/cal.php'; >
The <?
and >
are the correct begin and end markers for PHP code in HTML
the include 'http://cgi.blahblahblah.force9.co.uk/php/cal.php';
tells PHP to load that file and interpret it as PHP code.
HTH
-
Nope it didn't work either Adept.
I have sent a request to Force9 to see what they say. The problem I think is that the cgi server is separate to the HTML server and so linking the two is quite difficult.
For the time being I have used
<br /><iframe src="http://cgi.blahblahblah.force9.co.uk/php/cal.php"<br />></iframe></center><br />
Which works fine.
DJ
-
I had a response from force9.
It states that as the two servers are separate (cgi and html) I can't embed php in a html document.
Instead I have referenced the php page in the place of my html page - and it seems to work ok.
Thanks all for the input
DJ
-
i know you have a resolution to this. a thought though. why did you have to run the php from the cgi bin? do they not have php installed as a module in apache - thus allowing you to just use php on the main webserver (where you have you html files in your case)?
-
Hi Sam,
Cheers for the reply - you must have loads of posts to trawl your way through.
The way that my ISP (Force9) has its servers set is that one is normal HTML and one is CGI which they allow you to run PHP. Don't ask me why its the way they set them up!
I'm looking to transfer everything onto the CGI server soon (but need to chose the space limits they have etc).
Might be asking for your help soon ;)
DJ
-
so they dont have php installed on their main webserver?? if so god that is a bit old school. i might even consider swapping hosts. I personally dont like to fill up my cgi bin with anything but scripts and since my site is 100% php (well mixed in with xhmtl) there is no way i could do it.
have you tried to run php from the main (html) webserver?
if you want you can figure out what they are running my creating a simple script:
<br /><?php<br /><br />phpinfo();<br /><br />?><br />
and see what it returns you.
oh as for lots of posts.. yep i do.. gonna try and respond to any i can soon... i am also busy working on the site speed...and general maintanance