Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 22
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    63

    Problemi confersione pagina con estensione .xhtml in .php

    Ciao a tutti chi mi può spiegare perchè quando cambio l'estensione di una pagina da .xhtml in .php e provo a visualizzarla nel browser non visualizzo niente? In poche parole voglio cambiare l'estensione della pagina registrazione.xhtml in registrazione.php solo che dopo la modifica se richiamo la pagina dal browser mi esce una pagina bianca.....................

  2. #2
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    3,709
    ma la apri "localmente" o via "http"? cioè... nel browser l'indirizzo è "file://..." o "http://..."? probabilmente il web server non sta elaborando le pagine php come pensi

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    63
    le apro localmente...........come posso risolvere ?

    questa e la pagina rinominata:

    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>

  4. #4
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    3,709
    se per "localmente" intendiamo appunto come "file" allora il problema è che non vengono gestite correttamente... dovresti indicare il browser e il contenuto del documento (è una "normale" pagina o cosa contiene?)... cmq se usi ".php" probabilmente vorresti eseguire codice php... è così? In questo caso devi installare un web server, non puoi semplicemente aprire il file.

  5. #5
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    63
    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?

  6. #6
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    3,709
    è un po' lunga... di solito la pagina bianca è sintomo di un errore PHP che però non visualizzi perchè non hai impostato correttamente le opzioni, puoi fare così: crea un'altra pagina "check.php" così fatta:

    Codice PHP:
    <?php
    error_reporting
    (E_ALL);
    ini_set('display_errors','On');
    include(
    'page.php'); // questa è la pagina che hai creato tu...
    ?>
    e apri questa, ma mettendola nel web server ed aprendola con "http://"... etc. etc. e poi posta cosa ottieni...

  7. #7
    Moderatore di PHP L'avatar di Alhazred
    Registrato dal
    Oct 2003
    Messaggi
    12,503
    In che modo la apri la pagina?
    Doppio click sul file o scrivendo l'indirizzo sul browser?
    Nel secondo caso, che indirizzo usi?

    Controlla anche che dopo il rename non ti ritrovi il file con doppia estensione, tipo .xhtml.php o .php.xhtml

  8. #8
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    63
    mi esce scritto questo:

    Parse error: syntax error, unexpected T_STRING in /home/fra/Scrivania/ProgettoWeb/SitoWeb/homePage.php on line 1

    Per collegarmi da da browser nell'url scrivo:

    http://localhost/SitoWeb/homePage.php

  9. #9
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    3,709
    forse c'è qualche riga vuota all'inizio... assicurati che NON ci siano righe vuote all'inizio e di non usare formati "strani" (eventualmente fai copia&incolla dentro il notepad di Windows ed elimina eventuali righe vuote iniziali)

  10. #10
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    63
    fatto ma ma non viene visualizzata..................

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.