Archivio per July, 2007

In questo tutorial vedremo come leggere i dati da una tabella "tabella_access" di un database access "formazione.mdb". 

<?php
//Connect Database
$dbfile='formazione.mdb';
$conn = new COM("ADODB.Connection") or die("Non riesco a connettermi");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".$dbfile.";");
$requete = "SELECT * FROM tabella_access";
$resultat = $conn->execute($requete);
$i=1;
while (!$resultat->EOF)                 // cicla fino alla fine
{
$col2 = $resultat->Fields['cognome']->Value;        // colonne 2
$col2=str_replace("'","",$col2);
$col3 = $resultat->Fields['nome']->Value;       // colonne 3
$col3=str_replace("'","",$col3);
$col4 = $resultat->Fields['indirizzo']->Value;         // colonne 4
$col4=str_replace("'","",$col4);
$periodo="";
echo "# riga".$i." $col2 $col3 $col4<br>";
$resultat->MoveNext();                 // prossimo record
$i++;
}
$resultat->Close();                        // chiude i risultati
$conn->Close();                           // chiude la connessione
?>

24
07

85 scripts ajax professionali

posted di Administrator, in ajax, links. No Commenti

1. AJAX AutoSuggest: An AJAX auto-complete text field
2. AJAX Autocompleter / script.aculo.us library
3. AJAX AutoCompleter
4. Ajax autosuggest/autocomplete from database
5. Ajax dynamic list

AJAX Instant Edit

6. AJAX inline text edit 2.0

7. AJAX & CSS Flickr-like Editing Fields

8. AJAX Instant Edit

AJAX Menus, Tabs

9. 14 Tab-Based Interface Techniques
10. AJAX Menu Widget
11. AJAX Accordion Navigation: mootools demos
12. AJAX Dialogs, Menus, Grids, Trees and Views
13. AJAX Tab Module - Closeable Implementation
14. Ajax Tabs Content
15. AJAX Tabbed Content
16. MooTabs - Tiny tab class for MooTools
17. Dynamically loaded articles

AJAX Date, Time, Calendars

18. AJAX Datetime Toolbocks - Intuitive Date Input Selection
19. AJAX Calendars

AJAX Interactive Elements

20. AJAX Floating Windows
21. AJAX Star Rating Bar
22. Ajax poller

AJAX Developer’s Suite

23. AJAX HistoryManager, Pagination
24. AJAX Login System Demo
25. AJAX image preloader
26. AJAX Tooltips: Nice Titles revised | Blog | 1976design.com
27. 40+ Tooltips Scripts With AJAX, JavaScript & CSS | Smashing Magazine
28. AJAX Web Controls
29. AJAX syntaxhighlighter
30. GMail Ajax Style Username Signup
31. Gmail Ajax Style Check Username
32. Transparent Message
33. ModalBox — An easy way to create popups and wizards
34. AJAX File Uploads progress bar
35. Chained select boxes
36. Fly to basket
37. AJAX Key Events Signal
38. Disable form submit on enter keypress

Enhanced AJAX Solutions

39. AJAX Instant Completion: Rico Framework
40. Novemberborn: Event Cache
41. Altering CSS Class Attributes with JavaScript
42. Select Some Checkboxes JavaScript Function
43. AJAX Emprise Charts: 100% Pure JavaScript Charts
44. amCharts: customizable flash Pie & Donut chart
45. PJ Hyett : The Lightbox Effect without Lightbox

Ajax Forms

46. AJAX Upload Form
47. An AJAX contact form
48. AJAX contact form
49. Ajax.Form: mootools demo
50. Ajax form validation
51. Really easy field validation
52. AJAX fValidate: a high quality javascript form validation tool
53. Ajax newsletter form
54. wForms: A Javascript Extension to - Web Forms The Form Assembly

AJAX Grids, Tables

55. Data Grids with AJAX, DHTML and JavaScript | Smashing Magazine
56. Grid3 Example
57. AJAX Table Sort Script (revisited)
58. AJAX Sortable Tables: from Scratch with MochiKit
59. AJAX TableKit

AJAX Lightboxes, Galleries, Showcases

60. 30 Scripts For Galleries, Slideshows and Lightboxes | Smashing Magazine
61. AJAX LightBox, Sexy Box, Thick Box
62. AJAX Lightbox JS
63. AJAX Unobtrusive Popup - GreyBox
64. SmoothGallery: Mootools Mojo for Images | Full gallery
65. AJAX Libraries and Frameworks

Visual Effects, Animation

66. How to Create Digg Comment Style Sliding DIVs with Javascript and CSS
67. How to Create a Collapsible DIV with Javascript and CSS
68. How to Create an Animated, Sliding, Collapsible DIV with Javascript and CSS
69. AJAX Shopcart
70. Draggable content
71. Dragable RSS boxes
72. AJAX Pull Down Effect: Rico Framework
73. AJAX Animation Effects: Rico Framework
74. Combination Effects in scriptaculous wiki
75. AJAX Motion Transition: Fx.Morph

Useful Basic JavaScripts

76. 9 Javascript(s) you better not miss !!
77. Top 10 custom JavaScript functions of all time
78. Hyperdisc Materials: JavaScript: Top 10: Automatic Breadcrumb Trail
79. JavaScript: Top 10 Most Useful JavaScripts
80. My Favorite Javascripts for Designers: Blakems.com ?

Galleries, Resources

81. MiniAjax.com: a showroom of nice looking simple downloadable DHTML and AJAX scripts.
82. Ajax Rain: growing showcase of AJAX-examples.
83. Max Kiesler - mHub : Ajax and rails examples & how-to’s
84. Ajax Resources
85. DZone Snippets: Store, sort and share source code, with tag goodness

