Parse error: syntax error, Unexpected end of file

Asked

Viewed 429 times

0

I have an error running a PHP code

( ! ) Parse error: syntax error, Unexpected end of file in C: wamp64 www site successemail.php on line 35

The code is this

<?php
mysqli_connect("localhost", "root", "") or die(mysql_error());


if(isset($_POST['seunome']) && isset($_POST['suasenha']) && empty($_POST['seunome'] ==false) && empty($_POST['suasenha'] == false)){



  $seunome  = $_POST['seunome'];
  $suasenha = $_POST['suasenha'];

$sqli = "CREATE DATABASE" .$_POST['seunome'];

$geral = mysqli_query($sqli) or die("Errro ao criar");

?>
  • Are you sure this is the code? It says line 35 in the error. If this is it, check where it closes the open key in the IF.

1 answer

2

Missing a key at the end of the code

<?php
mysqli_connect("localhost", "root", "") or die(mysql_error());


if(isset($_POST['seunome']) && isset($_POST['suasenha']) && empty($_POST['seunome'] ==false) && empty($_POST['suasenha'] == false)){

  $seunome  = $_POST['seunome'];
  $suasenha = $_POST['suasenha'];
} //Coloquei aqui, mas não sei se deveria ser mais abaixo

$sqli = "CREATE DATABASE" .$_POST['seunome'];    
$geral = mysqli_query($sqli) or die("Errro ao criar");   

?>
  • that key I’ve tried from the same problem

  • Young man, the key. It’s in the code.

  • yes I put it before, gives the same problem.

  • Well, then you’re missing information on your question. It’s probably missing to close more keys. No more details no way to know.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.