Blogbonzo: Matteo Magni

Consulente Informatico, Web Developer & System Administrator

Importare ed esportare db MySQL

leave a comment

Per esportare un database Mysql:
mysqldump -u [user] -p [database] > [database .sql]

Per importare un database dal file creato precedentemente:
mysql -u [user] -p [database] < [database.sql]

Written by Bonzo

settembre 3rd, 2009 at 9:45 pm

Posted in Senza categoria

Tagged with

links for 2009-09-02

leave a comment

  • Blogbabel is a blog indexing/aggregation service which was launched in the summer of 2006. It's currently indexing almost 15.000 Italian blogs, has more than 220.000 visits and 350.000 pageviews a month (Google Analytics). I am selling it to concentrate on other projects, in the hope that the buyers will have the resources and enthusiasm to make it grow further.

    BlogBabel is currently indexing Italian blogs and has an Italian interface, but the software can be easily translated into different languages as we did with the Spanish version we had in 2006-2007, and later abandoned for the difficulties in managing a foreign service from here. I can also assist you in localizing the service to a specific language or implementing additional features if you win the auction, with a separate agreement based on standard consulting fees.

    (tags: ebay blogbabel)

Written by delicious

settembre 2nd, 2009 at 12:05 pm

Posted in Delicous

Bug di IE con le gif animate

leave a comment

Purtroppo su IE ogni volta che inviamo un form le gif animate vengono fermate.

Ecco uno scenario tipico per questo errore: una form per inviare una foto dove si vuole fare attendere l’utente che finisca l’upload dandogli la sensazione, tramite una gif animata, che la pagina web stia lavorando.

<form onSubmit="gif()" name="myform" action="#" method="post" enctype="multipart/form-data">
<p id="wait">
<img id="WaitImage" src="images/loadingAnimation.gif"/><br />
<strong>È in corso l'invio ...<br />
L'operazione potrebbe richiedere qualche minuto, attendi senza chiudere questa finestra.
</strong>
</p>
</form>

Visto che su IE la gif che era nascosta, quando invio la form smette di essere animata, bisogna trovare un modo per farla ripartire.

Tutto si può fare dando l’impressione ad IE di aver modificato l’immagine con Javascript un tempo successivo all’invio della form, tramite questa istruzione:

setTimeout('document.getElementById("WaitImage").src = "images/loadingAnimation.gif"', 200);


<script type="text/javascript">
function gif()
{
if (document.forms["myform"]["file"].value != "")
{
document.getElementById(\'bottone_carica\').style.display = \'none\';
document.getElementById(\'wait\').style.display = \'block\';
setTimeout(\'document.getElementById("WaitImage").src = "images/loadingAnimation.gif"\', 200);
}
}
</script>

Così la gif bloccata ripartirà a eseguire la sua animazione.

Written by Bonzo

settembre 1st, 2009 at 7:02 am

Posted in Javascript

Tagged with

Evitare Cache di una immagine con PHP

leave a comment

Se volete che una immagine venga ripescata dalla cache in PHP è molto semplice, basta accodare una stringa che varia ogni volta all’indirizzo dell’immagine.
Il Browser sarà così ingannato e penserà di dover recuperare una nuova immagine.
Per esempio si potrebbe usare la funzione time che ritorna il timestamp.


'<img src="immagine.jpg?t='.time().'"/>'

Written by Bonzo

agosto 31st, 2009 at 3:36 pm

Posted in php

links for 2009-08-31

leave a comment

Written by delicious

agosto 31st, 2009 at 12:03 pm

Posted in Delicous