Page 1 of 3 123 LastLast
Results 1 to 10 of 114

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    MODERATOR COMMENT: Adding eval() to arbitrarily execute random PHP or other code in the manner suggested here opens your site up to security risks.
    USE AT YOUR OWN RISK.


    I definately needed this feature. Here's an even simpler version.

    Replace this:
    Code:
    <div><?php echo $var_pageDetails->fields['pages_html_text']; ?></div>
    with this:

    Code:
    <div><?php eval(stripslashes('?>' . $var_pageDetails->fields['pages_html_text'])); ?></div>
    This way you don't have worry about php being 'on' in the ezpage - you can make the code of the page html with php inside it (a lot easier).

    Tim

  2. #2
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Quote Originally Posted by brandtim View Post
    I definately needed this feature. Here's an even simpler version.
    ...
    Tim
    Code:
    <div><?php eval(stripslashes('?>'.$var_pageDetails->fields['pages_html_text'])); ?></div>
    Verified this works in 1.3.5

    Thanks for the simplification Tim.
    I am starting to really appreciate the concatenation operator!

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

    Default Re: PHP inside ezpages

    Be sure to thoroughly understand the security risks associated with using the eval() function.
    .

    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.

  4. #4
    Join Date
    Jul 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    I notice I can't input php with the default wysiwyg editor. It erases it and replaces it with a line break.

    I'm wanting to replace ezpages with my own uploaded php pages to be wrapped by the site. Is there an easier way to do this than to have an include in the ezpage?

  5. #5
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Quote Originally Posted by rambo View Post
    I notice I can't input php with the default wysiwyg editor. It erases it and replaces it with a line break.

    I'm wanting to replace ezpages with my own uploaded php pages to be wrapped by the site. Is there an easier way to do this than to have an include in the ezpage?
    Before I discovered the eval() function, we used inline frames to present our PHP pages in the old infopages module. Passing variables can get tricky, but it works.

  6. #6
    Join Date
    Jul 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    I'm good to use the eval function method. I just need to know how I can place php code into a page via a wysiwyg editor in ezpages. Like I said, the default embeded wysiwig is erasing my code. How are you guys doing this?

  7. #7
    Join Date
    Dec 2006
    Location
    Vermont
    Posts
    128
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Hi,

    We want to be able to use PHP inside our "Main" page, under the "Define Pages Editor", so that when we copy our site to our "test" site, the links to special items change to match that.

    What do we have to do, for instance, to change this link to PHP code in the "Main" page?:

    HTML Code:
    http://vtstuff.com/index.php/vt-capital-tree-souvenirs-c-63.html
    I want the
    HTML Code:
    http://vtstuff.com
    to be changed according to the index location, ie; vtstuff.com vs. vtstuff.com/vtstuffwork

    Can anyone tell me what we need to do?

    Thanks.

  8. #8
    Join Date
    Dec 2006
    Location
    Vermont
    Posts
    128
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    OK, I got something to work to do this in the "Define Pages", but the same code won't work in the EZ Pages. That's OK for now, but it would be nice to be able to do it in an EZ Page

    This is solely for the purpose of being able to COPY a site to a WORK area that has direct links to categories or products in the HTML code, so that the domain changes according to the site location.

    Here's what I did to show the Product Info Page for an item:

    PHP Code:
    <?php echo '<a href="' zen_href_link(FILENAME_DEFAULT) . 'index.php/buttermilk-ranch-dressing-marinade-drews-p-441.html'' ">' 'Click here to check out Drews Buttermilk Ranch Dressing & Marinade' '</a>';?>
    Just embed this code into the Define Pages page you're working on, chaning the item link and description sections to your item.

    Make sure you enter this in TEXT mode.

    Note, our site uses SEO URL's.

  9. #9
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    Hello All,

    I have been trying very hard to get this to work and could use some help. I have created a price list that draws from the database and want to make it so that users have to log in to see it. I have taken the steps below to make this work. I have described the results at the end. Any help would be appreciated.

    1. I copied includes/templates/template_default/templates/tpl_page_default.php to includes/templates/*my template*/templates/

    2. I modified the code in tpl_page_default.php to the following:

    <div><?php echo $titlecheck=substr($var_pageDetails->fields[pages_title],0,5);
    if ($titlecheck=="Print"){
    eval(stripslashes('?>' . $var_pageDetails->fields['pages_html_text'])); }
    else{echo $var_pageDetails->fields['pages_html_text']; }?></div>

    3. I created a new Ez page called “Print” and a new page called “priceList_ezInclude.php”.

    4. I inserted the following code into the Print ez page via the html box.

    <php?

    include (" http://www.blackoliveeastnursery.net/zenCart_boe/priceManager/priceList_ezInclude.php");

    ?>
    <a href="http://www/zen-cart.com">Get Zenned</a>

    5. I actived the “Page is SSL” button in the Admin > Tools > ez pages page for the Print ez page.

    RESULT:

    When I click on the “Print” link in the sidebox, I am sent to the Login page. After I log in, I am taken to the Print page, but the included page does not appear. All that is there is the include code below:

    Print
    <php?
    include
    (" http://www.blackoliveeastnursery.net/zenCart_boe/priceManager/priceList_ezInclude.php"); ?>
    <a href="http://www/zen-cart.com">Get Zenned</a>

    I have verified that the link to the included file is working, so that is not the problem. Any help would be appreciated.

  10. #10
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: PHP inside ezpages

    I have also made the changed to the FCKeditor as suggested.

    Same results.

    thanks

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. PHP inside EZ-Pages
    By digiprint in forum General Questions
    Replies: 0
    Last Post: 17 Jun 2013, 09:10 AM
  2. PHP code inside of an EZ page
    By tcarden in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Dec 2012, 05:19 PM
  3. PHP inside EZpages
    By hookah in forum General Questions
    Replies: 3
    Last Post: 15 Nov 2008, 08:40 AM
  4. search inside php files
    By papadopoulos in forum General Questions
    Replies: 2
    Last Post: 20 Jun 2006, 02:31 AM

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