hi i have a form for members to fill in and i want there own personal submissions under form where i will be adding options but it will only work if i put the submitted data above form else i get white screen heres my coding

top php block

<?php
include("config/db_connect.php");
//include("config/ckh_session.php");

 if (isset($_POST['submit'])) {
    $event_type = mysqli_real_escape_string($conn, $_POST['event_type']);
    $event_date = mysqli_real_escape_string($conn, $_POST['event_date']);
    $event_country = mysqli_real_escape_string($conn, $_POST['event_country']);
    $event_postcode = mysqli_real_escape_string($conn, $_POST['event_postcode']);
    $event_title = mysqli_real_escape_string($conn, $_POST['event_title']);
    $event_description = mysqli_real_escape_string($conn, $_POST['event_description']);
    $event_ltm = mysqli_real_escape_string($conn, $_POST['event_ltm']);

       $sql = "INSERT INTO meets (event_type, event_date, event_country, event_postcode, event_title, event_description, event_ltm)
VALUES ('$event_type', '$event_date', '$event_country', '$event_postcode', '$event_title', '$event_description', '$event_ltm')";

?>

form goes here///////////

submitted php data goes here

<?php
if (mysqli_query($conn, $sql)) {
    echo "<h2>Your Input:</h2>";
    echo $event_type;
    echo "<br>";
echo $event_date;
echo "<br>";
echo $event_country;
echo "<br>";
echo $event_postcode;
echo "<br>";
echo $event_title;
echo "<br>";
echo $event_description;
echo "<br>";
echo $event_ltm;
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}

mysqli_close($conn);
}
?> </body> </html>

is this correct has its giving me a white screen but with no error logs showing

solved it now but thankyou for getting back to me

Member Avatar for diafol

OK mark as solved. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.