Jump to content

janroald

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

About janroald

  • Birthday 07/26/1980

Contact Methods

  • MSN
    janroah@hotmail.com

Profile Information

  • Gender
    Not Telling
  • Location
    Trondheim, Norway

janroald's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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 :-)
×
×
  • 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.