Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-10-2006, 06:47 AM   #1
Registered: Oct 2005
Location: london
Distribution: fedora 4
Posts: 61

Rep: Reputation: 15
colour selected columns using php sessions?

hi all

i have this code that creates all these columns using checkboxes,

PHP Code:
if (isset($_SESSION['checkbox2'])) {
fwrite($handle,'<td><xsl:value-of select="county_UA"/></td>'."\n");
if (isset(
$_SESSION['checkbox3'])) {
fwrite($handle,'<td><xsl:value-of select="pop_code"/></td>'."\n");

this produces:
[HTML]<td><xsl:value-of select="county_UA"/></td>
<td><xsl:value-of select="pop_code"/></td>[/HTML]

i want be able to have the ability to give the user to colour the columns they require using dropdownlist for the fields and radiobuttons for colours:

<input type="radio" name="radiobutton1" value="chocolate" />chocolate
<input type="radio" name="radiobutton1" value="forestgreen" />forestgreen
<input type="radio" name="radiobutton1" value="turquoise" />turquoise
<br />
<select name="dropdown">
<option value="county_UA">county_UA</option>
<option value="pop_code">pop_code</option>
<option value="favourite_instrument">favourite_instrument</option>
<option value="bbb">bbb</option>
<option value="id">id</option>
<option value="fruit">fruit</option>
<option value="prizes">prizes</option>
<option value="fguk_code">fguk_code</option>
<option value="fgeu_code">fgeu_code</option>

can that be done?, baring in mind that all thevalues for these checkboxes are in sessions.

here is quick picture of the sort of thing i want to achieve?

thanks for your time :injured:

Last edited by ati; 05-10-2006 at 08:34 AM.
Old 05-10-2006, 09:30 AM   #2
Registered: Oct 2005
Location: london
Distribution: fedora 4
Posts: 61

Original Poster
Rep: Reputation: 15

i have got something here but i,m getting errors everywhere may be its just bad syntax or just totaly wrong:

PHP Code:
if (isset($_SESSION['radiobutton1']))
if (
$_SESSION['radiobutton1'] == 'chocolate');
$colour "#D2691E";
else if (
$_SESSION['radiobutton1'] == 'forestgreen');
$colour "#228B22";
else if (
$_SESSION['radiobutton1'] == 'turquoise');
$colour "#00DED1";

if (isset(
$_SESSION['checkbox10'])) {
fwrite($handle,'<td><xsl:value-of select="fgeu_code"/></td>'."\n");
$_SESSION['dropdown'] == "fgeu_code") {
fwrite($handle,'<td bgcolor=\"$colour\"><xsl:value-of select="fgeu_code"/></td>'."\n");



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
display field by colour chosen using sessions? ati Programming 5 05-12-2006 03:16 AM
sessions in PHP zowey Programming 2 12-26-2004 07:35 PM
Problem with php sessions sashhoney Linux - Software 7 08-28-2003 08:30 AM
Apache PHP and sessions Satriani Programming 0 04-21-2003 12:55 PM
PHP Sessions RecoilUK Programming 1 04-21-2002 06:57 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration