Holly cow - IT LIVES!  <div><br></div><div>I had no idea - I just thought I&#39;d keep the error reporting to see what went wrong. Didn&#39;t clock that it this in itself would generate headers, but it makes total sense. Thanks so much Mark &amp; Gordon for looking at this - beer&#39;s on me when we meet. <div>
<div><br></div><div>Cheers all for the air-time, - Merry Easter!</div><div>Ben R. </div><div><br></div><div><br></div><div><br><div class="gmail_quote">On 4 April 2010 00:45, Mark Bryars <span dir="ltr">&lt;<a href="mailto:electronclub@darkskiez.co.uk">electronclub@darkskiez.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You probably don&#39;t have errors suppressed, and the fopen to test if the<br>
camera is there is failing and printing an error, which generates<br>
output, which means you cant send any headers.<br>
<br>
prefix the fopen with an @ sign<br>
<div class="im"><br>
if (@fopen($img_remote, &quot;r&quot;)== true )<br>
<br>
<br>
</div>Regards,<br>
<font color="#888888"> Mark<br>
</font><div><div></div><div class="h5"><br>
Ben Rush wrote:<br>
&gt; Gordon,<br>
&gt;<br>
&gt; Thanks for taking a look at this - I got the sense that an something<br>
&gt; was firing off before it should. I&#39;ve yet to break away from family<br>
&gt; obligations this weekend, but I have managed to post the code to paste<br>
&gt; bin: <a href="http://pastebin.com/rrC86Zdj" target="_blank">http://pastebin.com/rrC86Zdj</a><br>
&gt;<br>
&gt; happy Easter everyone - cracking day out today, spent it fishing for<br>
&gt; sculpture bits out of the graving docs in Govan -- good times!<br>
&gt;<br>
&gt; Ben<br>
&gt;<br>
&gt;<br>
&gt; On 3 April 2010 20:43, Gordon JC Pearce &lt;<a href="mailto:gordonjcp@gjcp.net">gordonjcp@gjcp.net</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; On Sat, 2010-04-03 at 00:15 +0100, Ben Rush wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hello folks,<br>
&gt;&gt;&gt; Im going to preface this by stating I&#39;m a self described noob, so if<br>
&gt;&gt;&gt; this seems elementary - I stand by my assertion.<br>
&gt;&gt;&gt; I have come to a block and Im not sure how to deal with it, and any<br>
&gt;&gt;&gt; thought would be amazing.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Im working on a fetch image script for a webcam and everything seemed<br>
&gt;&gt;&gt; hunky-dorry.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I later decided to add an if/else on the off chance the camera wasn&#39;t<br>
&gt;&gt;&gt; available. This is where things got confusing.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If the camera fails I get a &quot;Warning: Cannot modify header<br>
&gt;&gt;&gt; information&quot;. The thing is I cant figure out were the header info is<br>
&gt;&gt;&gt; being declared, as the warning seem to indicate that the declaration<br>
&gt;&gt;&gt; comes from in the &#39;if&#39; statement itself. Wait didn&#39;t that just fail?!?<br>
&gt;&gt;&gt;<br>
&gt;&gt; Something is outputting stuff to the server before you get a chance to<br>
&gt;&gt; send the header() part.<br>
&gt;&gt;<br>
&gt;&gt; A quick demonstration - type &quot;telnet <a href="http://www.electronclub.org" target="_blank">www.electronclub.org</a> 80&quot;<br>
&gt;&gt; Once you get the &quot;Escape character is &#39;^]&#39;.&quot; message type<br>
&gt;&gt; &quot;GET / HTTP/1.0&quot; then &lt;RETURN&gt; &lt;RETURN&gt;<br>
&gt;&gt;<br>
&gt;&gt; You&#39;ll see the server&#39;s response - &quot;HTTP/1.1 200 OK&quot; and a bunch of<br>
&gt;&gt; things like &quot;Date:&quot; and &quot;Length:&quot; and importantly &quot;Content-Type:&quot;.<br>
&gt;&gt; These are the headers.  There&#39;s a blank line before the actual content<br>
&gt;&gt; *and this is very important*.<br>
&gt;&gt; Once you send that blank line, you cannot send any more headers.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; Moving the &#39;header(&#39;content-type: image/jpg&#39;);&#39; higher up in the<br>
&gt;&gt;&gt; script doesn&#39;t seem to fix it. Moving it before the if statement all<br>
&gt;&gt;&gt; together gives a broken image link - the echo of file contents don&#39;t<br>
&gt;&gt;&gt; seem to make to the browser.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I also checked to see if there was any empty space before or after my<br>
&gt;&gt;&gt; &lt;? ?&gt; - no empty echoes there either. .<br>
&gt;&gt;&gt;<br>
&gt;&gt; Can you put the script up in something like pastebin, with line numbers?<br>
&gt;&gt; That would make it a wee bit easier to trace.<br>
&gt;&gt;<br>
&gt;&gt; Gordon MM0YEQ<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; members mailing list<br>
&gt;&gt; <a href="mailto:members@electronclub.org">members@electronclub.org</a><br>
&gt;&gt; <a href="http://lists.electronclub.org/cgi-bin/mailman/listinfo/members" target="_blank">http://lists.electronclub.org/cgi-bin/mailman/listinfo/members</a><br>
&gt;&gt;<br>
&gt;&gt; Instructions for changing your mailing list settings:<br>
&gt;&gt; <a href="http://lists.electronclub.org/emailhowto.html" target="_blank">http://lists.electronclub.org/emailhowto.html</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; members mailing list<br>
&gt; <a href="mailto:members@electronclub.org">members@electronclub.org</a><br>
&gt; <a href="http://lists.electronclub.org/cgi-bin/mailman/listinfo/members" target="_blank">http://lists.electronclub.org/cgi-bin/mailman/listinfo/members</a><br>
&gt;<br>
&gt; Instructions for changing your mailing list settings:<br>
&gt; <a href="http://lists.electronclub.org/emailhowto.html" target="_blank">http://lists.electronclub.org/emailhowto.html</a><br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
members mailing list<br>
<a href="mailto:members@electronclub.org">members@electronclub.org</a><br>
<a href="http://lists.electronclub.org/cgi-bin/mailman/listinfo/members" target="_blank">http://lists.electronclub.org/cgi-bin/mailman/listinfo/members</a><br>
<br>
Instructions for changing your mailing list settings:<br>
<a href="http://lists.electronclub.org/emailhowto.html" target="_blank">http://lists.electronclub.org/emailhowto.html</a></div></div></blockquote></div>
</div></div></div>