From fa183f628b38e0743cd22e16aa864843ceb616ac Mon Sep 17 00:00:00 2001 From: Suvodip Date: Tue, 11 Mar 2025 13:22:14 +0530 Subject: [PATCH] s11 --- .hta_slug/_404.php | 65 +++++++++++++++++++-- .hta_slug/_home.php | 107 +++++++++++++++++++++++++++-------- .hta_slug/add-tool.php | 3 +- .hta_slug/json-formatter.php | 4 +- index.php | 6 +- 5 files changed, 152 insertions(+), 33 deletions(-) diff --git a/.hta_slug/_404.php b/.hta_slug/_404.php index 3513c2e..005c077 100644 --- a/.hta_slug/_404.php +++ b/.hta_slug/_404.php @@ -1,7 +1,7 @@
@@ -50,4 +50,61 @@ require_once('../.hta_slug/_nav.php'); } ?> -
\ No newline at end of file + + \ No newline at end of file diff --git a/.hta_slug/_home.php b/.hta_slug/_home.php index 6483de0..6c17748 100644 --- a/.hta_slug/_home.php +++ b/.hta_slug/_home.php @@ -17,29 +17,88 @@ require_once('../.hta_slug/_nav.php');
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - // $stmt = $conn->prepare("SELECT * FROM api_tools"); - // $stmt->execute(); - // $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - // // var_dump($rows); - // foreach($rows as $row){ - // // echo $row['name'].'
'; - // if($row['status']==1){ - // $link_button = ''.$row['name'].''; - // } else{ - // $link_button = ''.$row['name'].''; - // } - // echo ' - //
- //

'.$row['description'].'

- // '.$link_button.' - //
'; - // } - // } catch (PDOException $e) { - // $in_page_message = "

Error: " . $e->getMessage() . "

"; - // } + try { + $conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("SELECT * FROM api_tools"); + $stmt->execute(); + $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + // var_dump($rows); + foreach($rows as $row){ + // echo $row['name'].'
'; + if($row['status']==1){ + $link_button = ''.$row['name'].''; + } else{ + $link_button = ''.$row['name'].''; + } + echo ' +
+

'.$row['description'].'

+ '.$link_button.' +
'; + } + } catch (PDOException $e) { + $in_page_message = "

Error: " . $e->getMessage() . "

"; + } ?>
- \ No newline at end of file + + \ No newline at end of file diff --git a/.hta_slug/add-tool.php b/.hta_slug/add-tool.php index d32b641..2cddc71 100644 --- a/.hta_slug/add-tool.php +++ b/.hta_slug/add-tool.php @@ -1,5 +1,6 @@ 3)){ $slugText = $_POST['name']; diff --git a/.hta_slug/json-formatter.php b/.hta_slug/json-formatter.php index a41a559..9a31c82 100644 --- a/.hta_slug/json-formatter.php +++ b/.hta_slug/json-formatter.php @@ -1,6 +1,4 @@ - +

JSON Formatter

diff --git a/index.php b/index.php index 0b1441e..bfc02f9 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,9 @@