Jump to content

kvnmck18

Members
  • Posts

    365
  • Joined

  • Last visited

Everything posted by kvnmck18

  1. I know, but that works and would be a quick fix for this.
  2. But you can do what I said...I've done it before. As long as you don't use CDATA
  3. I have a code for a form by php to xml. It's on here.But makes the data only as attributes.
  4. kvnmck18

    CSS Style sheets

    Why not make them yourself?If you need help go to http://www.w3schools.com/css/default.asp
  5. for fun...you can write a link like this: <a href="THELINK.COM"> click here </a> (I hope I didn't have a typo)
  6. Post some examples of your elements or attributes you want, so we can help you out.something like: <schedule><flight><toDest></toDest><fromDest></fromDest><depart></depart><arriv></arriv></flight></schedule> <schedule><flight><toDest>LA, CAL</toDest><fromDest>Columbus, OH</fromDest><depart>7:00AM</depart><arriv>3:00PM</arriv></flight><flight><toDest>Boston, MA</toDest><fromDest>Chicago, IL</fromDest><depart>1:00PM</depart><arriv>4:00PM</arriv></flight></schedule> ...or whatever you had in mind.
  7. Can you explain what you are doing? I'm very confused when I post things...but this is very confusing what you are trying to do.Just looking at that quickly it looks like it'd be just "2"$j + 1 = 2when $j=1 (from the <xsl:param name="j" select="1"/>)
  8. That's my question too hahaI think it's either the $whatever_final, or $arg that needs the htmlspecialchars()
  9. That would create the </whatever> just to be </whatever>But I want this to make: <whatever><arg cat="One" subj="My friends & Me" other="I don't know what to say here" /></whatever> to: <whatever><arg cat="One" subj="My friends & Me" other="I don't know what to say here" /></whatever> using the htmlspecialchars() function.
  10. kvnmck18

    Login Page Codes

    I don't think this works. I tried it out to test it and it doesn't.Maybe I messed up?
  11. Where can I use this in a form to XML? I think it needs to be added to the:<?php $xml_file = "xml.xml"; $xslt_file = "xsl.xsl"; $xp = xslt_create() or die("Could not create XSLT processor"); if($result = xslt_process($xp, $xml_file, $xslt_file)) { echo $result; } else { echo "An error occurred: " . xslt_error($xp) . "(error code " . xslt_errno($xp) . ")"; } xslt_free($xp); ?> ...and somewhere in the process. Just not sure. :\! <?php$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);echo $new; // <a href='test'>Test</a>?> Form.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ><html xmlns="http://www.w3.org/1999/xhtml"><body><form action="process.php" method="post"><table cellspacing="0" class="ttop"><tr><td id="left"> Category : </td><td><select id="cat" name="cat"> <option>--CHOOSE--</option> <option id="cat" name="cat" value="one">One</option> <option id="cat" name="cat" value="two">Two</option></select></td></tr><tr><td id="left"> Subject :</td><td><input type="text" id="subj" name="subj" /></td></tr><tr><td id="left">Other: </td><td><input type="text" id="other" name="other" /></td></tr><tr><td id="left">Add or Delete:</td><td><select name="action"><option value="ins">--CHOOSE--</option><option value="ins">Add</option><option value="del">Delete</option></select></td></tr><tr><td id="left2"> Make Sure All <br />Information Is Correct </td><td id="leftsub"><input type="submit" id="sub" value="SUBMIT" /></td></tr></table></form><br /><?php $xml_file = "xml.xml"; $xslt_file = "xsl.xsl"; $xp = xslt_create() or die("Could not create XSLT processor"); if($result = xslt_process($xp, $xml_file, $xslt_file)) { echo $result; } else { echo "An error occurred: " . xslt_error($xp) . "(error code " . xslt_errno($xp) . ")"; } xslt_free($xp); ?> </body></html> Process.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body><?$whatever = Array();function start_element($parser, $name, $attrs){ global $whatever; if($name == "arg"){ array_push($whatever, $attrs); }}function end_element ($parser, $name){}$whateverXML_string = file_get_contents("xml.xml");$parser = xml_parser_create();xml_set_element_handler($parser, "start_element", "end_element");xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);xml_parse($parser, $whateverXML_string) or die("Error parsing XML document.");print "<br />";if($_POST['action'] == "ins"){ array_push($whatever, Array( "cat" => $_POST['cat'], "subj" => $_POST['subj'], "other" => $_POST['other'], $whatever_final = $whatever;}else if($_POST['action'] == "del"){ $whatever_final = Array(); foreach($whatever as $arg){ if($arg['id'] != $_POST['id']){ array_push($whatever_final, $arg); } }}$write_string = "<whatever>";foreach($whatever_final as $arg){ $write_string .= "<arg cat=\"$arg[cat]\" subj=\"$arg[subj]\" other=\"$arg[other]\" />";}$write_string .= "</whatever>";$fp = fopen("xml.xml", "w+");fwrite($fp, $write_string) or die("Error writing to file");fclose($fp);print "You did it, way to go!!!";print "<br />";print "<a href=\"form.php\" title=\"return\">Return</a>";?></body></html> ....something like this?: $write_string .= "</faq>";$fp = fopen("xml.xml", "w+");fwrite($fp, $write_string) or die("Error writing to file");fclose($fp);print "You did it, way to go!!!"; to $write_string .= "</whatever>";htmlspecialchars($write_string);$fp = fopen("xml.xml", "w+");fwrite($fp, $write_string) or die("Error writing to file");fclose($fp);print "You did it, way to go!!!"; ...but wouldn't that make the <whatever /> be changed too?
  12. kvnmck18

    XML PHP Login

    Yeah, I was thinking about something like that. But if that's possible then how do you make a XML/PHP login using encrypted passwords?
  13. kvnmck18

    XML PHP Login

    Well, boen...if you ever figure how to have the xml hidden do post it. As for now this is dead.
  14. kvnmck18

    XML PHP Login

    Well, I was reading about it on XML.com.
  15. kvnmck18

    XML PHP Login

    You can still secure XML. (encryptions) By making the XML not available to be opened.W3.com Encryptions...and I believe banks use XML for logins.... not 100% but I think they do.
  16. If from an attribute it's :<img src="{@attribute}" />example xml: <images> <image src="image.jpg" sub="this is a picture of me" /><image src="image2.jpg" sub="this is a picture of you" /></images> example xsl: <xsl:for-each select="//image"><img src="{@src}" title="{@sub}" /><br/></xsl:for-each> Output:<img src="image2.jpg" title="this is a picture of you" /><br/><img src="image.jpg" title="this is a picture of me" /><br/>
  17. kvnmck18

    XML PHP Login

    I actually want to create both a create account and a login. The username, passwords will be stored in xml. So this all done without sqlBut for right now I want to just work on the login part.Lets say the XML is like this: <members><user><fname>John</fname><lname>Doe</lname><uname>jogmaster2000</uname><pass>dynamite42</pass> </user></members> start_page.php: <html><body><form action="login.php" method="post">UserName:<input name="username" id="username" type="text" /><br/>Password:<input name="password" id="password" type="text" /><br/><input name="submit" id="sumbit" type="submit"/></form></body></html> Any ideas?
  18. No I know what you meant, but that doesn't mean anything. Because say the "page=" is just defined...but the "id=" is.The defined id would open the picture but leave the page (thumbnail side) incomplete and just empty.
  19. Say you have an xml like this: <whatever><hmph sub="This is a subject" cat="One" text="I don't have a text to that!" /><hmph sub="92 mph was fast" cat="One" text="I think I have a car" /><hmph sub="9dfsdf3452 fsdfst" cat="Two" text="Idfdf fdsfsdfa fasdfsdfr" /></whatever> Image that XML being longer (and logical)...So say if you wanted to list the @cat... but you did not want repeats in the @catWhen you do a: <xsl:for-each select="//hmph"><xsl:value-of select="@cat"/> <br/></xsl:for-each> You result in:OneOneTwoWhat do you put to limit it to just one so it's like:OneTwo.... <xsl:for-each select="//hmph"><xsl:if test="position()=1"><xsl:value-of select="@cat"/> <br/></xsl:if></xsl:for-each> ...this gives you just:One.... <xsl:for-each select="//hmph"><xsl:if test="position()=3"><xsl:value-of select="@cat"/> <br/></xsl:if></xsl:for-each> ...this gives you just:TwoIs there an if test that is something like "no-repeat"?
  20. I don't see how an isset() works here.I'm so confused right now. dfdsfsdlfk
  21. The PHP kindof like this: <?php$xmlfile = "xml.xml";$xslfile = "xsl.xsl";if ($_GET['page']) {$expression = array("page" => ."=['".$_GET['page']."']");}else {$expression=NULL;} $args = $expression;else if ($_GET['photo']) {$expression2 = array("photo" => ."=['".$_GET['photo']."']");}else {$expression2=NULL;} $args2 = $expression2;$engine = xslt_create();$output = xslt_process($engine, $xmlfile, $xslfile, NULL, NULL, $args, $args2);print $output;xslt_free($engine);?> ...but that doesn't work.But say if that worked make the XSL call a template when the NULL is called.
  22. Oh, I see what you meant. I guess I misread that. That does work...and thank you very much! Here is the working php XML/XSL with two params: <?php$xmlfile = "xml.xml";$xslfile = "xsl.xsl";$args = array("page" => $_GET['page'], "photo" => $_GET['photo']);$engine = xslt_create();$output = xslt_process($engine, $xmlfile, $xslfile, NULL, NULL, $args);print $output;xslt_free($engine);?> ...But I guess I want to include the "if" because if the GET is not "Got" then I want it to move to a default value. In this case, if the Get is not Got in reference to the "Page" (?page=) I want it to view all Thumbnails ---Such as if .php was typed. But I don't know how this is possible when the Get for page goes with a Select of the: <xsl:for-each select="//image[@cat=$page]">...and the only way to make this work would be if the Page default value was "//image[@cat]"...so right now if a value is not present, it does not bring up thumbnails because the select becomes: "//image[@cat= ]".Also the same for the value of the "photo" or in the XML refrence the @id. ".php?photo=&page=Weddings" Brings the thumbs of Weddings and no default value for the <xsl:apply-templates select="//image[@id=$photo]"/>. And in the case of an empty value (no defined value) for the $photo/@id=''/photo I want it to go to the first value listed in the thumbs.BUT A BIG PROBLEM--if the default value of "page" would bring up @cat then the links to the images would still include the .php?page=Value&photo=SomeValue, but when I have the default being at @cat I would want the links just to have .php?photo=SomeValue.I think this is all be done with just a little if added to the php and then call-templates in the xslt. But I'm not quite sure how to get this done... :/
  23. I've moved this to PHP forum here's a link: http://w3schools.invisionzone.com/index.php?showtopic=7780 - if you want to add to this topic.Thanks.
  24. Link to the XSLT Discussion about this issue.I'm making a photo section on my site, with three Catagories. Each image has an individual ID to pull up the picture. But the problem is when the thumbnail is clicked it opens the picture correctly but then the thumbnails go to the default value (which is "Wedding"). I want it so when I am in the "Theme Parties" when the thumbs are clicked it brings that image up and the Theme Parties thumbs stay.I know how to pass one, but I'm trying to get two $_GET values to pass through a PHP to pull the data from the XML in the XSLT using templates. Both values do work but not together. I can have the .php?page=Value and it brings the right page value up, I can have .php?photo=SomeValue and that works, but if I have .php?page=Value&photo=SomeValue it does not work. So when I make the links include both values it does not work.Here's my current php:<?php$xmlfile = "xml.xml";$xslfile = "xsl.xsl";if ($_GET['photo']) {$expression= array("photo" => $_GET['photo']);} $args = $expression;if ($_GET['page']) {$expression= array("page" => $_GET['page']);}else {$expression=NULL;}$engine = xslt_create();$output = xslt_process($engine, $xmlfile, $xslfile, NULL, NULL, $args);print $output;xslt_free($engine);?> I know I canhave the array as: $expression= array("photo" => $_GET['photo']), ("page" => $_GET['page']);};} But I don't know how to include both the "ifs" and the "GETs". I'm using PHP4, and I know this would be easily done if PHP5...but that's not an option so I knwo this has to be obtainable through php4.Any ideas? Hope you can help!THank you!
  25. $args = array("photo" => $_GET['photo'], "page" => $_GET['page']); That is how you do an array in PHP for passing params...and I know how to do that only when there is one $_Get and the other is a default value that is to be passed such as the Date or just a saying, ect. So I guess this real problem is actually the line before all of this I don't know how to get the Get value with two different names to pass through both. Maybe this is a question for the PHP forum not XSLT....because I believe that all the XSLT is correct. boen_robot it's not that you have been stumped I just know that PHP isn't your expertise really, at least when dealing with PHP 4.You always seem to come up with an answer though so if you can think of anything please help out.You know I appreciate all your help...and thank you.
×
×
  • Create New...