NOTE: not sure this is done right or if there is other places in webid it has to be done,
this is part of comment to the will this script be completely rewritten from scratch?
Removed! the code as some actual thinking this example was a mod.
Results 1 to 10 of 10
-
29-04-2012, 09:23 AM #1
Session variables is not removed from memory
Last edited by Dahlsvarehus.com; 04-05-2012 at 08:00 AM.
-
29-04-2012, 11:53 AM #2Junior Member
- Join Date
- Apr 2012
- Posts
- 28
Sorry, to clarify this issue -
$_SESSION['SELL_array'] means to put your SELL_action, SELL_payment etc into a single array like so:
$_SESSION['SELL_array'] = array(
'payment' => 'etc',
'action' => 'etc'
);
Then, you can simply unset them all by unsetting the entire array. This also allows you to better manage the entire data for an auction, serialize that data between requests, and easily store it for later. It is better practice.
Not just that, because when you delete you use $_SESSION['blah'] = ''; you're control structures are messy. It should be:
if(isset($_SESSION['SELL_array']['action']))
not:
if(!empty($_SESSION['SELL_action']))
You can also move all this into objects and make it even more manageable.
With a well designed object, this could turn into:
$auction->loadData($_SESSION['SELL_array']);
if($auction->getPayment())
This then gives you the opportunity to reuse entire blocks of code, and will only make it more easier on yourselves, the developers, to further expand the script.Last edited by interdummy; 29-04-2012 at 11:56 AM.
-
29-04-2012, 11:58 AM #3
-
29-04-2012, 12:00 PM #4Junior Member
- Join Date
- Apr 2012
- Posts
- 28
-
03-05-2012, 08:18 PM #5Member
- Join Date
- Apr 2012
- Posts
- 44
so if im understanding you correctly you are saying replace all that with this
PHP Code:$_SESSION['SELL_array'] = array(
'payment' => '',
'action' => '',
'starts' => '',
'UPLOADED_PICTURES' => array(),
'with_reserve' =>'',
'reserve_price' =>'',
'minimum_bid' => '',
'file_uploaded' => '',
'title'=> '',
'subtitle' => '',
'description' => '',
'pict_url' => '',
'pict_url_temp' => '',
'atype' => '',
'iquantity' =>'',
'with_buy_now' => '',
'buy_now_price' => '',
'duration' => '',
'relist' => '',
'increments' => '',
'customincrement' => 0,
'shipping' => '',
'shipping_terms' => '',
'payment' => '',
'international' => '',
'buy_now_only' => '',
'action' => '',
'shipping_cost' => 0,
'is_bold' => 'n',
'is_highlighted' => 'n',
'is_featured' => 'n',
'start_now' => '1'
);
Last edited by carls1976; 03-05-2012 at 09:31 PM.
-
03-05-2012, 08:33 PM #6
-
03-05-2012, 09:35 PM #7
-
04-05-2012, 12:50 AM #8
-
04-05-2012, 08:41 AM #9Member
- Join Date
- Apr 2012
- Posts
- 44
-
04-05-2012, 08:48 AM #10
Dont know mate but thats what the bloke that made the original post said needs doing.
I supose if your confident enough that you could use it then why not use it, think dahl was refering to himself and folk like me that dont know how to code.Last edited by nay27uk; 04-05-2012 at 08:53 AM.
100%Webid Ready Hosting | Fleamart.co.uk the UK's 10p Auction Site



Reply With Quote

Bookmarks