Jump to content

janroald

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Everything posted by janroald

  1. I am looking for a good class to synchronize a mysql database schema based on a master-DB Anyone got tips on good classes to use for this? Found a couple of interesting ones on phpclasses.org, but they lack feedback and critique(both positive and negative). Anyone got such a class to recommend?
  2. function foo(callURL) { var xmlhttp = getHTTPObject(); xmlhttp.open('POST', callURL, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == && xmlhttp.Status == 200) { var bar = xmlhttp.responseText; } } xmlhttp.send(null); //How can i at this point in the code return the responseText to where the function "foo" was originally called? }
  3. Did a check and its the same on my server too. Havent really thought too much about this before now, but you got me a bit curious. Seems php does it's work and outputs when its all done. I'm guessing this behaviour can be changed through setting som custom php.ini variables, and will look into it tomorrow some time. Maybe someone else has the solution for you before then.
  4. $emails() = meaningless in php $emails = $_POST['picemail[]']; should be $emails = $_POST['picemail']; then your loop will work. There are lots of array functions : http://no.php.net/manual/en/ref.array.php
  5. How does you foreach loop look like?
  6. Js cant access any array since there exists no array in the input fields, only pure text. Of course js can parse the text an build it's own array, but that proves nothing. Unless you can provide an example of what your intensions are, I can only understand that what you are trying to say makes no sense at all. In essence, the example I started with at first, will be sent to the server like this text string : ?foo%5B%5D=bar1&foo%5Bfoomatic%5D%5B%5D=bar2&foo%5Bfoomatic%5D%5B%5D=bar3&foo%5Bfoomatic%5D%5Bbar%5D%5B%5D=bar4&foo%5Bfoomatic%5D%5Bbar%5D%5B%5D=bar5 in php then : $_REQUEST[foo] now contains the array parsed from that text string. Whether js can access anything, has nothing to do with it at all.
  7. Yes, you can do like this in your preg /stronghold (this|that|other)/ which will match "stronghold this" "stronghold that" or "stronghold other" also you can do something like /stronghold (\w+)/ to math "stronghold whatsoever" In both cases you can return and replace either the entire string or just the subpattern with what suits you. If you are quite clever you can make it so that the relation between the string and the image to put in are consistent so that the right picture can be put in for all circumstances. http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
  8. I'm not at all sure what you mean, or that you understand what I am writing here. foo[bar] is just text with brackets on client side.
  9. Seems we kind of agree then. My question still stands. Does this way of passing multidimensional arrays work with all common webservers/browsers/languages? Is it a standardized way to pass multidimensional arrays? I'm googling and googling, but can't seem to find references to this anywhere. Just plain old [] to send an array. Cant seem to find examples of anyone doing name="foo[bar]", which will make the array assosiative, much less name="foo[bar][]" which will make it multidimensional. If this is now standard behaviour there are huge advantages to benefit from it.
  10. Obviously, the webserver/scripting language does it's part too. Since an array variable is created in php from a form string. I'm sure this couldn't be done earlier at some point, since we used serializing to get it done.
  11. Your script does actually output data after each query, right? Not making one big variable to put out at the end?
  12. Not sure about this, but maybe if you give your table an absolute width, and als each row the same, then the browser might output faster as it doesnt have to recalculate fixed proportions depending on the output. One minute pr row? Damn... You could also try to make each row it's own table.
  13. I guess he's saying that there can be a variety of different "Stronghold _____" 's and he wants a preg to pick them up. If so, the question is really whether there are _really_ many strongholds, or an unforseen amout of them. (dynamically generated maybe) Unless my above sentence has some truth into it, you should go with the solution Hell Toupe and I gave you.
  14. Difficult to read what you're after m8, but I'll try. I'm guessing what you want requires no more than str_replace, which is much faster then preg_replace $string = ' Stronghold Common Stronghold Uncommon Stronghold Rare'; $replace = array( 'Stronghold Common', 'Stronghold Uncommon', 'Stronghold Rare' } $replace_with = array( '1', '2', '3' } echo str_replace($replace, $replace_with, $string); // output is '1 2 3';
  15. No need for shame m8, we all waste hours this way from time to time :-) You just need to get better in trying to isolate the problem step by step. I copy/pasted your code, and when I didn't get it to work the way you wanted it to, i changed the method to GET. I then got "?test1" in the url. Problem was then easily found :-)
  16. Next time, when you have a similar problem, make the form method GET, then you can see for yourself what data is sent.
  17. Hehe, was pussled there for a while when I didn't get it to work myself :-) You see what's wrong here? : name"test1" I'm the man :-)
  18. Yes, it works in the context I mentioned in the start post. The question is really to what extent this works. In "old" times I used the [] way to transfer arrays, but I had no idea it worked with multidimensional ones too. Serializing data was, to my knowledge, the best way to transfer such data between pages, of course until sessions became an option, as "mjlogan" points out. This way one can access all form data through only one array variable. A huge workload has been lifted from me with this. What makes this work? Is it the browser, webserver or PHP?
  19. Not sure if this is the right forum-cathegory, but heck... //Examplified vars <input type="hidden" name="foo[]" value="bar1"> <input type="hidden" name="foo[foomatic][]" value="bar2"> <input type="hidden" name="foo[foomatic][]" value="bar3"> <input type="hidden" name="foo[foomatic][bar][]" value="bar4"> <input type="hidden" name="foo[foomatic][bar][]" value="bar5"> print_r Array ( [0] => bar1 [foomatic] => Array ( [0] => bar2 [1] => bar3 [bar] => Array ( [0] => bar4 [1] => bar5 ) ) ) Anyone knows when this feature was supported, or to what extent it is supported? Tested on FF/IE6 POST/GET Apache/PHP4
  20. <input type="checkbox" name="borat[]" value="crazy"><br> <input type="checkbox" name="borat[]" value="little"><br> <input type="checkbox" name="borat[]" value="khazhakstan-man"><br> We send the form... <? echo '<pre>'; print_r($_POST[borat]); echo '</pre>'; ?> Then we get the output : Array ( [0] => crazy [1] => little [2] => khazhakstan-man ) Try it, play with it and use it a lot from now on :-)
  21. At first glimps I must say i agree with fenway. Try playing with you z-index'es, I see your container-div has a index of 100, but none of your other layers has been assigned an index. On the other hand, I suspect you have done some trickery to get your transparent png background working in iE. Maybe : _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='http://www.something.png'); Is this the case or have you used some other magic, like a js-hack to get it working? If so your problem is a familiar one with several solutions, but I wont get into them unless it's the actual case here. Just try to remove your transparent png background anyways, and report back if it changes anything.
  22. Hi Hamp! The other guys have said mostly what needs to be said, so I just want to tell you one thing; remember what you started with! Wether php or asp etc, it is markup you essentially are producing :-) A lot of programmers in this buissness really don't get that... HTML->SHTML->PERLHTML->PHP4HTML->PHP5HTML->PHP4.5HTML :-)
  23. I agree with wildteen88; probably there is no good or easy way to do this with html/css/js. Seems like a fun challenge though :-) My suggestion would be to arrange your hierarchial structure horizontally rather than vertically. Then you will eliminate the problems with text size etc. and in most aspects get an easier task to accomplish. You could make use of solutions typically used in forum-threading etc.
  24. Thanks, ozfred :-) You really made us look bad now ;-) Think it's time for a second reading of the manuals. Might save a lot of trouble and headache...
  25. Yes, by building the myrows array through a loop, checking parentthis&childthat, I probably would get the result i need. :-) But as a stubborn perfectionist I'm required to dig deeper through the manuals to find the more elegant way. Lucky me... lol
×
×
  • 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.