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

YOU ARE HERE:
Template has PHP includes, how to still use?

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Template has PHP includes, how to still use? »
Welcome, Guest. Please Login or Register.
12/12/17 at 17:58:47
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   Template has PHP includes, how to still use?
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Template has PHP includes, how to still use?  (Read 1111 times)
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Template has PHP includes, how to still use?
« on: 02/20/04 at 09:55:25 »
Reply with quote Modify message

So my template page is php.  I had some php includes to grab my menu and layout from (since my entire site uses it).  Obviously the CGI executes the page and it won't run the actual PHP as code, just prints it out.  

How do I still include those files within my page..  to actually insert the necessary wrapper files I have?  Any help is appreciated, thanks!
Logged

----------------
http://www.astphotos.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Template has PHP includes, how to still use?
« Reply #1 on: 02/20/04 at 10:39:22 »
Reply with quote Modify message

Put your template into a non-cgi-bin directory, and reference it in cpshop as a URL instead of a file.  That way your server can process the PHP, SSI and whatever else you have in the template before cpshop uses it.

So in the Default HTML Template field, instead of this:

mytemplate.html

or this:

/www/mysite/docs/mytemplate.html

enter this:

http://www.mysite.com/mytemplate.html
« Last Edit: 02/20/04 at 10:39:36 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #2 on: 02/20/04 at 12:27:57 »
Reply with quote Modify message

Thanks Marty, it worked.  I thought for some reason, they needed to be processed by the server at the same time.  I didn't even think the script just takes a processed page and looks for it needs to insert its date.  

I now have a site up at:
http://astphotos.com/store/cpshop.cgi

but for some reason, there are numbers appearing below and after my code.  I don't see anything in the template, but you can see what I mean there.  It inserted like
1190 before
{html} in my code
and a 0
after {/html}

any ideas?  Thanks

Tony
Logged

----------------
http://www.astphotos.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Template has PHP includes, how to still use?
« Reply #3 on: 02/20/04 at 13:55:10 »
Reply with quote Modify message

Hmm.  That's bizarre.

Try setting up a blank html page, and referencing it as the template, and see what happens.  I can't think of anything in the code that might be causing it, which leads me to believe cpshop could be interpreting something strange from your web server.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #4 on: 02/20/04 at 14:14:44 »
Reply with quote Modify message

<!-- test -->

I put Text as the only thing in the doc and when I reloaded my blank.html page, I got that above, no numbers or anything

EDIT:
Scratch that, I pointed to a non-existant test.html, but when I did fix it, my page only popped up
Test   like it should have
« Last Edit: 02/20/04 at 14:20:39 by Tony » Logged

----------------
http://www.astphotos.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Template has PHP includes, how to still use?
« Reply #5 on: 02/20/04 at 15:08:06 »
Reply with quote Modify message

So now try replacing the template file with one that just says:

<[title]>
<hr>
<[content]>

And see what happens then.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #6 on: 02/20/04 at 15:14:09 »
Reply with quote Modify message

http://astphotos.com/store/cpshop.cgi

No weird numbers still.  

This is the source of my template:

Code:
<html>
<head>
<title><[title]></title>
<meta name="keywords" content="shirts, hats, mugs, sweaters, custom, designs">
<meta name="description" content="Shirts, hats, mugs and more!">
<meta http-equiv="imagetoolbar" content="no" />
<meta content="TRUE" name="MSSmartTagsPreventParsing" />
<link rel="stylesheet" type="text/css" href="/css/styles.css">

</head>
<body>
<?php include "/vhosts/sites/astphotos/docs/wrapper.header" ?>
<center>
<[content]>
</center>
<?php include "/vhosts/sites/astphotos/docs/wrapper.footer" ?>
</body>
</html>
Logged

----------------
http://www.astphotos.com
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #7 on: 02/20/04 at 15:20:38 »
Reply with quote Modify message

So I copied my template.php file to be one without those includes in them, and now they have numbers still, so I know it's not the includes.

I made sure my php file was ascii as well in case that means anything.
Logged

----------------
http://www.astphotos.com
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #8 on: 02/20/04 at 15:43:11 »
Reply with quote Modify message

Ok, I tried something else

I took the same template2.php file that has no includes and changed it to template2.html

No numbers....

So that would be a problem since I need my html to include php in it.  
Logged

----------------
http://www.astphotos.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Template has PHP includes, how to still use?
« Reply #9 on: 02/20/04 at 15:52:57 »
Reply with quote Modify message

Alright -- let's see if we can come up with a short-term fix, since this seems to be a pretty isolated bit of server weirdness.

In cpshop.cgi, where you have this line:

&gettemplate;

Add 2 new lines below it like this:

&gettemplate;
$html =~ s/^.*<html/<html/i;
$html =~ s/<\/html>.*$/<\/html>/i;

Then try loading cpshop again, and see what happens.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #10 on: 02/20/04 at 16:09:04 »
Reply with quote Modify message

still a no go.  I wonder what that number means.  without all the major code, and just that quick template I made, it's now 19e before the HTML tag, as long as I keep in PHP.  I"m going to point my server admin friend to check out this thread to see what he says, he's just now around right now.  Thanks for helping me along the way Marty.
Logged

----------------
http://www.astphotos.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Template has PHP includes, how to still use?
« Reply #11 on: 02/20/04 at 17:25:02 »
Reply with quote Modify message

It sounds to me like it's something to do with the server itself, not cpshop.

Hopefully your friend can make heads or tails of it.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Tony
Gold Dragon
****

Gender: male
Posts: 85



Hello?  Where am I?
   

WWW
Re: Template has PHP includes, how to still use?
« Reply #12 on: 02/22/04 at 12:48:58 »
Reply with quote Modify message

Thanks for helping Marty.  I'll get back to you to see what I find out and post it here in case anyone else ever comes across this.
Logged

----------------
http://www.astphotos.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.