LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   creating tr fields according to session values? (https://www.linuxquestions.org/questions/programming-9/creating-tr-fields-according-to-session-values-442783/)

ati 05-08-2006 09:43 AM

creating tr fields according to session values?
 
hi

here is my code for the question first:

PHP Code:

fwrite($handle,'<tr><th>county_UA</th><th>pop_code</th><th>favourite_instrument</th>       <th>bbb</th><th>id</th><th>fruit</th><th>prizes</th><th>fguk_code</th><th>fgeu_code</th></tr>'."\n"); 

this codes writes the rows for the table which looks like this:

[HTML]
<table id="tab" border="5">
<tr><th>county_UA</th><th>pop_code</th><th>favourite_instrument</th> <th>bbb</th><th>id</th><th>fruit</th><th>prizes</th><th>fguk_code</th>
<th>fgeu_code</th></tr>
[/HTML]

is there way using sessions could do this according to the value of sessions:

so a session value contains county_ua it will write <th>county_UA</th>.

i have done similar but it works fine but not for this:

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");
                   }

                if (isset(
$_SESSION['checkbox4'])) {
                  
fwrite($handle,'<td><xsl:value-of select="favourite_instrument"/></td>'."\n");
                   } 

this basicaly says if the session checkbox4 contains that value print or write this code.

something similar to that would be great.

thanks for the time

ruh31 05-09-2006 06:23 AM

Hi!

Code:

is there way using sessions could do this according to the value of sessions:

so a session value contains county_ua it will write <th>county_UA</th>.

If the variable $_SESSION[county] contains that text that you want to replace "county_UA" with, then you couldjust write
PHP Code:

echo "<th>" $_SESSION[county] . "</th>"

Hope that helps ...

ati 05-09-2006 06:31 AM

Quote:

Originally Posted by ruh31
Hi!

Code:

is there way using sessions could do this according to the value of sessions:

so a session value contains county_ua it will write <th>county_UA</th>.

If the variable $_SESSION[county] contains that text that you want to replace "county_UA" with, then you couldjust write
PHP Code:

echo "<th>" $_SESSION[county] . "</th>"

Hope that helps ...


thats great thanks

would you also mind looking at this thread please?

where greamef soloution starts about this!

i,m trying to set a colour to the field picked bith by the user via sessions, look at the bottom of the thread and page 2.

there is also pic of the desired effect.

http://www.linuxquestions.org/questi...d.php?t=442728

thanks again

ruh31 05-09-2006 06:40 AM

Oh, I am sorry, but this other thread seems too confusing for me right now. I scaned through it but I suppose I will not be able to help you, sorry for that!

ati 05-09-2006 06:43 AM

hi

no problem, thanks for looking i think i should start another one as i want to solve this as quick as i can.

thanks again

ruh31 05-09-2006 06:45 AM

Okay, you can send me an email if you have started that new thread, maybe that one will seem more clear to me ... at least I can have a look at it ;)

ati 05-09-2006 03:45 PM

@ ruh31

here is the thread

http://www.linuxquestions.org/questi...d.php?t=442888


All times are GMT -5. The time now is 02:00 PM.