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

YOU ARE HERE:
How to embed cpshop in a PHP page

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « How to embed cpshop in a PHP page »
Welcome, Guest. Please Login or Register.
12/18/17 at 01:00:24
Home Help Search Login Register
   marty.net message board
   About cpshop
   Tutorials
   How to embed cpshop in a PHP page
(Moderator: Marty)
Pages: « 1 2 3 4 5 6 7 » Reply Notify of replies Send the topic Print 
   Author  Topic: How to embed cpshop in a PHP page  (Read 64417 times)
jmfpub
Green Dragon
*

Posts: 7



Probably my fault!
  jmfpub jmfpub   jmfpub

WWW E-Mail
Re: How to embed cpshop in a PHP page
« Reply #30 on: 04/02/04 at 07:36:07 »
Reply with quote Modify message

This probably doesn't apply to a whole lot of people, but this method of embedding CPShop in a PHP file fails for people who are running in shared hosting environments with Safe Mode enabled for PHP.  The backticks are the problem.  I ran across this a few months ago and just went about it a whole different way.  But Xeon's current problem (in another thread) got me thinking about it again.

Anyway, for anyone who's having problems getting this to work, check your error log for a message about backticks not being allowed in Safe Mode.  It might save you some headaches.
Logged
flashmind
White Dragon
**

Posts: 21



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #31 on: 05/29/04 at 11:02:06 »
Reply with quote Modify message

the script was working fine a few days ago now I keep getting this

Warning: shell_exec, passthru, popen() has been disabled for security reasons in /home/fm1/public_html/content.php on line 156



any help please...  
Logged

http://www.flash-mind.com
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: How to embed cpshop in a PHP page
« Reply #32 on: 05/29/04 at 12:28:15 »
Reply with quote Modify message

That's a problem with your webspace provider having changed a security setting.  You should probably speak to them first.
Logged

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

Posts: 8




   

WWW E-Mail
Re: How to embed cpshop in a PHP page
« Reply #33 on: 06/02/04 at 12:53:04 »
Reply with quote Modify message

Just what I was looking for, but I'm a bit scared to use it.
I have two huge "4images" galleries, in which there are several categories. What I would like to do is make a category "store", and if my visitors click on it, they should see the frontpage of the store and not another gallery.
Is that what this modification will do...?
Logged
Drew
Guest

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #34 on: 08/24/04 at 16:26:15 »
Reply with quote Modify message


on 04/02/04 at 07:36:07, jmfpub wrote:
This probably doesn't apply to a whole lot of people, but this method of embedding CPShop in a PHP file fails for people who are running in shared hosting environments with Safe Mode enabled for PHP.  The backticks are the problem.  I ran across this a few months ago and just went about it a whole different way.  But Xeon's current problem (in another thread) got me thinking about it again.

Anyway, for anyone who's having problems getting this to work, check your error log for a message about backticks not being allowed in Safe Mode.  It might save you some headaches.


So I've got this probelm. Is there a solution?
Logged
Drew
Green Dragon
*

Posts: 3



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #35 on: 08/24/04 at 16:28:52 »
Reply with quote Modify message

Thought I whould login to validate my post above as a registered user.
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: How to embed cpshop in a PHP page
« Reply #36 on: 08/26/04 at 22:20:29 »
Reply with quote Modify message

Unfortunately, I'm not an expert on PHP at all.  Any PHP gurus out there with any ideas?
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
david@zatz.com
White Dragon
**

Posts: 11



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #37 on: 08/27/04 at 15:01:18 »
Reply with quote Modify message

Marty, I'm not sure if you're asking about user validation or the problem with the guy with the wrong PHP settings at his ISP. Frankly, for the second issue, either he should ask his ISP to change the config file or switch to a more PHP-friendly ISP.

It's not like there aren't a few ISPs out there.
Logged
Simon
Gold Dragon
****

Gender: male
Posts: 51



Go Scots!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #38 on: 09/13/04 at 00:30:34 »
Reply with quote Modify message

Regarding the PHP security settings. I'm researching a host just now and hes got the safe_mode on  

But I was thinking that maybe it would work if I can convince the host to set  safe_mode_exec_dir to the cgi-bin directory. I'm no php expert either, just reading the manuals, but I understand this would allow execution in the specified directory.

Anyone here that knows PHP that can verify that?

Logged

Byholm - Casual Clothing and Gifts
Photos from Finland
Simon
Gold Dragon
****

Gender: male
Posts: 51



Go Scots!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #39 on: 09/24/04 at 09:27:52 »
Reply with quote Modify message

In replay to my own message I got the problem solved by having the host use open_basedir instead of safe_mode for the php security.

I now have our cpshop through php site up and working at www.byholm.com there's still some things to fix there but it should soon be ready to receive some traffic.

Now I wonder is it at all possible to use the clean store urls with php? When I turn them on and click on a section link I get the main store screen again but with some changes to the stylesheet that makes my sidebar go white.

Simon
Logged

Byholm - Casual Clothing and Gifts
Photos from Finland
Simon
Gold Dragon
****

