www.mutationevent.com

Archive pour la catégorie ‘php’

List of MIME types

Mardi 2 mars 2010

voici la liste des mime types disponible j'ai essayer de rassembler un maximum, mais vous pouvez trouver d'autre.

PHP donne la possibilitée de récupérer le mime type du fichier a l'aide de la fonction : mime_content_type

ex:

ez=> application/andrew-inset,
hqx=> application/mac-binhex40,
cpt=> application/mac-compactpro,
doc=> application/msword,
bin=> application/octet-stream,
dms=> application/octet-stream,
lha=> application/octet-stream,
lzh=> application/octet-stream,
exe=> application/octet-stream,
rar=> application/x-rar-compressed,
class=> application/octet-stream,
so=> application/octet-stream,
dll=> application/octet-stream,
oda=> application/oda,
pdf=> application/pdf,
ai=> application/postscript,
eps=> application/postscript,
ps=> application/postscript,
smi=> application/smil,
smil=> application/smil,
mif=> application/vnd.mif,
xls=> application/vnd.ms-excel,
ppt=> application/vnd.ms-powerpoint,
wbxml=> application/vnd.wap.wbxml,
wmlc=> application/vnd.wap.wmlc,
wmlsc=> application/vnd.wap.wmlscriptc,
bcpio=> application/x-bcpio,
vcd=> application/x-cdlink,
pgn=> application/x-chess-pgn,
cpio=> application/x-cpio,
csh=> application/x-csh,
dcr=> application/x-director,
dir=> application/x-director,
dxr=> application/x-director,
dvi=> application/x-dvi,
spl=> application/x-futuresplash,
gtar=> application/x-gtar,
hdf=> application/x-hdf,
js=> application/x-javascript,
skp=> application/x-koan,
skd=> application/x-koan,
skt=> application/x-koan,
skm=> application/x-koan,
latex=> application/x-latex,
nc=> application/x-netcdf,
cdf=> application/x-netcdf,
sh=> application/x-sh,
shar=> application/x-shar,
swf=> application/x-shockwave-!ash,
sit=> application/x-stuffit,
sv4cpio=> application/x-sv4cpio,
sv4crc=> application/x-sv4crc,
tar=> application/x-tar,
tcl=> application/x-tcl,
tex=> application/x-tex,
texinfo=> application/x-texinfo,
texi=> application/x-texinfo,
t=> application/x-troff,
tr=> application/x-troff,
roff=> application/x-troff,
man=> application/x-troff-man,
me=> application/x-troff-me,
ms=> application/x-troff-ms,
ustar=> application/x-ustar,
src=> application/x-wais-source,
xhtml=> application/xhtml+xml,
xht=> application/xhtml+xml,
zip=> application/zip,
au=> audio/basic,
snd=> audio/basic,
mid=> audio/midi,
midi=> audio/midi,
kar=> audio/midi,
mpga=> audio/mpeg,
mp2=> audio/mpeg,
mp3=> audio/mpeg,
aif=> audio/x-aiff,
aiff=> audio/x-aiff,
aifc=> audio/x-aiff,
m3u=> audio/x-mpegurl,
ram=> audio/x-pn-realaudio,
rm=> audio/x-pn-realaudio,
rpm=> audio/x-pn-realaudio-plugin,
ra=> audio/x-realaudio,
wav=> audio/x-wav,
pdb=> chemical/x-pdb,
xyz=> chemical/x-xyz,
bmp=> image/bmp,
gif=> image/gif,
ief=> image/ief,
jpeg=> image/jpeg,
jpg=> image/jpeg,
jpe=> image/jpeg,
png=> image/png,
tiff=> image/tiff,
tif=> image/tiff,
djvu=> image/vnd.djvu,
djv=> image/vnd.djvu,
wbmp=> image/vnd.wap.wbmp,
ras=> image/x-cmu-raster,
pnm=> image/x-portable-anymap,
pbm=> image/x-portable-bitmap,
pgm=> image/x-portable-graymap,
ppm=> image/x-portable-pixmap,
rgb=> image/x-rgb,
xbm=> image/x-xbitmap,
xpm=> image/x-xpixmap,
xwd=> image/x-xwindowdump,
igs=> model/iges,
iges=> model/iges,
msh=> model/mesh,
mesh=> model/mesh,
silo=> model/mesh,
wrl=> model/vrml,
vrml=> model/vrml,
css=> text/css,
html=> text/html,
htm=> text/html,
asc=> text/plain,
txt=> text/plain,
rtx=> text/richtext,
rtf=> text/rtf,
sgml=> text/sgml,
sgm=> text/sgml,
tsv=> text/tab-separated-values,
wml=> text/vnd.wap.wml,
wmls=> text/vnd.wap.wmlscript,
etx=> text/x-setext,
xsl=> text/xml,
xml=> text/xml,
mpeg=> video/mpeg,
mpg=> video/mpeg,
mpe=> video/mpeg,
qt=> video/quicktime,
mov=> video/quicktime,
mxu=> video/vnd.mpegurl,
avi=> video/x-msvideo,
movie=> video/x-sgi-movie,
ice=> x-conference/x-cooltalk

