Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Konsola serwera - php. Dla zielonego
poplop
post
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 14.06.2010

Ostrzeżenie: (0%)
-----


Witam,
zacząłem dopiero zabawę w pisaniu skryptów php.
Napisałem prostą konsolę serwera w PHP ale niestety coś skopałem.
Może ktoś poprawić mój kod lub naprowadzić jak to prawidłowo napisać?
  1. <?php
  2.  
  3.  
  4.  
  5. $polecenie=shell_exec(&#8222;cd ~\n”.$tresc);
  6.  
  7. echo $polecenie;
  8.  
  9.  
  10.  
  11. ?>
  12.  
  13.  
  14.  
  15. <html><title>DED-Panel - Konsola</title>
  16.  
  17.  
  18.  
  19. <form action="konsola.php">
  20.  
  21. <input name="$tresc" />
  22.  
  23. </form>
  24.  
  25. </html>


Pozdrawiam,
Poplop
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
CuteOne
post
Post #2





Grupa: Zarejestrowani
Postów: 2 958
Pomógł: 574
Dołączył: 23.09.2008
Skąd: wiesz, że tu jestem?

Ostrzeżenie: (0%)
-----


  1. <?php
  2.  
  3. if(!empty($_POST['tresc'])) {
  4.  
  5. $polecenie=shell_exec("cd ~\n".$_POST['tresc']);
  6.  
  7. echo $polecenie;
  8. }
  9. ?>
  10.  
  11.  
  12.  
  13. <html>
  14. <head>
  15. <title>DED-Panel - Konsola</title>
  16. </head>
  17. <body>
  18. <form action="konsola.php" method="post">
  19.  
  20. <input type="text" name="tresc" />
  21. <input type="submit" name="submit" value="Wyślij" />
  22. </form>
  23. </body>
  24. </html>


Ten post edytował CuteOne 18.08.2011, 17:57:52
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 23:04