Thursday, November 30, 2006

create a spam mailer (from any mail id to another one)

<?
$from="abc@gmail.com"; #ucan specify any mail id
$to="cde@gmail.com"; #ucan specify any mail id
$subj=" hi";
$msg=" ";
$val=0;
$headers = "From:".$from."\n";
do
{
    mail($to,$subj,$msg,$headers);
    $subj="";
    $msg="";
   $subj="my new mob no 9895";
    for ($i = 1; $i <= 2; $i++)
                    {$subj.= (rand(97,122));}
     for ($i = 1; $i <= 200; $i++)
                 {$msg.= chr(rand(97,122));}

        print $val ."no of msg send <p/>";
   
    $val++;
 }while($val<50);
?>

creating large no of file in a folder using php

# in this pgm i created only 100 files, u  can  change the no
<?
for($i=0;$i<100;$i++)
{
$name="";
$msg="";
    for($j=0;$j<4;$j++)
    {
     $name.=chr(rand(97,122));
    }
    for($j=0;$j<100;$j++)
    {
     $msg.=chr(rand(97,122));
    }
$filename=$folder.$name.".txt";
$fd=fopen($filename,"w+");
$fout=fwrite($fd,$msg);
fclose($fd);
}
?>