Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to: Extracting email addresses from your vanilla database.
This is, "for me", a simple way to extract email addresses. Great if you'd like to send out a newsletter to your members. This script is not intended to be placed anywhere within the vanilla installation folder/directory.
Im no PHP expert so there may me a more efficient way to access the database and display the results but this is a function I compiled to handle all of my query's.
I have this in my header file, which is not located anywhere within the vanilla installation:
Now this will output all of the email addresses into an array, you can easily work from there.
Hope this helps some people. Once I finish the newsletter script "that all of the above was intended for" I will update this "Discussion", shouldn't be longer than a day or two. -- If you need need help understanding my jibberish, or have a way I can improve the code above please share! =]
Im no PHP expert so there may me a more efficient way to access the database and display the results but this is a function I compiled to handle all of my query's.
I have this in my header file, which is not located anywhere within the vanilla installation:
<?php
# my function for handling query's
function funcSql($table,$type,$query){
mysql_pconnect(localhost,"USER","PASSWORD");
@mysql_select_db($table) or die("Unable to select database");
if($type=="SELECT"){
global $result;
global $num;
$result=mysql_query($query);
$num=mysql_num_rows($result);
}elseif($type=="INSERT" || $type=="UPDATE" || $type=="DELETE"){
$result=mysql_query($query);
}
}
# handy little function to print out the array.
function printr($array_string){
echo '<pre>';
print_r($array_string);
echo '</pre>';
}
?>
Now this will output all of the email addresses into an array, you can easily work from there.
<?php
funcSql("TABLE_NAME","SELECT","SELECT * FROM LUM_User"); //LUM_User should be the correct table to extract from.
for($i=0;$i<$num;$i++){
$emails[] = mysql_result($result,$i,"Email");
}
printr($emails);
?>
Hope this helps some people. Once I finish the newsletter script "that all of the above was intended for" I will update this "Discussion", shouldn't be longer than a day or two. -- If you need need help understanding my jibberish, or have a way I can improve the code above please share! =]
0
This discussion has been closed.
Comments
How-ever the example I made was not intended to be used within the vanilla environment, you can use it anywhere on your localhost not inside the vanilla install path.