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.
function jarray(){
$sql = "SELECT * FROM table_name LIMIT 0, 100000000";
$jarray = "var your_array = new Array();\n\t\t";
$i = 0;
$q = mysql_query($sql);
while($object = mysql_fetch_object($q)){
$jarray = $jarray."your_array[{$i}] = \"{$object->field_name}\";\n\t\t";
$i++;
}print $jarray."\n";
}
Put your own info where the Text is bold
0 comments ↓
If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.
DCE's Hottest Posts
Learn to Swap your ALT and CTRL keys in Windows XP. Windows has something called Scancode keys built in (but not really); this will let you switch the positioning of your alt and ctrl key to act like an apple layout. The jump from Apple Command to CTRL is messing with my pinky so lets fix it. Read Full Article...
Read Full Article...
Read Full Article...
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment