parse error:syntax error,unexpected T_STRING

mirkomirko

Nuovo Utente
30 Lug 2012
25
4
3
Ragazzi ho questo errore parse error:syntax error,unexpected T_STRING in Calciatore.php on line 45 e non riesco a capire come risolverlo visto che non mi sembra di trovare stringhe inattese,posto il codice di seguito.
PHP:
   <?php
	class Calciatore extends Persona {
		var $reti;

		function Calciatore($n="",$c="",$e="",$cf="",$r){
			$this -> Persona($n,$c,$e,$cf);
			$this -> reti = $reti;
		}
		
		

		function leggiDatidaDB(){
			CalciatoreDAO::load($this);
		}

		function inserisciDatisuDB(){
			return CalciatoreDAO::insert($this);
		}
	
		function aggiornaDatisuDB(){
			CalciatoreDAO::update($this);
		}
		
		function cancellaDatidaDB(){
			CalciatoreDAO::delete($this);
		}

		function aggiungiCalciatore($n,$c,$e,$cf,$r,$squadra,$campionato){
			mysql_query("call ins_calciatore('$n','$c','$e','$cf','$r','$squadra','$campionato')") or die("errore: ".mysql_error());
			$ris = $this->controllaCalciatore();
			return $ris;
		}	

		function visualizzaSquadra(){
			$ris = mysql_query("select nome,cognome,eta,cf,squadra,campionato from Persona,Tesserato where Tesserato.calciatore='$this->cf' and Persona.cf='$this->cf' ") or die("errore: ".mysql_error());
			return $ris;
		}

		function visualizzaNazionale(){
			$ris = mysql_query("select nome,cognome,eta,cf,nazionale from Persona,Convocato where Convocato.calciatore='$this->cf' and Persona.cf='$this->cf' ") or die("errore: ".mysql_error());
			return $ris;
		}

		function controllaCalciatore(){
			$temp = mysql_query("select controllaCalciatore('$this->cf')") or die("errore: ".mysql_error());
                        $ris = mysql_fetch_array($temp);
			return $ris[0];
		}

	}
?>
questa è la classe in cui mi da errore,la linea 45 è subito dopo la funzione controllaCalciatore(),mentre la pagina php che chiama questa classe è la seguente:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login avvenuto con successo</title>
<link rel="stylesheet" type="text/css" href="../formattazione.css">
</head>
<body bgcolor=#FFFFFF>
<font color=#000000>
<?php
	session_start();
	if(!isset($_SESSION['calciatore'])) header("location:../errore.php?p=2");
	require_once('../Class/Calciatore.php');

	$host="localhost"; //hostname
	$username="root"; //username mysql
	$password=""; //pwd mysql
	$db_name="Tesi"; //nome database

	//connessione al database
	mysql_connect("$host","$username","$password") or die("cannot connect");
	mysql_select_db("$db_name") or die("cannot select database");

	if(isset($_POST['logout'])){
		sessio_destroy();
		header("location:../index.php");
	}

	$codice=$_SESSION['calciatore'];
	$sql="SELECT * FROM Persona WHERE Persona.cf='$codice'";
	$result=mysql_query($sql);
	while($c=mysql_fetch_array($result)){
		$nome=$c['nome'];
		$cognome=$c['cognome'];
		$eta=$c['eta'];		
		$reti=$c['reti'];
	}
	$calciatore=new Calciatore($nome,$cognome,$eta,$codice,$reti);
	echo"<h2>Login effettuato da parte del calciatore ".$nome.", ".$cognome."di anni ".$eta.",gol realizzati ".$reti.".</h2>";
?>
</body>
</font>
</html>
Grazie in anticipo...spero ne veniate a capo :) io sto perdendo la testa :(
 

borgo italia

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
4 Feb 2008
16.046
150
63
PR
www.borgo-italia.it
ciao
quell'errore può saltare fuori per una dimenticanza di un apice o anche di un ;
tieni presente che pero se ti dice a riga 45, non è detto che l'errore sia li, può nascere a monte. (incusioni, richiami function...)
guardando il tuo codice mi sembra sintatticamente corretto
 
Discussioni simili
Autore Titolo Forum Risposte Data
W Parse error: syntax error, unexpected '$result' (T_VARIABLE) PHP 4
G [WordPress] [PHP] Parse error: syntax error, unexpected '$x332cbce1' WordPress 2
U [PHP] Parse error: syntax error, unexpected variabile (T_VARIABLE) PHP 8
G Parse error: syntax error, unexpected '=' PHP 2
gandalf1959 Parse error: syntax error, unexpected T_VARIABLE PHP 2
Z Parse error: syntax error, unexpected 'parts' (T_STRING), expecting ',' or ';' PHP 2
T Nuova installazione vB: Parse error: syntax error, unexpected T_STRING ... CMS (Content Management System) 0
K Parse error: syntax error, unexpected $end PHP 2
H Parse error: syntax error, unexpected T_SL in /membri/sito/pagina.php... PHP 2
P Parse error: syntax error, unexpected T_STRING on line 5 PHP 7
J Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in PHP 3
N Parse error: syntax error, unexpected T_VARIABLE Piccolo Aiutino :) PHP 0
L Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' PHP 1
T [PHP] ...Parse error che non c'è... PHP 7
N [PHP] problema Parse error in file configurazione PHP 3
F Aiuto PHP : Parse error PHP 1
L AGORA - Parse error PHP 5
D Parse Error Login PHP 2
L responseXML -> xml parse error XML 2
B Parse error PHP 66
U Parse Error PHP 6
W Area riservata: Parse error PHP 2
G Script Bash linux parse Programmazione 10
K Notifiche con parse.com Sviluppo app per Android 1
neo996sps Non riesco a fare un parse XML con PHP PHP 1
F inviare dati ottenuti da "parse script" PHP 5
S 404 Error " Page not Find" Error SEO e Posizionamento 0
L Error Code: 1215. Cannot add foreign key constraint MySQL 3
M HTTP Status 500 - Internal Server Error. Java 0
A Uncaught Error: jQuery 1
F Uncaught (in promise) Error: 3000ms timeout exceeded Javascript 0
U Campo vuoto data errore Fatal error: PHP 2
W ADODB.Recordset error '800a0bb9' Classic ASP 2
D error text in table HTML e CSS 11
W Microsoft OLE DB Provider for Visual FoxPro error '80040e14' Function name is missing ). Classic ASP 0
W Errore di run-time di Microsoft VBScript error '800a0035' Impossibile trovare il file Classic ASP 0
I Fatal error: Query Failed! SQL: SELECT * INTO OUTFILE PHP 1
G Upload file error Apache 0
A Server Apache immagine not found (ERROR 404) Apache 5
L [PHP] Fatal error: Call to a member function prepare() on null in PHP 0
D [PHP] Fatal error: Class 'COM' not found in C:\..... PHP 6
T MySQL ERROR 1064 MySQL 1
T [PHP] aiuto....Fatal error: Uncaught Error:non riesco a capire PHP 1
C [PHP] Errore "Fatal error: Call to undefined function getTotalUsers()" PHP 2
V [MySQL] You have an error in your SQL syntax MySQL 1
G PHPMailer: SMTP error Gmail PHP 8
I [PHP] Login Facebook SDK returned an error: No URL set! PHP 0
bubino8 [PHP] Query syntax error PHP 6
J [PHP] Recoverable fatal error: PHP 4
momeraths [WordPress] cURL error: problema aggiornamento/installazione plugin WordPress 4

Discussioni simili