Spero di non essere diventato orbo/cieco io ma nel codice qui sotto, mi viene segnalato un'errore che non mi sembra di vederlo
Codice PHP:
class oggetti_form {
var $label;
var $name;
var $style;
function oggetti_form($label, $name, $style) {
(!is_numeric($label)) ? $this->label = $label : die('Hai passato un parametro non valido: ' . $label);
(!is_numeric($name)) ? $this->name = $name : die('Hai passato un parametro non valido: ' . $name);
(!is_numeric($stile)) ? $this->style = $style : die('Hai passato un parametro non valido: ' . $style);
}
function genera_form() {
echo 'Questo metodo verrà sovrascritto dagli altri';
}
}
/** Definizione della classe per l'oggetto input di testo **/
class input_testo extends oggetti_form {
var $value;
var $maxlenght;
function input_testo($label, $name, $style, $value, $maxlenght) {
parent::oggetti_form($label, $name, $style);
(!is_numeric($value)) ? $this->value = $value : die('Parametro non valido: ' . $value);
(is_int($maxlenght) && $maxlenght > 2 && $maxlenght < 30) ? $this->maxlenght = $maxlenght : die('Parametro non valido: ' . $maxlenght);
}
function genera_form() {
$html = $this->label . '<input type="text" name="' . $this->name . '" value="' . $this->value . '" class="' $this->style . '" maxlenght="' . $this->maxlenght . "\" />\n";
return $html;
}
}
La riga incriminata è:
Codice PHP:
$html = $this->label . '<input type="text" name="' . $this->name . '" value="' . $this->value . '" class="' $this->style . '" maxlenght="' . $this->maxlenght . "\" />\n";
e mi dice unexpected T_VARIABLE in ............quella riga li.......
Ah spero non c'entri qualcosa il fatto che scrivo codice php4 su un server aggiornato a php5 questa semplice classe dovrebbe essere riconosciuta lo stesso..
Ci vedete meglio di me?? :master: