where do i put my php scripts... please help!

General ShopSite user discussion

where do i put my php scripts... please help!

Postby lipidshield » Tue Jul 24, 2007 2:34 pm

Hello all!

I've been using php forever it feels like and shopsite has been part of the website for a while now as well. My problem is that I have no idea how to incorporate php into the custom templates I have set up. opening and closing php tags just get echoed (printed to screen for any non-php people) and I don't see any support for this in the shopsite API. Admittedly, it's difficult to search for since all the shopsite page names end in .php.

Where do I put php that I want to run on, for example, the thank you page. Please give the step by step beginning at logging into the shopsite back office. Thank you in advance!
lipidshield
 
Posts: 14
Joined: Fri Feb 23, 2007 9:03 am

Postby loren_d_c » Tue Jul 24, 2007 2:38 pm

PHP code will not work on any of the customer-facing screens that are created by a cgi, i.e. the shopping cart screens, the customer registration screens, and the search results screen.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby beley » Fri Jul 27, 2007 9:32 am

loren_d_c wrote:PHP code will not work on any of the customer-facing screens that are created by a cgi, i.e. the shopping cart screens, the customer registration screens, and the search results screen.

-Loren


To add to what Loren said, you also need to make sure that you use a PHP extension on pages you want to be parsed. By default, ShopSite has .html pages. You can have all your pages (including more info pages) have a .php extension (or .phtml) and then they will be parsed as PHP.

Of course, that doesn't fix anything for the shopping cart or other dynamic sections, but those can't parse PHP at all.
Brandon Eley
Certified ShopSite Designer
beley
 
Posts: 111
Joined: Sun Aug 06, 2006 10:05 am
Location: LaGrange, GA

Postby Nathan » Tue Jul 31, 2007 5:18 pm

beley wrote:
To add to what Loren said, you also need to make sure that you use a PHP extension on pages you want to be parsed. By default, ShopSite has .html pages. You can have all your pages (including more info pages) have a .php extension (or .phtml) and then they will be parsed as PHP.

Of course, that doesn't fix anything for the shopping cart or other dynamic sections, but those can't parse PHP at all.


On most web servers you can include PHP into .html pages. The trick is to tell the server, via the .htaccess file to define how a web page is processed. An .htaccess file containing the line:
AddType application/x-httpd-php .php .htm .html
will tell the server to look in .htm and .html (as well as .php) file for a mix of HTML and PHP. Locate the .htaccess file in the root of the website to affect the entire site or in the specific directory where the pages containing PHP reside.
Nathan
 
Posts: 5
Joined: Wed Jan 31, 2007 10:23 am
Location: Camarillo, Ca.


Return to User Forum

Who is online

Users browsing this forum: No registered users and 60 guests