Author Topic: rem.php -"Header may not contain more than a single hea  (Read 11034 times)

ivhe

  • Posts: 3
    • View Profile
rem.php -"Header may not contain more than a single hea
« on: January 05, 2007, 08:40:26 am »
I'm having problems with rem.php.

I have used the global code !remove in emails for the unsubscribe link and when its clicked the page that opens is in the form: http://www.mysite.com/List/rem.php?u=XXXX

However I'm getting the following php warning:

"Header may not contain more than a single header, new line detected. in /<= XXXXX (path to rem.php file) = >/rem.php on line 180"

The version of php on the server is 4.4.4 and I note that from the header function page on php.net http://uk2.php.net/manual/en/function.header.php that since 4.4.2 you cant send more than one header.

I have set up the custom HTML pages to point to URL's for all the subscribe and unsubscribe pages - could this be causing a problem?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
rem.php -"Header may not contain more than a single hea
« Reply #1 on: January 05, 2007, 10:22:10 am »
I would say there is some unexpected configuration issue, perhaps what you mention, or there could be a problem with the way rem.php was uploaded.  In case it's the former, please submit your info so I can perform a full bug investigation.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
rem.php -"Header may not contain more than a single hea
« Reply #2 on: January 08, 2007, 01:51:33 am »
Greetings,
Quote
> I've tracked down the reason for the php warning I was getting: "Header
> may not contain more than a single header, new line detected. in
> /XXXXX/rem.php on line 180". It seems that because the form appended to
> the URL query string for the header redirect on  line 180 contained
> line breaks, php version 4.4.4 was reading each new line as the start
> of a separate header. I echoed and copied your header location then
> hardcoded it , deleting the line breaks so the url and query string
> were all one line and then the redirect worked. Obviously I was working
> on a copy of rem.php and I imagine that there will be other situations
> and possibly other files which append the form in the same manner.  I
> obviously dont want to touch your code and would be grateful if you
> could let me know when you update ListPro.
>
> I also thought that I'd mention that it might be helpful to state in
> the admin pages that if a redirect is used as a custom html page that
> the url is absolute and not relative as it wasnt clear to me (probably
> should have been) and as I understand it header redirects in HTTP 1.1
> will only  work with absolute urls.
>
> Anyway thanks - I appreciate the irritation that can occur when
> behaviour changes in a new php version and suddenly previously working
> scripts develop bugs.

If you don't mind I would like to be sure about the cause and solution of this.  I don't see line breaks in the header() call in rem.php around line 180, and you should not be able to add a line break in the single line text box on the Custom HTML page - was the problem simply caused by not using an absolute URL?

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

ivhe

  • Posts: 3
    • View Profile
rem.php -"Header may not contain more than a single hea
« Reply #3 on: January 13, 2007, 02:57:09 am »
I am using absolute URLs. The line breaks are in the output generated by
Code: [Select]
header('Location: '.str_replace('URL:','',$data));
on line 180 which is:
Code: [Select]
Location: http://www.mysite.com/path/remove-confirm.php?button=<form name=rconf method=post>
<input type=hidden name=list value=>
<input type=hidden name=dodel value=1>
<input type=hidden name=u value=XXXXXX>
<input type=hidden name=r value=>
<input type=hidden name=c value=>
<input class=confirm_button type=submit value="Remove Me">
</form>


Each newline for the form inputs breaks the header redirect. The header redirect will work if it outputs as:
Code: [Select]
Location: http://www.mysite.com/path/remove-confirm.php?button=<form name=rconf method=post><input type=hidden name=list value=><input type=hidden name=dodel value=1><input type=hidden name=u value=XXXXXX><input type=hidden name=r value=><input type=hidden name=c value=><input class=confirm_button type=submit value="Remove Me"></form>

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
rem.php -"Header may not contain more than a single hea
« Reply #4 on: January 13, 2007, 07:13:38 pm »
This is definitely not expected behaviour and may be a ListMail bug.  When you save a forwarding URL in the Custom HTML section the actual HTML section should be blank - in fact, it should be overwritten/cleared automatically when you save the entered link.

The resulting database data for the HTML page should simply be:

URL: http://example.com

I would like to take a look at this if possible.  Please let me know if you would be interested in submitting your info for a bug investigation.  If possible, please include specific details about existing pages having the or problem or how it can be recreated.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

ivhe

  • Posts: 3
    • View Profile
rem.php -"Header may not contain more than a single hea
« Reply #5 on: January 15, 2007, 02:39:06 am »
Quote
This is definitely not expected behaviour and may be a ListMail bug. When you save a forwarding URL in the Custom HTML section the actual HTML section should be blank - in fact, it should be overwritten/cleared automatically when you save the entered link.
This is all happening as it should - there is No problem here.



Quote
The resulting database data for the HTML page should simply be:

URL: http://example.com

Have a problem here. What is the point of having a URL to redirect to for Custom HTML if I cant append variables to the URL? How would the redirected page know what messages to display? How would I go about displaying the appropriate messages for the 'Signup Error', 'Unsub Confirm', 'Unsub Success' and 'Unsub Error'? if I didnt append variables to the URL?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
rem.php -"Header may not contain more than a single hea
« Reply #6 on: January 16, 2007, 01:37:54 am »
Passing variables to a forwarded page is unfortunately not yet possible.  If you would like to suggest this as a feature please start a new post in the Suggestions category or I can simply move this post to that forum.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting