Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Ej:
$ziper = new zipfile();
$filename1 = 'images/imagen1.jpg';
$filename2 = 'images/imagen2.jpg';
$fileZip = 'images/imagen.zip';
$ziper->addFile(file_get_contents($filename1),$filename1);
$ziper->addFile(file_get_contents($filename2),$filename...
22
10688
posted 18 years ago by lmcdougall
A quick and simple way to search a MySQL database. Example: mysql_search('items', 'title tags', isset($_GET['q'])?$_GET['q']:'', Array('columns'=>'*', 'method'=>'OR', 'extra_sql'=>'AND active = "true" ORDER BY id DESC'));
5
1654
posted 18 years ago by lmcdougall
Script takes links that are not on your domain and opens them in a new window. This code allows for XHTML strict validation and meets Accessibility criteria on opening new windows.
5
2056
posted 18 years ago by skatan
Obviously there's no real crytpo here -- use this for cases like regenerating and emailing a user password.
1
1668
posted 18 years ago by ches
A way to call a function before the window is unloaded/refreshed/etc. Used in the first E-shot Management System. Useful for auto-saving data/content before the window is closed or refreshed.
1
1797
posted 18 years ago by andyhartleeds
Strip out non-alphanumeric characters. Very useful for use with filenames.
3
1741
posted 18 years ago by andyhartleeds