Quote:
Parse error: syntax error, unexpected end of file
This means that every times you open a '{', you have to close it later.
See your code with correct indentation
<?php require_once("dataconfig.php"); ?>
<?php
if (isset($_POST['signup'])){
$name=$_POST['company_name'];
$cid=$_POST['company_id'];
$adress=$_POST['adress'];
$city=$_POST['City'];
$state=$_POST['state'];
$email=$_POST['email'];
$phone=$_POST['Phone'];
$owner=$_POST['owner'];
$ownerphone=$_POST['ownerphone'];
$contactperson=$_POST['contactperson'];
$contactpersonphone=$_POST['contactpersonphone'];
$contactpersonemail=$_POST['contactpersonemail'];
$contactpersonposition=$_POST['contactpersonposition'];
$coment=$_POST['coment'];
$date=date('Y-m-d');
if(filter_var($email, FILTER_VALIDATE_EMAIL)){
$sql = mysqli_query($conn, "SELECT * FROM users WHERE email = '{$email}'");
if(mysqli_num_rows($sql) > 0){
echo "$email - This email already exist!";
}else{
if(isset($_FILES['image'])){
$img_name = $_FILES['image']['name'];
$img_type = $_FILES['image']['type'];
$tmp_name = $_FILES['image']['tmp_name'];
$img_explode = explode('.',$img_name);
$img_ext = end($img_explode);
$extensions = ["jpeg", "png", "jpg"];
if(in_array($img_ext, $extensions) === true){
$types = ["image/jpeg", "image/jpg", "image/png"];
if(in_array($img_type, $types) === true){
$time = time();
$new_img_name = $time.$img_name;
if(move_uploaded_file($tmp_name,"images/".$new_img_name)){
$sql = "INSERT INTO `company`(`name`, `company_id`, `address`, `city`,`state`, `email`, `pnumber`, `Owner`, `Opnumber`) Values
('$name','$cid','$adress','$city','$email','$phone','$owner','$ownerphone')" ;
$query= mysqli_query($dbc,$sql);
if ($query){
$sql2 = "INSERT INTO `companyid`(`id`, `company_id`, `contact_person`, `name`, `email`, `adress`, `city`, `State`, `pNumber`, `Owner`, `contact_number`, `contact_email`, `Contact_position`, `date`, `Coment`) Values
('','$cid','$contactperson','$name','$email','$adress','$city','$state','$phone','$owner','$contactpersonphone','$contactpersonemail','$contactpersonposition','$date','$coment')";
$query2=mysqli_query($dbc,$sql2);
echo '<br>Company Created Successfully.';
header( "refresh:2;url=index.php" );
echo '<br>You\'ll be redirected in about 5 secs. If not, click <a href="index.php">here</a>.';
}else{
echo'Something went wrong!!!';
}
}
?>
You have 6 missing '}'