Sublime Forum

Can you help me identify why the PHP code snippet appears at the top of the browser and how to fix it?

include '../components/connect.php';

if (isset($_POST['submit'])) {
    $id = unique_id();
    $name = $_POST['name'];
    $name = filter_var($name, FILTER_SANITIZE_STRING);
    $email = $_POST['email'];
    $email = filter_var($email, FILTER_SANITIZE_EMAIL);
    $pass = $_POST['pass'];
    $pass = filter_var($pass, FILTER_SANITIZE_STRING);
    $cpass = $_POST['cpass'];
    $cpass = filter_var($cpass, FILTER_SANITIZE_STRING);
    $image = $_FILES['image']['name'];
    $image = filter_var($image, FILTER_SANITIZE_STRING);
    $ext = pathinfo($image, PATHINFO_EXTENSION);
    $rename = unique_id() . '.' . $ext;
    $image_size = $_FILES['image']['size'];
    $image_tmp_name = $_FILES['image']['tmp_name'];
    $image_folder = '../uploaded_files/' . $rename;

    $select_seller = $conn->prepare("SELECT * FROM `sellers` WHERE email = ?");

    if ($select_seller->rowCount() > 0) {
        $warning_msg[] = 'Email already exists!';
    } else {
        if ($pass != $cpass) {
            $warning_msg[] = 'Confirm password does not match';
        } else {
            $hashed_password = password_hash($cpass, PASSWORD_BCRYPT);
            $insert_seller = $conn->prepare("INSERT INTO `sellers` (id, name, email, password, image) VALUES (?, ?, ?, ?, ?)");
            $insert_seller->execute([$id, $name, $email, $hashed_password, $rename]);
            move_uploaded_file($image_tmp_name, $image_folder);
            $success_msg[] = 'New seller registered! Please log in now';

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Blue Sky Summer - Seller Registration</title>
    <link rel="stylesheet" href="../css/admin_style.css">
    <link rel="stylesheet" href="">
    <div class="form-container">
        <form action="" method="post" enctype="multipart/form-data" class="registration">
            <h3>Register Now</h3>
            <div class="flex">
                <div class="col">
                    <div class="input-fields">
                        <p>Your Name <span>*</span></p>
                        <input type="text" name="name" placeholder="Enter your name" maxlength="50" required class="box">
                    <div class="input-fields">
                        <p>Your Email <span>*</span></p>
                        <input type="email" name="email" placeholder="Enter your email" maxlength="50" required class="box">
                <div class="col">
                    <div class="input-fields">
                        <p>Your Password <span>*</span></p>
                        <input type="password" name="pass" placeholder="Enter your password" maxlength="50" required class="box">
                    <div class="input-fields">
                        <p>Confirm Password <span>*</span></p>
                        <input type="password" name="cpass" placeholder="Confirm your password" maxlength="50" required class="box">
            <div class="input-fields">
                <p>Your Profile <span>*</span></p>
                <input type="file" name="image" accept="image/*" required class="box">
            <p class="link">Already have an account? <a href="login.php">Login now</a></p>
            <input type="submit" name="submit" value="Register Now" class="btn">

    <script src=""></script>
    <script src="../js/script.js"></script>
    <?php include '../components/alerts.php'; ?>


This is a forum for support issues related to Sublime Text; your question is more a general purpose programming question.

Someone may be able to help you, but overall I would recommend seeking out a forum more directly related to programming topics.



Dumb question: Do you run a PHP server?