Jump to content

Mortekai

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Mortekai's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I would save the XML file as a string with a timestamp (in a different column I assume?) and then check each time the data is requested if the timestamp is x minutes different than current time and if so re-import the XML file again?
  2. I have built a small database which use the Twitter API to extract data from the listed members XML files (http://twitter.com/users/show.xml?screen_name=username) and it works well, but since the database makes several calls everytime a page loads I get kicked out very quickly, even with a small memberbase. So I wonder what solution would help with this problem? I have considered dropping the XML data into the database and saving each XML file on the server, but I am not sure what solution would be best?
  3. <?xml version="1.0" encoding="ISO-8859-1"?> <filmer> <film> <title>Testfilm</title> <genre>Action</genre> <length>96</length> <rating>4</rating> <picture>http://static.lovefilm.se/img/cover/movie/small/Outlander/51284.jpg</picture> <year>2006</year> </film> </filmer> Need to be transformed to... <?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>Lämplig titel</title> <link>Länk</link> <description>Beskrivning</description> <item> <title>Testfilm</title> <link>http://www.w3schools.com/rss</link> <description>Action</description> </item> </channel> </rss>
  4. This is really driving me nuts...
  5. Not surprising as you can not use PHP inside a xml file...*silly me*
  6. Ok, I am trying this, but I am not getting any results.... <rss version="2.0"> <channel> <title>W3Schools Home Page</title> <link>http://www.w3schools.com</link> <description>Free web building tutorials</description> <?php header('Content-type: text/html; charset=utf-8'); $xml = simplexml_load_file('filmer.xml'); foreach($xml->filmer->film as $film) { echo"<item>"; echo "<title>".utf8_decode($film->title)."</title>"; echo "<link>".utf8_decode($film->picture)."</link>"; echo "<description>".utf8_decode($film->title)."</description>"; echo"</item>";} ?> </channel> </rss>
  7. I have a XML file that I want to create a RSS file for, but I am not quite sure what to do or how.... I tried using XSLT to transform the XML file, but I am not sure thats the right approach?
  8. I have been using Magpie for RSS for a while and although it works, I would like to add RSS feed to my website without it, but I am not really sure how to do it, or rather how to do it the way I want. I want to be able to grab any RSS feed and either just print out a ul list with headlines or the entire feed. I also want to merge several feeds into one and have each individual feed have its own icon... ideas and suggestions?
  9. Always a good idea, but I already have my head deep in the books here I just wonder what the best approach would be. The XML file for type of activity I can just setup a XML file, but how do I load it into a dropdown field from there? Should I store the entries in an array and then parse out when printing the table below, or is there a better way?
  10. I am trying to build a training diary using xml where I'll have one xml file holding date, length, time and comments, then one xml file holding type of activity. I want to be able to add to the diary and display the contents in a table below the form, but I am not sure where to begin....
  11. I think I need to clean this up a bit and do things a bit dirrerent to get the submit form to remain even after the onClick value...not sure how though <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body> <script language="javascript" type="text/javascript"> <!-- function MakeArray( n ) { if( n <= 0 ) { this.length = 0; return this; } this.length = n; for( var i = 1; i <= n; i++ ) { this[ i ] = 0; } return this; } var myForm = new MakeArray( 15 ); var index = 0; var cmmnd = 1; function f_store( sTR ) { var i; if( index >= myForm.length ) { for( i = 1; i < myForm.length; i++ ) myForm[i-1] = myForm[i]; index = myForm.length - 1; } myForm[ index ] = sTR; ++cmmnd; ++index; document.myForm.command.value=""; } function f_print() { var allCmmnds, i; allCmmnds = ""; document.writeln("<form name='myForm'><input name='command' type='text' value=''><input type='button' value='Lägg till titel' onclick='f_store(document.myForm.command.value)'><input name='myForm' type='button' value='Visa titlar' onclick='f_print()'></form>"); document.writeln("<table border='1' width='200'"); for( i = 0; i < index; i++ ) // allCmmnds += myForm[i] + "\n"; document.writeln("<tr><td>" + myForm[i] +"</td></tr>"); document.writeln("</table"); // alert( allCmmnds ); } // --> </script> <form name="myForm"> <input name="command" type="text" value=""> <input type="button" value="Lägg till titel" onclick="f_store(document.myForm.command.value)"> <input name="myForm" type="button" value="Visa titlar" onclick="f_print()"> </form> </body> </html> and <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <script language="javascript" type="text/javascript"> var bilar = new Array(); bilar [0] = "saab"; bilar [1] = "volvo"; bilar [2] = "mercedes"; bilar [3] = "bmw"; function search(){ var searchValue = document.getElementById("searchInputForm").value; var resultat = "Bilen finns inte"; if (bilar.length<1){ document.writeln("arraylistan är tom"); } else{ for (var counter = 0; counter <= bilar.length-1; ++counter){ if (bilar[counter] == searchValue){ resultat = "bilen finns!"; } }//slut på for document.writeln(resultat); }//slut på else }//slut på funktionen </script> </head> <body> <form action="" id="theForm"> <input id="searchInputForm" name="" type="text"><input id="submitButton" name="" type="submit" onClick="search(searchInputForm)"> </form> </body> </html> Any help is most welcome!
  12. That worked like a charm I'll go over it and see if I can make out how it works I owe you, big time.
  13. I am not sure what I am trying to do with the accursed checkboxes and radiobuttons really... Do I fetch the whole group and then loop through to find the checked one and then pick out the value...or how do I do this? Picking out the value of one ID is not so difficult, but the concept of filtering through groups of inputs is still not clear to me...
  14. Ok...I have this now: <script language="javascript" type="text/javascript"> function submitForm(){ var namn = document.getElementById("name").value; /////////////////// var cbs = document.forms[0].elements["radio"]; for(var i=0; i<cbs.length; i++){ cbs[i].checked = true; } document.writeln(namn + cbs); } </script> The output gives the name and [object NodeList] , so how can I output the value of the boxes instead?
  15. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <script language="javascript" type="text/javascript"> function submitForm(){ var dryck=""; var namn = document.getElementById("form1").value; /////////////////// if (document.getElementById("form1").elements[2].checked) dryck="glögg"; else if (document.getElementById("form1").elements[3].checked) dryck="glögg"; document.writeln(dryck + namn); } </script> <body> <form id="form1" name="form1" method="post" action=""> <table border="2" cellpadding="2" cellspacing="2" bgcolor="#CCCCCC"> <tr> <td align="right">Namn</td> <td align="left"><label> <input name="name" type="text" id="name" size="45" /> </label></td> </tr> <tr> <td align="right">Dryck</td> <td align="left"><label> <input type="radio" name="radio" id="radio1" value="radio" /> Glögg<br /> <input type="radio" name="radio" id="radio2" value="radio" /> Julmust<br /> <input type="radio" name="radio" id="radio3" value="radio" /> Sprit</label></td> </tr> <tr> <td align="right">Dresskod</td> <td align="left"><label> <select name="select" id="select"> <option>select:</option> <option>Julmössa</option> <option>Bikini</option> <option>Finkostym</option> </select> </label></td> </tr> <tr> <td align="right">Önskemål</td> <td align="left"><label> <input type="checkbox" name="checkbox" id="checkbox1" /> Kräkas<br /> <input type="checkbox" name="checkbox" id="checkbox2" /> Somna<br /> <input type="checkbox" name="checkbox" id="checkbox3" /> Dö<br /> </label></td> </tr> <tr> <td align="right"> </td> <td align="right"><label> <input type="submit" name="button" id="button" value="Skicka" onClick="submitForm" /> </label></td> </tr> </table> </form> </body> </html> I think I am way off with this one
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.