note 28914 deleted from function.fopen by alindeman
| From: | alindeman@php.net | Date: | Sat, 17 May 2003 21:07:55 +0000 |
| Subject: | note 28914 deleted from function.fopen by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48267@lists.php.net to get a copy of this message | ||
Note Submitter: php@spotlite.de
Why use fopen() on small tasks? You can always use specific commands from your Operating System.
Look at my Guestbook (smallest on earth? tell me!) It's not clean HTML, it's ugly PHP and
you should not use it in a productive environment. But for demonstration, it's great.
<code>
<form action=g.php><input name=t><?$_GET[t]?
echo
'$_GET[t]<hr>'>>g:'';include(g)?>
</code>
Look how "echo" is called. Just use backquotes on *nix to execute a command. Be sure that
the command is in your $PATH.
P.S.
I tried to make this smaller with the syntax:
.....<?$t=$_GET[t]?echo '$t<hr>'>>g:'';.....
But with the "?" - Syntax instead of "if" php seems not to get the
"$t=$_GET[t]" - part. $t is not assigned like it would be with "if
($t=$_GET['t']) ...".