Trying To Include PHP Into Another Page
I'm found this great little script that is great if you want a quicky little image gallery here. It nice, the only bad thing about it is that you have to use HTML4 or else it won't validate.
I put up a test page here
I'm using a header and footer wrapped around the index.php file in that test page.
I'm trying to include the index.php file on my weblog using this:
<?php
include("http://www.sapphirestudios.net/testgallery/index.php");
?>
It's not working! Nothing shows on my weblog!
Is it something with that script itself, or is something wrong with the way that I'm trying to call it in?
(I can't use SSI because the weblog is php..hence I cannot use a shtml extention)
Roo
Renegade posted this at 22:14 — 7th October 2005.
He has: 3,022 posts
Joined: Oct 2002
I don't see anything wrong with the page, it shows up for me.
Roo posted this at 22:23 — 7th October 2005.
She has: 840 posts
Joined: Apr 1999
Yes, that's the test page. That part is fine.
I want to include that gallery...index.php file in a weblog post, and it won't show.
demonhale posted this at 23:55 — 7th October 2005.
He has: 3,278 posts
Joined: May 2005
your using a path, try using just the folder and or filename... (assuming you saved the file you inserted the php in also to php).. I guess you found it just now, I was posting about this in refresh your eyes thread, im using that since before...
Roo posted this at 02:48 — 8th October 2005.
She has: 840 posts
Joined: Apr 1999
It was my understanding that you had to include the full path. Yes? No?
demonhale posted this at 03:00 — 8th October 2005.
He has: 3,278 posts
Joined: May 2005
If you insert it into an html file then the embedding is different, in a php file then its just the include tag, for both dont use paths with http, use only folder full paths to make it work, try it out, if you use full paths like the ones you have it will be read just like an html file thus disabling the php commands...
Roo posted this at 09:19 — 8th October 2005.
She has: 840 posts
Joined: Apr 1999
Never mind. I asked on the pmachine forums, and you can't put a php tag into a post.
demonhale posted this at 16:50 — 8th October 2005.
He has: 3,278 posts
Joined: May 2005
if a post supports html you can, theres a hack for this...
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.