1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

preg_replace error

Discussion in 'PHP' started by Weirfire, Jul 2, 2005.

  1. #1
    I'm getting the following errors;

    Warning: preg_replace(): Empty regular expression in /home/******/public_html/forum/includes/UpdateKeywordlist.php on line 7

    Warning: Cannot modify header information - headers already sent by (output started at /home/******/public_html/forum/includes/UpdateKeywordlist.php:7) in /home/******/public_html/forum/posting.php on line 593

    Warning: Cannot modify header information - headers already sent by (output started at /home/******/public_html/forum/includes/UpdateKeywordlist.php:7) in /home/******/public_html/forum/includes/page_header.php on line 528

    Warning: Cannot modify header information - headers already sent by (output started at /home/******/public_html/forum/includes/UpdateKeywordlist.php:7) in /home/******/public_html/forum/includes/page_header.php on line 530

    Warning: Cannot modify header information - headers already sent by (output started at /home/******/public_html/forum/includes/UpdateKeywordlist.php:7) in /home/******/public_html/forum/includes/page_header.php on line 531


    I'm using a stopword list as the pattern for preg_replace and I've no idea what the headers error is all about.
    SEMrush
    Does anyone have any ideas what these errors might mean?


    Cheers :)
     
    Weirfire, Jul 2, 2005 IP
    SEMrush
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The header errors are due to the preg replace error being output when you cms/code expected to be able to output headers. What exactly is the regular expression you're using (it looks like it's not valid).
     
    exam, Jul 2, 2005 IP
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    I'm using a stopword pattern on a string. Could there be a problem with the pattern?
     
    Weirfire, Jul 2, 2005 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, that's what I thought I said :) ... let's try agian .... What exactly is the regular expression you're using? (it looks like it's not valid) :D
     
    exam, Jul 2, 2005 IP
  5. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    64
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This means that the server has already sent some output (HTTP headers plus some of the page text) to the client and can no longer modify HTTP headers. For example, this code will result in this error:

    <?php
    echo("Some text");
    header("x-some-header: some-value");
    ?>
    PHP:
    J.D.
     
    J.D., Jul 2, 2005 IP
  6. envoy

    envoy Active Member

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Show us lines 5-10 of the file /home/******/public_html/forum/includes/UpdateKeywordlist.php

    Perhaps then we can help you out.
     
    envoy, Jul 3, 2005 IP
  7. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #7
    Thanks guys. :)
     
    Weirfire, Jul 4, 2005 IP