Need help calling .php files inside search results pages

General ShopSite user discussion

Need help calling .php files inside search results pages

Postby drose » Thu Oct 11, 2007 10:29 am

<?
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
drose
 
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm

Postby loren_d_c » Thu Oct 11, 2007 10:40 am

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
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Any suggestions?

Postby drose » Thu Oct 11, 2007 12:23 pm

There must be a way around this.

DR
www.jewelrycrossings.com
www.d2m.com
twitter.com/jewelrycrossing
drose
 
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm

Postby loren_d_c » Thu Oct 11, 2007 12:46 pm

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
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

What about javascript

Postby drose » Thu Oct 11, 2007 1:01 pm

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
drose
 
Posts: 12
Joined: Sat Aug 04, 2007 8:31 pm

Postby loren_d_c » Thu Oct 11, 2007 1:05 pm

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
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: No registered users and 88 guests

cron