
20-02-2008, 15:30
|
|
|
|
חבר מתאריך: 30.10.02
הודעות: 120
|
|
|
עזרה ב PHP.. מה צריך לעשות?
אוקי אז ככה,
אני מנסה לעשות משהו פשוט
לקבל מ TEXTAREA רשימת מיילים אחד אחרי השני (כל אחד בשורה נפרדת)
ואני רוצה להציג רק את הדומינים בTEXTAREA
ניסיתי לעשות ככה:
קוד PHP:
<?php if ($_POST['submit2']){ $file=$_POST['textarea'];
if ($file=="") { echo"<span class='error'>שגיאה</span>"; $skip=true;} else { $NewFile = str_replace("\r", "¦", $file); $lines=0; $number_lines=0; $lines = explode("¦", $NewFile); $number_lines = count($lines); $number_lines1 = $number_lines-1; echo "$number_lines1"; if($number_lines1>3) { $d = rtrim($NewFile, "¦");
$splitcontents = explode("¦", $d); } else {
$Data = rtrim($NewFile, "/n"); $splitcontents = explode("/n", $Data); }
function a1($mail) { $domain = explode ( '@', $mail) ;
$File = "./logs/1.txt"; $fh = fopen($File, 'a'); $FileSize = filesize($File);
fputs($fh, $domain[1]."\r\n"); fclose($fh);
} foreach ( $splitcontents as $split ) { $mail = $split; a1($mail);
}
} $File = "./logs/1.txt"; $fw = fopen($File, 'r+'); $FileSize = filesize($File); if ($FileSize>"0") { $Data4 = fread($fw,filesize($File)); } fclose($fw);
}
?>
לא יודע.. משהו פה לא מסתדר לי
בבקשה עזרה!
תודה מראש
|