Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    54
    Plugin Contributions
    0

    Default Is it possible to use php coded links in category descriptions?

    Instead of links like this:
    Code:
    <a href="http://fabricland.com/zencart/index.php?main_page=index&cPath=86_89">Adults</a>
    I'd like to use something like this:
    Code:
    <a href="<?php echo ($_SERVER[''] . 'index.php?main_page=index&cPath=86_89');?>">Adults</a>
    This works fine in ezpages (after installing the appropriate mod) and also define_pages. This would make life a lot easier when copying site from test server to live.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Is it possible to use php coded links in category descriptions?

    Why use absolute links at all ?

    Just use relative links instead:

    Code:
    <a href="index.php?main_page=blahblah">etc....</a>
    This way it's server-independent.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2005
    Posts
    54
    Plugin Contributions
    0

    Default Re: Is it possible to use php coded links in category descriptions?

    Quote Originally Posted by DrByte View Post
    Why use absolute links at all ?

    Just use relative links instead:

    Code:
    <a href="index.php?main_page=blahblah">etc....</a>
    This way it's server-independent.
    Yes that would be much better. Duh! Now I get to chuckle at myself. My only excuse is that in my rush to get online by Sept. 1st, I just pasted the links from the sideboxes and realizing that they were absolute I changed them with the $_SERVER[''] bit. I have to keep reminding myself....K.I.S.S.

    Thanks for straightening me out Doc.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Is it possible to use php coded links in category descriptions?

    Simple's almost always better.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Using php next to Category descriptions
    By retched in forum General Questions
    Replies: 20
    Last Post: 27 Sep 2010, 08:18 PM
  2. Confirmation: can't use php in Product Descriptions?
    By karma-lab in forum General Questions
    Replies: 33
    Last Post: 27 Aug 2009, 09:08 AM
  3. is it possible to use PHP 5.1.6 for zencart?
    By sukhada in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 23 Jan 2007, 10:16 AM
  4. Replies: 3
    Last Post: 11 Sep 2006, 07:37 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
  •  
disjunctive-egg