Posted by Syl on 11/17/47 11:49
Nikola Skoric wrote:
> I have this very simple PHP script:
>
> #!/usr/local/bin/php -q
>
> <?php
> $post="From: \"Burek\" <burek@burek.hr>\\nSubject: foobar\\nNewsgroups:
> hr.test\\n\\nNesto, nesto.';
>
> $command="echo -ne \"mode reader\\npost\\n" . $post . "\\n.\\nquit\\n\"
> | nc news.carnet.hr 119\n";
> echo $command;
> exec($command);
> ?>
>
> And it fails to execute:
> PHP Parse error: parse error in /home/users/n/nick/bin/postFAQ.php on
> line 6
>
> I have dissected the script and found that when I write it this way:
> $command=
> "echo"
> . " -ne \"mode reader\\npost\\n" . $post . "\\n.\\nquit\\n\" | nc
> news.carnet.hr 119\n";
> Then the error is on the line where "echo" is. Now, what am I missing?
try this :
$command="echo -ne 'mode reader\\npost\\n' . $post . '\\n\\nquit\\n\'
| nc news.carnet.hr 119\n";
also - why do you the dot operator here :
"\\n.\\nquit\\n\"
Navigation:
[Reply to this message]
|