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?
FTP issues
Hi all,I am currently facing some serious problems with a script and really need some advise before I am actually sick To give you a brief overview of the situation, I have a script which is going to
Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs eachI'm having SOOOOOOOOO much trouble with it... it's supposed to work! >,<I get the right
Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a small web application where I want to make sure the data presented on a page (currently an HTML file)
type check while uploading
Hi Everyone,How can I check the exact type of a file while uploading on my site?Here is the scenario:I have allowed only .jpg, .gif, .png files to be uploaded on my site. Suppose an user renames his
Something like an INI editor or a DelimitedText-Editor
Hi all,Am very, very, very new to PHP and not sure if I should be posting this to a Javascript or PHP forum so I posed the question on both FORUM.Basically, I am looking for something like an INI
Weird problem with SELECT command..Help!
Hi!It seems I'm having a really weird problem with SQL SELECT command....I have table into a mySQL DB wich as 4 entry in it. I created the select command to retrieve the data and only 3 of the 4 entry
New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understand simple arrays, associative arrays, and multidimensional arrays also. The book I am reading
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or should i always put a die() function underneath the header() function?
Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.The problem I have, is getting php to access the php session. It gives me a persmission error. It seems the
PHP header help!
Hi all I am trying to get this php page to refresh every 5 seconds on my phone which is an aastra 480i IP desk phone.The code below the header line displays a menu on my phone. That works fine so no