.


:




:

































 

 

 

 


PHP

, . . . maillist.txt . , . . . , - . , . , , , . .

:

<form method="post" action="ras.php" enctype="multipart/form-data"> <input type="text" name="email" size="30"> <input type="submit" name="submit" value=""></form>

, , email 30 , . , ras.php .

ras.php , . - , . : - , - . , . - , . , :

<? $file = "maillist.txt"; // , error_reporting(0); // function test_mail($char) // , { $flag = false; if(eregi("^[_\.0-9a-z-]+@([0-9a-z][-0-9a-z\.]+)\.([a-z]{2,3}$)", $char)) $flag = true; if ($flag) return true; else return false; } $email = trim(strtolower($email)); // // // function copy_mail($char) // , { $file = "maillist.txt"; $list = file($file); for ($i = 0; $i < sizeof ($list); $i++) if ($char == trim($list[$i])) $flag = true; if ($flag) return true; else return false; } echo "<center>"; if (is_file($file)) // { $maillist = file($file); if (!$email == '') { if (test_mail($email)) { if (!copy_mail($email)) { $maillist[] = "\n$email"; print "E-mail: $email </center>"; } else print "E-mail: $email </center>"; } else print "E-mail: $email </center>"; } else print "</center>"; } else print " $file! <A HREF=\"mailto:$fromemail\"></a> .</center>"; // echo "<br><center> <form method=\"post\" action=\"ras.php\" enctype=\"multipart/form-data\">"; echo " mail:<input type=\"text\" name=\"email\" size=\"30\"><input type=\"submit\" name=\"submit\" value=\"\"></form></center>"; echo "<CENTER><br><br><form method=\"post\" action=\"ras.php\" enctype=\"multipart/form-data\">"; echo " <br> mail:"; echo "<input type=\"text\" name=\"delmail\" size=\"15\"><input type=\"submit\" name=\"submit\" value=\"\"></form></CENTER>"; // - $flag = false; $fw = fopen($file, "w"); for ($i = 0; $i < sizeof ($maillist); $i++) if (trim(strtolower($delmail)) == trim(strtolower($maillist[$i]))) { if (!$delmail == '') { print "<center>$delmail </center>"; $flag = true; } } else fputs($fw, $maillist[$i]); // fclose($fw); if (!$delmail == '') if (!$flag) print "<center>$delmail </center>";?>

. . ?. , , :

<form method="POST" action="out.php"> <input type="password" name="pass" value=""> <input type="submit" value=""> </form>

pass . , out.php:

<? $subject = " "; // $fromemail = "@"; // ( ) $file = "maillist.txt"; // $password = "secretpassword"; // if ($pass == $password) // // : // , , // // , send.php { echo "<font size=\"-1\"><hr><form method=\"POST\" action=\"send.php\">"; echo " <br><input type=\"text\" name=\"fromemail\" value=\"$fromemail\" size=\"25\"><br>"; echo " <br><input type=\"text\" name=\"subject\" value=\"$subject\" size=\"50\">"; echo "<br> :<br><textarea name=\"body\" rows=\"8\" cols=\"50\"></textarea>"; echo "<br><input type=\"submit\" value=\" \"></form></font>"; print "<i> <b>". sizeof($maillist)."</b> </i><br><hr>"; for ($i = 0; $i < sizeof ($maillist); $i++) print $maillist[$i]. "<br>"; } // - else echo "<form method=\"POST\" action=\"ras.php\"><input type=\"password\" name=\"pass\" value=\"\"><input type=\"submit\" value=\"\"></form>";?>

- , :

<? $odr = "\n\n\n \n"; $homepage = "http://./ras.php"; error_reporting(0); $subject = $HTTP_POST_VARS["subject"]; $body = $HTTP_POST_VARS["body"]; $subject = stripslashes($subject); $body = stripslashes($body); $file = "maillist.txt"; $maillist = file($file); print " ". sizeof($maillist)." <br>"; for ($i = 0; $i < sizeof ($maillist); $i++) { #echo($maillist[$i]."<br>"); mail($maillist[$i], $subject, $body."$odr $homepag?delmail=$maillist[$i]", "From: $fromemail"); } echo "!";?>

: , .

! . . . .

, . , mail , , .

, , , , , . , . , , . . -, , -, , 1 . , :)

.

 



<== | ==>
 | 1.
:


: 2015-09-20; !; : 276 |


:

:

: , , , , .
==> ...

1722 - | 1561 -


© 2015-2024 lektsii.org - -

: 0.01 .