Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral


  • Rank
  • Birthday 02/01/1986

Previous Fields

  • Languages

Contact Methods

  • MSN
  • Website URL
  • ICQ

Profile Information

  • Location
  • Interests
    Computers<br />Programming (C/C++, PHP, Perl)<br />Music<br />Photographing<br />Choir
  1. First, the else-statement and continue is unnecessary (unless you trying to be extremely "clear") as it's nothing after the if anyway.Second, I can't (don't need and don't want to) use DOM to create the select-element, as I need it as an string to be inserted in the content of the dialog. The dialog takes it content as a string with (X)HTML and not DOM, there's three (good?) reasons for that: 1. It's easier to use a string 2. as most of the dialogs content is generated by PHP (and then sent to the browser using XML etc) It would be a pain to use DOM 3. I don't need to, it works great without i
  2. Yes, the content-type is right.The "catching" code: function getCustCarInfo( id ){ var URL = _DOMAIN_ + _PATH_; //URL = URL + "khtml_test.php"; URL = URL + "?task=getCustCars&cid=" + id + "&ajax=1"; var first = true; if (kAjaxDebug == true) URL = URL + "kdebug=1"; kdebug( 'getCustCarInfo(): URL = ' + URL ); XmlHttp.onreadystatechange = null; XmlHttp.open( "GET", URL, false ); XmlHttp.send( null ); var XmlDoc = XmlHttp.responseXML; if (!XmlDoc) { kdebug( 'getCustCarInfo(): Not xml... <pre>' + XmlHttp.responseText + '</pre>' ); XmlDoc = (new DOMParser()).parseFromString(X
  3. The commenting is strange I know, but i use it when I have multiple parts of code that I want to test seperately, works like this (bold is commented)/**/str += '<option value="' + i + '">' + node.nodeValue + '</option>';/*/str += '<option value="' + i + '">' + node.childNodes[0].nodeValue + '</option>';/**/or (note the space in the first "block comment")/** /str += '<option value="' + i + '">' + node.nodeValue + '</option>';/*/str += '<option value="' + i + '">' + node.childNodes[0].nodeValue + '</option>';/**/Which let me alternate between two l
  4. I have a problem with XML-DOM and Javascript (!).My PHP-file generates a xml-file like this: <?xml version="1.0" encoding="UTF-8"?><cars> <car> <id>1</id> <reg>ABC123</reg> <make><![CDATA[Volvo]]></make> <model>V70</model> <year>-07</year> <color><![CDATA[rod]]></color> <ownerid>1</ownerid> <trans><![CDATA[Automat]]></trans> <fuel><![CDATA[bensin]]></fuel> <extra><![CDATA[]]></extra> </car> <car> <id&g
  5. Hi!Here's what troubles my mind atm: I'm working on a webapp. for a client (for booking "sessions" in "Autoshops![?]/mechanichs"), which they then will sell as a service to "autoshops". I'm buidling it in PHP and have written my own framework and db-wrapper. Right now (while developing) I'm using MySQL (as that is what I have installed). But I don't know what db-server/engine I should tell my clients to use when setting up their server.As it's a "comercial services" I guess they would need MySQL enterprise (or can they actually use MySQL Community Edition???) which is about $300/year (which ma
  6. Mr_CHISOL

    Blocking Opera

    First (as the other said): you can't secure a site by blocking out a certain browser...and opera is one of the better browsers avaliable...Second: there's many differentways the user can change in the source of your sites (well atleast the [generaterd] HTML) as saving the source etc. and there's nothing you can do about it..I would say that, if you are so concerned about that users change the HTML on your site (the changes wont transfer back to the server) you a poorely designed security on your site and you need to go over it and make the right changes (or rewrite it completely) :?) (I agr
  7. Your missing two echo's in your code...it should be: if ($alt) echo "<tr bgcolor=\"#F2F2F2\">";else echo "<tr bgcolor=\"#FFFFFF\">"; not if ($alt)<tr bgcolor=\"#F2F2F2\">";else<tr bgcolor=\"#FFFFFF\">";
  8. The thing is that that reg.exp (/[A-Z0-9 _-]{3,12}/i) matches a substring/section of the string and not nessassary the whole string. (/abc/ matches "abc", "aabc", "123abc456" etc.). To make it to only match the whole string you need to add ^ (matches the beginning of the string) and $ (matches the end of the string) (just as you have in the first reg.exp. The regexp would the look like this:/^[A-Z0-9 _-]{3,12}$/iOr in the code: <?php// The "i" after the pattern delimiter indicates a case-insensitive searchif (preg_match("/^([0-9]{1}|[0-9]{2})-[a-z]{3}, [0-9]{2}:[0-9]{2} GMT$/i", "01-Jun, 1
  9. May I ask why don't you want to use a form??You are still able to submit the form without using a submitbutton (using JavaScript) or visible fields...
  10. That's not completely true. Apparentely you never heard of AJAX!?AJAX Can be used to send (as GET or POST) and recive data without reloading the pageTake a look what you can find using google: http://www.google.se/search?q=AJAX+POST&am...lient=firefox-a
  11. Mr_CHISOL

    Referrer URL

    One other way to do it is to use sessions...
  12. Use isset(): if (isset($_GET['s'])) {...} else if (isset($_GET['letter'])) {...} else {...}
  13. Mr_CHISOL

    PHP Password Check

    You forgot the line...But you have many ("obvious") problems with your code, for example missplaced semi-colons (; ).Here's how it should look: <?php$password = $_POST['password'];$cpassword = 'pass1';if ($password == $cpassword) { print "Correct Password";} else { print "Wrong Password";} Ex: If you have a semi-colon after the if-statement if (...); that means you end the "entite if-statement", so the else-statement is then "unvalid", as it's no "open" if-statement...You also don't need semi-colons after blocks ({ ... };). Semi-colons doesn't stand for end-of-line, it stands for end-of-s
  14. Yes, that's why they are faster.. {EDIT: Apparently it isn't a great idea to go away and eat while posting in a forum }You could use SimpleXML or DOM, but (at least with SimpleXML) you get a "ugly output" (no newlines etc), (saw that you could get nicer output with DOM via ::formatOutput).One thing that I would miss with both your method (specially your method...) and DOM is to (easally) add tags within other tags. I'm working on my own framework (basically the same idea as you have, but a little more advanced/more features), among other things, it keeps track of the opened tags (and closes a
  15. ""OFF TOPIC""First: Even if it's not your site, I'll guess that's you that's writing the page (or helping someone do it..), nomather what you should do it in the "correct" or best way (not always the simplest). If you do things right and in a good way (also behave nicely etc..), you get a good reputation (can give you more clients or a job..), if you do things in the "wrong" or in a "bad way", you get a bad reputation (= hard to get customers etc..).Remember that! Always try to do things right etc..Second: (this builds somewhat on the first..) Most IE users aren't stupid (perhaps "ignorant"/"u
  • Create New...