Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    Inserting PHP PopShop into my site template?
    HTML person here, asking PHP questions....

    I know very little about PHP and have only worked with it a tiny bit. I want to use PHP output with PopShops so it will be dynamic. Two questions -

    1) Can I simpy pop the PHP output into my template for new pages that I create and then save as whatever.php? (the doctype is HTML 4 transitional). It seems to be working so far doing that.

    2) How can I incorporate PHP into existing pages that have been indexed by search engines and that I'd rather NOT rename? Should I put the shop into an iframe?

    Thanks everyone. I really want to start popping in products but just went Pro and am trying to figure out what format to use.

  2. #2
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    Quote Originally Posted by joyaz
    2) How can I incorporate PHP into existing pages that have been indexed by search engines and that I'd rather NOT rename? Should I put the shop into an iframe?
    Skip the iframe idea, too much can go wrong regarding seo and merchants policies and more.

    Any page, that the server is enabled for, can parse php. Php pages are that way by default. Like html page render html by default. If you have access to the mime types settings for your server, you can instruct the server to parse php on html pages. This way (I'm assuming your existing pages are html), you leave your page names alone and they will now recognize and execute any php found on those pages.

    Read this whole thread, but pay attention to stuff in post #44:
    http://forum.abestweb.com/showpost.p...4&postcount=44

  3. #3
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Quote Originally Posted by joyaz
    HTML person here, asking PHP questions....

    I know very little about PHP and have only worked with it a tiny bit. I want to use PHP output with PopShops so it will be dynamic. Two questions -

    1) Can I simpy pop the PHP output into my template for new pages that I create and then save as whatever.php? (the doctype is HTML 4 transitional). It seems to be working so far doing that.

    2) How can I incorporate PHP into existing pages that have been indexed by search engines and that I'd rather NOT rename? Should I put the shop into an iframe?

    Thanks everyone. I really want to start popping in products but just went Pro and am trying to figure out what format to use.
    I'll give this a stab, but hopefully some far more "tech savvy" people will come along to confirm or deny my efforts, or at least make sure I'm getting it right:

    As for 1) -- I THINK you're all right with that. I'm not sure, either, why or how exactly that works, but I think it will.

    As for 2) --

    If your site is on a unix/linux server (and most are, unless you've specifically sought a Windows server), there should be a file on your site called ".htaccess" -- it isn't a text file, HTML file, or PHP file, it's a unix file. There is no extension (.txt, .php, .htm, etc.) on it -- but note there is a period (".") at the beginning of the name.

    You can edit that file with a plain text editor, but be sure NOT to save it with any extension, i.e., not as htaccess.txt.

    In that file you can use a "rewrite rule," which should look something like this, just put into the file as a single line with no line breaks:

    AddType application/x-httpd-php .htm .html

    Put that in your .htaccess file, either using your File Manager in cpanel or downloading/uploading via FTP. Make sure you don't mess with any lines already in the file, just add the one above. Then save it back to your server, making sure to keep the name of it as ".htaccess"

    That should cause your web site's html pages to be read like php pages without needed the .php extension. It should let your site's php pages continue to work as normal.

    DISCLAIMER: I'm not a programmer/techie sort of guy. I mostly do words ("writerguy") and not code (NOT "coderguy ) so you might wish to GOOGLE ".htaccess" or "ModRewrite" or continue to search for such things here at the forum. I know I've tried your 1) stuff and it works; and I've done my suggested .htaccess stuff on a couple of sites I have and it works.

    But maybe someday it'll explode the whole works -- I'll let you know.
    Generate more fake news.

  4. #4
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    Thanks Donuts and Writerguy -

    I really appreciate your help. Yes, I'm on a unix server so I will try modifying my htaccess file as instructed. I researched this a bit and found examples showing both ---

    addType application....etc

    and

    addHandler application...etc

    Either one? Is there a difference?

    Also do you only need the htaccess file in your root directory? I host 6 domain names with one hosting account, so the site in question resides in a subdirectory. I think to access the htaccess file I'll find that only at the root of my main domain. Hopefully this doesn't complicate things too much!


  5. #5
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    main (or lowest) domain root works fine

  6. #6
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    Okay, I could not be happier right now! I edited my htaccess file in my top level directory (main domain my hosting account is under) and my PHP storefront inserted into my page of HTML works fine!

    Thank you again for your assistance.

    I hope this is the beginning of a long, happy relationship between me, data feeds and PopShops! Now I'm actually excited to get working!

  7. #7
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    Writerguy et al,

    I need to do this process again for another hosting account I have, but there is no .htaccess file visible when I connect to the server. If I create one with a single line of code as instructed above for it to handle PHP will that work?

    Thanks.

    Joyce

  8. #8
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Wink
    Quote Originally Posted by joyaz
    Writerguy et al,

    I need to do this process again for another hosting account I have, but there is no .htaccess file visible when I connect to the server. If I create one with a single line of code as instructed above for it to handle PHP will that work?

    Thanks.

    Joyce
    Do it and see what happens.

    If it works keep it.

    If it doesn't delete it.

    Vietnam Veteran 1966-1970 USASA
    ABW Forum Rules - Advertise At ABW

  9. #9
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    I was afraid it would mess up my main domain since this new site is using a domain pointer, but all seems to be working okay so far.

    Thanks.

  10. #10
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Hi all, I'm glad that I found this thread. Thanks for all the great advices. I was testing one shop(a new page saved as .php) on my existing site which is made of Frontpage with all pages are by default saved as .html)

    My problem is:

    The new php page won't show my template borders(header, footer and natigation bar)

    I did add "AddHandler application/x-httpd-php .htm .html" to .htaccess file on my serve as well.

    I saved the same php page as another .html page, it shows everything just fine.

    So what have I done wrong? Please help.

  11. #11
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Anybody? Help?


    Now I really think I did something wrong...

  12. #12
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    there's too many possibilities for us to guess without more information. give us more input.

    are your template borders in an external css file that you forgot to reference within the php page's head?

    are you using the frontpage extensions on your server (they can do crazy things to non-html pages)?

    are you using an ftp client to upload your .htaccess file (frontpage doesn't like files without a file name extension)?

    when you right click and view source on your php page, can you see the generated elements that are missing? how do they render? what problems do you see?

    are you using includes that you may not have configured properly at your new host?

    and on and on...

  13. #13
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    I'm going to try and get some help here...

    Jessie

  14. #14
    ABW Ambassador joyaz's Avatar
    Join Date
    September 27th, 2007
    Location
    Arizona
    Posts
    516
    Mayfly,

    When you say your new php page won't show template and borders, etc - do you mean in the design environment? What about after the page is uploaded?

  15. #15
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Donuts, you got me I'm completely new on php and forgive me if I didn't get your questions right.
    Let me try to answer them:

    Q1:are your template borders in an external css file that you forgot to reference within the php page's head?

    Not quite sure what does it mean. I guess the answer is no?

    Q2: are you using the frontpage extensions on your server (they can do crazy things to non-html pages)?

    No, I'm not using frontpage extensions on my server.

    Q3: are you using an ftp client to upload your .htaccess file (frontpage doesn't like files without a file name extension)?

    No, I didn't use an ftp client to upload my .htaccess file. Instead, I edit the .htaccess file on my file manager(will that be the problem?).

    Q4: when you right click and view source on your php page, can you see the generated elements that are missing? how do they render? what problems do you see?

    No, all the elements that are in the other html page are there. Not sure "how they render" and seems no problems to me.

    Q5: are you using includes that you may not have configured properly at your new host?

    includes?

    Sorry for the confusion and thanks for your reply .

  16. #16
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Quote Originally Posted by joyaz
    Mayfly,

    When you say your new php page won't show template and borders, etc - do you mean in the design environment? What about after the page is uploaded?
    Actually it looks just fine when preview on my local computer. But after the page is uploaded, it only shows the products without header and footer...

  17. #17
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    Can you send me the URL of the page you're having an issue with and the shop you're trying to embed? (support@popshops.com)

    Jessie

  18. #18
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Quote Originally Posted by JessieJ
    I'm going to try and get some help here...

    Jessie
    Jessie, I sent an email this morning to support@ and PM you as well with the details. Got an "email received"auto-reply right away. I tried to search for some answers while waiting for your email and found this thread similar to my problem. Figured it won't hurt to ask...

    I will wait for your email response. Thank you.


    edit: oops, looks like we posted at the same time. So you didn't get my email and PM?
    Last edited by mayfly; November 14th, 2007 at 05:08 PM.

  19. #19
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    Ok, now I recognize you from the support email. I wish I could do more but, as many will tell you, FrontPage makes things a bit of a challenge. Your best option is to contact your host and make sure the .htaccess file is in correctly:

    AddHandler application/x-httpd-php .htm .html

    Otherwise, you need to find out how to build PHP pages with FrontPage (or change editing software which, I know, would be a big pain).

    Another idea is to get in a froum for FrontPage...your issue isn't PopShops, it's understanding the dynamic of both FrontPage and your host.

    Wish I coudl be more helpful :-(

    JessieJ

  20. #20
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    I use FP 2003 and mix php and htm on the same pages all the time.

    I build the pages as htm or html and leave them that way with the php included where I want it to appear on the page.

    It always works fine for me - but you cannot actually view the full page until you load it to your server and call it up.

    The top, bottom, right, and left of the pages are php includes. The center is for the content.

    If you are making different folders you may have to add a ./ or ../ in front of the include url.

    You can do whatever you are trying to do with FP - you do not need another editor.

    It always works for me.

    Does this help.

    Vietnam Veteran 1966-1970 USASA
    ABW Forum Rules - Advertise At ABW

  21. #21
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    To Jessie, thanks for the reply. I've just contacted my host and they said my .htaccess file is working properly. It is a little frustrating that my first try with popshop does not work out for me. My another guess: would that be because I'm using the free version for testing? I do like your tool and thinking about upgrade to pro or enterprise version once I get use to it. Will the free version made the difference?



    To BurgerBoy(I was kind of hoping you will reply for all day ):
    I'm using FP 2003 too. I made two exact same pages with one popshop using the same template with the same borders. One saved as .php, another saved as .html and I uploaded both to the server. the html page showthe store beautifully but the php page only shows the store part without borders.

    I really didn't add any codes to the existing template. You said "If you are making different folders you may have to add a ./ or ../ in front of the include url." Are you refering the "folders" to the border folder?

    Thanks for making me feel a lot more confident about FP by saying "You can do whatever you are trying to do with FP - you do not need another editor.".

    If I'll never figure this out, do you think I can just save all the pages as .html?

  22. #22
    Full Member JessieJ's Avatar
    Join Date
    July 13th, 2006
    Location
    Seattle, WA
    Posts
    426
    Hey, that's great! If your .htaccess file is working fine, and you have added that handler, have you tried seeing if php will execute? Try embedding this script in a test file (saved .html):

    <?php
    echo "Hello World!";
    ?>

    If that works, then you're set...I think. Right?

    Jessie

  23. #23
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Yes - save all of your pages as html. You did say that it worked when the page was html. It should also work as htm.

    I don't use shared borders. It sounds like that's what you are doing.

    When using shared borders in FP it takes my changes forever to load - and also when you save a change in the shared borders it also takes forever for your computer to save the change to all the pages.

    In my template page I put a blank table for the top, bottom, left and right along with a table for the center of the page.

    The table in the center of these is for your content.

    Make four new pages - leftinclude. htm, rightinclude. htm. topinclude. htm, and bottominclude. htm.

    In them put what you want in them and save them.

    From then on when you make a change you are only saving one page instead of all of the pages.

    In your template page put <?php include_once 'topinclude.htm'; ?> in the top table on your template where you want the information to appear.

    Do the same for the left table <?php include_once 'leftinclude.htm'; ?>

    Right table <?php include_once 'rightinclude.htm'; ?>

    Bottom table <?php include_once 'bottominclude.htm'; ?>

    From then on whenever you make a change in your borders you only change the include page and save it - it saves only the one page instead of all of the pages. Publish the include page and all of the pages change immediately to the new information as they are called on the server. It is so much faster.

    On your template take off the meta tag in the head that says - borders lrtb etc.
    On you template page have the head, body, html and soforth so that it is a complete page.

    On your include pages remove the head - body - end head - end body html - end html and soforth.

    All you want on the include page is just the information that you want included.

    Example:

    Code:
    <table border="0" width="100%" id="table1">
    <tr>
    <td>
    <p align="center"><font face="Brush Script MT" size="7" color="#FF0000">what ever you want here</font></p>
    <p align="center">
    <a target="_blank" href="http://whatever"><img src="http://whatever" alt="whatever" border="0"></a></td>
    	</tr>
    </table>
    In the center table of the template put the php code that the merchant gives for for their information where you want it in the table.

    If you have your includes in your root and make a new folder for a merchant then your include would need to say

    <?php include_once './topinclude.htm'; ?> or <?php include_once '../topinclude.htm'; ?> in order for the file in the folder to find the include page in the root of the web.

    If the template is in the root web with the include pages you will not need the ./ or../ when you call the include page into your template.

    You will not see the includes when viewing the page in FP. You have to publish to your server and then you will be able to see the entire page with the includes added.

    I bet I've confused you ,now - huh.

    Vietnam Veteran 1966-1970 USASA
    ABW Forum Rules - Advertise At ABW

  24. #24
    ABW Ambassador
    Join Date
    January 4th, 2006
    Location
    USA
    Posts
    2,477
    Quote Originally Posted by JessieJ
    Hey, that's great! If your .htaccess file is working fine, and you have added that handler, have you tried seeing if php will execute? Try embedding this script in a test file (saved .html):

    <?php
    echo "Hello World!";
    ?>

    If that works, then you're set...I think. Right?

    Jessie
    I was doing some google search on php, seems a lot of place mentioned <?php
    echo
    ?>
    Not quite understand...but let me try...

  25. #25
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Echo is telling the php to write on the page whatever is after the work echo.

    Your php is working.

    You said that when you name the page html that it works and the information is ok - right?

    If it is and you have php from PS on it then you php is working.

    If you're using shared borders FP extensions is not adding the borders to the page because of the .php page extension. Use .htm or .html

    Vietnam Veteran 1966-1970 USASA
    ABW Forum Rules - Advertise At ABW

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Inserting Affiliate ID into Link using PHP script
    By writerguy in forum Programming / Datafeeds / Tools
    Replies: 17
    Last Post: May 21st, 2010, 10:26 AM
  2. Replies: 0
    Last Post: April 24th, 2009, 09:31 AM
  3. using .php page template for AE
    By rgourley in forum Cusimano.com Scripts
    Replies: 1
    Last Post: March 22nd, 2006, 02:34 PM
  4. inserting php in ssi
    By Cursal in forum Programming / Datafeeds / Tools
    Replies: 6
    Last Post: December 21st, 2005, 10:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •