0

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

2
Contributors
3
Replies
15
Views
7 Months
Discussion Span
Last Post by diafol
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.