Added basic field editing
This commit is contained in:
15
newppr.php
15
newppr.php
@@ -18,8 +18,19 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
echo "<h2>Received POST Data:</h2>";
|
||||
echo "<ul>";
|
||||
foreach ($_POST as $key => $value) {
|
||||
$columns[] = "`" . $conn->real_escape_string($key) . "`";
|
||||
$values[] = "'" . $conn->real_escape_string($value) . "'";
|
||||
$escaped_key = "`" . $conn->real_escape_string($key) . "`";
|
||||
|
||||
if ($value === '' || $value === null) {
|
||||
$escaped_value = "NULL"; // Use NULL for empty values
|
||||
} elseif (is_numeric($value)) {
|
||||
$escaped_value = $value; // No quotes for numbers
|
||||
} else {
|
||||
$escaped_value = "'" . $conn->real_escape_string($value) . "'"; // Escape and quote strings
|
||||
}
|
||||
|
||||
$columns[] = $escaped_key;
|
||||
$values[] = $escaped_value;
|
||||
|
||||
echo "<li><strong>" . htmlspecialchars($key) . ":</strong> " . htmlspecialchars($value) . "</li>";
|
||||
}
|
||||
if (!empty($columns)) {
|
||||
|
||||
Reference in New Issue
Block a user