PDA

View Full Version : [PHP] syntax error


zebmckey
05-02-2018, 09:46
Buongiorno a tutti, ho un problema con un piccolo script php. Un errore che non riesco a trovare.....
vi posto stralcio del codice interessato:

File html del post:

<td bgcolor="#00FFFF" colspan="2" rowspan="1" style="width: 136px; height: 40px;">ECG</td>
<tr>
<td style="width: 100px; height: 25px;">Tipo Ecg:</td>
<td style="width: 136px; height: 25px;"><input type="text" name="tipo_ecg" size="40"></td>
</tr>
<tr>
<td style="width: 100px; height: 25px;">Data Ecg:</td>
<td style="width: 136px; height: 25px;"><input type="date" name="data_ecg"></td>
</tr>
<tr>
<td style="width: 100px; height: 25px;">File Ecg:</td>
<td style="width: 136px; height: 25px;"><input type="file" name="file_ecg"></td>
</tr>
<tr>
<td style="width: 100px; height: 25px;">Note:</td>
<td style="width: 136px; height: 25px;"><input type="textarea" name="note_ecg" size="100"></td>
</tr>

il file php

$tipo_ecg = $_POST['tipo_ecg']; //linea 44
$date_ecg = $_POST['data_ecg'];
$file_ecg = $_POST['file_ecg'];
$note_ecg = $_POST['note_ecg'];
$tipo_ecg = mysql_real_escape_string($tipo_ecg);
$note_ecg = mysql_real_escape_string(note_ecg);

Questo è l'eerorre che mi restituisce!!!

Parse error: syntax error, unexpected 'tipo_ecg' (T_STRING), expecting ']' in C:\xampp\htdocs\test\input_user.php on line 44

Sinceramente non capisco!!!

Pbdz
05-02-2018, 13:06
hai provato a commentare provvisoriamente la linea 44 per vedere se il problema è anche sulle altre variabili $_POST?

A occhio non si nota nulla di strano...

RagingBull
05-02-2018, 14:11
Sarebbe utile conoscere i dati passati in POST. Ad ogni modo ho trovato anche questo problemino:

$note_ecg = mysql_real_escape_string(note_ecg);

Eduadie
05-02-2018, 16:57
Puoi farci vedere il file php completo? L'errore potrebbe essere qualche punto e virgola più sopra non chiuso correttamente.

zebmckey
07-02-2018, 06:56
Sarebbe utile conoscere i dati passati in POST. Ad ogni modo ho trovato anche questo problemino:

$note_ecg = mysql_real_escape_string(note_ecg);

Grazie non me ne ero accorto!
Vi ringrazio tutti ho risolto il problema. Non era alla riga 44 ma quella prima che non era stata chiusa con il (;).... chiedo scusa se vi ho rotto le scatole per una mia distrazione :( :( :(

Eduadie
07-02-2018, 10:45
Grazie non me ne ero accorto!
Vi ringrazio tutti ho risolto il problema. Non era alla riga 44 ma quella prima che non era stata chiusa con il (;).... chiedo scusa se vi ho rotto le scatole per una mia distrazione :( :( :(

Come volevasi dimostrare :D