html - Php T_encapsed and whitepasce error -


i error

parse error: syntax error, unexpected '' (t_encapsed_and_whitespace), expecting identifier (t_string) or variable (t_variable) or number (t_num_string) in c:\xampp\htdocs\atestat\addate.php on line 51

on line

else if ($_post) {      if (($_post['p_nume'] == "") || ($_post['p_nume'] == "")) {      header("location: addate.php");      exit;  

<?php  include 'ch20_include.php';   if (!$_post) {//nu se vede,arata   $display_block = <<<end_of_text <form method="post" action="$_server[php_self]">  <fieldset>  <legend>prenume/nume:</legend><br/>  <input type="text" name="p_nume" size="30" maxlength="75" required="required" />  <input type="text" name="nume"   size="30" maxlength="75" required="required" />  </fieldset>   <p>label for="adress">strada:</label><br/>  <input type="text"  id="adress" name="adress" size="30" /></p>   <fieldset>  <legend>oras/judet/cod postal:</legend><br/>  <input type="text" name="oras" size="30" maxlength="50" />  <input type="text" name="judet" size="5" maxlength="2" />  <input type="text" name="cod_postal" size="10" maxlength="10" />  </fieldset>   <fieldset>  <legend>numar de telefon:</legend><br/>  <input type="text" name="telefon" size="30" maxlength="25" />  <input type="radio" id="tel_type_h" name="tel_type" value="home" checked />      <label for="tel_type_h">acasa</label>  <input type="radio" id="tel_type_w" name="tel_type" value="work" />      <label for="tel_type_w">elev</label>  <input type="radio" id="tel_type_o" name="tel_type" value="altceva" />      <label for="tel_type_o">altceva</label>  </fieldset>   <fieldset>  <legend>nota-romana:</legend><br/>  <input type="text" name="notar_1" size="5" maxlength="50" />  <input type="text"  name="notar_2" size="5" maxlength="50" />  <input type="text"  name="notar_3" size="5" maxlength="50" />  <input type="text"  name="notar_4" size="5" maxlength="50" />  <input type="text"  name="notar_5" size="5" maxlength="50" />  <input type="text"  name="medier"  size="5" maxlength="50" />  </fieldset>    <p><label for="nota_personala">nota personala:</label><br/>  <textarea id="nota_personala" name="nota_personala" cols="35" rows="3"></textarea></p>   <button type="submit" name="submit" value="send">adauga elev</button>  </form>   end_of_text;  } else if ($_post) {      if (($_post['p_nume'] == "") || ($_post['p_nume'] == "")) {      header("location: addate.php");      exit;     }      //conectarea la bazadedate          dodb();       $safe_p_nume = mysqli_real_escape_string($mysqli,$_post['p_nume']);      $safe_nume = mysqli_real_escape_string($mysqli,$_post['nume']);      $safe_adresa = mysqli_real_escape_string($mysqli,$_post['adresa']);      $safe_oras = mysqli_real_escape_string($mysqli,$_post['oras']);      $safe_judet = mysqli_real_escape_string($mysqli,$_post['judet']);      $safe_cod_postal = mysqli_real_escape_string($mysqli,$_post['cod_postal']);      $safe_tel_numar = mysqli_real_escape_string($mysqli, $_post['tel_numar']);      $safe_notab_1 = mysqli_real_escape_string($mysqli,$_post['notab_1']);      $safe_notab_2 = mysqli_real_escape_string($mysqli,$_post['notab_2']);      $safe_notab_3 = mysqli_real_escape_string($mysqli,$_post['notab_3']);      $safe_notab_4 = mysqli_real_escape_string($mysqli,$_post['notab_4']);      $safe_notab_5 = mysqli_real_escape_string($mysqli,$_post['notab_5']);      $safe_medieb = mysqli_real_escape_string($mysqli,$_post['medieb']);      $safe_notac_1 = mysqli_real_escape_string($mysqli,$_post['notac_1']);      $safe_notac_2 = mysqli_real_escape_string($mysqli,$_post['notac_2']);      $safe_notac_3 = mysqli_real_escape_string($mysqli,$_post['notac_3']);      $safe_notac_4 = mysqli_real_escape_string($mysqli,$_post['notac_4']);      $safe_notac_5 = mysqli_real_escape_string($mysqli,$_post['notac_5']);      $safe_mediec = mysqli_real_escape_string($mysqli,$_post['mediec']);      $safe_notaf_1 = mysqli_real_escape_string($mysqli,$_post['notaf_1']);      $safe_notaf_2 = mysqli_real_escape_string($mysqli,$_post['notaf_2']);      $safe_notaf_3 = mysqli_real_escape_string($mysqli,$_post['notaf_3']);      $safe_notaf_4 = mysqli_real_escape_string($mysqli,$_post['notaf_4']);      $safe_notaf_5 = mysqli_real_escape_string($mysqli,$_post['notaf_5']);      $safe_medief = mysqli_real_escape_string($mysqli,$_post['medief']);      $safe_notafr_1 = mysqli_real_escape_string($mysqli,$_post['notafr_1']);      $safe_notafr_2 = mysqli_real_escape_string($mysqli,$_post['notafr_2']);      $safe_notafr_3 = mysqli_real_escape_string($mysqli,$_post['notafr_3']);      $safe_notafr_4 = mysqli_real_escape_string($mysqli,$_post['notafr_4']);      $safe_notafr_5 = mysqli_real_escape_string($mysqli,$_post['notafr_5']);      $safe_mediefr = mysqli_real_escape_string($mysqli,$_post['mediefr']);      $safe_notag_1 = mysqli_real_escape_string($mysqli,$_post['notag_1']);      $safe_notag_2 = mysqli_real_escape_string($mysqli,$_post['notag_2']);      $safe_notag_3 = mysqli_real_escape_string($mysqli,$_post['notag_3']);      $safe_notag_4 = mysqli_real_escape_string($mysqli,$_post['notag_4']);      $safe_notag_5 = mysqli_real_escape_string($mysqli,$_post['notag_5']);      $safe_medieg = mysqli_real_escape_string($mysqli,$_post['medieg']);      $safe_notai_1 = mysqli_real_escape_string($mysqli,$_post['notai_1']);      $safe_notai_2 = mysqli_real_escape_string($mysqli,$_post['notai_2']);      $safe_notai_3 = mysqli_real_escape_string($mysqli,$_post['notai_3']);      $safe_notai_4 = mysqli_real_escape_string($mysqli,$_post['notai_4']);      $safe_notai_5 = mysqli_real_escape_string($mysqli,$_post['notai_5']);      $safe_mediei = mysqli_real_escape_string($mysqli,$_post['mediei']);      $safe_notam_1 = mysqli_real_escape_string($mysqli,$_post['notam_1']);      $safe_notam_2 = mysqli_real_escape_string($mysqli,$_post['notam_2']);      $safe_notam_3 = mysqli_real_escape_string($mysqli,$_post['notam_3']);      $safe_notam_4 = mysqli_real_escape_string($mysqli,$_post['notam_4']);      $safe_notam_5 = mysqli_real_escape_string($mysqli,$_post['notam_5']);      $safe_mediem = mysqli_real_escape_string($mysqli,$_post['mediem']);      $safe_notare_1 = mysqli_real_escape_string($mysqli,$_post['notare_1']);      $safe_notare_2 = mysqli_real_escape_string($mysqli,$_post['notare_2']);      $safe_notare_3 = mysqli_real_escape_string($mysqli,$_post['notare_3']);      $safe_notare_4 = mysqli_real_escape_string($mysqli,$_post['notare_4']);      $safe_notare_5 = mysqli_real_escape_string($mysqli,$_post['notare_5']);      $safe_mediere = mysqli_real_escape_string($mysqli,$_post['mediere']);     $safe_notar_1 = mysqli_real_escape_string($mysqli,$_post['notar_1']);      $safe_notar_2 = mysqli_real_escape_string($mysqli,$_post['notar_2']);      $safe_notar_3 = mysqli_real_escape_string($mysqli,$_post['notar_3']);      $safe_notar_4 = mysqli_real_escape_string($mysqli,$_post['notar_4']);      $safe_notar_5 = mysqli_real_escape_string($mysqli,$_post['notar_5']);      $safe_medier = mysqli_real_escape_string($mysqli,$_post['medier']);     $safe_note = mysqli_real_escape_string(%mysqli,$_post['note']);       //adauga      $add_nume_sql = "insert nume_principal (date_added, date_modified, p_nume, nume) values(now(), now(), '".$safe_p_nume"', '".$safe_nume"')";      $add_nume_res = mysqli_query($mysqli, $add_nume_sql) or die(mysqli_error($mysqli));       if (($_post['adress;]) || ($_post['oras']) || ($_post['judet']) || ($_post['cod_postal'])) {      $add_adress_sql = "insert adress (nume_id, date_added, date_modified, adresa, oras, judet, cod_postal) values ('".$nume_id"', now(), now(), '".$safe_adresa"', '".$safe_oras"', '".$safe_judet"', '".$safe_cod_postal"')";      $add_adress_res = mysqli_query($mysqli, $add_adress_sql) or die(mysqli_error($mysqli));      }      if ($_post['tel_numar']) {      $add_tel_sql = "insert telefon (nume_id. date_added, date_modified, tel_numar) values ('".$nume_id"', now(), now(), '".$safe_tel_numar"')";      $add_tel_res = mysqli_query($mysqli, $add_tel_sql) or die(mysqli_error($mysqli));      }  if ($_post['notab_1']) || ($_post['notab_2']) || ($_post['notab_3']) || ($_post['notab_4']) || ($_post['notab_5'] || ($_post['medieb'])) {      $add_biologie_sql = "insert biologie (nume_id, date_added, date_modified, notab_1, notab_2, notab_3, notab_4, notab_5, medieb) values ('".$nume_id"', now(), now(), '".safe_notab_1")"' ,'".$safe_notab_2"', '".$safe_notab_3"', '".$safe_notab_4"', '".$safe_notab_5"', '"$safe_medieb"')";      $add_biologie_res = mysqli_query($mysqli,$add_biologie_sql) or die(mysqli_error($mysqli));  }  if ($_post['notac_1']) || ($_post['notac_2']) || ($_post['notac_3']) || ($_post['notac_4']) || ($_post['notac_5'] || ($_post['mediec'])) {      $add_chimie_sql = "insert chimie (nume_id, date_added, date_modified, notac_1, notac_2, notac_3, notac_4, notac_5, mediec) values ('".$nume_id"', now(), now(),  '".safe_notac_1")"' ,'".$safe_notac_2"', '".$safe_notac_3"', '".$safe_notac_4"', '".$safe_notac_5"', '"$safe_mediec"')";      $add_chimie_res = mysqli_query($mysqli,$add_chimie_sql) or die(mysqli_error($mysqli));  }  if ($_post['notaf_1']) || ($_post['notaf_2']) || ($_post['notaf_3']) || ($_post['notaf_4']) || ($_post['notaf_5'] || ($_post['medief'])) {      $add_fizica_sql = "insert fizica(nume_id, date_added, date_modified, notaf_1, notaf_2, notaf_3, notaf_4, notaf_5, medief) values ('".$nume_id"', now(), now(),   '".safe_notaf_1")"' ,'".$safe_notaf_2"', '".$safe_notaf_3"', '".$safe_notaf_4"', '".$safe_notaf_5"', '"$safe_medief"')";      $add_fizica_res = mysqli_query($mysqli,$add_fizica_sql) or die(mysqli_error($mysqli));  }  if ($_post['notafr_1']) || ($_post['notafr_2']) || ($_post['notafr_3']) || ($_post['notafr_4']) || ($_post['notafr_5'] || ($_post['mediefr'])) {      $add_franceza_sql = "insert franceza (nume_id, date_added, date_modified, notab_1, notafr_2, notafr_3, notafr_4, notafr_5, mediefr) values ('".$nume_id"', now(), now(),   '".safe_notafr_1")"' ,'".$safe_notafr_2"', '".$safe_notafr_3"', '".$safe_notafr_4"', '".$safe_notafr_5"', '"$safe_mediefr"')";      $add_franceza_res = mysqli_query($mysqli,$add_franceza_sql) or die(mysqli_error($mysqli));  }  if ($_post['notag_1']) || ($_post['notag_2']) || ($_post['notag_3']) || ($_post['notag_4']) || ($_post['notag_5'] || ($_post['medieg'])) {      $add_germana_sql = "insert germana (nume_id, date_added, date_modified, notag_1, notag_2, notag_3, notag_4, notag_5, medieg) values ('".$nume_id"', now(), now(),  '".safe_notag_1")"' ,'".$safe_notag_2"', '".$safe_notag_3"', '".$safe_notag_4"', '".$safe_notag_5"', '"$safe_medieg"')";      $add_germana_res = mysqli_query($mysqli,$add_germana_sql) or die(mysqli_error($mysqli));  }  if ($_post['notai_1']) || ($_post['notai_2']) || ($_post['notai_3']) || ($_post['notai_4']) || ($_post['notai_5'] || ($_post['mediei'])) {      $add_informatica_sql = "insert informatica (nume_id, date_added, date_modified, notai_1, notai_2, notai_3, notai_4, notai_5, mediei) values ('".$nume_id"', now(), now(),  '".safe_notai_1")"' ,'".$safe_notai_2"', '".$safe_notai_3"', '".$safe_notai_4"', '".$safe_notai_5"', '"$safe_mediei"')";      $add_informatica_res = mysqli_query($mysqli,$add_informatica_sql) or die(mysqli_error($mysqli));  }  if ($_post['notam_1']) || ($_post['notam_2']) || ($_post['notam_3']) || ($_post['notam_4']) || ($_post['notam_5'] || ($_post['mediem'])) {      $add_matematica_sql = "insert matematica (nume_id, date_added, date_modified, notam_1, notam_2, notam_3, notam_4, notam_5, mediem) values ('".$nume_id"', now(), now(),  '".safe_notam_1")"' ,'".$safe_notam_2"', '".$safe_notam_3"', '".$safe_notam_4"', '".$safe_notam_5"', '"$safe_mediem"')";      $add_matematica_res = mysqli_query($mysqli,matematica_sql) or die(mysqli_error($mysqli));   }  if ($_post['notare_1']) || ($_post['notare_2']) || ($_post['notare_3']) || ($_post['notare_4']) || ($_post['notare_5'] || ($_post['mediere'])) {      $add_religie_sql = "insert religie (nume_id, date_added, date_modified, notare_1, notare_2, notare_3, notare_4, notare_5, mediere) values ('".$nume_id"', now(), now(),   '".safe_notare_1")"' ,'".$safe_notare_2"', '".$safe_notare_3"', '".$safe_notare_4"', '".$safe_notare_5"', '"$safe_mediere"')";      $add_religie_res = mysqli_query($mysqli,$add_religie_sql) or die(mysqli_error($mysqli));  }  if ($_post['notar_1']) || ($_post['notar_2']) || ($_post['notar_3']) || ($_post['notar_4']) || ($_post['notar_5'] || ($_post['medier'])) {      $add_romana_sql = "insert romana (nume_id, date_added, date_modified, notar_1, notar_2, notar_3, notar_4, notar_5, medier) values ('".$nume_id"', now(), now(),  '".safe_notar_1")"' ,'".$safe_notar_2"', '".$safe_notar_3"', '".$safe_notar_4"', '".$safe_notar_5"', '"$safe_medier"')";      $add_biologie_res = mysqli_query($mysqli,$add_biologie_sql) or die(mysqli_error($mysqli));  }  if ($_post['note']) {  $add_nota_sql = "insert nota_personala (nume_id, date_added, date_modified, note) values ('".$nume_id"', now(), now(), '".$safe_note"')";  $add_nota_res =  mysqli_query($mysqli, $add_nota_sql) or die(mysql_error($mysqli));  }  mysqli_close($mysqli);  $display_block = "<p>a fost adaugat.ai dori sa mai adaugi si <a fref=\"addata.php\">altceva</a>?</p>";      }  ?>  <!doctype html>  <head>  <title>adauga un elev</title>  </head>  <body>  <h1>adauga un elev</h1>  <?php echo $display_block; ?>  </body>  </html>  

i have posted code,i'm trying marks-catalog school.and i'm trying add notes , info's

in line 49, there whitespace @ end of end_of_text; should remove.

the file has other typos, in line 120, instead of:

$safe_note = mysqli_real_escape_string(%mysqli,$_post['note']);  

should be:

$safe_note = mysqli_real_escape_string($mysqli,$_post['note']);  

and also, line 123, semicolon should changed quote:

$_post['adress;]) 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -