Jump to content

Search the Community

Showing results for tags 'variables'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 17 results

  1. mlitch

    variable variables

    My PHP-generated form file will generate any number of text fields called "recipient"+an integer, so "recipient1", "recipient2", etc The PHP file handling the form submission will not know how many fields there are, so I need to get something like the following logic: $i=1; $max=how many fields there are (it will know this from a mysqli_num_rows variable being passed) while ($i <= $max) { $recipient+$i = $_POST[recipient+$i] } In other words, as long as $i is less than or equal to the maximum number, generate a variable named "recipient" concatenated with $i and assign it the value of $_POST['recipient concatenated with $i']. I can't wrap my little brain around this. Help?
  2. Hi guys, here is what I have: an excel sheet (XLS, 4MB) with postal codes in the first column more data in the other columns here is what I need: looking for the postal code in the excel sheet get the information to this postal code from the other columns work with the other information (use them as variables) example: PC | A | B | C 1234 | 2.3 | 3.5 | 1.1 2345 | 3.3 | 3.3 | 7.8 ---> If I have the postal code 2345, I want to create the variables $a=3.3 ; $b=3.3 ; c=7.8 in PHP here is what I heard about: phpexcel.php php_excelReader here are my questions: What would you recommend (phpexcel.php or php_excelReder or something else)? Is there a tutorial on w3schools (I couldnĀ“t find one)? Can you provide some code? Thanks for your help!
  3. rcampos39

    Migrading from PHP 4+ TO 5.4+

    I am fairly new to PHP and I was tasked with migrading an app that runs on php 4+ enviroment into a 5.4 enviroment and I am getting warnings becasue its very old code, but I also would lie to know if there is a better way of writing the fallowing script of php code. It checks weather a member has attended a course and if so it charges a price if not its a different price and so on. Any help would be very appriciated. <?phpif ($semattend == 'MEMBER-ATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1299" name="amount" size="28">$1,299</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you belong to a member instituion and have completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="MEMBER-ATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Attended Course" name="attended"> <input type="hidden" id = "member" value="Member" name="member">";} elseif ($semattend == 'MEMBER-NOTATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1799" name="amount" size="28">$1,799</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you belong to a member instituion and have not completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="MEMBER-NOTATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Not Attended Course" name="attended"> <input type="hidden" id = "member" value="Member" name="member">"; } elseif ($semattend == 'NONMEMBER-ATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="1599" name="amount" size="28">$1,599</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you do not belong to a member instituion and have completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="NONMEMBER-ATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Attended Course" name="attended"> <input type="hidden" id = "member" value="Non Member" name="member">"; } elseif ($semattend == 'NONMEMBER-NOTATTENDED') {$total = "<tr> <td height="30" align="right"><p><font color="#FF9900">*</font><font size="2">Total: </font></p></td> <td height="30" colspan="3" align="left"><font size="2"><input type="hidden" id = "amount" value="2099" name="amount" size="28">$2,099</font></td> </tr> <tr> <td colspan="3" align="left"><p>Search results indicate that you do not belong to a member instituion and have not completed the Essentials of SEM course</p></td> </tr> <input type="hidden" id = "semstatus" value="NONMEMBER-NOTATTENDED" name=semstatus"> <input type="hidden" id = "attended" value="Not Attended Course" name="attended"> <input type="hidden" id = "member" value="Non Member" name="member">"; }echo $total;?>
  4. jxfish2

    Persistent PHP Variables

    I am using checkboxes to select specific criteria to use within a MySQL query string. In my case, as long as the checkboxes do not change, I want to keep the previously selected checkbox values, and pass them on to any additional page sorting that's done after the initial checkbox selection process. I'm already initializing my MySQL query string successfully, using these checkboxes. But, once I have the data set that I want to work with, I need the ability to re-sort the columns, or refresh the page, based on my initial selection criteria. But, I have not been able to get the initially selected criteria to "persist", when I sort the columns, after the select has finished. How can I take the incoming variables, and make them persistent? How can I take the incoming variables, and pass them to the sort process? Thanks in advance. JCF
  5. I have a working PHP created webpage, that I want to give a data sort option to. Currently, I am calling one of 6 different scripts, to accomplish this data sort routine. If I can just figure out how to pass the sort parameter back to the script itself, so that it will reload the page, using the new sort variable, I can combine all 6 scripts into a single script, making it much easier to maintain. My current button selection code looks like this: <td><form action="Get_Old_Assets_By_Alt.php" method="post"><input type="submit" value="Sort By Alt Code"></input></form></td><td><form action="Get_Old_Assets_By_Title.php" method="post"><input type="submit" value="Sort By Title"></input></form></td><td><form action="Get_Old_Assets_By_Prov.php" method="post"><input type="submit" value="Sort By Provider"></input></form> </td> I want to combine all of the code under a single script called "Get_Old_Assets.php", but I need to pass in one of the following variables: alt title prov I already tried the following: <td><form action="Get_Old_Assets.php?alt" method="post"><input type="submit" value="Sort By Alt Code"></input></form> </td> But, I can't seem to get the script to read in the URL argument. I tried several different things when refreshing the display. Here are a few of my attempts: $OPT=$argv[0]; $OPT=$argv[1]; Nothing! Actually, there were several more, but they're not worth mentioning. Inside of this same script, I want to initialize the variable "OPT", making it the argument that I'm trying to pass to it: Then, I'm trying to use conditional statements to check variable value: if ($OPT == 'alt') { .... } I also tried a "$_POST[name]", to recover the variable, but it didn't work either. This is not supposed to be an interactive prompt. It should only pass a new variable, when one of the button options is selected. Any help would be greatly appreciated.
  6. deldalton

    [SOLVED] Query: JS Variables

    The code below works fine (apart from in Safari but that's a different problem). You can see the working code in action here: http://codepen.io/deldalton/full/mfoIi function expandNav() { var nav = document.getElementById("navBar"); if (nav.className == "collapsed") { nav.className = "expanded"; document.getElementById("navButton").src="images/lightNavUp.png";} else { nav.className = "collapsed"; document.getElementById("navButton").src="images/lightNavDown.png";}}function changeIconOnMouseOver() { if (document.getElementById("navBar").className == "collapsed") { document.getElementById("navButton").src="images/lightNavDown.png";} else { document.getElementById("navButton").src="images/lightNavUp.png";}}function changeIconOnMouseOut() { if (document.getElementById("navBar").className == "collapsed") { document.getElementById("navButton").src="images/darkNavDown.png";} else { document.getElementById("navButton").src="images/darkNavUp.png";}} However, using the following code which is basically the same thing except using global variables instead of "document.getElementById"s all the time, doesn't work. var nav = document.getElementById("navBar");var button = document.getElementById("navButton");function expandNav() { if (nav.className == "collapsed") { nav.className = "expanded"; button.src="images/lightNavUp.png";} else { nav.className = "collapsed"; button.src="images/lightNavDown.png";}}function changeIconOnMouseOver() { if (nav.className == "collapsed") { button.src="images/lightNavDown.png";} else { button.src="images/lightNavUp.png";}}function changeIconOnMouseOut() { if (nav.className == "collapsed") { button.src="images/darkNavDown.png";} else { button.src="images/darkNavUp.png";}} Can anyone tell me why?
  7. Nah-Trowen

    Re-Declaring JavaScript Variables

    Do you have to Re-Declare a variable to assign it a different Data Type?
  8. SinnerSmile

    Sharing variables between users?

    Hello, gentlemen.Can you give me a quick tip about how can i achieve some server side things.Truly i just don't know what i need to learn.What i need, is to be able to send value of some JS variable of user1 to the same JS variable of user2. Value need to be send from user1 if user1's value changed, and user2's function must start as soon as he receives this value.How can i achieve this value transferring between users of my page.Am I moving in right direction with learning ASP.NET Web Pages, or i totally misunderstood their purpose?
  9. Hello,I'm new here and to be honest it's the first time I am writing into a Forum. Until now I was only reading through various posts which considerd the same problem as I had. But now I really have no idea what to search and where my problem is. Down here is the PHP Script I have written for a Prom Vote in a nearby school. It would be really great if someone could find my mistake and correct me. <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <?php$con = mysql_connect("localhost","xxx","xxxxxxxxx");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db(bgschwechat) or die( "Unable to select database");$abfrage = "SELECT * FROM teilnehmer";$ergebnis = mysql_query($abfrage);$abfrage2 = "SELECT * FROM teilnehmer";$ergebnis2 = mysql_query($abfrage2);echo '<script>';echo 'var stimmzahl = array();';echo 'var name = array();';echo '</script>';while($row = mysql_fetch_object($ergebnis)) { echo '<script>'; echo 'stimmzahl['; echo $row->id; echo '] = 0; '; echo 'name['; echo $row->id; echo '_name'; echo '] = '; echo $row->name; echo '; '; echo 'function '; echo $row->id; echo 'plus() {'; echo 'stimmzahl['; echo $row->id; echo ']++; '; echo 'document.getElementById("'; echo $row->id; echo 'result").innerHTML = stimmzahl['; echo $row->id; echo ']; '; echo '}'; echo 'function '; echo $row->id; echo 'minus() {'; echo 'stimmzahl['; echo $row->id; echo ']--; '; echo 'document.getElementById("'; echo $row->id; echo 'result").innerHTML = stimmzahl['; echo $row->id; echo ']; '; echo '}'; echo '</script>'; } echo '<table class="teilnehmer-liste">'; while($row = mysql_fetch_object($ergebnis2)) { echo '<tr>'; echo '<td>'; echo $row->name; echo '</td>'; echo '<td>'; echo '<button id="'; echo $row->id; echo 'plus" onClick= "function '; echo $row->id; echo 'plus()">+</button>'; echo '</td>'; echo '<td>'; echo '<button id="'; echo $row->id; echo 'minus" onClick=" function '; echo $row->id; echo 'minus()">-</button>'; echo '</td>'; echo '<td>'; echo '<div id="'; echo $row->id; echo 'result">/</div>'; echo '</td>'; echo '</tr>';}mysql_free_result($ergebnis);?></table> </body> </html> The PHP Code works pretty fine but I am not happy with the result because the + and - Buttons don't work :/ Here's the result of the PHP Code in HTML : <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <script>var stimmzahl = array();var name = array();</script><script>stimmzahl[1] = 0; name[1_name] = Test Person 1; function 1plus() {stimmzahl[1]++; document.getElementById("1result").innerHTML = stimmzahl[1]; }function 1minus() {stimmzahl[1]--; document.getElementById("1result").innerHTML = stimmzahl[1]; }</script><script>stimmzahl[2] = 0; name[2_name] = Test Person 2; function 2plus() {stimmzahl[2]++; document.getElementById("2result").innerHTML = stimmzahl[2]; }function 2minus() {stimmzahl[2]--; document.getElementById("2result").innerHTML = stimmzahl[2]; }</script><table class="teilnehmer-liste"><tr><td>Test Person 1</td><td><button id="1plus" onClick= "function 1plus()">+</button></td><td><button id="1minus" onClick=" function 1minus()">-</button></td><td><div id="1result">/</div></td></tr><tr><td>Test Person 2</td><td><button id="2plus" onClick= "function 2plus()">+</button></td><td><button id="2minus" onClick=" function 2minus()">-</button></td><td><div id="2result">/</div></td></tr></table> </body> </html> It would be really great if someone could help me I need to find a solution as soon as possible because I only have rare time to finish the project. Thanks in advance. ASavic P.S. Here's the Website Link - http://www.cryze.com/bgschwechat/test.php - sometimes offline because it's in development. ^^
  10. I want to changedomain.com/profile.php?user_id=100todomain.com/Danolike facebook or youtubehow can I do that in ASP classic or JavaScript??
  11. I was able to complete a live search with a T-SQL database similar to the design found here on W3Schools, though now I am running into some difficulties passing multiple arguments/parameters to the JavaScript search page. Basically, we thought it would be a good idea to let people search by just a first name or last name if they wanted, as well as searching by their affiliation. Here is an excerpt from the form that appears to be giving me the problems: <form><input type="text" name="name" id="nameID" size="40" maxlength="64" onKeyUp="showNames('nameID', 'typeID', 'firstLastID')"onblur="if (this.value == '') this.value = this.defaultValue" onFocus="if (this.value == this.defaultValue) this.value = ''"value="Enter a name or a part of a name here"> <br><select name="type" id="typeID" onChange="showNames('nameID', 'typeID', 'firstLastID')"><option value="All">Members & Staff</option><option value="Member">Member</option><option value="Staff">Staff</option></select> <br><select name="firstLast" id="firstLastID" onChange="showNames('nameID', 'typeID', 'firstLastID')"><option value="Both">First & Last Name</option><option value="First">First Name</option><option value="Last">Last Name</option></select></form> Right now the form is passing the literal names of nameID, typeID, and firstLastID when I echo the variables in a separate PHP file. I've tried single quotes (which gives the literal names), double quotes (does not work), and no quotation marks (does not work) around the arguments just to see if that was the culprit, but no luck there. Before using the ID's I had been using "this.value", though unfortunately I couldn't use that any longer once we added the additional arguments to showNames(). Finally, I tried removing all of the arguments from showNames() and collecting the data using "document.getElementByID('...').value" (where '...' is the ID) in the JavaScript function, but that didn't work either. Can anyone help me figure this out? Thank you!
  12. sepoto

    Going global with variables.

    I am trying to figure out how to go global with these variables. This works great: <!DOCTYPE html><html><head><title>My Title</title><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script>$(document).ready(function(){ $('#map').hide(); $("#theyellow").click(function() { $('#map').show();sepysfunction(); }); });//end</script><script type="text/javascript"> function sepysfunction() { //sepysfunction//sepysfunction//sepysfunction//sepysfunction//sepysfunction var mapDiv = document.getElementById('map');var latlng = new google.maps.LatLng(37.09, -95.71); var options = { center: latlng, zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP}; var map = new google.maps.Map(mapDiv, options); /****************************************************/if(document.forms[0].physichaladdress.value != "") { geocoder = new google.maps.Geocoder();var geocoderRequest = { address: document.forms[0].physichaladdress.value } geocoder.geocode(geocoderRequest, function(results, status) {/////////////////////////////////////////////////////////////if(status == google.maps.GeocoderStatus.OK) {map.setCenter(results[0].geometry.location);map.setZoom(14);getData(document.forms[0].physichaladdress.value);}////////////////////////////////////////////////////////////}); }/******************************************************/ }//sepysfunction//sepysfunction//sepysfunction//sepysfunction//sepysfunction</script> <script type="text/javascript">var thedata; function getData(str) { if (str.length==0) {return;}if (window.XMLHttpRequest) {xmlhttp=new XMLHttpRequest();}else {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} ////////////////////////////////////////////////////////xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4 && xmlhttp.status==200) {thedata=xmlhttp.responseText;} }/////////////////////////////////////////////////////// xmlhttp.open("GET","getdata.php?q="+str,true);xmlhttp.send();}</script><style>body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; background: #fff; }#map { width: 100%; height: 500px; border: 1px solid #000; }</style></head><body><form name="mymapgetter"><h3>Enter your physichal address:</h3><input type="text" name="physichaladdress" value="" style="width: 99.5%; margin-left: .25%; margin-right: .25%;"></input><input type="button" id="theyellow" value="getmap" style="width: 100%"></input></form><div id="map"></div><p>To add or comment on locations contact webmaster@wirelessinternetlocations.com</p></body></html> This however breaks the whole program: <!DOCTYPE html><html><head><title>My Title</title><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script>$(document).ready(function(){ $('#map').hide(); $("#theyellow").click(function() { $('#map').show();sepysfunction(); }); });//end</script><script type="text/javascript"> //GLOBALSvar mapDiv = document.getElementById('map');var latlng = new google.maps.LatLng(37.09, -95.71); var options = { center: latlng, zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP}; var map = new google.maps.Map(mapDiv, options);//GLOBALS function sepysfunction() { //sepysfunction//sepysfunction//sepysfunction//sepysfunction//sepysfunction /****************************************************/if(document.forms[0].physichaladdress.value != "") { geocoder = new google.maps.Geocoder();var geocoderRequest = { address: document.forms[0].physichaladdress.value } geocoder.geocode(geocoderRequest, function(results, status) {/////////////////////////////////////////////////////////////if(status == google.maps.GeocoderStatus.OK) {map.setCenter(results[0].geometry.location);map.setZoom(14);getData(document.forms[0].physichaladdress.value);}////////////////////////////////////////////////////////////}); }/******************************************************/ }//sepysfunction//sepysfunction//sepysfunction//sepysfunction//sepysfunction</script> <script type="text/javascript">var thedata; function getData(str) { if (str.length==0) {return;}if (window.XMLHttpRequest) {xmlhttp=new XMLHttpRequest();}else {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} ////////////////////////////////////////////////////////xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4 && xmlhttp.status==200) {thedata=xmlhttp.responseText;} }/////////////////////////////////////////////////////// xmlhttp.open("GET","getdata.php?q="+str,true);xmlhttp.send();}</script><style>body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; background: #fff; }#map { width: 100%; height: 500px; border: 1px solid #000; }</style></head><body><form name="mymapgetter"><h3>Enter your physichal address:</h3><input type="text" name="physichaladdress" value="" style="width: 99.5%; margin-left: .25%; margin-right: .25%;"></input><input type="button" id="theyellow" value="getmap" style="width: 100%"></input></form><div id="map"></div><p>To add or comment on locations contact webmaster@mydomain.com</p></body></html> I don't understand why the program breaks. The modifications I made are intended to make those variables global so they can be accessed by other functions. Does anyone know what is going on?
  13. I've got the simple code to write out the text of the new position of the div: var posTeller = $('.movingDiv').position();$('span').text(posTeller.left) $(".buttonClass").click(function(){ $(".movingDiv").animate({left: '+=20'}, 500,function() { posTeller = $('.movingDiv').position(); $('span').text(posTeller.left); });}); However, I would like to have it update as it's moving. I will need this later so that an 'if' function can catch it at a certain value and stop the animation mid-way and call a new animation. I found the $.throttle plugin but I'm unsure how to implement it based off the examples. The end purpose is preventing a slide of thumbnails from going too far and 'bouncing back'. Throttle Plugin Thanks!
  14. nurfnose

    sorting xsl with asp variables

    I have an asp form where a user can select their campus and class section. I want to use their answers (variables) in the xsl file to pull only those options from the xml file. Anybody have an idea of how to make this work? Here is my xsl file: <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <table cellpadding="5" cellspacing="0" border="1"> <thead> <tr> <th>Class</th> <th>Type</th> <th>Day</th> <th>Time</th> <th>Tutor</th> <th>Location</th> </tr> </thead> <tbody> <xsl:for-each select="schedule/course[@section='<% response.write(section) %>' and @campus='<% response.write(campus) %>']"> <xsl:sort select="class" order="ascending"/> <tr> <td><xsl:value-of select="class"/></td> <td><xsl:value-of select="type"/></td> <td><xsl:value-of select="day"/></td> <td><xsl:value-of select="time"/></td> <td><xsl:value-of select="tutor"/></td> <td><xsl:value-of select="location"/></td> </tr> </xsl:for-each> </tbody> </table> </xsl:template></xsl:stylesheet> this is my asp file <%dim campus, sectioncampus = request.form("campus")section = request.form("section")'Load XMLset xml = Server.CreateObject("Microsoft.XMLDOM")xml.async = falsexml.load(Server.MapPath("tutor.xml"))'Load XSLset xsl = Server.CreateObject("Microsoft.XMLDOM")xsl.async = falsexsl.load(Server.MapPath("tutor.xsl"))'Transform fileResponse.Write(xml.transformNode(xsl))%>
  15. Hi, I am a novice at javascript and I am hoping the forum can help me out with a question:Given the following code:var x = 8;var y = x;var x = x+4;alert(y);The result is y=8Meaning, when you change the value of x (after the statement y=x), y doesn't correspond to x anymore.Is it possible to have y change with x all the time- is this doable?I thought in other languages, if you do y=x, it will permanently associate y with x so that every time x changes, so does y.How can this be done in javascript?Thanks
  16. Hi there. I'm new to xslt but I've done a fair amount of research on it in the last couple of days. I'm missing something when it comes to variables, though. What I would like to do is check the value of a field (ows_Style) and if it's equal to something ('~New~Paragraph~') then set a variable (Prefix) to some value ('abc') so that I can add that value to the output. In my current output I'm displaying 'aaa' and 'bbb' in order to see what gets displayed between them -- but right now nothing does. My expectation was that in my CHOOSE statement one of the two parts (the WHEN or the OTHERWISE) would be executed no matter what, so $Prefix would have either the value 'abc' or the value 'xyz'. If you could let me know what I need to do to make this work, I'd really appreciate it. Here's my xml: <?xml version="1.0" encoding="UTF-8"?><listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" > <rs:data ItemCount="883"> <z:row ows_LookupKey="CANC300" ows_Priority="1.00000000000000" ows_Language="en_CA" ows_Style="~New~Paragraph~" ows_Content="MEMO TO: {var}BN_ProducerCode_Description{/var}" ows_MetaInfo="391;#" ows__ModerationStatus="0" ows__Level="1" ows_ID="391" ows_owshiddenversion="3" ows_UniqueId="391;#{D30E3EB7-238C-4989-BBDD-ED4D9F1AD8CE}" ows_FSObjType="391;#0" ows_Created="2011-12-02 10:12:29" ows_FileRef="391;#sites/coop/base/Lists/Content Pages Sections/391_.000" /> <z:row ows_LookupKey="CANC300" ows_Priority="2.00000000000000" ows_Language="en_CA" ows_Style="~New~Paragraph~" ows_Content="DATE: {var}BN_EditEffectiveDate{/var}" ows_MetaInfo="393;#" ows__ModerationStatus="0" ows__Level="1" ows_ID="393" ows_owshiddenversion="3" ows_UniqueId="393;#{92C36A45-6B75-48E4-B03A-29EDECE4A246}" ows_FSObjType="393;#0" ows_Created="2011-12-02 10:12:29" ows_FileRef="393;#sites/coop/base/Lists/Content Pages Sections/393_.000" /> </rs:data></listitems> And here's my xslt: <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="[url="http://www.w3.org/1999/XSL/Transform"]http://www.w3.org/1999/XSL/Transform[/url]" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" > <xsl:output method="text" encoding="windows-1252" /> <xsl:template match="/"> <xsl:text>LookupKey,Priority,Language,Style,Content </xsl:text> <xsl:apply-templates select="listitems"/> </xsl:template> <xsl:template match="listitems"> <xsl:apply-templates select="rs:data"/> </xsl:template> <xsl:template match="rs:data"> <xsl:apply-templates select="z:row"/> </xsl:template> <xsl:template match="z:row"> <xsl:variable name="Prefix"> <xsl:choose> <xsl:when test="@ows_Style = '~New~Paragraph~'"> <xsl:copy-of select="abc" /> </xsl:when> <xsl:otherwise> <xsl:copy-of select="xyz" /> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat(@ows_LookupKey,',' ,format-number(@ows_Priority,'####'), ',',@ows_Language,',' ,@ows_Style,',aaa',$Prefix,'bbb')"/> <xsl:text> </xsl:text> </xsl:template></xsl:stylesheet> Dave
  17. I need to access an array value but don't know all the values to call until I get them from a different array value. I'm not explaining this well so I will show some of the code below (This is from a drupal based website). I want to access this value: $variables[taxonomy][taxonomy_term_1083][title]The problem is I don't know the term id (1083) until I have accessed this value: $variables[field_journal_name][0][value] I have tried creating a string that combines the term id with the rest of the array: $termid = $variables[field_journal_name][0][value]; $taxname = 'variables[taxonomy][taxonomy_term_'.$termid.'][title]';and then using the variable variable method: $name = ${$taxname};and many different variations of this but nothing seems to work. Any ideas would be greatly appreciated. Thanks - Dave.
×