Welcome to the most active Linux Forum on the web.
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-07-2006, 04:45 AM   #1
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

<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.


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:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="/">
<html xmlns="" xml:lang="en">
<link rel="stylesheet" type="text/css" href="first.css"/>
<link rel="stylesheet" type="text/css" href="second.css"/>
<body id="contents">

<h1>Joint Wes_ica Tables</h1>
<table id="tab" border="5">

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



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.

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

Rep: Reputation: 97
check out the XSL if function:
Old 05-07-2006, 11:07 AM   #3
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


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:30 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