[suspicious - maybe spam] note 50206 added to function.ereg-replace

From: Date: Mon, 21 Feb 2005 23:08:33 +0000
Subject: [suspicious - maybe spam] note 50206 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-85337@lists.php.net to get a copy of this message
hi.. i am just learning php since a few days.. i had mount a website in my own pc and want let users to post messages.. anyway, i wrote a very tiny page that let you run some commands remotely, that is useful mostly as example of ereg_replace and shell_exec :D <!-----run.php----- <pre> <?php $salida=ereg_replace("<","&lt;",shell_exec($_POST["comando"])); echo "comando: ",$_POST["comando"],"<br>",$salida,"<br>"; ?> <form action="run.php" method="post"> comando: <input type="text" name="comando"> </form> </pre> -----eof-----> the ereg_replace is only for replace the "<" character at the output for his code, which html reads as a tag.. - first tou must write something in the form.. - when page is opened again it takes it, replaces "<" characters and puts in $salida variable (it may be useful later).. - then prints out and you can write something again :) .. i haven't change the ">" and other characters.. i don't know if you can process the same string changing its lenght in the process.. maybe it becomes illegible after changing patterns of diffrent length such $str=ereg_replace("a","aaaaa",$str), dont know yet. greetings ;) ---- Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50206 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50206&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50206&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50206&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50206&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50206&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50206&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85337) next »