marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
php not working in cptemplate?

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « php not working in cptemplate? »
Welcome, Guest. Please Login or Register.
12/15/17 at 12:21:10
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   php not working in cptemplate?
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: php not working in cptemplate?  (Read 476 times)
Kronus_GT
Green Dragon
*

Gender: male
Posts: 7



I'm awesome!
   

WWW
php not working in cptemplate?
« on: 10/14/08 at 13:03:26 »
Reply with quote Modify message

It's not too fancy(I'm new at this), but I currently have the sections of my website split up into seperate files so I don't have to update much when changes are made.  I use php include/require to import those files(menu, footer, content, and header), and it works perfectly with everything but the cpshop template.  I have to copy/paste each section into cptemplate for them to appear, which is a bit of a hassle.

Does PHP just not work within a cpshop template?
Logged

www.bojosbazaar.com
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: php not working in cptemplate?
« Reply #1 on: 10/14/08 at 14:07:25 »
Reply with quote Modify message

I use php in my templates. I think there's an issue with some hosting accounts of having the templates in the cgi-bin, if I remember correctly. Try moving them somewhere else. Oh, and you also need to reference them as a full url, not a file path.
Logged
Kronus_GT
Green Dragon
*

Gender: male
Posts: 7



I'm awesome!
   

WWW
Re: php not working in cptemplate?
« Reply #2 on: 10/14/08 at 15:29:16 »
Reply with quote Modify message

I originally had cpshop in cgi-bin, but just moved it earlier to clean up the url a bit.  I've tried both with no success, including referencing the full url.

I was expecting a big nope for my answer, so now I'm really puzzled as to why it isn't working properly.

If it helps, the php include code actually appears in the view source(colored pink in the Firefox view source) instead of the code that it's supposed to import.  So to me that indicates that it's simply not being executed, correct?

Here is an example of what I put in my code: (I've removed the link.)
« Last Edit: 12/29/11 at 16:13:50 by Kronus_GT » Logged

www.bojosbazaar.com
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: php not working in cptemplate?
« Reply #3 on: 10/15/08 at 04:41:11 »
Reply with quote Modify message

Use the full URL's in cpadmin. Try this in your template ( or whatever the path to your template is):

<?php include("Header.php"); ?>
Logged
Kronus_GT
Green Dragon
*

Gender: male
Posts: 7



I'm awesome!
   

WWW
Re: php not working in cptemplate?
« Reply #4 on: 10/15/08 at 06:19:06 »
Reply with quote Modify message

Thanks!  Using the full url for cptemplate in cpadmin fixed my issue.
Logged

www.bojosbazaar.com
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright 2000-2001, X-Null. All Rights Reserved.