Technorati Tags: code, mime type, php

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

PHP libraries for JSON

Lundi 9 novembre 2009

Technorati Tags: javascript, json, library, object, php

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

PHP library for twitter

Vendredi 23 octobre 2009

Technorati Tags: library, php, twitter

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

AjaxCRUD

Vendredi 6 mars 2009

AjaxCRUD est une API PHP open-source qui permet de se connecter à une base de données mySQL et facilement effectuer les opérations CRUD (créer, lire, mettre à jour et supprimer ) (create, read, update, & delete rows).

ajaxcrud

Technorati Tags: Ajax, CRUD, php

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

Valider l’extension d’un fichier en PHP

Jeudi 3 avril 2008
  1. function validate_extension($file_name) {
  2.  
  3. $ext_array = array(".zip",".rar",".jpg",".jpeg",".gif",".bmp");
  4. $extension = strtolower(strrchr($file_name,"."));
  5. $ext_count = count($ext_array);
  6.  
  7. if (!$file_name) {
  8. return false;
  9. } else {
  10. if (!$ext_array) {
  11. return true;
  12. } else {
  13. foreach ($ext_array as $value) {
  14. $first_char = substr($value,0,1);
  15. if ($first_char <> ".") {
  16. $extensions[] = ".".strtolower($value);
  17. } else {
  18. $extensions[] = strtolower($value);
  19. }
  20. }
  21.  
  22. foreach ($extensions as $value) {
  23. if ($value == $extension) {
  24. $valid_extension = "TRUE";
  25. }
  26. }
  27.  
  28. if ($valid_extension) {
  29. return true;
  30. } else {
  31. return false;
  32. }
  33. }
  34. }
  35. }

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

PHP and JSON

Mercredi 19 décembre 2007

Dans ce tutoriel nous allons créer des données et les convertir au format JSON.

avant de commencer nous allons d'abord vérifier si la biblioth

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

Code Igniter un autre FrameWork php

Lundi 12 février 2007

Code Igniter est Framework php qui integre les possibilités qu'offrent les autres Frameworks(cakePHP, phpMVC, Symfony,...).

codeigniter_logo

Features

  • Model-View-Controller Based System
  • PHP 4 Compatible
  • Extremely Light Weight
  • Full Featured database classes with support for several platforms.
  • Active Record Database Support
  • Form and Data Validation
  • Security and XSS Filtering
  • Session Management
  • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
  • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
  • File Uploading Class
  • FTP Class
  • Localization
  • Pagination
  • Data Encryption

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

afficher les archives de votre blog

Vendredi 19 janvier 2007

Afficher les archives de votre blog sous cette forme

  • Janvier 2007 (10)
  • Décembre 2006 (35)
  • ...

Cela peut parfois sembler compliquer mais non, on peut le faire grâce à une seule requête

Supposons notre table "blog"

CREATE TABLE `blog` (
`id_blog` int(11) NOT NULL AUTO_INCREMENT,
`titre` varchar(150) NOT NULL DEFAULT '',
`texte` longtext NOT NULL,
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id_blog`)
) TYPE=MyISAM ;

Pour afficher les archives :

SELECT DISTINCT YEAR( date ) AS year, MONTH( date ) AS
month , Count( id_blog ) AS posts, MONTHNAME(date) AS monthname
FROM blog
WHERE date < now( )
AND date != '0000-00-00 00:00:00'
GROUP BY YEAR( date ) , MONTH( date )
ORDER BY date DESC

Les champs que nous aurons sont : year,month,post,monthname

Reste plus qu'a les placer dans l'ordre : monthname year (post) avec le code php.

ET voici le code php

$query = "SELECT DISTINCT YEAR( date ) AS year, MONTH( date ) AS
month , Count( id_blog) AS posts, MONTHNAME(date) as monthname
FROM blog
WHERE date < now( )
AND date != '0000-00-00 00:00:00'
GROUP BY YEAR( date ) , MONTH( date )
ORDER BY date DESC "
$result = mysql_query($query,$connect);
$row = mysql_fetch_assoc($result);
 
do {
echo '<li><a href="/site/archives/'.$row['year'].'/'.$row['month'].'/">'.$row['monthname'].' '.$row['year'].' ('.$row['posts'].')</a></li>';
}while($row = mysql_fetch_assoc($result));

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

créer son blog partie 3 et 4

Dimanche 17 décembre 2006

toujours dans la suite du tutotial créer son blog et avec un peu de retard.

voici la partie 3(créer un modele) et 4(définition des styles).

Get the Flash Player to see this content.

Get the Flash Player to see this content.

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

Créer un blog cinquième partie

Dimanche 26 mars 2006

Extraire les categories et les nouveaux articles à partir de la base de donnés et les integrés dans le modele.

Get the Flash Player to see this content.

Get the Flash Player to see this content.

  • Twitter
  • Facebook
  • Digg
  • Delicious
  • Google Reader
  • LinkedIn
  • Technorati Favorites
  • Netvibes Share
  • NewsVine
  • Share/Bookmark

  • Archives

  • Catégories