All pastes #954771 Raw Edit

Something

public text v1 · immutable
#954771 ·published 2008-03-24 02:46 UTC
rendered paste body
<XoiZ> eg.
<XoiZ>  $msg = $_POST["msg"];
<XoiZ> how would I add a \n to the end?
<poutine> you need ASP.net for that
<XoiZ> erm
<XoiZ> why would I need ASP to simply add to a string?
<poutine> PHP is a brand new technology
<poutine> you can't expect everything
<XoiZ> I see thousands of functions
<XoiZ> but
<XoiZ> theres not one which can simply add \n to a string ..?
<poutine> you're clearly the first person who has thought of this
<poutine> sorry, this has been forwarded to management
<XoiZ> o.<>
<XoiZ> by the way poutine
<XoiZ> I don't mean actually add \n to the post data
<XoiZ> if thats what you're thinking
<poutine> I think we should name this brand new concept
<XoiZ> couldn't I just: $msg \n
<XoiZ> ?
<XoiZ> like print "$msg \nNew line";
<poutine> 'concatenation'
<poutine> sound good?
<XoiZ> >>
<poutine> it has 'cat' in it
<XoiZ> poutine
<poutine> ?
<XoiZ> say I wanted to post data to the same page, then php will check it from there
<XoiZ> how would I;
<XoiZ> get it to return no errors and check if ones been submitted
<XoiZ> eg.
<XoiZ>  if ($usr && $msg) {
<XoiZ> I'd need to do that and set the variables to use if, right?
<XoiZ> but if I try to add the variables and it hasn't been submitted (I think), I'll get this;
<poutine> I'm not sure, this seems like banter for theoreticians, not regular chitchat for simple folk like us
<XoiZ> Parse error: syntax error, unexpected T_VARIABLE
<poutine> Wow, how is that impossible??11 This is a major bug of PHP
<poutine> alert the presses
<XoiZ> ...
<XoiZ>  $fmsg = "By ".$_POST["usr"] . "on" . date(DATE_RFC822) . "-" . $_POST["msg"] . "\n";
<XoiZ> whats wrong with that
<XoiZ> :x
<poutine> nothing, apparently some fool broke PHP before it was released
<poutine> it'll be fixed soon, just keep your code the same
<XoiZ> SHUT THE HELL UP
<poutine> XoiZ, please don't shoot the messenger
* MaoTseTongue (~looking@c-65-34-250-62.hsd1.fl.comcast.net) has joined #PHP
* akuCowoBiasa (~demonic@203.78.115.121) has joined #php
* akuCowoBiasa (~demonic@203.78.115.121) has left #php
<XoiZ> is anyone here who can actually help?
<XoiZ> I got the rest working
<XoiZ> but now
<XoiZ> when I try to fwrite, instead of writing to test.txt (which $filename is set to), it writes to testtxt
<poutine> should we send out an amber alert?