I'm trying to store an array of checkbox values into a session array, sort of like a shopping cart, but I can't figure out how to not overwrite the sessions array each time new checkbox values are added to the stored session...
Here is an array that is created upon submitting with two checkboxes checked:
Code: Array
(
[0] => 606613
[1] => 606614
)
And then my sessions array is now like so:
Code: Array
(
[checked] => Array
(
[0] => 606613
[1] => 606614
)
)
The code for that so far is this:
<?php
if (!isset($_SESSION['checked'])) {
$_SESSION['checked'] = array();
}
$_SESSION['checked'] = $_GET['new_checked'];
?>
I know I probably need to add a loop that checks the arrays, but I just can't think how I should go about adding newly checked checkbox values, that are not duplicates, to the *end* of the session array "checked"??
Would anybody care to share some ideas?
php sessions,logouts & the bloomin back button!
Hi All,I've got a cms that members can log into. When they logout, the session is destroyed, however, if you click the back button, you can get back into the CMS.How can I get around this?My logout
Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages so thought it'd be easier to just make all pages .php, however when i upload and try and view, in
why aint this working?
i have this code:Code: $num = 250; $count = ($num - $rcount); echo $rcount; echo ""; echo $count;when i echo $rcount it gives me 153...so my calculations is 250-153 = 97.but
Please help with code for SMTP authenticated PHP email form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authentication. They hosting service sent me this link: http://email.about.com/od/emailprogramm ...
Return X values where an ID number doesnt matter
Well as for subject heading, thats the best i could think of.Currently im having a problem with a rather old piece of script i had written for a guestbook.The guestbook itself relies completely on the
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignored, rejected, or misunderstood in this forum. I'm surprised there isn't already any
Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of the important topics in PHP.
server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase connection failure
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I
CHECH A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect and start from next sentenceI am splitting into two sentences"This is first sentence." This