SMF Support > SMF 2.0.x Support

member emails

<< < (5/6) > >>

pkrack:
@Kindred thanks for comments. Actually i am very busy now days in writing code for a mobile search engine toplist due to which i wrote this code roughly. And thanks for fixing it. :-)

Ventic:
Internal Server Error now i got this damn

pkrack:
           You mean 500 internal error. Does your host support .txt files? Some server do not support that and can possibly cause an error.
           Some time php also cause error with looping but this code isnt repeating. I think i have to test it on my own server

Ventic:
it accept txt files yes

pkrack:

--- Code: ---<?php include("Settings.php");

$conn=@mysql_connect($db_server,$db_user,$db_pass);
if(!$conn)return false;
$db=@mysql_select_db($db_name);
if(!$db)return false;
return true;

$sql=mysql_Query("SELECT * from Smf_members");
$get=mysql_fetch_array($sql);
$email=$get[email_address];

echo ' adding emails to textfile';
//adding emails to textfile
$fn = "file.txt";
$file = fopen($fn, "a+");
$size = filesize($fn);
$space.= "\n";
fwrite($file, $get);
$text = fread($file, $size);
fwrite ($file, $space);
fclose($file);
?>

--- End code ---

now test it, i have uploaded it at hitcross.tk/a.php and is giving no error.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version