Gender: male
Posts: 51



Go Scots!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #40 on: 09/24/04 at 10:43:55 »
Reply with quote Modify message

Another issue with php is that the cpshop script defines the following general styles that interferes with the styles of my main page. This means when the cpshop code is displayed some fonts change size for me. Maybe it would be better to use only named styles in cpshop and name them something like cps_smallprint and so on to prevent namespace pollution.

body {
     font-family: verdana,geneva,arial,helvetica,sans-serif;
     font-size: 10pt;
}

hr {
     noshade;
}
img.imageborder {border-width:0;}

tr, td, table,form,input,button,select,option  {
     font-family: verdana,geneva,arial,helvetica,sans-serif;
     font-size: 11px;
     page-break-inside: avoid;
}

table.border {
     font-family: verdana,geneva,arial,helvetica,sans-serif;
     page-break-inside: avoid;
     border-width:1px;
     border-style:solid;
}
Logged

Byholm - Casual Clothing and Gifts
Photos from Finland
Simon
Gold Dragon
****

Gender: male
Posts: 51



Go Scots!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #41 on: 09/24/04 at 11:36:58 »
Reply with quote Modify message

With the risk of becoming boring I'm reporting another issue with php. The statistict doesn't seem to work at all. Maybe because the script is called "from the command line" and not in cgi context?

If I access the cpshop.cgi page the statistics updates, if I access the php page with embedded cpshop it doesn't show in the statistics.
Logged

Byholm - Casual Clothing and Gifts
Photos from Finland
david@zatz.com
White Dragon
**

Posts: 11



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #42 on: 10/28/04 at 10:48:27 »
Reply with quote Modify message

I had to do a Windows reinstall (the server motherboard croaked) and I've gotten everything reinstalled and working again, except for the version of cpshop called from PHP.

When I call the cpshop admin interface from a browser window directly, I get dropped into the interface just fine. This leads me to think I've got Perl installed correctly.

However, when I call the php interface, which then calls the Perl code through a code block like what follows, the server opens the cpshop.pl file in a Notepad window on the server's console.

Here's the code that worked before the reinstall:


Code:
<?php
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
$str = `C:\var\www\cgi-bin\cpshopManila\cpshop.pl http://giftshop.zatz.com/stories/storyReader$7 http://linux1.zatz.com/cgi-bin/cpshopManila/cpshop.pl $qs`;
echo $str;
?>


I'm sure I just haven't configured some type for Perl or the PHP link, but I'll be darned if I know what's missing. Any ideas would be greatly appreciated.

Thanks,
David
Logged
Simon
Gold Dragon
****

Gender: male
Posts: 51



Go Scots!
   

WWW
Re: How to embed cpshop in a PHP page
« Reply #43 on: 10/29/04 at 02:46:14 »
Reply with quote Modify message

I'm no expert on perl in windows but I think if you assosiate the .pl extension with your perl interpreter in windows it would run perl instead of notepad in the file.

Win2000: Right click on the cpshop.pl and select open with->choose progam and then select perl from the list of applications and tick the box that says "Always use this program to open..."

If you want to be able to open perl files with notepad by just clicking at them another way may be to modify the code to something like this:


Code:
<?php
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
$str = `perl.exe C:\var\www\cgi-bin\cpshopManila\cpshop.pl http://giftshop.zatz.com/stories/storyReader$7 http://linux1.zatz.com/cgi-bin/cpshopManila/cpshop.pl $qs`;
echo $str;
?>


But you will brobably have to add a path to perl.exe and possibly give it some parameters.

Logged

Byholm - Casual Clothing and Gifts
Photos from Finland
anton
White Dragon
**

Gender: male
Posts: 11



My Body Is A Temple.  Respect My Freedom of Religion.
   

WWW E-Mail
Re: How to embed cpshop in a PHP page
« Reply #44 on: 12/20/04 at 03:04:35 »
Reply with quote Modify message



on 07/28/02 at 14:29:37, SmokinL wrote:
Ok, found the problem.



Code:
<?php

� �$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
� �/* $str = `/htdocs2/1001/cgi/marty/cpshop/dev/php http://www.marty.net/phpstore/ http://cgi.marty.net/cgi/marty/cpshop/dev/php $qs`; */
� �$str = `/home/backbbq/public_html/hr/cgi-bin/store/cpshop.cgi http://hr.thebackyardbbq.com/phpstore/store2.php http://hr.thebackyardbbq.com/cgi-bin/store/cpshop.cgi $qs`;
� � �echo $str;

?>


And it worked!!! �Can you see the differences? �Subdomain diction for some reason threw it off. �Weird. �The page works both under hr.thebackyardbbq.com and www.thebackyardbbq.com/hr, even though the coding was specific.  


Hmm, now I'm experiencing the same problem, only I don't have any subdomains here, so this solution will not work for me.  I'll quickly read to the end of the thread to see if anyone else had this problem...
Logged
Pages: « 1 2 3 4 5 6 7 » 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.