Need help calling .php files inside search results pages

General ShopSite user discussion
Post Reply
drose
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm
Contact:

Need help calling .php files inside search results pages

Post by drose »

<?
include("http://xx.xx.xx.xx/left.php");
?>

I am trying to get the above include to work inside a search results page template. Is there a problem with using this code inside a cgi driven page?

I cannot get it to show up, though it shows up in other templates. Is there a problem with using this kind of include while on a search page, or am I missing some qualifying code to make it work. I'm stuck!

Thanks,

DR
www.jewelrycrossings.com
www.d2m.com
twitter.com/jewelrycrossing
loren_d_c
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere
Contact:

Post by loren_d_c »

PHP includes won't work in a cgi page. It will work on your store pages because they are static HTML pages that the webserver can parse for PHP code, but this won't work on the search results or the shopping cart screens.

-Loren
drose
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm
Contact:

Any suggestions?

Post by drose »

There must be a way around this.

DR
www.jewelrycrossings.com
www.d2m.com
twitter.com/jewelrycrossing
loren_d_c
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere
Contact:

Post by loren_d_c »

None that I know of with ShopSite's cgi-based product search. Perhaps you can try some other site search feature that is based on PHP so you could use your PHP includes in it.

Note that if all your left.php file has in it is text and/or HTML, and no actual PHP code that has to be executed, then you could just put that text/HTML in a ShopSite custom search template. Again, no PHP code will be executed from here.

-Loren
drose
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm
Contact:

What about javascript

Post by drose »

I remember once i used javascript to pull in a .js file inside a .asp environment. Will that work? It is a list of links, so I would like to pull from one file rather than have two files with the same links.

Thanks,

DR
www.jewelrycrossings.com
www.d2m.com
twitter.com/jewelrycrossing
loren_d_c
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere
Contact:

Post by loren_d_c »

Sure, you could do it with JavaScript because JavaScript is executed on the client-side, not the server, so the server-side method of creating the page (PHP, CGI, plain HTML, etc) does not matter.

-Loren
Post Reply