OK I tried to look through possible duplicates but didn't help
Now , I have a coffee website mainly built in HTML 4 and CSS3, JavaScript and a bit of php. What I did is on a page named coffee.html
I created a picture. When I click on it a cookie
is created.
I have 8
such images on one page like coffee.html
and I have 4
such pages.
That means I can create 8 x 4 = 32 cookies
.
On orders page where I can see what are the items I ordered. I used
<?php
if($_COOKIE['cup1'])
{echo "<img src='img//coffee69.png' width='10%' onClick='erasec1()'>";}
if($_COOKIE['cup2'])
{echo "<img src='img//coffee131.png' width='10%'>";}
if($_COOKIE['cup3'])
{echo "<img src='img//hot drink64.png' width='10%'>";}
if($_COOKIE['cup4'])
{echo "<img src='img//caffeine1.png' width='10%'>";}
if($_COOKIE['cup5'])
{echo "<img src='img//tea24.png' width='10%' onClick='erasec1()'>";}
if($_COOKIE['cup6'])
{echo "<img src='img//coffee20.png' width='10%'>";}
if($_COOKIE['cup7'])
{echo "<img src='img//cup31.png' width='10%'>";}
if($_COOKIE['cup8'])
{echo "<img src='img//coffee34.png' width='10%'>";}
?>
This is only for first 8 cookies. like that I will have 24 more cookies. So my Question is
From the start I don't have something set for those cookies
and that's why it shows error messages ugly error messages
Notice: Undefined index: cup1 in /opt/lampp/htdocs/cafe/orders.php on line 56`
and that sucks.
I will leave a few screen shots to go through. and a download link for my code.