DaniWeb IT Discussion Community

Code Snippets (http://www.daniweb.com/code/)
-   php (http://www.daniweb.com/code/php.html)
-   -   Interactive PHP Shell (one line of PHP) (http://www.daniweb.com/code/snippet847.html)

digital-ether php syntax
Apr 17th, 2008
Just copy and paste the snippet into a file and save.

You need to save this under the web root, not in a web accessible folder. For example, on linux you could save it in your home directory. Say your user is "joe" then save it in /home/joe/ . Ify saved the file as interactive.php then you would invoke it via the command line with: ./interactive.php

More information is at: http://onwebdevelopment.blogspot.com...ive-shell.html

  1. #!/usr/bin/php
  2. <?php while (1) { fputs(STDOUT, "\n\-PHP$ "); eval(trim(fgets(STDIN))); } ?>