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/13/17 at 09:00:34
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 64367 times)
sdimbert
Green Dragon
*

Posts: 8



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #60 on: 03/26/06 at 23:39:03 »
Reply with quote Modify message

Yeah... I changed the name of the page. Check this out:

It works here: http://www.biav.org/cgi-bin/store/cpshop.cgi

But not here: http://www.biav.org/web/shop/

Help?
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 #61 on: 03/27/06 at 16:27:01 »
Reply with quote Modify message

It would help if I could see the PHP code you used to make the cpshop call.
Logged

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

Posts: 8



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #62 on: 03/27/06 at 16:36:31 »
Reply with quote Modify message


on 03/27/06 at 16:27:01, Marty wrote:
It would help if I could see the PHP code you used to make the cpshop call.


Can-do!

Code:
<?php
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
$str = `/home/biavorg/public_html/cgi-bin/store/cpshop.cgi "http://www.biav.org/web/shop/" http://www.biav.org/cgi-bin/store/cpshop.cgi $qs`;
echo $str;
?>
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 #63 on: 03/28/06 at 11:04:56 »
Reply with quote Modify message

Hmm...that looks correct.  What's the actual URL of the php file?
Logged

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

Posts: 8



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #64 on: 03/28/06 at 11:37:00 »
Reply with quote Modify message



on 03/28/06 at 11:04:56, Marty wrote:
What's the actual URL of the php file?


As far as I know, it's http://www.biav.org/web/shop/

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 #65 on: 03/28/06 at 11:47:53 »
Reply with quote Modify message

What I mean is, didn't you create a file called index.php, or something like that?  And if so, where is it exactly?  http://www.biav.org/web/shop/index.php throws a file not found error, so that doesn't appear to be it.

Or is it that the page is being mysteriously created by WordPress?
« Last Edit: 03/28/06 at 11:48:51 by Marty » Logged

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

Posts: 8



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #66 on: 03/28/06 at 11:56:41 »
Reply with quote Modify message


on 03/28/06 at 11:47:53, Marty wrote:
Or is it that the page is being mysteriously created by WordPress?


Exactly. According to the WordPress Codex, "Pages are not files. They are stored in your database just like Posts are."

I did discover that I can ignore Permalinks and use a URL like this: http://www.biav.org/web/?page_id=19

(But that doesn't seem to help.)

More information here: http://codex.wordpress.org/Pages
« Last Edit: 03/28/06 at 11:58:58 by sdimbert » Logged
sdimbert
Green Dragon
*

Posts: 8



Go Scots!
   

E-Mail
Re: How to embed cpshop in a PHP page
« Reply #67 on: 04/05/06 at 23:15:36 »
Reply with quote Modify message

Marty,  

Anything new?
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 #68 on: 04/07/06 at 00:44:44 »
Reply with quote Modify message

I'm afraid I just don't know much about the WordPress architecture.  For example, is it executing your PHP code each time the page runs?  Or is it running it once, and caching the results?

I'd probably have to dig right in to have any shot at figuring out why it doesn't work, and I just don't think I'm going to have time to do that.

(Of course, if you're really just trying to use your WordPress page as a cpshop template, you can do just that -- plunk some cpshop template tags right into the WordPress page, and then enter that page's URL into cpadmin as the Default HTML Template.)
Logged

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

Posts: 54



Go Scots!
   

Re: How to embed cpshop in a PHP page
« Reply #69 on: 06/03/06 at 14:05:10 »
Reply with quote Modify message

removed by poster
« Last Edit: 06/05/06 at 21:24:39 by dem22 » Logged
dem22
Gold Dragon
****

Posts: 54



Go Scots!
   

Re: How to embed cpshop in a PHP page part2
« Reply #70 on: 06/03/06 at 22:21:14 »
Reply with quote Modify message

removed by poster
« Last Edit: 06/05/06 at 21:24:20 by dem22 » Logged
ToonDawg
White Dragon
**

Posts: 17



Go Dawgs!
   

Re: How to embed cpshop in a PHP page
« Reply #71 on: 08/25/07 at 06:48:14 »
Reply with quote Modify message

I've followed the steps in making cpshop work in php, but when I launch my php page, it looks like nothing is being passed source-wise:

http://antiorange.dawgtoons.com/store.php

cpshop.cgi is working:

http://antiorange.dawgtoons.com/cgi-bin/store/cpshop.cgi

I've got "use query strings with store URLs (with a "?i=")" selected, and here's what I have  in my php file:


Code:
<?php
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
$str = `/public_html/antiorange/cgi-bin/store/cpshop.cgi "http://antiorange.dawgtoons.com/store.php" http://antiorange.dawgtoons.com/cgi-bin/store/cpshop.cgi $qs`;
echo $str;
?>


Can someone help?  I've hit a wall as to what to troubleshoot next.  

FWIW, I had to put in

Code:
$script_dir = "$ENV{'DOCUMENT_ROOT'}/cgi-bin/store/";


in cpshop.cgi in order to keep from getting a 500 Internal Server error.  I've tried using $ENV{'DOCUMENT_ROOT'} on my php page as well with no luck.  I'm not sure if that bit of info helps or not, but thought I'd mention it.
« Last Edit: 08/25/07 at 06:56:00 by ToonDawg » 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 #72 on: 08/25/07 at 07:00:44 »
Reply with quote Modify message

Your full document path is:
/home/dawgto2/public_html/antiorange/cgi-bin/store/

Try updating the code to match.
Logged

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

Posts: 17



Go Dawgs!
   

Re: How to embed cpshop in a PHP page
« Reply #73 on: 08/25/07 at 08:40:04 »
Reply with quote Modify message

D'oh!  Thanks!  
Logged
Redi_Jedi
Green Dragon
*

Posts: 5



Go Scots!
   

Re: How to embed cpshop in a PHP page
« Reply #74 on: 09/04/07 at 14:48:36 »
Reply with quote Modify message

Hello all.. few questions:
Would I be correct In assuming your all working in *nix/Apache?

anyone try this in windows/iis?

Also earlier in the thread marty said

Quote:
As for running PHP within cpshop, that's a totally different thing.  cpshop is a perl script, meaning the best you could do would be to use the php wrapper page to call cpshop, and then parse the output.  I wouldn't recommend it.


.... why exactly would you not recomend that?  Cause I've already started doing it and am wondering if I should stop...

I wanted to add SEO links but since I'm on windows the cpshop option doesn't work so I found a PHP solution that parses your output html and replaces the default links with the permalinks that point at a separate page, then when the person links in, that page catches them and includes the page there asking for.. basically just what I was looking for so I'd like to not have to trash it... although performance may be an issue... not really sure yet..


Also--  what exactly is that code you have there doing?  is it using the command line to execute the perl compiler(interpreter?) on the stores cgi files returning the output to $str and echoing it to the screen, or storing some special command that executes when echo'd?

basically if you added a var_dump($str) and commented the echo would have all the html for the page in $str or just the string you stored there?
« Last Edit: 09/04/07 at 14:58:14 by Redi_Jedi » 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.