Where to paste php code in WordPress...

by gixxer
4 replies
Hey Everyone!

I did a few searches before posting and couldn't find an answer to my question. If this is a repeat, I apologize.

I'm running WordPress hosted on Hostgator. I have DLGuard installed successfully on the server.

When I get the code that I'm supposed to past into the page to create the sign-up form, I don't know WHERE to post it. The Hostgator tech explained to me about how WP uses "virtual" pages that aren't real .php pages.

I've tried pasting the code in HTML view, between the [code] tags and have played a bit with a "run php" WP plugin but got confused. I also used File Manager in CPanel to try and find the "physical" page to try and edit the code, but wasn't able to.

I have SOME technical understanding, but I'm stuck and in a little over my head!

Thanks a lot!

Adam
#code #paste #php #wordpress
  • Profile picture of the author Tim Franklin
    I will try to answer your question, I want to see if I have it right,
    1. you are using Dlguard, on hostgator,
    2. you want to protect a page using dlguard
    3. you want to protect a wordpress (page) or (post) using DL guard.
    If this is correct you will need to (create) a page on your wordpress website, then use a template, near the top, but after the wordpress template, (required PHP code) you would paste you dlguard PHP,

    I can look up the required, code, and post it back if you like but you will need to use html, and PHP together, if that makes sense, or perhaps here is a better way to say that,

    Use PHP to notify wordpress, (that you are using a special template)
    or custom template, then you use the PHP to do membership check using DLguard, then you use html and or PHP to pull in a webpage design to brand your custom page,

    let me know if that works for you, Tim

    Originally Posted by gixxer View Post

    Hey Everyone!

    I did a few searches before posting and couldn't find an answer to my question. If this is a repeat, I apologize.

    I'm running WordPress hosted on Hostgator. I have DLGuard installed successfully on the server.

    When I get the code that I'm supposed to past into the page to create the sign-up form, I don't know WHERE to post it. The Hostgator tech explained to me about how WP uses "virtual" pages that aren't real .php pages.

    I've tried pasting the code in HTML view, between the [code] tags and have played a bit with a "run php" WP plugin but got confused. I also used File Manager in CPanel to try and find the "physical" page to try and edit the code, but wasn't able to.

    I have SOME technical understanding, but I'm stuck and in a little over my head!

    Thanks a lot!

    Adam
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[3045750].message }}
  • Profile picture of the author somacorellc
    [DELETED]
    {{ DiscussionBoard.errors[3045755].message }}
    • Profile picture of the author gixxer
      @Tim - Hey, Tim, yes you have what I want to do (1-3) correct. I kinda sorta understand the rest of what you said, but it's a little past me The thing is, I can't imagine DLGuard requires any hand coding to integrate with WP. There HAS to be something missing here.

      Can you expand on this part? "then use a template, near the top, but after the wordpress template"

      @somacorellc - Yeah, you'd THINK that's what you would do. It DOESN'T WORK though!

      Thanks again, guys!

      Adam
      {{ DiscussionBoard.errors[3045858].message }}
      • Profile picture of the author Tim Franklin
        Ok, I think I can help you, just a sec while I find the code I am looking for and I will PM, you if you like or if you have skype, we can try that out, I have used DLG for years, but never in wordpress, I would like to see how it works out, and yes, sadly there is no plugin yet, but you never know, I might be interested in making one

        Originally Posted by gixxer View Post

        @Tim - Hey, Tim, yes you have what I want to do (1-3) correct. I kinda sorta understand the rest of what you said, but it's a little past me The thing is, I can't imagine DLGuard requires any hand coding to integrate with WP. There HAS to be something missing here.

        Can you expand on this part? "then use a template, near the top, but after the wordpress template"

        @somacorellc - Yeah, you'd THINK that's what you would do. It DOESN'T WORK though!

        Thanks again, guys!

        Adam
        Signature
        Bitcoin | Crypto | Blockchain Secrets |
        {{ DiscussionBoard.errors[3045954].message }}
  • Profile picture of the author somacorellc
    [DELETED]
    {{ DiscussionBoard.errors[3045868].message }}
    • Profile picture of the author gixxer
      Originally Posted by somacorellc View Post

      Can you paste the code here so we have a better idea of what we're dealing with?
      These are the instructions:

      To offer a free product in DLGuard, firstly you need to create a page on your website where your customers will signup to get your free product. This page must be on the same website as DLGuard is installed, and it needs to be named with a PHP file extension.



      Once you've done that, enter the URL to this page below, and DLGuard will generate a piece of PHP code.


      You then paste this piece of PHP code into your signup page into the spot where you want the signup box to be displayed. You must paste this in the source code view of your page (the one where you can see all the HTML code).

      And this is the code:

      <?php
      $pathToCBDM = "../dlg/";
      $cbdmProduct = 1;
      include ($pathToCBDM."cbdm.php");
      ?>

      (BTW, If I posted something secure up there please let me know so I can scub it :confused

      I have a post on the DLGuard Board as well. No response yet!

      Adam
      {{ DiscussionBoard.errors[3045888].message }}

Trending Topics