[glux] PHP
Riccardo Sama'
riccards@interfree.it
Sat, 6 Oct 2001 12:21:08 +0200
Messaggio in formato MIME composto da pił parti.
------=_NextPart_000_0014_01C14E61.61239280
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
ecoovi le quattro righe di codice php che servono per accedere al database
dbf e restituiscono titolo anno ecc dei libri della biblio
ciao e a giovedi
WillY
------=_NextPart_000_0014_01C14E61.61239280
Content-Type: application/octet-stream;
name="dbf.php"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="dbf.php"
<HTML>=0A=
<HEAD>=0A=
<TITLE>Prove PHP</TITLE>=0A=
</HEAD>=0A=
<BODY>=0A=
<CENTER>=0A=
<B>PROVE PHP</B><P> =0A=
<TABLE border=3D1>=0A=
=0A=
<? $db=3Ddbase_open('./BIBLIO.DBF',0);=0A=
$i=3D1;=0A=
# while (dbase_get_record($db,$i)) { =0A=
while ($i<20) {=0A=
$array=3Ddbase_get_record($db,$i);=0A=
array_walk($array, 'stampa');=0A=
$i++;=0A=
}=0A=
=0A=
dbase_close($db); =0A=
=0A=
function stampa($item, $key) {=0A=
if ($key=3D=3D1) {=0A=
echo "<TR><TD align=3Dleft>";=0A=
echo "<B>TITOLO</B>: $item";=0A=
echo "</TD>";=0A=
}=0A=
else if ($key=3D=3D2) {=0A=
echo "<TD align=3Dleft>";=0A=
echo "<B>AUTORE</B>: $item";=0A=
echo "</TD>";=0A=
}=0A=
else if ($key=3D=3D8) {=0A=
echo "<TD align=3Dleft>";=0A=
echo "<B>EDITORE</B>: $item";=0A=
echo "</TD>";=0A=
}=0A=
else if ($key=3D=3D10) {=0A=
echo "<TD align=3Dleft>";=0A=
echo "<B>ANNO</B>: $item";=0A=
echo "</TD></TR>";=0A=
}=0A=
}=0A=
=0A=
?>=0A=
</TABLE>=0A=
=0A=
</CENTER>=0A=
</BODY>=0A=
</HTML>=0A=
------=_NextPart_000_0014_01C14E61.61239280--