From 02e34365a5c98a4293855c377415cbe45056f9a6 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 15 Nov 2021 14:55:05 +0100 Subject: [PATCH] Add product --- includes/assets/css/default.css | 2 ++ includes/pages/wishlist-product-add.php | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/includes/assets/css/default.css b/includes/assets/css/default.css index 547f1b00..6fa2ba88 100644 --- a/includes/assets/css/default.css +++ b/includes/assets/css/default.css @@ -69,6 +69,8 @@ fieldset { border: none; } +input[type="number"], +input[type="url"], input[type="email"], input[type="password"], input[type="text"] { diff --git a/includes/pages/wishlist-product-add.php b/includes/pages/wishlist-product-add.php index 1df4e0f7..f9422c01 100644 --- a/includes/pages/wishlist-product-add.php +++ b/includes/pages/wishlist-product-add.php @@ -7,20 +7,25 @@ */ use wishthis\Page; -use Brick\Schema\SchemaReader; -use Brick\Schema\Interfaces as Schema; use Embed\Embed; -$page = new page(__FILE__, 'Add a product'); +if (isset($_POST['url'], $_POST['wishlist'])) { + $database->query('INSERT INTO `products` + (`wishlist`, `url`) VALUES + (' . $_POST['wishlist'] . ', "' . $_POST['url'] . '") + ;'); +} $url = 'https://www.amazon.de/Adventskalender-2020-Schokolade-Weihnachtskalender-346g/dp/B08CTTP5JX'; $embed = new Embed(); $info = $embed->get($url); -echo '
';
-var_dump($info->oembed);
-echo '
'; +// https://github.com/oscarotero/Embed +// echo '
';
+// var_dump($info);
+// echo '
'; +$page = new page(__FILE__, 'Add a product'); $page->header(); ?>
@@ -30,7 +35,12 @@ $page->header();
- + +
+ +
+ +