LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   colour selected columns using php sessions? (https://www.linuxquestions.org/questions/programming-9/colour-selected-columns-using-php-sessions-443389/)

ati 05-10-2006 05:47 AM

colour selected columns using php sessions?
 
hi all

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

php:
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:

html:
[HTML]
<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>
</select>/>favourite_instrument[/HTML]


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?
http://img293.imageshack.us/img293/7974/sas6vn.jpg

thanks for your time :injured:

ati 05-10-2006 08:30 AM

hi

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


thanks


All times are GMT -5. The time now is 11:30 AM.