Page 1 of 2 12 LastLast
Results 1 to 25 of 43
  1. #1
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    Using PHP (or JS) on .htm or .html pages
    You can use Popshops PHP on your HTML pages (with either .htm or .html) very easily. All it takes is putting a line or two of simple code in .htaccess on an Apache server, and the .html pages will be parsed for PHP exactly as though they were .php pages. No problem, no difference, no need to change file extensions or to use anything other than .htm or .html file extensions for pages.

    The difference between using Javascript or PHP:

    PHP operates server-side and puts out static HTML code on pages before the pages actually load, which all user-agents can "read" - both browsers and search engine crawlers.

    Javascript is "client side" and can only be seen by user-agents (browsers) that have Javascript enabled, which around 90% do. But not search engine spiders, so what's in the Javascript code doesn't get indexed by the engines or count toward rankings.

    Either way, for search engine purposes it's a good idea to put some original text (and page titles and meta descriptions where possible) on pages, especially to avoid putting out "blank" page content to crawlers when JS is used.

    To use .htm or .html file extensions with PHP:

    If you don't already have an .htaccess file, create one in a text editor (not a WYSIWYG) like Notepad, with no added other file extension. And put this line in to have the pages parsed (processed) for PHP:

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

    That's it!

    ====================

    Added:

    There can be a slight difference between how servers are set up (for handling mime-types), and also can be a difference if PHP4 or PHP5 is being used. That code works on some hosts I use, but for other hosts I have to use:

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

    On some sites I have both and it works. If you happen to add one and get a 500 Internal Server Error, try the other. One of them will work.

    (This is only for Apache servers; for IIS I don't have a clue but someone else probably will know, even how on .asp pages if possible.)
    Last edited by webworker; March 19th, 2008 at 07:55 PM.

  2. #2
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    The code(s) you put into your .htaccess file to have php parsed in htm or html pages is as follows:

    Code:
    AddHandler application/x-httpd-php .htm
    AddHandler application/x-httpd-php .html
    As you can see - the first line parses htm pages.

    The second line parses html pages.

    I have both lines in my .htaccess file because I have both htm and html pages.

    Don't change or remove anything that is already in the file.

    Just add these lines and save the file.

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

  3. #3
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Quote Originally Posted by Marcia
    Either way, for search engine purposes it's a good idea to put some original text (and page titles and meta descriptions where possible)
    Is this flexibility available in the $5/mon plan?


  4. #4
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    This is the plan comparison; I'll be upgrading to fool with it and see what it does trying with different ways:

    http://www.popshops.com/faq/plans

  5. #5
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    If your server uses cpanel - it is easy to find your .htaccess file.

    In your cpanel home page click on - file manager.

    When it opens you will see a folder on the left hand side of the page that says - public_html. Click on the folder image - not the hyper-link.

    When that opens scroll down the page until you see the .htaccess file on the left hand side of that page.

    Click on the .htaccess hyper-link.

    When you click on it a window on the upper right hand corner of the page will have links that you can click on for the .htaccess file.

    Click on edit file.

    Add the two lines in my post above.

    After the lines are added scroll down the page and click on the save button to save the file.

    That's all you have to do.

    If you don't already have a .htaccess file in your public_html - you will see a link that says - Create New File. Click on it.

    Again - in the upper right hand corner of the page you will see a box to name your file.

    Leave it as a text document.

    In the box type - .htaccess

    Then click on the create button.

    Now you have a .htaccess file in your public_html.

    Then open it and do as already explained above.

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

  6. #6
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    To place the PopShops php in your html or htm page - put the php code that they give you where you want the items to appear on your page.

    Save your page and publish it to your server.

    Go to the page in your browser and you will see what you wanted on the page.

    You CANNOT see it in your computer. All you will see on your computer is the php code that you added to your page.

    You will ONLY see the items if you visit your page on the internet through your browser.

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

  7. #7
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,350
    Just be warned that it isn't always possible to modify the .htaccess file to insert php into a .html page. After hours of discussion with earthlink help desk, I was told that it wasn't possible on my site. It's always good to talk to your web host, if including the snippets recommended on the popshops faq don't work.

  8. #8
    No Longer Banned!
    Join Date
    January 19th, 2008
    Location
    Wilmer, Texas 75172
    Posts
    939
    This post needs to be a sticky...
    Marcia

    Please consider making this post a sticky since it is a tutorial oriented post

    Steve
    DreamLinux.net | Registered Linux User 453976 | PM me to view our sites. It's a Google thing.

  9. #9
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    There is a complete explanation of how to add the php to your site here:

    http://forum.abestweb.com/showthrea...t=102805&page=2
    That got a little to socially complex for me. I'm going to sign up for the $5 plan and am guessing that it won't be to hard to figure out.


  10. #10
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Quote Originally Posted by Aunt Lily
    Just be warned that it isn't always possible to modify the .htaccess file to insert php into a .html page. After hours of discussion with earthlink help desk, I was told that it wasn't possible on my site. It's always good to talk to your web host, if including the snippets recommended on the popshops faq don't work.
    I don't know earthlink was a host.

    Maybe you might consider changing host.

    I use the baby plan at: http://www.hostgator.com/shared.shtml

    I have never had any problems there of any kind and for me they are super fast for my websites.

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

  11. #11
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Quote Originally Posted by bumpaw
    Is this flexibility available in the $5/mon plan?
    bumpaw

    If you're using the free plan and up-grade to the $5.00 plan - you'll still have to add what I said to your .htaccess file to use their self-updating php on your site.

    I think that's what your question is - I'm not sure what you're asking.

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

  12. #12
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    I don't deal with add-on domains because I use mod_rewrite on every site (and 301's for files sometimes), so I use reseller hosting with the WHM for Cpanel so I can add stand-alone domains that each have their own separate Cpanel & stats. I use the cheapie here and did the 24 months so it's cheap enough for stingy ole me:

    http://fastnext.com/resellers.html

  13. #13
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    I had a site with fastnext and it didn't work more than it did work so I moved my site to hostgator with the rest of my sites and all of my problems were solved.

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

  14. #14
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    I've never yet had a problem with Fastnext, and can just copy and paste my .htaccess to new sites when I put them up.

  15. #15
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,350
    Quote Originally Posted by BurgerBoy
    I don't know earthlink was a host.

    Maybe you might consider changing host.

    I use the baby plan at: http://www.hostgator.com/shared.shtml

    I have never had any problems there of any kind and for me they are super fast for my websites.
    I have websites with many different hosts, the earthlink site is the only one I have this problem with. For a variety of reasons, I'm not prepared to move it - yet. I just thought that I would let folks know that the code snippets don't work for some hosts. It might save hours and hours of frustration.

  16. #16
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    Personally, while mentioning hosting functionality is appropriate, I think that discussing specific hosting recommendations and comparisons is OFF TOPIC - and that happens quite enough. Plus, it isn't fair to others, especially when the thread was not started as a hosting thread but a Popshops thread.

    The last thing we need is more bickering. And I know I personally dislike (and resent) when I start a thread for a reason and it goes off the subject.

  17. #17
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Cool
    Quote Originally Posted by Marcia
    I don't deal with add-on domains because I use mod_rewrite on every site (and 301's for files sometimes), so I use reseller hosting with the WHM for Cpanel so I can add stand-alone domains that each have their own separate Cpanel & stats. I use the cheapie here and did the 24 months so it's cheap enough for stingy ole me:

    http://fastnext.com/resellers.html
    Then why were you linking to fastnext??

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

  18. #18
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    4,053
    Quote Originally Posted by BurgerBoy
    Then why were you linking to fastnext??
    Because they got knocked, and as long as the thread went off topic, I might as well defend the host I have TWO reseller accounts with and have had NO PROBLEMS with.

    As long as the thread won't be split off for off-topic discussion, it wouldn't be fair to let a host get hosed without presenting the other side.

    Now I'm sorry I started the thread, I'll think twice before ever starting another one here at ABW.

  19. #19
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Cool
    I assumed that Aunt Lily wanted to run the PopShops php and her host wouldn't let her so I was telling her a host that would let her run it - so - She could use her POPSHOPS php which is on topic in the thread.

    The thread is about php and PopShops isn't it??

    Boy - are you ever Grouchy today.

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

  20. #20
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Now let me say something positive about PopShops. It took me 2.25 hours to sign up with the $5 dollar plan and get 8 battery drills sold by 2 merchants up on a live page. That seemed fast for me in a new set up. I used the PHP code.

    The only help files I needed was to get the Network IDs right. Don't want to make a mistake there. This is a way smooth set up. I have been seeing a lot of posts about PopShops but never took the time to check it out. I have got to hand it to Angel. It's really a user friendly set up.


  21. #21
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Yes - it's great and easy to use their php code.

    Some of the affiliates here just didn't know how to use it and I was trying to help them understand how to use it.

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

  22. #22
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Some of the affiliates here just didn't know how to use it and I was trying to help them understand how to use it.
    You got me moving.


  23. #23
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    Quote Originally Posted by bumpaw
    You got me moving.
    Glad to help.

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

  24. #24
    The Seal of Aproval rematt's Avatar
    Join Date
    November 19th, 2006
    Location
    The Windy City
    Posts
    4,140
    Quote Originally Posted by Marcia
    Because they got knocked, and as long as the thread went off topic, I might as well defend the host I have TWO reseller accounts with and have had NO PROBLEMS with.

    As long as the thread won't be split off for off-topic discussion, it wouldn't be fair to let a host get hosed without presenting the other side..
    Marcia, it seems that most threads take at least a minor detour (this could be considered one) and go slightly off-topic. Don't worry about it, you did a great job of refocusing the thread.

    Quote Originally Posted by Marcia
    Now I'm sorry I started the thread, I'll think twice before ever starting another one here at ABW.
    And that would be a shame. There's a lot of great information here. You've managed to provide an excellent tutorial, I'm sure everyone appreciates it and would love to see anything that you may wish to contribute. Don't worry if it gets a little off track.

    -rematt
    "I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant." - Richard Nixon

  25. #25
    Advocate mellie's Avatar
    Join Date
    January 18th, 2005
    Location
    Here
    Posts
    1,925
    Thank you for posting this info! This is a big help, I had tried once before but did something wrong.
    Melanie
    President - Affiliate Advocacy 2008 ShareaSale Performance Industry Advocate Award, 2009 Affiliate Summit Pinnacle Award - Affiliate Advocate
    Affiliate Advocacy
    NYAffiliateVoice Seery Writing

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Runing PHP code in a htm page
    By websmith in forum Programming / Datafeeds / Tools
    Replies: 6
    Last Post: July 11th, 2008, 07:40 PM
  2. .PHP pages versus .HTML pages?
    By sixeden in forum Search Engine Optimization
    Replies: 7
    Last Post: January 20th, 2007, 05:24 PM
  3. html vs. htm
    By Rhia7 in forum Midnight Cafe'
    Replies: 19
    Last Post: September 11th, 2006, 11:27 AM
  4. PHP on .HTML - .SHTML Pages
    By AddHandler in forum Programming / Datafeeds / Tools
    Replies: 11
    Last Post: April 16th, 2005, 08:52 PM
  5. Making .html pages be parsed as .php
    By ~Michelle in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: June 6th, 2004, 09:20 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
  •