Online shop that dynamically displays items in PHP
Is it possible to make sharp wind that can cut stuff from afar?
Can a German sentence have two subjects?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Shell script not opening as desktop application
How can bays and straits be determined in a procedurally generated map?
How do I create uniquely male characters?
Why was the small council so happy for Tyrion to become the Master of Coin?
DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?
Why is an old chain unsafe?
Why CLRS example on residual networks does not follows its formula?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Why don't electromagnetic waves interact with each other?
Suffixes -unt and -ut-
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
How to get the available space of $HOME as a variable in shell scripting?
Motorized valve interfering with button?
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
Why can't I see bouncing of a switch on an oscilloscope?
Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).
TGV timetables / schedules?
Can I interfere when another PC is about to be attacked?
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Why are only specific transaction types accepted into the mempool?
Online shop that dynamically displays items in PHP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I'm currently working on an online shop for school where the goal is to dynamically display a bunch of items to buy. You should then be able to click on the item to see page where all the informations of the items are displayed (without creating a new webpage for every item).
We shouldn't use any databank yet, that's why I stored all of the attributes in an array that I then include.
On top of that everything should be in HTML, CSS and PHP only.
This is the code for the shop page. It runs through every item in the array and displays the image with the logo, name, price and so on.
Sine this is my first time with web development I'm not sure if the code is good like this. What can I do improve my code and get close to something you would actually see in the industry?
You can download the whole shop here. This is the index page of the shop:
<?php
include 'shop/productlist.php';
?>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<title> Shop </title>
</head>
<body>
<?php include "./nav.php"; ?>
<div class="search_bar">
<form action="" autocomplete=off>
<button type="submit">
<img src="./resources/search_icon.png">
</button>
<input type="text" name="search" placeholder="Im Shop suchen">
</form>
</div>
<div class="shop">
<?php
for($row = 0; $row < sizeof($product_name); $row++)
if($product_price[$row][0] > 0)
$price = $product_price[$row][0] . "€";
elseif($product_price[$row][0] == 0)
$price = "Kostenlos";
//Search for term
if(isset($_GET["search"]) && $_GET["search"] != "")
$search_filter = $_GET["search"];
else
goto search;
if(stripos($product_name[$row], $search_filter) !== false)
search:
echo '
<div class="shop_item">
<form action="./product.php">
<button type="submit" name="id" value="'.$row.'">
<div class="store_image">
<img src="shop/product_img/'.$product_name[$row].'/Shop.jpg" class="primary">
<div class="logo_wrapper">
<div class="logo">
<img src="shop/product_img/'.$product_name[$row].'/Logo.png" class="logo">
</div>
</div>
</div>
<div class="details_wrapper">
<span class="details">
<h1> '.$product_name[$row].' </h1>
<p> <dev> '.$product_developer[$row].' </dev> </p>
</span>
<span class="price">
<price> '.$price.' </price>
</span>
</div>
</button>
</form>
</div>
';
?>
</div>
<?php include "./footer.php"; ?>
</body>
</html>
php html
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I'm currently working on an online shop for school where the goal is to dynamically display a bunch of items to buy. You should then be able to click on the item to see page where all the informations of the items are displayed (without creating a new webpage for every item).
We shouldn't use any databank yet, that's why I stored all of the attributes in an array that I then include.
On top of that everything should be in HTML, CSS and PHP only.
This is the code for the shop page. It runs through every item in the array and displays the image with the logo, name, price and so on.
Sine this is my first time with web development I'm not sure if the code is good like this. What can I do improve my code and get close to something you would actually see in the industry?
You can download the whole shop here. This is the index page of the shop:
<?php
include 'shop/productlist.php';
?>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<title> Shop </title>
</head>
<body>
<?php include "./nav.php"; ?>
<div class="search_bar">
<form action="" autocomplete=off>
<button type="submit">
<img src="./resources/search_icon.png">
</button>
<input type="text" name="search" placeholder="Im Shop suchen">
</form>
</div>
<div class="shop">
<?php
for($row = 0; $row < sizeof($product_name); $row++)
if($product_price[$row][0] > 0)
$price = $product_price[$row][0] . "€";
elseif($product_price[$row][0] == 0)
$price = "Kostenlos";
//Search for term
if(isset($_GET["search"]) && $_GET["search"] != "")
$search_filter = $_GET["search"];
else
goto search;
if(stripos($product_name[$row], $search_filter) !== false)
search:
echo '
<div class="shop_item">
<form action="./product.php">
<button type="submit" name="id" value="'.$row.'">
<div class="store_image">
<img src="shop/product_img/'.$product_name[$row].'/Shop.jpg" class="primary">
<div class="logo_wrapper">
<div class="logo">
<img src="shop/product_img/'.$product_name[$row].'/Logo.png" class="logo">
</div>
</div>
</div>
<div class="details_wrapper">
<span class="details">
<h1> '.$product_name[$row].' </h1>
<p> <dev> '.$product_developer[$row].' </dev> </p>
</span>
<span class="price">
<price> '.$price.' </price>
</span>
</div>
</button>
</form>
</div>
';
?>
</div>
<?php include "./footer.php"; ?>
</body>
</html>
php html
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I'm currently working on an online shop for school where the goal is to dynamically display a bunch of items to buy. You should then be able to click on the item to see page where all the informations of the items are displayed (without creating a new webpage for every item).
We shouldn't use any databank yet, that's why I stored all of the attributes in an array that I then include.
On top of that everything should be in HTML, CSS and PHP only.
This is the code for the shop page. It runs through every item in the array and displays the image with the logo, name, price and so on.
Sine this is my first time with web development I'm not sure if the code is good like this. What can I do improve my code and get close to something you would actually see in the industry?
You can download the whole shop here. This is the index page of the shop:
<?php
include 'shop/productlist.php';
?>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<title> Shop </title>
</head>
<body>
<?php include "./nav.php"; ?>
<div class="search_bar">
<form action="" autocomplete=off>
<button type="submit">
<img src="./resources/search_icon.png">
</button>
<input type="text" name="search" placeholder="Im Shop suchen">
</form>
</div>
<div class="shop">
<?php
for($row = 0; $row < sizeof($product_name); $row++)
if($product_price[$row][0] > 0)
$price = $product_price[$row][0] . "€";
elseif($product_price[$row][0] == 0)
$price = "Kostenlos";
//Search for term
if(isset($_GET["search"]) && $_GET["search"] != "")
$search_filter = $_GET["search"];
else
goto search;
if(stripos($product_name[$row], $search_filter) !== false)
search:
echo '
<div class="shop_item">
<form action="./product.php">
<button type="submit" name="id" value="'.$row.'">
<div class="store_image">
<img src="shop/product_img/'.$product_name[$row].'/Shop.jpg" class="primary">
<div class="logo_wrapper">
<div class="logo">
<img src="shop/product_img/'.$product_name[$row].'/Logo.png" class="logo">
</div>
</div>
</div>
<div class="details_wrapper">
<span class="details">
<h1> '.$product_name[$row].' </h1>
<p> <dev> '.$product_developer[$row].' </dev> </p>
</span>
<span class="price">
<price> '.$price.' </price>
</span>
</div>
</button>
</form>
</div>
';
?>
</div>
<?php include "./footer.php"; ?>
</body>
</html>
php html
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I'm currently working on an online shop for school where the goal is to dynamically display a bunch of items to buy. You should then be able to click on the item to see page where all the informations of the items are displayed (without creating a new webpage for every item).
We shouldn't use any databank yet, that's why I stored all of the attributes in an array that I then include.
On top of that everything should be in HTML, CSS and PHP only.
This is the code for the shop page. It runs through every item in the array and displays the image with the logo, name, price and so on.
Sine this is my first time with web development I'm not sure if the code is good like this. What can I do improve my code and get close to something you would actually see in the industry?
You can download the whole shop here. This is the index page of the shop:
<?php
include 'shop/productlist.php';
?>
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<title> Shop </title>
</head>
<body>
<?php include "./nav.php"; ?>
<div class="search_bar">
<form action="" autocomplete=off>
<button type="submit">
<img src="./resources/search_icon.png">
</button>
<input type="text" name="search" placeholder="Im Shop suchen">
</form>
</div>
<div class="shop">
<?php
for($row = 0; $row < sizeof($product_name); $row++)
if($product_price[$row][0] > 0)
$price = $product_price[$row][0] . "€";
elseif($product_price[$row][0] == 0)
$price = "Kostenlos";
//Search for term
if(isset($_GET["search"]) && $_GET["search"] != "")
$search_filter = $_GET["search"];
else
goto search;
if(stripos($product_name[$row], $search_filter) !== false)
search:
echo '
<div class="shop_item">
<form action="./product.php">
<button type="submit" name="id" value="'.$row.'">
<div class="store_image">
<img src="shop/product_img/'.$product_name[$row].'/Shop.jpg" class="primary">
<div class="logo_wrapper">
<div class="logo">
<img src="shop/product_img/'.$product_name[$row].'/Logo.png" class="logo">
</div>
</div>
</div>
<div class="details_wrapper">
<span class="details">
<h1> '.$product_name[$row].' </h1>
<p> <dev> '.$product_developer[$row].' </dev> </p>
</span>
<span class="price">
<price> '.$price.' </price>
</span>
</div>
</button>
</form>
</div>
';
?>
</div>
<?php include "./footer.php"; ?>
</body>
</html>
php html
php html
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 mins ago
LucasOeLucasOe
11
11
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
LucasOe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
LucasOe is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217033%2fonline-shop-that-dynamically-displays-items-in-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
LucasOe is a new contributor. Be nice, and check out our Code of Conduct.
LucasOe is a new contributor. Be nice, and check out our Code of Conduct.
LucasOe is a new contributor. Be nice, and check out our Code of Conduct.
LucasOe is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217033%2fonline-shop-that-dynamically-displays-items-in-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown