Wrox Programmer Forums
|
Wrox Book Feedback A forum to submit feedback on Wrox books if other forums on P2P have been unable to address your book-specific needs. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Wrox Book Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 29th, 2003, 04:39 PM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning PHP4 Chapter 8

Well the script for the sessions (pagecount) script works fine. Ive attempted to adapt it for a shopping cart, whihc works, you can add items to your basket, and icrements the GLOBAL that are registered for the session. The problem Im having is deleteing or rather re assigning values to the .$GLOBAL["item${itemid}"]. where $itemid is the global variable i wish to reset to "".
It works fine if i do the last item i added :D, but if you take anything else and deltete it makes all the variables after it 0 aswell, and only reduces the itemcount by 1 :(
this is what i tried to use:

<?
if($delitem=1) {
$GLOBALS["item${itemid}"]="";
$GLOBALS["itemnumber"]=($GLOBALS["itemnumber"]-1);
}
?>

where item id is the item i want to delete.

http://www.sabdesign.co.uk/gls/index.htm

will take you into the shop (items are only in shin guards and gloves)
Any tips would be really helpful? Ive even tried moving it onto a seperate page, with no success :(
Reply With Quote
  #2 (permalink)  
Old July 12th, 2003, 12:12 AM
Registered User
 
Join Date: May 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
pls post ur query on the "Biginning PHP4" forum under the "Books" category.

Devinder Yadav
VC++\VBA\C++
Wiley Support Team
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning PHP4 chapter 8 jaapzwaan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 January 26th, 2004 03:50 PM
Beginning PHP4 chapter 8 jaapzwaan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 January 26th, 2004 03:48 PM
Beginning PHP4 chapter 8 jaapzwaan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 January 22nd, 2004 08:56 AM
Beginning PHP4 keithu1 Wrox Book Feedback 1 October 1st, 2003 07:05 AM
Beginning php4 wjt11 All Other Wrox Books 0 June 12th, 2003 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.