ok... fondamentalmente ci sono molti files, ma quelli che ci interessano sono tre.

il primo è functions.php dove inserisco le funzioni (per ora una sola)
functions.php
Codice PHP:
function strcorr($str) {
$str stripslashes($str);
$str mysql_real_escape_string($str);
$str str_replace("à""a'"$str);
$str str_replace("è""e'"$str);
$str str_replace("é""e'"$str);
$str str_replace("ì""i'"$str);
$str str_replace("ò""o'"$str);
$str str_replace("ù""u'"$str);
return 
$str;

poi abbiamo include.php dove inserisco tutti gli script da includere nelle pagine

include.php
Codice PHP:
<?php include("db_info.php"); //dati e accesso al database ?> 
<?php include("login_success.php"); //controllo di login amministratore ?>
<?php 
include("functions.php");  //elenco funzioni  ?>
e poi c'è il file contacts.php che serve all'amministratore a modificare i contatti del suo sito

contacts.php

Codice PHP:
include("include.php");

if (isset(
$_POST['edit_contacts'])) {

$new_indirizzo $_POST['indirizzo'];
$new_indirizzo strcorr($new_indirizzo);

$new_telefono $_POST['telefono'];
$new_cellulare $_POST['cellulare'];
$new_fax $_POST['fax'];
$new_email $_POST['email'];

$edit_contacts_query mysql_query("UPDATE contatti SET indirizzo='$new_indirizzo', telefono='$new_telefono', cellulare='$new_cellulare', fax='$new_fax', email='$new_email'");
echo 
"Modifica avvenuta con successo
"
;
}

echo 
"<a href=\"index.php\">Indietro</a>
"
;
$select_contacts mysql_query("SELECT * FROM contatti");
$contacts mysql_fetch_array($select_contacts);
echo 
"<table>
<form name=\"edit_contacts\" method=\"post\" action=\"\">
<tr><td>Indirizzo:</td><td><textarea rows=\"3\" cols=\"20\" name=\"indirizzo\">"
.$contacts['indirizzo']."</textarea></td></tr>
<tr><td>Telefono:</td><td><input name=\"telefono\" type=\"text\" value=\""
.$contacts['telefono']."\"></td></tr>
<tr><td>Cellulare:</td><td><input name=\"cellulare\" type=\"text\" value=\""
.$contacts['cellulare']."\"></td></tr>
<tr><td>Fax:</td><td><input name=\"fax\" type=\"text\" value=\""
.$contacts['fax']."\"></td></tr>
<tr><td>Email:</td><td><input name=\"email\" type=\"text\" value=\""
.$contacts['email']."\"></td></tr>
<tr><td><input type=\"submit\" name=\"edit_contacts\" value=\"Edit\"></td>
</form>
</tr>
</table>"

lo script funziona egregiamente, tranne che per il fatto che non esegue la funzione strcorr()