Documente Academic
Documente Profesional
Documente Cultură
(https://www.facebook.com/g
(https://twitter.com/w3p
(https://plus.googl
(http://www.w3programmers.com/)
HOME (HTTP://WWW.W3PROGRAMMERS.COM/)
CATEGORIES (HTTP://WWW.W3PROGRAMMERS.COM/#)
Categories
Android Application
Development
(http://www.w3program
mers.com/category/andr
oid-apps-development/)
ADMINISTRATOR PAGES
Angular JS
(http://www.w3program
mers.com/category/angu
lar-js-2/)
CakePHP
(http://www.w3program
mers.com/category/cake
simple. The primary function for the admin is to view and confirm
php/)
CODEIGNITER
(http://www.w3program
<?php
session_start();
require("config.php");
if(isset($_SESSION['SESS_ADMINLOGGEDIN'])
== TRUE) {
8
9 header("Location: " . $config_basedir);
mers.com/category/code
igniter/)
Drupal
(http://www.w3program
mers.com/category/drup
al/)
Facebook
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
if($_POST['submit'])
$loginres = mysql_query($loginsql) or
die(mysql_error());
$numrows = mysql_num_rows($loginres);
if($numrows == 1)
$loginrow = mysql_fetch_assoc($loginres);
session_register("SESS_ADMINLOGGEDIN");
$_SESSION['SESS_ADMINLOGGEDIN'] = 1;
else
else
require("header.php");
if(@$_GET['error'] == 1) {
?>
<p>
<table>
(http://www.w3program
mers.com/category/face
book1/)
FAT FREE FRAMEWORK
(http://www.w3program
mers.com/category/fatfree-framework/)
HTML and CSS
(http://www.w3program
mers.com/category/html
-and-css/)
JAVASCRIPT
(http://www.w3program
mers.com/category/java
script/)
Joomla
(http://www.w3program
mers.com/category/joo
mla/)
JQUERY and AJAX with
PHP
(http://www.w3program
mers.com/category/jque
ry-and-ajax-with-php/)
JSON, XML and Web
Services
(http://www.w3program
mers.com/category/jsonxml-and-web-services/)
Laravel
(http://www.w3program
mers.com/category/larav
el/)
Magento
(http://www.w3program
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<tr>
<td>Username</td>
</tr>
<tr>
<td>Password</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
<?php
require("footer.php");
?>
Much of this code should look familiar to you. When the admin has
mers.com/category/mag
ento/)
MySQL Tutorial
(http://www.w3program
mers.com/category/mys
ql-tutorial/)
PHP
(http://www.w3program
mers.com/category/php/
)
PHP & MySQL Basics
(http://www.w3progr
ammers.com/categor
y/php/php-mysqlbasics/)
PHP & MySQL
Projects
(http://www.w3progr
ammers.com/categor
y/php/php-mysqlprojects/)
created.
and Numbers
(http://www.w3progr
<?php
session_start();
require("config.php");
session_unregister("SESS_ADMINLOGGEDIN");
?>
ammers.com/categor
y/php/php-arraysstrings-andnumbers/)
PHP Date Time and
RegEx
(http://www.w3program
mers.com/category/phpdate-time-and-regex/)
PHP Design patterns
(http://www.w3program
mers.com/category/php-
design-patterns/)
Programming
some tables. The script has two primary states: either displaying
(http://www.w3program
mers.com/category/php-
you pass the page func=conf GET variable and the order number,
object-oriented-
programming/)
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
<?php
session_start();
require("config.php");
require("functions.php");
if(isset($_SESSION['SESS_ADMINLOGGEDIN'])
== FALSE) {
if(isset($_GET['func']) == TRUE) {
if($_GET['func'] != "conf") {
$validid =
pf_validate_number($_GET['id'],"redirect",
$config_basedir);
mysql_query($funcsql);
else {
require("header.php");
mers.com/category/phppdo-and-mysqli/)
PHP Security and
Exceptions
(http://www.w3program
mers.com/category/phpsecurity-and-exceptions/)
Python
(http://www.w3program
mers.com/category/pyth
on/)
SASS and LESS
(http://www.w3program
mers.com/category/sass
-and-less/)
Standard PHP Library
(SPL)
(http://www.w3program
mers.com/category/stan
dard-php-library-spl/)
Symfony
38
39 $orderssql = "SELECT * FROM orders WHERE
status = 2";
40
41 $ordersres = mysql_query($orderssql);
42
43 $numrows = mysql_num_rows($ordersres);
44
45 if($numrows == 0)
46
47 {
48
49 echo "<strong>No orders</strong>";
50
51 }
52
53 else
54
55 {
56
57 echo "<table cellspacing=10>";
58
59 while($row = mysql_fetch_assoc($ordersres))
60
61 {
62
63 echo "<tr>";
64
65 echo "<td>[<a href='adminorderdetails.php?
id=" . $row['id']. "'>View</a>]</td>";
66
67 echo "<td>". date("D jS F Y g.iA",
strtotime($row['date'])). "</td>";
68
69 echo "<td>";
70
71 if($row['registered'] == 1)
72
73 {
74
75 echo "Registered Customer";
76
77 }
78
79 else
80
81 {
82
83 echo "Non-Registered Customer";
84
85 }
86
87 echo "</td>";
88
89 echo "<td>£" . sprintf('%.2f',
90
91 $row['total']) . "</td>";
92
93 echo "<td>";
94
95 if($row['payment_type'] == 1)
96
97 {
98
99 echo "PayPal";
100
101 }
(http://www.w3program
mers.com/category/symf
ony/)
Twitter Bootstrap
(http://www.w3program
mers.com/category/twitt
er-bootstrap/)
Useful PHP Functions
and Features
(http://www.w3program
mers.com/category/usef
ul-php-functions-andfeatures/)
WordPress
(http://www.w3program
mers.com/category/basi
c-wordpress-tutorial/)
YII
(http://www.w3program
mers.com/category/yii/)
Zend Framework 2.x
(http://www.w3program
mers.com/category/zend
-framework-2-x/)
Latest Posts
Dive into Python
(http://www.w3program
mers.com/dive-intopython/)
Getting Started Python
(http://www.w3program
mers.com/gettingstarted-python/)
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
else
echo "Cheque";
echo "</td>";
echo "</tr>";
echo "</table>";
require("footer.php");
?>
<?php
session_start();
require("config.php");
require("functions.php");
if(isset($_SESSION['SESS_ADMINLOGGEDIN'])
== FALSE) {
SonataAdminBundle of
Symfony2
(http://www.w3program
mers.com/sonataadminb
undle-of-symfony2/)
FOSUserBundle of
Symfony2
(http://www.w3program
mers.com/fosuserbundle
-of-symfony2/)
Magento Extension
Development Part-2
(http://www.w3program
mers.com/magentoextension-developmentpart-2/)
Magento Extension
Development Part-1
(http://www.w3program
mers.com/magentoextension-developmentpart-1/)
Magento Theme
Development From
Scratch Part-3
(http://www.w3program
After the usual introductory code, make a check to see if the func
mers.com/magento-
theme-development-
1
2
3
4
5
6
7
8
9
10
11
if(isset($_GET['func']) == TRUE) {
if($_GET['func'] != "conf") {
$validid =
pf_validate_number($_GET['id'],"redirect",
$config_basedir);
12
13 $funcsql = "UPDATE orders SET status = 10
WHERE id = " . $_GET['id'];
scratch-part-3/)
Magento Theme
Development From
Scratch Part-2
(http://www.w3program
mers.com/magentotheme-developmentfrom-scratch-part-2/)
Magento Theme
14
15
16
17
mysql_query($funcsql);
Development From
Scratch Part-1
(http://www.w3program
mers.com/magentotheme-developmentfrom-scratch-part-1/)
Symfony
field to 10.
(http://www.w3program
mers.com/user-
registration-withsymfony/)
orders:
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
else {
require("header.php");
$ordersres = mysql_query($orderssql);
$numrows = mysql_num_rows($ordersres);
if($numrows == 0)
else
while($row = mysql_fetch_assoc($ordersres))
echo "<tr>";
echo "<td>";
if($row['registered'] == 1)
Archives
June 2015
(http://www.w3program
mers.com/2015/06/)
May 2015
(http://www.w3program
mers.com/2015/05/)
February 2015
(http://www.w3program
mers.com/2015/02/)
January 2015
(http://www.w3program
mers.com/2015/01/)
December 2014
(http://www.w3program
mers.com/2014/12/)
November 2014
(http://www.w3program
mers.com/2014/11/)
October 2014
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
83
84
85
86
87
88
89
90
91
92
93
94
95
else
echo "</td>";
$row['total']) . "</td>";
echo "<td>";
if($row['payment_type'] == 1)
echo "PayPal";
else
echo "Cheque";
echo "</td>";
echo "</tr>";
echo "</table>";
require("footer.php");
?>
If all went well, the completed orders summary should look similar
to the page shown Figure 6-9.
(http://www.w3program
mers.com/2014/10/)
July 2014
(http://www.w3program
mers.com/2014/07/)
June 2014
(http://www.w3program
mers.com/2014/06/)
May 2014
(http://www.w3program
mers.com/2014/05/)
March 2014
(http://www.w3program
mers.com/2014/03/)
February 2014
(http://www.w3program
mers.com/2014/02/)
January 2014
(http://www.w3program
mers.com/2014/01/)
December 2013
(http://www.w3program
mers.com/2013/12/)
November 2013
(http://www.w3program
mers.com/2013/11/)
October 2013
(http://www.w3program
mers.com/2013/10/)
September 2013
(http://www.w3program
mers.com/2013/09/)
August 2013
(http://www.w3program
mers.com/2013/08/)
July 2013
(http://www.w3program
mers.com/2013/07/)
(http://www.w3programmers.com/wpcontent/uploads/2012/09/shop6.jpg)
May 2013
(http://www.w3program
mers.com/2013/05/)
April 2013
(http://www.w3program
mers.com/2013/04/)
March 2013
order, she needs to view the specific details for the order. This next
(http://www.w3program
mers.com/2013/03/)
(http://www.w3program
following code:
mers.com/2013/02/)
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
<?php
session_start();
require("config.php");
require("functions.php");
if(isset($_SESSION['SESS_ADMINLOGGEDIN'])
== FALSE) {
$validid =
pf_validate_number($_GET['id'],"redirect",
$config_basedir . "adminorders.php");
require("header.php");
$ordres = mysql_query($ordsql);
January 2013
(http://www.w3program
mers.com/2013/01/)
December 2012
(http://www.w3program
mers.com/2012/12/)
November 2012
(http://www.w3program
mers.com/2012/11/)
October 2012
(http://www.w3program
mers.com/2012/10/)
September 2012
(http://www.w3program
mers.com/2012/09/)
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
83
84
85
$ordrow = mysql_fetch_assoc($ordres);
echo "<tr><td><strong>Date of
order</strong></td><td>" . date('D jS F Y
g.iA',strtotime($ordrow['date'])) . "
</td>";
if($ordrow['payment_type'] == 1)
echo "PayPal";
else
echo "Cheque";
echo "</td>";
echo "</table>";
if($ordrow['delivery_add_id'] == 0)
$addres = mysql_query($addsql);
else
$addres = mysql_query($addsql);
$addrow = mysql_fetch_assoc($addres);
echo "<tr>";
echo "<td><strong>Address</strong></td>";
August 2012
(http://www.w3program
mers.com/2012/08/)
July 2012
(http://www.w3program
mers.com/2012/07/)
June 2012
(http://www.w3program
mers.com/2012/06/)
May 2012
(http://www.w3program
mers.com/2012/05/)
April 2012
(http://www.w3program
mers.com/2012/04/)
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
$addrow['surname'] . "<br>";
echo "<br>";
if($ordrow['delivery_add_id'] == 0)
else
echo "</td></tr>";
echo "<tr><td><strong>Phone</strong></td>
<td>". $addrow['phone'] . "</td></tr>";
echo "<tr><td><strong>Email</strong></td>
<td><a href='mailto:" . $addrow['email'] .
"'>". $addrow['email'] . "</a></td></tr>";
echo "</table>";
$itemsres = mysql_query($itemssql);
$itemnumrows = mysql_num_rows($itemsres);
echo "<th></th>";
echo "<th>Product</th>";
echo "<th>Quantity</th>";
echo "<th>Price</th>";
echo "<th>Total</th>";
while($itemsrow =
mysql_fetch_assoc($itemsres))
144
145 $quantitytotal = $itemsrow['price']*
$itemsrow['quantity'];
146
147 echo "<tr>";
148
149 if(empty($itemsrow['image'])) {
150
151 echo "<td><img
src='./productimages/dummy.jpg' width='50'
alt='". $itemsrow['name'] . "'></td>";
152
153 }
154
155 else {
156
157 echo "<td><img src='./productimages/".
$itemsrow['image'] . "' width='50' alt='".
$itemsrow['name'] . "'></td>";
158
159 }
160
161 echo "<td>" . $itemsrow['name'] . "</td>";
162
163 echo "<td>" . $itemsrow['quantity'] . " x
</td>";
164
165 echo "<td><strong>£" .
sprintf('%.2f',$itemsrow['price']) . "
</strong></td>";
166
167 echo "<td><strong>£" .
sprintf('%.2f',$quantitytotal) . "</strong>
</td>";
168
169 echo "</tr>";
170
171 @$total = $total + $quantitytotal;
172
173 }
174
175 echo "<tr>";
176
177 echo "<td></td>";
178
179 echo "<td></td>";
180
181 echo "<td></td>";
182
183 echo "<td>TOTAL</td>";
184
185 echo "<td><strong>£" .
sprintf('%.2f', $total). "</strong></td>";
186
187 echo "</tr>";
188
189 echo "</table>";
190
191 require("footer.php");
192
193 ?>
This code should look familiar you to you; it simply displays details
from the orders, orderitems, and delivery_addressestables.
The completed page should look like the one shown in Figure 6-10.
(http://www.w3programmers.com/wpcontent/uploads/2012/09/shop7.jpg)
Masud Alam
(http://www.w3programmers.com/author/masud
1985/)
Hi, My name is Masud Alam, love to work with Open Source
Technologies, living in Dhaka, Bangladesh. I graduated in
2009 with a bachelors degree in Engineering from State
University Of Bangladesh, Im also a Certified Engineer on
ZEND PHP 5.3, I served my first five years a number of
leadership positions at Winux Soft Ltd, SSL Wireless Ltd,
CIDA and MAX Group where I worked on ERP software and
web development., but now im a co-founder and Chief
Executive Officer and Managing Director of TechBeeo
Software Consultancy Services Ltd. Im also a Course
Instructor of ZCE PHP 5.3 Certification and professional web
development course at IBCS-PRIMAX Software (Bangladesh)
Limited a leading Training Institute in the country.
(www.facebook.com/profile.php?id=1413202909)
(twitter.com/masudeden)
MUHAMMAD EJAZ
REPLYTOCOM=522#RESPOND)
10 OCTOBER, 2012 AT 5:27 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT522)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
ALLBDLOGMIJAN
(HTTP://WWW.PHPPROGRAMMER.HOST.ORG/WORDPRESS/)
REPLYTOCOM=652#RESPOND)
652)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
VINMEDDIE
REPLYTOCOM=2502#RESPOND)
22 MARCH, 2013 AT 12:00 AM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT2502)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
CHARLES
REPLYTOCOM=12896#RESPOND)
27 AUGUST, 2013 AT 4:08 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT12896)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
VALERIE
REPLYTOCOM=14349#RESPOND)
30 SEPTEMBER, 2013 AT 1:43 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT14349)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
GENE
REPLYTOCOM=17509#RESPOND)
13 JANUARY, 2014 AT 4:40 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT17509)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
DHARMENDRA K RAI
REPLYTOCOM=21550#RESPOND)
3 JULY, 2014 AT 2:00 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT21550)
hi
nice work and also thanks for share experience
in php
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
MARTYN
REPLYTOCOM=22811#RESPOND)
22 SEPTEMBER, 2014 AT 5:49 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT22811)
Hi
This looks exactly what I am after but following
the tutorial I am missing register.php and its
not on any of the 3 pages. ?
Most pages will not open due to some error (I
think its down to some php error )
I click on either of the categories and it just
takes me to a blank white page. When I look at
the source code there is nothing there and the
page is just blank.
This is not the only page the links dont work
with. The same happens when I click on View
basket the same happens.
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
LJUBICA
REPLYTOCOM=23970#RESPOND)
10 DECEMBER, 2014 AT 10:24 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT23970)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
ADEDIVI
REPLYTOCOM=24580#RESPOND)
19 JANUARY, 2015 AT 4:17 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT24580)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
KELVIN
REPLYTOCOM=25163#RESPOND)
1 APRIL, 2015 AT 1:40 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT25163)
REPLY (/BUILD-A-SHOPPING-CART-WITH-PHP-PART-3/?
YASH
REPLYTOCOM=25574#RESPOND)
2 JUNE, 2015 AT 4:49 PM
(HTTP://WWW.W3PROGRAMMERS.COM/BUILD-ASHOPPING-CART-WITH-PHP-PART-3/#COMMENT25574)
Masud Alam,
I have suggestion for you.
please provide project source code and running
demo with every tutorial.
Its helpfull and more effective for new comer
learner
Leave a Reply
YOUR EMAIL ADDRESS WILL NOT BE PUBLISHED. REQUIRED FIELDS
ARE MARKED
*
NAME *
EMAIL *
WEBSITE
(#)
CAPTCHA CODE
*
COMMENT
POST COMMENT