Wrote this function to check email addresses already in a database, so I dont have to change pages, and check with javascript. Problem: it exposes your whole email list to the public in the source code, and the source code can become a monster length. So it isnt practical, but it works. (I’m not using it to check emails)
The script proves useful to do other things with javascript and spawn arrays to manipulate data… etc.
$sql = "SELECT * FROM <strong>table_name</strong> LIMIT 0, 100000000";
$jarray = "var <strong>your_array</strong> = new Array();\n\t\t";
$i = 0;
$q = mysql_query($sql);
while($object = mysql_fetch_object($q)){
$jarray = $jarray."<strong>your_array</strong>[{$i}] = \"{$object-><strong>field_name</strong>}\";\n\t\t";
$i++;
}
print $jarray."\n";
}
Put your own info where the Text is bold
1 comment so far ↓
If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.
DCE's Most Talked About Posts
Read Full Article...
Read Full Article...
Read Full Article...
are you sure wtihout echo “javascript” inside?
Leave a Comment