perchè mi vengono in mente certe cose
Codice PHP:
interface updateuser{
public function set_name();
public function set_surname();
public function set_live();
public function set_bio();
public function set_hobby();
public function calldbandsave();
public function filtre();
}
class createfunction implements updateuser{
public $name;
public $surname;
public $live;
public $bio;
public $hobby;
public $who__;
public $update;
public $error = array (
"inserire un nome da 0 a 10 caratteri alfa numerici",
"inserire un cognome da 0 a 10 caratteri alfa numerici",
"non superare i 15 caratteri nella sessione '\vivi\'",
"non superare i 160 caratteri nella sessione biobreve",
"non superare i 15 caratteri nella sessione hobby",
"image/jpd");
function __construct(){
$this->name = htmlspecialchars ($_GET['nome']);
$this->surname = $_GET['cognome'];
$this->live = $_GET['live'];
$this->bio = $_GET['bio'];
$this->hobby = $_GET['interessi'];
$this->who__ = $_SESSION['mail'];
}
public function set_name(){
if ( empty ($this->name)){
return true;
} if (ctype_alnum ($this->name) && strlen ($this->name) > 3 && strlen ($this->name) < 11){
$query = mysql_query ("update utenti
set nome = '$this->name'
where mail = '$this->who__'");
return true;
}else{
echo $this->error[0];
}
}
public function set_surname(){
if ( empty ($this->surname)){
return true;
} if (ctype_alnum ($this->surname) && strlen ($this->surname) > 3 && strlen ($this->surname) < 11){
$query = mysql_query ("update utenti
set cognome = '$this->surname'
where mail = '$this->who__'");
return true;
}else{
echo $this->error[1];
}
}
public function set_live(){
if (empty ($this->live)){
return true;
} if (ctype_alnum ($this->live) && strlen ($this->live) <= 15){
$query = mysql_query ("update utenti
set live = '$this->live'
where mail = '$this->who__'");
return true;
}else{
print_r ($this->error[2]);
}
}
public function set_bio(){
if (empty ($this->bio)){
return true;
} if (ctype_alnum ($this->bio) && strlen ($this->bio) <= 160){
$query = mysql_query ("update utenti
set bio = '$this->bio'
where mail = '$this->who__'");
return true;
}else{
print_r ($this->error[3]);
}
}
public function set_hobby(){
if (empty ($this->hobby)){
return true;
} if (ctype_alnum ($this->hobby) && strlen ($this->hobby) <= 15){
$query = mysql_query ("update utenti
set hobby = '$this->hobby'
where mail = '$this->who__'");
return true;
}else{
print_r ($this->error[4]);
}
}
}
Comunque le classi funzionano entrmbe, per ciò che concerne le "query multipli" il problema non sussiste, vengono richiamte per metodi e si "avviano" solo una alla volta..