hi i have to write a simple code transforms a string from a text box into integer, float string, bool
i wrote the code but on submit it doesn't shoe anything
<?php
echo "INSERISCI LA VARIABILE DA TRASFORMARE";
echo "<form name=\"trasf\" method=\"post\" action=".$_SERVER['PHP_SELF'].">";
echo "<INPUT TYPE=\"text\" NAME=\"variabile\">";
echo "<br>";
echo "<INPUT TYPE=\"submit\" VALUE=\"invia\">";
?>
</form>
<?php
if (isset($_POST['Submit'])) {
$variabile=$_POST['variabile'];
if (isset($variabile))
{ $i=(int) $variabile;
echo "Trasformata in integer vale:".$i;
echo "<br>";
$f=(float) $variabile;
echo "Trasformata in float vale:".$f ;
echo "<BR>";
$s=(string) $variabile;
echo "Trasformata in string vale:".$s;
echo "<br>";
echo $b=(bool) $variabile;
echo "Trasformata in boolean vale: ". (bool) $b;
echo "<BR>";
}
}
else { echo " non hai inserito alcun valore"; }
?>
cfould u pls help me figure out what's wrong with the script??
thanks