Voglio porvi questo problema in cui mi sono imbattuto:
ho creato due file in php che si chiamano sopra.inc.php e sotto.inc.php ora in una pagina che li include ho la necessità di inserire il controllo java che va tra i tag head e /head, come posso farlo dal momento che nella pagina contatti.php non c'è il tag in quanto è presente il file sopra.inc.php? mi hanno sconsigliato di reinserire il tag in contatti in quanto è un errore.
<SCRIPT LANGUAGE='JavaScript'>
<!--
function clear_field(field)
{
if (field.value==field.defaultValue)
{
field.value=''
}
}
function check_field(field)
{
if (field.value=='' ||
field.value==' ')
{
field.value=field.defaultValue
}
}
function validate_form()
{
if (document.jsform.nome.value==document.jsform.nome. defaultValue ||
document.jsform.nome.value.indexOf(' ',0)==0)
{
alert('\nNessun Nome inserito.')
document.jsform.nome.select()
document.jsform.nome.focus()
return false
}
if (document.jsform.cognome.value==document.jsform.co gnome.defaultValue ||
document.jsform.cognome.value.indexOf(' ',0)==0)
{
alert('\nNessun Cognome inserito.')
document.jsform.cognome.select()
document.jsform.cognome.focus()
return false
}
if (document.jsform.mail.value==document.jsform.mail. defaultValue)
{
alert('\nNessun indirizzo E-MAIL.')
document.jsform.mail.select()
document.jsform.mail.focus()
return false
}
if (document.jsform.mail.value.indexOf('@',0)==-1 ||
document.jsform.mail.value.indexOf('.',0)==-1)
{
alert('\nE-MAIL non valida.')
document.jsform.mail.select()
document.jsform.mail.focus()
return false
}
if (document.jsform.testo.value==document.jsform.test o.defaultValue ||
document.jsform.testo.value.indexOf(' ',0)==0)
{
alert('\nNon è stato inserito nessun Testo.')
document.jsform.testo.select()
document.jsform.testo.focus()
return false
}
else
{
if(confirm('\nClicca su OK per inviare.'))
{
return true
}
else
{
return false
}
}
}
//----------------------------------------
// -->
</SCRIPT>