This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop.php
82 lines (63 loc) · 2.92 KB
/
top.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php //alternate scroll slide
session_start();
include_once "assembly.css";
ob_start();
$conn=mysql_connect("localhost","root","")or die("could not set connectn");
mysql_select_db("shop");
$ses_id = session_id();
$_session['user']=$ses_id;
$query="create table $ses_id(icode varchar(10),iname varchar(20),idescriptn varchar(50),price int(5),quantity int(100))";
mysql_query($query);
$query="ALTER TABLE $ses_id ADD PRIMARY KEY(icode)";
mysql_query($query);
?>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<meta name="viewport" content="width=divice-width, initial-scale=1.0" />
</head>
<header class="mainHeader" >
<nav><ul>
<li class="active" ><a href="http://localhost/shopping/index.php?flag=cart">CART
<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db('shop');
$tabname=session_id();
$sel="SELECT * FROM ".$tabname;
$data= mysql_query($sel);
$total_item=0;
if($data)
{ while(mysql_fetch_array( $data ))
{
$total_item+=1;
}
}
echo '('.$total_item.')';
mysql_close($conn);
?>
</a></li>
<li title="HOME"><a href="http://localhost/shopping/start.php" >home</a></li>
<li title="about the origin of dis e-shopping"><a href="#">about us</a></li>
<li title="ALL Mobiles"><a href="http://localhost/shopping/mobile.php?flag=m">mobile</a></li>
<li title="ALL Camera's"><a href="http://localhost/shopping/camera.php?flag=c">camera</a></li>
<li title="ALL Books"><a href="http://localhost/shopping/books.php?flag=b">books</a></li>
<li title="Login from here"><a href="http://localhost/shopping/login.php">LOGIN</a></li>
<li title="Sign up from here"><a href="http://localhost/shopping/login.php?check=1">sign up</a></li>
<li title="YOU can contact us 24/7"><a href="http://localhost/shopping/index.php?flag=3">contact us</a></li>
</ul></nav>
</header>
<br><br>
<header class="top">
<nav class="guest">
<a href=" http://localhost/shopping/index.php?flag=shopping "><b>SMART E-SHOPPING</b></a>
<?php
if(isset($_COOKIE['name']))
echo '<br><marquee behavior="scroll" width="300px">Welcome Mr/Ms '.$_COOKIE['name'].'</marquee><u><a href="logout.php" >LOGOUT </a></>';
else
echo '<br><marquee behavior="alternate">Welcome Guest</marquee>';
?>
</nav>
</header>
<?php include_once"search.php";
?>
<?php ob_flush(); ?>