Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Would help if you actually posted the code. Offhand I'd say that you have your info display, form and your "processing" in the same script, and you have the processing stuff after the display, so it processes the first time around, but doesn't display updated listing until after you refresh. But that's just a shot in the dark. I'm not psychic or anything.
  2. .josh

    'Code' tags

    You could preg_match_all using the same pattern as the preg_replace, do what you need to do on the matches (like nl2br) and then use the results of that as the replacement in your preg_replace. .
  3. you're pushing an array into a declared array. As the title of your thread implies, it's a multi-dim array. But you're only echoing it out as if it's a single-dim array. You should be doing for instance: $error[0]['icon'] premiso had it right, but he used the wrong var for the first level. Should have been $row not $nr
  4. Old post, but it [i]is[/i] a sticky.... Just got this book as an xmas present.  I'm excited :) p.s.- [quote author=nrg_alpha link=topic=105245.msg956113#msg956113 date=1217848966] [quote author=cute_girl link=topic=105245.msg946909#msg946909 date=1216875386] hmmm lets try, i also want to be 100% in regex......  :-\ [/quote] If you are going to be strictly doing regex in PHP only, don't bother. As of PHP 6, the support for POSIX will be pretty much dropped in favor PCRE (I'm not sure if this means regex stuff will stop working in PHP.. but I would start converting any page expressions you have to Perl compatible... PCRE seems more robust and refined. Cheers, NRG [/quote] All of the preg_xxx functions are pcre...those aren't being dropped, are they?
  5. re: $PHP_SELF Happy side effect to continued use of $PHP_SELF is that it results in echoing out action='' which under these circumstances, produces the same effect as using $_SERVER['PHP_SELF']. Now, if he were wanting to reference the current script in another script...that would bea different story. re: using short tags. <?= $variable ?> This is actually shorthand for doing <?php echo $variable; ?>. It is not the same as doing <? echo $variable; ?> (using short tags). Although to be fair, <?= .. ?> is a setting in php.ini that can be enabled/disabled, thus putting it in the same boat as short tags, as far as possible server incompatibility.
  6. Unless you have register globals set to ON (which you probably don't), posted data is stored in $_POST['varname'] or $_GET['varname'] (depending on your post method), not $varname.
  7. .josh

    I...

    You gave no reason for coming to the conclusion that I was doing one thing instead of another. You just flat out said that's what I did. That was assumption, and I pointed it out. I gave you the reason why I left out your first statement, when it was called into question. Leaving out your first sentence was not an attempt to discredit you. I simply felt that it did nothing to credit your following statements. If anything, I could argue that your first statement further discredits you, because you think that by saying the proverbial "I'm not racist, but..." is reason enough, when it's not. And I'm not assuming that was your intention. You plain flat out said that my leaving it out is what makes you look like the "bad guy," so it was, in fact, your intention to justify those statements, simply by saying you weren't like that. Just like my example with racism, that's just not how it works. You can't just say you're not a fanboy/fanatic/whatever and then go on to say fanboy/fanatic/whatever things, and expect anybody to believe you're not a fanboy/fanatic/whatever, unless you explain how you really aren't a fanboy/fanatic/whatever, even though you're saying those things. It just doesn't work that way. If you really want me to believe that you are not a fanboy/fanatic/whatever, then perhaps you can explain why you don't feel you are, instead of just saying you're not. Because your following statements to that show otherwise, and so far, you've done nothing to defend that. I even asked you what word you would label those statements as, and you didn't respond to that, either. Now, I could assume that that's because you know damn good and well that I GOTTED YOU, and that your only option at this point in time, you think that you are automatically right, simply by proving me wrong (which is another thing that doesn't work; we could both be wrong). OR, I could NOT assume things, and ask say again: If you really want me to believe that you are not a fanboy/fanatic/whatever, then perhaps you can explain why you don't feel you are, instead of just saying you're not.
  8. That doesn't exactly account for if $int doesn't exist, though. If $int doesn't exist, it will evaluate true, or 0, and echo "pos". You'd have to wrap an if ($int) or if (isset($int)) or something around that. edited for clarification. I posted an example similar to darkwater's and based my explanation off it. But since he posted an example, I changed it to base it off of his example.
  9. .josh

    I...

    I left it out because I felt you were just trying to justify the next statement simply by saying it, when in my opinion, it did nothing of the sort. To me, it's like saying "Now I'm not racist but...black people need to die." That first part of the sentence means nothing, when you don't explain why black people need to die, and explain how it's not racist to want them to die.
  10. .josh

    I...

    Also, I personally did use the term 'fanboy' which I feel is a somewhat milder version of 'fanatic'. No, this is not a "HA I GOTTED YOU" post. It's a "I don't want to go back and edit my previous post because it would cause confusion" post.
  11. .josh

    I...

    fanatic: - A person with an extreme and uncritical enthusiasm or zeal.. - A person marked or motivated by an extreme, unreasoning enthusiasm.. - Marked by excessive enthusiasm for and intense devotion to a cause or idea.. - A person motivated by irrational enthusiasm... - Pertaining to, or indicating, fanaticism; extravagant in opinions; ultra; unreasonable; excessively enthusiastic... Seems like the appropriate word. I am open for alternative words. How would you label your statements?
  12. .josh

    I...

    I appreciate the level of 'deepness' you're trying to accredit me with, but I'm afraid I would not be able to sleep at night, knowing that I have been put on a pedestal under false assumptions. Not too long ago, you got all pissy because Dan and I decided to assume things about posts you made, instead of just taking it at face value. Perhaps you should take your own advice, here. I'd sure hate to consider you as one to adhere to something as base as hypocrisy. If you want to justify being fanatic about hating fanboys, then by all means, go ahead. Most fanatics aren't just blindly extremist about their views; they, too, justify their behavior.
  13. .josh

    I...

    It took you over six minutes to come up with that one. The sad thing is that after you wrote it, you probably smiled to yourself, thinking "HA. NOW I'VE GOT EM". I'm sorry... but Forum Board Psychiatry isn't going to take off anytime soon. Actually, my 2nd post was more of a concession to my first, not a "HA. NOW I'VE GOT EM" post. That's where the whole "I take that back..." part came in. Thanks for playing. Please try again. I think what Ginger probably meant was, responding to fanaticism with fanaticism. Which is pretty much what I said when I said you are a fanboy of hating fanboys.
  14. hmm...interesting...at face value, that does indeed seem to work. I'll look into the manual entries for flush and ob_flush to see what limitations, trade-offs, etc... there are. I mean, I recognize them and know what those things are in a general sense (due to people whining about header already sent errors all the time), but I've never really looked that deeply into them, as I've never really needed to use them.
  15. umm...unless you have some php setup that somehow transcends what php normally does, I'm afraid you are mistaken. The server sends nothing to the client until after the script is done executing. If you had a really large query that returned obscene amounts of results, and echoed this obscene amount of results, it may look like it's sending it as it's coming, but that's because the browser is rendering it as it loads, not because the server is sending it 1 line at a time.
  16. I do not recommend making variables global inside an array. Defeats the purpose of having scope. It depends on what you mean by "passing the file name outside the function". Are you calling another function inside the function? Just pass it as an argument in the function call. Are you wanting to have this file name after the function is called, and its done it's business? Just return the file name. function blah() { $filename = "somefile.php"; return $filename; } $filename = blah(); echo $filename; // output: somefile.php
  17. Just change your column name in your tabulated data into a link that passes the column's name using the GET method, and sort by that. . . . $sortby = $_GET['sortby']; . . . $sql = "select blahblahblah sortby $sortby"; . . . echo "<a href='wherever.php?sortby=column'>column</a>";
  18. premiso: can't do that dot thing because it nothing would be output until the script was done executing anyways. He would indeed have to look into ajax/flash for that. In fact, I think that might actually be the solution: an ajax/flash preloader % loaded type script might have the side-effect of keeping your http session alive.
  19. well it doesn't look like $info is currently an array to be sorted. Well, it is, but not in the sense that he wants it sorted. Kind of like doing this: while ($r = mysql_fetch_assoc($result)) { sort($r); } That would sort the columns returned in the current row. It would not sort by column. What he would need to do is in his foreach loop th calls getProjectedSales(), instead of doing this: $info = getProjectedSales(date(Y),$aCompany['id']); he would do like, this: $info[] = getProjectedSales(date(Y),$aCompany['id']); and then do a sort on $info. Or rather, I guess he'd have to do an array_multisort
  20. able to put it into an array and just sort it?
  21. In your first page you check if prev password matches and if it does, it updates table to new password, but then sends result as 1, which displays the password mismatched message. You send the password updated successfully message only if $sid == ""
  22. .josh

    I...

    I take that back. You seem to be a fanboy of hating fanboys. Paradoxical...
  23. .josh

    I...

    I agree. I mean, I can understand laughing about it, but annoyed enough to hate it and get "boiled" by it and post hate messages about it? Are they doing anything to harm you? Do you throw molotov cocktails at trekkie conventions? Lose sleep at night because of all the insidious renaissance festivals going on? Send death threats to churches? Maybe (and this is just a suggestion) your anger stems from jealousy, for not having found something to believe in or at least enjoy as much as other people.
  24. variables sent through the url are accessed from $_GET['varnamehere'] not $varnamehere
  25. set_time_limit might work for you.
×
×
  • 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.