• Content count

  • Joined

  • Last visited

  • Days Won


ShadowMage last won the day on October 5 2012

ShadowMage had the most liked content!

Community Reputation

94 Excellent

About ShadowMage

  • Rank
    Faal Vokundovah
  • Birthday 08/27/1867

Profile Information

  • Location
    America's dairyland
  • Interests
    I dabble in a little bit of everything. Gaming, programming, web development, fishing, paintballing, woodworking, farm equipment, reading, nature......

Previous Fields

  • Languages
    (X)HTML, CSS, JavaScript, PHP (though I still have much to learn)

Recent Profile Visitors

54,122 profile views
  1. Seems like that was the problem. Apparently Everyone doesn't include the IUSR... I couldn't find a way to add the IUSR account to the share in AD, but I did figure out how to change the account used in anonymous authentication in IIS.
  2. Maybe a silly question, but how and where do I find the IIS account? I see a group called IIS_IUSRS but there's no members.
  3. I'm not sure if this should go here or in PHP, but I'm having problems getting PHP to connect to a Progress DB. I have IIS installed and configured on a Windows 2008 server and all seems to be fine on that front. I can access the site, and I can run PHP code. I can also access the MySQL databases we have. When I try to access the Progress database, however, I get the following error: Warning: odbc_connect(): SQL error: Specified driver could not be loaded due to system error 5: Access is denied. (Progress OpenEdge 10.2A driver, \\share\path\to\file.dll)., SQL state IM003 in SQLConnect in C:\inetpub\phplib\ODBC.php on line 349 I created a system DSN on the webserver and I am able to successfully test connect from there. I've also added full control for Everyone on the specified DLL (and the path to get to it) and still get the access denied error. Any ideas or suggestions? Thanks in advance for any help you can offer.
  4. I just echoed the xml string. Nothing else. No html tags of any kind. This script is intended to be accessed through AJAX so there is no other output (aside from any error messages if/when they occur).
  5. This is the code I'm using: $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadXML($xml); // $tmp = $doc->saveXML(); $doc->save($FileLocation); The saveXML() function returns the xml code as a string. The save() function saves it to a file. When I echo $tmp, I get all the goofy characters described above. However, I just tested printing out the xml string prior to loading it into DOMDocument and it prints out just fine... Must be something with DOMDocument messing up the character encoding.
  6. It seems to recognize as a valid entity at least. I know that it works in HTML. I did try using the other two you mentioned. ™ doesn't seem to work in either the browser or when I save it as a file. Shows a bunch of odd symbols in the browser and puts the entity code itself into the file where the symbol should be. Maybe that's how it's supposed to work, not sure. However, while ™ doesn't work in the browser, it does put the actual symbol (not the entity code) in the right place when saved to a file. I think I'll run with it this way for now and see if I encounter any problems.
  7. As mentioned before, I haven't actually created an XML file yet. I'm just loading a string previously generated in the PHP into DOMDocument. I did try re-saving all my PHP files as UTF-8, but it didn't seem to make any difference... I also noticed that when I actually save the XML file to the filesystem, it doesn't put anything in the place where the trademark is supposed to be. No trademark, no other goofy symbols. When I output it to the browser, I get the behavior described above.
  8. ok, so I tried escaping the ampersand (™) which doesn't give me an error, but it doesn't print the trademark symbol either. Just prints "™" Also tried using utf8_encode on the xml string before loading it into DOMDocument. I tried it with the chr() function and it gave me the same result as using did before (ie, the goofy 'A' symbol). Using still gives me the same result. Tried it with the actual TM character and it gave me a lot more goofy symbols than before. Didn't get any errors using utf8_encode, though!
  9. I have the xml DTD included in the string I'm trying to load: <?xml version='1.0' encoding='UTF-8'?> I also tried specifying the encoding when I created the DOMDocument object: $doc = new DOMDocument('1.0', 'UTF-8'); which didn't help. I'm not working with any files yet. It just generates the string, then attempts to load it into DOMDocument. Or are you referring to the PHP script itself being saved as UTF-8? As for utf8_encode, where do I use that? On the string I'm trying to load into DOMDocument? Like this: $doc->loadXML(utf8_encode($xml)); Thanks, I didn't know that was possible. If I can't get this working any other way, I'll try creating my own entity.
  10. I'm using DOMDocument to load an xml document from a string generated in PHP. One particular node needs to have a trademark symbol in it's value and I'm having trouble getting that to load with DOMDocument. First a little setup/background: I have a value stored in a database field that needs to have the trademark. This value is both displayed on screen and written to the XML. Right now I'm using placeholder text ("{TM}") and using str_replace to replace the placeholder text with the HTML entity (™) to display it onscreen. This works fine. It doesn't work when writing to XML because the ™ is not a recognized entity apparently. So, when writing to the XML I tried: $systemDesc = str_replace('{TM}', '', $arrGlazeType[$this->GlazeType]['Description']); Which sort of works. I get an extra goofy 'A' symbol, though: Guardian 275™ If I just replace the placeholder with an empty string, it displays just "Guardian 275" as I'd expect. So I tried: $systemDesc = str_replace('{TM}', '™', $arrGlazeType[$this->GlazeType]['Description']); which gives me: Guardian 275â„¢ and $systemDesc = str_replace('{TM}', chr(153), $arrGlazeType[$this->GlazeType]['Description']); which produces an error: Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Input is not proper UTF-8, indicate encoding ! Bytes: 0x99 0x3C 0x2F 0x73 in Entity, line: 19 Line 19 is where the trademark symbol should appear. You might ask "well, why are you using the placeholder anyway?" Good question. When I put the trademark symbol directly into the database, it showed up on screen as a black diamond with a question mark. The htmlentities() function didn't help. And in the XML, I get the same error as using the chr() function. I didn't think this would be that hard...
  11. It could be done with Canvas, yes, but that's much more complicated than Ingolme's suggestion (using a GIF) and wouldn't work in instances where the user has JavaScript disabled since canvas requires JavaScript to function.
  12. To specifically answer the question about multiple conditions in an if statement, you need to use the Logical Operators here:
  13. Yes, they are the same in terms of structure. The difference is in the evaluation of the criteria in the if statements. I'm not sure how much clearer it can be explained. Like Ingolme said, indentation is important to help you keep track of what code is in each block. If we look at your code (properly indented): var x = "b"; var y = "a"; var z = "c"; if(x==y) { if(x==z) { console.log( "equal"); } else { console.log("not equal"); } } Everything between the red brackets is one block of code and will be executed together. So when it checks the condition if(x==y) it will run that code only if x is equal to y and since they're not ("b" is not equal to "a") and you have no else statement to match that block, nothing gets executed. Your other example can be formatted exactly as above, but the condition is different. In that one, the condition evaluates to true (after all, 40 is indeed less than 70) and so the code in the block is then executed. If you change the value of temp to anything greater than 70, you will get the same result as in your first code (that is, nothing). In order to get output under every single instance, you would need to add another else block to go with the first if statement: if(x==y) { if(x==z) { console.log( "equal"); } else { console.log("not equal"); } } else { console.log("not equal"); }
  14. Aren't those technically the same since innerHTML is part of the DOM?
  15. I've actually used it a couple times. One such example: I have a table of values that changes depending on parameters set elsewhere in the page. I use AJAX to send the parameters to PHP and calculate the values then send those values back as a JSON object. I loop through the rows of values like a normal numeric array. I then loop through the "properites" (ie, columns) of each row and update the values in the table.