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

[PHP] Im not good at coding, please help me if you can

Discussion in 'PHP & Perl' started by pubudusoft, Dec 9, 2013.

  1. pubudusoft

    pubudusoft Power Member

    Joined:
    Aug 21, 2011
    Messages:
    650
    Likes Received:
    133
    Hello,

    Im trying to use this script:
    http://www.blackhatworld.com/blackh...s-viral-script-plugin-wordpress-its-free.html

    So i added,
    Code:
    <?php include ('./wp-content/plugins/royserpa/cookie.php') ?>
    To my wordpress header. And it gives this error msg.
    Code:
    [B]Warning[/B]:  Cannot modify header information - headers already sent  by (output started at  /home3/[B]MyDomain[/B]/public_html/[B]MyDomain[/B].com/wp-content/themes/eStore/header.php:2)  
    in [B]/home3/MyDomain/public_html/[B]MyDomain[/B].com/wp-content/plugins/royserpa/cookie.php[/B] on line [B]19[/B]
    Where should i add that "include" thing? In that thread, writer asked to add it to the header...
     
  2. BLITZandKILL

    BLITZandKILL Newbie

    Joined:
    Jul 4, 2013
    Messages:
    13
    Likes Received:
    1
    It will need to be near the very top so that it is one of the first lines to be executed. Once information has been sent, you cannot add header info, it has to be sent first. But if the header information has already been sent by another page you will need to find the page that is posting the header info and put that include line in that page instead.
     
    • Thanks Thanks x 1
  3. ttrox

    ttrox Regular Member

    Joined:
    Jun 28, 2013
    Messages:
    217
    Likes Received:
    75
    That error happens when you already sent header information to the browser (be it, a redirect or something like that).

    What has probably happened, you included the cookie.php after sending header information (check out for something along the lines of Header('Location') or whatever you might have before that line). It depends on the structure of your header, but it should be one of the first lines, if not the first one itself.
     
    • Thanks Thanks x 1
  4. crazyflx

    crazyflx Elite Member

    Joined:
    Nov 9, 2009
    Messages:
    1,674
    Likes Received:
    4,825
    Location:
    http://CRAZYFLX.COM
    Home Page:
    Moved thread from black hat seo to PHP scripting section.
     
    • Thanks Thanks x 1
  5. neOtron

    neOtron Regular Member

    Joined:
    Nov 22, 2012
    Messages:
    352
    Likes Received:
    449
    Home Page:
    put thi on the top of index.php :
    ob_start();


    that should take the error away.,
     
    • Thanks Thanks x 1
  6. barigain

    barigain Junior Member

    Joined:
    Aug 23, 2012
    Messages:
    100
    Likes Received:
    12
    Please check if your php file is saved in UTF-8 mode.
    In this case there could be first 2 hidden bytes before "<?php" tag.
    Just remove these bytes in Hex editor.
    Hope it helps!
     
  7. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    708
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    That should fix it, but I always prefer arranging the codes perfectly to not make the error first of all. :)
     
  8. royserpa

    royserpa Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2011
    Messages:
    4,645
    Likes Received:
    3,492
    Gender:
    Male
    Occupation:
    Negative Options aka Rebills!
    Location:
    Royserpa
    Home Page:
    Hey op, pm me with your details if you havent reeolved thsi :)
     
  9. hardc0der

    hardc0der BANNED BANNED

    Joined:
    Dec 13, 2013
    Messages:
    130
    Likes Received:
    27
    I can help you with this, let me know if it's still an issue for you.
     
  10. odesk

    odesk Newbie

    Joined:
    Dec 17, 2013
    Messages:
    6
    Likes Received:
    0
    Location:
    Lahore Pakistan
    Home Page:
    friend here you just need to find sql detail from your wp_config.php file simple then use that info here