LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 05-07-2006, 04:45 AM   #1
ati
Member
 
Registered: Oct 2005
Location: london
Distribution: fedora 4
Posts: 61

Rep: Reputation: 15
for loop to retrieve info and write approbiate line of code?


hi all

here are all my cookies and sessions: there are many more

PHP Code:
    $_SESSION['checkbox2'] = $_POST['checkbox2'];
    
$_SESSION['checkbox3'] = $_POST['checkbox3'];
    
$_SESSION['checkbox4'] = $_POST['checkbox4'];

$_COOKIE['checkbox0'] = $_POST['checkbox0'];
    
$_COOKIE['checkbox1'] = $_POST['checkbox1'];
    
$_COOKIE['checkbox2'] = $_POST['checkbox2']; 


i am retrieving info from page 1 to page 2 using cookies and sessions, so for example i have these check boxes: there also many more check boxes

[HTML]
<input type="checkbox" name="checkbox2" value="1st_name" />1st_name
<input type="checkbox3" name="checkbox3" value="2nd_name" />2nd_name
<input type="checkbox4" name="checkbox4" value="3rd_name" />3rd_namet[/HTML]

once ticked it will show their values on the next page which page2.php.

i.e:

Micheal Jordan Junior

or if one box ticked depending which one it will only show

i.e Micheal or Jordan or Junior

from these values that are saved in the cookies or sessions, i think sessions as it will be easier i want to use a FOR a loop and IF statement to say if you see this value write this line to file
which is in my xsl

i.e like: here is my xsl so far:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="first.css"/>
<link rel="stylesheet" type="text/css" href="second.css"/>
</head>
<body id="contents">

<h1>Joint Wes_ica Tables</h1>
<table id="tab" border="5">
<tr><th>1st_name</th><th>2nd_name</th><th>3rd_name</th>

<xsl:for-each select="newdata/data1">
<xsl:sort select="1st_name"/>
<tr>
<td><xsl:value-of select="1st_name"/></td>
<td><xsl:value-of select="2nd_name"/></td>
<td><xsl:value-of select="3rd_name"/></td>

</tr>
</xsl:for-each>

</table>

</body>
</html>
</xsl:template>
</xsl:stylesheet>
and this is sorting by first name and displaying all the fields, but i want some times to write a line to only display that particular field and the same sort for example.



can some one please help me with this if its possible, thanks for your time and effort.





so basicaly in another words:

The information that are retreived from the first page and then saved into cookis or sessions needs to be used on page 3 to choose what elements of the XSL style sheet are to be written to the file. For example on the third page you would run an if statement to see if the display 1st_name box was ticked, if not then dont write any of the lines relating to the 1st_name.

thanks
 
Old 05-07-2006, 11:04 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,013

Rep: Reputation: 83
check out the XSL if function: http://www.w3schools.com/xsl/xsl_if.asp
 
Old 05-07-2006, 11:07 AM   #3
ati
Member
 
Registered: Oct 2005
Location: london
Distribution: fedora 4
Posts: 61

Original Poster
Rep: Reputation: 15
thanks for that, is the thread clear or hard to understand as i havent had any feedback at all
 
  


Reply


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
Retrieve receiving interface info using ancillary fabdouze Programming 0 12-21-2005 02:00 PM
Retrieve Window ID in command line.. joely2k Linux - General 3 11-26-2005 11:44 AM
help trying to retrieve info from raid or another hge3 newusermike Linux - Newbie 4 07-30-2005 06:46 PM
Best way to retrieve system and hardware info vharishankar Programming 5 04-11-2005 06:29 AM
Authenticatin Service cannot retrieve authentication info sdandeker Linux - Security 3 04-03-2004 12:51 AM


All times are GMT -5. The time now is 08:23 AM.

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