Prechádzať zdrojové kódy

Setting error display first
Initial commit for submit_activities.php

Sebastian Vendt 5 mesiacov pred
rodič
commit
cd172a4c1b
1 zmenil súbory, kde vykonal 6 pridanie a 4 odobranie
  1. 6 4
      index.php

+ 6 - 4
index.php

@@ -1,10 +1,12 @@
 <?php
-// Include the external configuration file
-require_once '../config.php';
 
 // error reporting
 error_reporting(E_ALL);
 
+// Include the external configuration file
+require_once '../config.php';
+
+
 try {
     // Use the settings from config.php for the PDO connection
     $pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
@@ -57,7 +59,7 @@ if (!$activities) {
     <form action="submit_activities.php" method="GET">
         <?php foreach ($activities as $activity): ?>
             <div class="activity-item">
-                <input type="checkbox" name="activity_ids[]" value="<?php echo htmlspecialchars($activity['activityID']); ?>">
+                <input type="checkbox" name="activity_ids" value="<?php echo htmlspecialchars($activity['activityID']); ?>">
                 <label for="category_<?php echo htmlspecialchars($activity['activityID']); ?>">
                     <?php echo htmlspecialchars($activity['activityName']); ?>
                 </label>
@@ -65,7 +67,7 @@ if (!$activities) {
         <?php endforeach; ?>
 
         <br>
-        <button type="submit">Submit</button>
+        <button type="submit">Pack it in!</button>
     </form>
 
 </body>