Fonte: http://php-ajax-code.blogspot.com/2007/07/80-ajax-solutions-for-professional.html

23
07

PHP Mysql tips

posted di Administrator, in mysql, tutorials. No Commenti

Word searching

1.

SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('Keyword')

(Fastest)

2.

SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('+Keyword' IN BOOLEAN MODE)

(Fast)

3.

SELECT * FROM TABLE WHERE RLIKE '(^| +)Keyword($| +)'

OR

SELECT * FROM TABLE WHERE
RLIKE '([[:space:]]|[[:<:]])Keyword([[:space:]]|[[:>:]])'

(Slow)
Contains searching

1.

SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('Keyword*' IN BOOLEAN MODE)

(Fastest)

2.

SELECT * FROM TABLE WHERE FIELD LIKE 'Keyword%'

(Fast)

3.

SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('*Keyword*' IN BOOLEAN MODE)

(Slow)

4.

SELECT * FROM TABLE WHERE FIELD LIKE '%Keyword%'

(Slow)
Recordsets

1.

SELECT SQL_CALC_FOUND_ROWS * FROM TABLE WHERE Condition LIMIT 0, 10
SELECT FOUND_ROWS()

(Fastest)

2.

SELECT * FROM TABLE WHERE Condition LIMIT 0, 10
SELECT COUNT(PrimaryKey) FROM TABLE WHERE Condition

(Fast)

3.

$result = mysql_query("SELECT * FROM table", $link);
$num_rows = mysql_num_rows($result);

(Very slow)
Joins

Use an INNER JOIN when you want the joining table to only have matching records that you specify in the join. Use LEFT JOIN when it doesn’t matter if the records contain matching records or not.

SELECT * FROM products
INNER JOIN suppliers ON suppliers.SupplierID = products.SupplierID

Returns all products with a matching supplier.

SELECT * FROM products
LEFT JOIN suppliers ON suppliers.SupplierID = products.SupplierID
WHERE suppliers.SupplierID IS NULL

Returns all products without a matching supplier.

 

Sito web: http://www.photoshoproadmap.com/....photoshop-text-effects-on-the-web/ 

La funzione javascript window.location permette di rendirizzare l'utente verso un altra pagina. Quello che faremo è reindirazzarlo dopo un tot di secondi. In javascript si parla di millisecondi:

1000 millisecondi = 1 secondo

Supponiamo di volere reindirizzarlo dopo 5 secondi

<script language="JavaScript">
var time = null
function move() {
window.location = 'http://www.dominio.it/nuovapagina.html'
}
</script>

e nel tag body della pagina andremo a inserire

<body onload="timer=setTimeout('move()',2000)">

18
07

10000 fonts gratuite su showfont.net

posted di Administrator, in links, siti web. No Commenti

Su http://www.showfont.net/ ci sono 10000 fonts ordinati per iniziale che è possibile vedere e scaricare.

 10000 fonts gratuite su showfont.net

18
07

Imparare haskell in 10 minuti

posted di Administrator, in tutorials, vari, vari. No Commenti

Haskell è un linguaggio di programmazione, creato da un apposito comitato negli anni '80 e chiamato così in onore del logico Haskell Curry. È un linguaggio funzionale, dove l'esecuzione del programma non è dettata dai passi successivi dei linguaggi procedurali tradizionali, ma è il risultato della soluzione di equazioni matematiche. È stato creato da un comitato formatosi nel 1987 con il compito specifico di definire un linguaggio con tali caratteristiche. Il precursore diretto di Haskell è Miranda, inventato nel 1985. L'ultima versione del linguaggio è chiamata Haskell 98 e fornisce una versione minimale e portabile del linguaggio.

In http://www.haskell.org/haskellwiki/Learn_Haskell_in_10_minutes è possibilie seguire un corso per impararlo

<?
// Directory da mostrare
$theDirectory            = ".";
if(is_dir($theDirectory))
{
    echo "<table><tr><td>Nome</td><td>Tipo</td><td>Dimensione</td></tr>";
    $dir = opendir($theDirectory);
    while(false !== ($file = readdir($dir)))
    {
        $type    = filetype($theDirectory ."/". $file);
        if($type != "dir")
        {
            echo "<tr><td>" . $file . "</td>";
            echo "<td>" . $type . "</td>";
            echo "<td>";
            if($type == "file")
                echo filesize($file);
            echo "</td></tr>";
        }
    }
    closedir($dir);
    echo "</table>";
}
else
{
    echo $theDirectory . " nn è una directory";
}
?>

$theText = "testo trasparente";
$fontSize = 15;
$angle = 25;
$font = "arial.ttf";
$size = imageTTFBBox($fontSize, $angle, $theFont, $theText);
$image = imageCreateTrueColor(abs($size[2]) + abs($size[0]), abs($size[7]) + abs($size[1]));
imageSaveAlpha($image, true);
ImageAlphaBlending($image, false);
$transparentColor = imagecolorallocatealpha($image, 200, 200, 200, 127);
imagefill($image, 0, 0, $transparentColor);
$textColor = imagecolorallocate($image, 200, 200, 200);
imagettftext($image, $fontSize, 0, 0, abs($size[5]), $textColor, $font, $theText);
imagepng($image, "textImage.png");
imagedestroy($image);

17
07

Load ed unload movie con flash

posted di Administrator, in flash, tutorials. No Commenti

La funzione loadMovieNum, carica nel filmato corrente, un altro filmato flash, ad esempio:

loadMovieNum ("contatti.swf", 2);

carica il filmato contatti.swf al livello 2. Per togliere il filmato occorre usare la funzione unloadMovieNum.

unloadMovieNum (2);

Toglie il filmato caricato sopra

web tracker