1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need to know how to edit a php header

Discussion in 'BlackHat Lounge' started by naturalbornthriller, Aug 16, 2013.

  1. naturalbornthriller

    naturalbornthriller BANNED BANNED

    Joined:
    Apr 22, 2011
    Messages:
    249
    Likes Received:
    91
    The following are the instructions I'm following to accomplish the results I need in setting up 2 sites, and it was posted by "stylus" from the websitewarriors forum.

    I have 2 websites hosted by Host Gator. One is a content locked page with CPA offers, and the other is the site my traffic needs to come from in the eyes of my CPA network since they don't allow incentive based traffic like content locking. Both sites are using the Wordpress plug-in.

    Here is what "stylus" says to do, and below his quoted text are my questions.

    1. "Now, you MUST edit the header file (header.php) of your blog's theme (in the theme folder /public_html/wp-content/themes) and add the following line of code to the first line of header.php:
    PHP:
    Code:
    <?php if (prc_red()) exit(); ?>"


    Q: Which header file do I have to edit? When I go to /public_html/wp-content/themes in my Host Gator cPanel, I have the following items, but I don't see the header.php file you are referring to:
    FOLDER- airlock
    FOLDER- twentyeleven
    FOLDER- twentytwelve
    FILE- index.php


    2. "Now, set the blog permalinks to something like: /%postname%/ (don't forget to add the .htaccess code). Finally, let's learn how to use it the user interface is below."

    Q: Do I need to change the permalink settings for each post individually?
    Q: Which option do I choose when changing the permalink settings(default, day and time, month and name, numeric, post name, custom structure)? Is it the custom structure setting?
    Q: If I do need to choose the custom structure setting, do I just add /%postname%/ after it and save it?


    3. What do you mean add the .htaccess code, and how do I do that?

    Thank you in advance for any help you can give me.
     
    Last edited: Aug 16, 2013
  2. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    789
    Likes Received:
    3,129
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    1. the "header.php" files are in:

    yourdomain.com/airlock/

    yourdomain.com/twentytwelve/

    yourdomain.com/twentytwelve/

    ---

    2. all permalinks are set from within the "wordpress admin" panel. the option that you choose is "/%postname%/" to make this work.

    ---

    3. you simply create a text file called ".htaccess" and (i assume) place it in your blog's main folder. no idea what you're supposed to put on it.

    all of these questions are at the neophyte level and if you don't know the answers already then you're going to have problems running wordpress.
     
  3. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:
    Just a heads up, If wordpress is already installed then .htaccess file already exists and he can download/edit/upload it but creating another file and uploading it will overwrite the existing one and WP won't work properly.
     
    • Thanks Thanks x 1
  4. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    789
    Likes Received:
    3,129
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    right! simply add that code to your existing .htaccess file and in two weeks,
    you will be a multi-millionaire!

    just like the guy who sold you that script!

    :D :D :D
     
  5. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:
    That was so "Pimpy" :D
     
  6. naturalbornthriller

    naturalbornthriller BANNED BANNED

    Joined:
    Apr 22, 2011
    Messages:
    249
    Likes Received:
    91
    Obviously I don't know much about coding, but I appreciate the help guys, and even the jokes.

    So, do I need to change all 3 header.php files from within the folders then to make this work? As far as the /%postname%/, I understand that I just go into my WP admin panel and check the "post name" option and save. If I already have a .htaccess file, then how do I add it and what do I add it to? If not, how do I create one and what do I put in it? Any help is appreciated. If you guys need more specific info about what I'm doing to be able to help me further, please let me know. Thanks.
     
  7. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    789
    Likes Received:
    3,129
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    1. you only need to change the header of the theme that you're using.

    2. you can edit the existing ".htaccess" file via c-panel.

    3. it would help to know the name of the wp plugin you are installing.
     
  8. naturalbornthriller

    naturalbornthriller BANNED BANNED

    Joined:
    Apr 22, 2011
    Messages:
    249
    Likes Received:
    91
    1. Do I change the header.php file from the cPanel? And if so, which folder of the 3 I have to choose from?

    2. So I can edit the .htaccess file via the cPanel in Host Gator? Any clue what the OP of these instructions meant by "Don't forget to add the .htaccess code" when he was instructing to change the blogs permalinks to /%postname%/?

    3. The WP plug-in I'm using is "CPA Redirector." I think it is a custom plug-in created by the OP, unless I'm mistaken.

    Basically, I'm trying to fake a browser referrer, which I am clueless about other than following the OP's incomplete instructions. Thanks for any help The Scarlet Pimp!
     
  9. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    789
    Likes Received:
    3,129
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    1. edit the "header.php" file from c-panel. you will have to change the header.php file on any/every theme that you use.

    2. the .htacces file can be edited from c-panel.

    3. did he give you instructions that contain some code to be added to htaccess?
    if so, add that code to the htaccess file.
     
  10. naturalbornthriller

    naturalbornthriller BANNED BANNED

    Joined:
    Apr 22, 2011
    Messages:
    249
    Likes Received:
    91
    1. I understand that I will need to change the "header.php" file in all themes I'm using from the cPanel.

    2. I cannot find a .htaccess file in cPanel anywhere. Based on the instructions, he makes it sound like the .htaccess is edited from the WP dashboard when he said:
    "Now, set the blog permalinks to something like: /%postname%/(don't forget to add the .htaccess code). Finally, let's learn how to use
    it - the user interface is below."

    3. He gave no code to be added to the ".htaccess."
     
  11. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    789
    Likes Received:
    3,129
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    2. go to c-panel and click "file manager" or "legacy file manager". navigate to your blog folder and the .htaccess file is the first file shown.

    3. if he gave no code to be added then you will have to ask him what he meant.

    note: since you have nothing to add, there's not much point in editing the file.