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?
Send inserts to mysql thru port 80
Hi!I have an application that must do some inserts in a mysql db. This db is behind a firewall, and only port 80 is available.My first thougt is to use xml or csv, and in some way parse that using
Using CSS to format MySQL query
Hi,If i want to have a news page on my site, which displays all records of a table in descending order by date I am using the below code. I can display it all in a big table but this is a bit boring.
Best way to read this text file.
Hi.I am planning to make a small application in C# to convert the players from Football manager 2010 game into Fifa 10 game.I have this text file exported from
Why doesn't this work? (SSH2)
This is my script:Code: <?php$connection = ssh2_connect('213.251.167.109', 22);ssh2_auth_password($connection, 'root', 'MGdgfskc');$stream = ssh2_exec($connection, 'useradd -d /home/users/test
why isn't this PHP code working ???
it's suppose to find a name on the database. <?php $s = $_POST["lname"]; $x = trim($s); $exists = false; $selectedRow = 0; mysql_connect (localhost,testuser,testuser);
Character increment
Hi,I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc....The container where i am displaying this is being dynamically generated using jquery.Any help?
Create a form of 2 numbers input and find the greatest.
Hi, everybody.I have a homework in my training of php, which ask you to make a form that asks you to input 2 numbers and so tell you which number is greater than the other.I need to know how to make
Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to put the CRON code do I put it in the header between the head tags? do I put it before any html code?
Printing issues with xMII 11.5
For some reason, we have one report (and only one) that is giving us fits when trying to print. The user has JRE 1.4.2_13 installed. When he clicks the print button, IE freezes, and nothing prints.
Delete Client 066 Earlywatch
Hi all,