Ho gia installato web server Apache2 e php6..................ho creato una pagina di prova php così come segue:
codice:
<html>
<head>
<title>How many days in this month?</title>
</head>
<body>
<?php
date_default_timezone_set('America/New_York');
$month = date('n');
if ($month == 1) { echo '31'; }
if ($month == 2) { echo '28 (unless it\'s a leap year)'; }
if ($month == 3) { echo '31'; }
if ($month == 4) { echo '30'; }
if ($month == 5) { echo '31'; }
if ($month == 6) { echo '30'; }
if ($month == 7) { echo '31'; }
if ($month == 8) { echo '31'; }
if ($month == 9) { echo '30'; }
if ($month == 10) { echo '31'; }
if ($month == 11) { echo '30'; }
if ($month == 12) { echo '31'; }
?>
</body>
</html>
Funziona mi visualizza il numero di mesi cioè 31...........il mio problema è che ho provato a rinominare da .xhtml a .php questa pagina:
codice:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Registrazione </title>
<link rel="stylesheet" type="text/css" href="generalCSS.css" />
<script type="text/javascript">
function validazione()
{
var nome = document.getElementById('nome');
var cognome = document.getElementById('cognome');
var email = document.getElementById('newEmail');
var passw = document.getElementById('passw');
var repeatPassw = document.getElementById('repeatPassw');
document.getElementById('visN').style.visibility = "hidden";
document.getElementById('visC').style.visibility = "hidden";
document.getElementById('visE').style.visibility = "hidden";
document.getElementById('visP').style.visibility = "hidden";
document.getElementById('visRp').style.visibility = "hidden";
if(nomeScorretto(nome.value))
{
document.getElementById('visN').style.visibility = "visible";
nome.select();
return false;
}
else if(cognomeScorretto(cognome.value))
{
document.getElementById('visC').style.visibility = "visible";
cognome.select()
return false;
}
else if(emailScorretta(email.value))
{
document.getElementById('visE').style.visibility = 'visible';
email.select()
return false;
}
else if(passwScorretta(passw.value))
{
document.getElementById('visP').style.visibility = 'visible';
passw.select()
return false;
}
else if(repeatPasswScorretta(repeatPassw.value))
{
document.getElementById('visRp').style.visibility = 'visible';
repeatPassw.select()
return false;
}
else
{
return true;
}
}
</script>
<script type="text/javascript" src="script.js" > </script>
</head>
<body onload="loadDate()">
<div id="generalR">
<div id="topH">
[img]webUtilities.gif[/img]
<form id="utenteRegistrato" method="post" action="testdb.php" onsubmit="return autentificazione()">
<fieldset >
<legend>Accesso Utenti</legend>
<label>Email:</label>
<input type="text" name="utemail" id="emailLogin" class="emailLoginCSS"></input>
<label>Password:</label>
<input type="password" id="passwLogin"></input>
<button type="submit" value="invia">Invia </button>
<label>Se non sei registrato clicca Qui</label>
</fieldset>
</form>
</div>
<div id="barra">
<table>
<tr>
<td>HOMEPAGE </td>
<td>REGISTRAZIONE</td>
<td>RUBRICA </td>
<td>AGENDA </td>
<td>CALCOLATRICE </td>
<td>SVEGLIA </td>
<td>CONTATTI </td>
</tr>
</table>
</div>
<div id="centerR" class="centerR">
<form id="register" method="post" onsubmit="return validazione()">
<table summary="datiReg" id="reg" class="tabReg">
<caption>
Dati Anagrafici
</caption>
<tr>
<td>Nome </td>
<td><input type="text" id="nome"></input></td>
<td class="visN" id="visN">Nome non corretto </td>
</tr>
<tr>
<td>Cognome </td>
<td><input type="text" id="cognome"></input></td>
<td class="visC" id="visC">Cognome non corretto</td>
</tr>
<tr>
<td>Data Di Nascita </td>
<td> <select id="giorno"></select>
<select id="mese" onchange="controllaData()"></select>
<select id="anno" onchange="controllaData()"></select>
</td>
</tr>
<tr>
<td>Sesso </td>
<td><select id="Sesso" name="sesso">
<option value="M">M </option>
<option value="F">F </option>
</select>
</td>
</tr>
<tr>
<td>Email </td>
<td><input type="text" id="newEmail"></input></td>
<td class="visE" id="visE">Email non valida </td>
</tr>
<tr>
<td>Password </td>
<td><input type="password" id="passw"></input></td>
<td class="visP" id="visP">Password min 6 e max 12 caratteri</td>
</tr>
<tr>
<td>Ripeti Password</td>
<td><input type="password" id="repeatPassw"></input></td>
<td class="visRp" id="visRp">La password non coincide</td>
</tr>
<tr>
<td><input type="submit" value="registrati"> </input></td>
<td><input type="reset" value="reset"></input></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
Il risultato è che non mi visualizza un bel niente come mai?