note 28914 added to function.fopen
| From: | php at spotlite dot de | Date: | Mon, 27 Jan 2003 22:48:21 +0000 |
| Subject: | note 28914 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42889@lists.php.net to get a copy of this message | ||
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']) ...".
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+28914
http://master.php.net/manage/user-notes.php?action=delete+28914
http://master.php.net/manage/user-notes.php?action=reject+28914