Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. http://www.phpfreaks.com/forums/index.php/topic,282094.0.html
  2. From: Button for PHP code? Cast your vote! Voting ends in 7 days, though that's just an estimate and can be haggled. Please refer to the above quote for a clean look of the buttons, and the image below as to what is "the left" and is "the right". Notice, there are only 2 buttons total being voted on. The 2nd row of buttons is the "hover state" of the top row buttons.
  3. right. you can certainly use java as a bridge to javascript just the same. Was just throwing that out there that since you know php you could go from php to javascript to java. Dunno your situation but in general javascript may be more useful to you, since it's more directly involved in web development. because it is more directly involved in web development, you should pick up on the underlying structure (like the DOM) and point faster. As you learn the DOM, you learn the things like string-as-object and then those will carry over to learning java, which is a much broader "stage" than just web development. My theory is that you'd learn javascript faster than java because you already know php, so use that as a stepping stone to java.
  4. This has thrown me off, as well. I might make a small suggestion for you: learn javascript first. Or if you know javascript, think of javascript as the Rosetta stone between java and php. For me, learning javascript was a lot less painful because it is more directly web-oriented, but also has the Object-based programming (for example, that string-as-object thing you mentioned). IMO this makes javascript a great learning-bridge between someone going from php to something like java. Maybe that's just me, but dunno, maybe that might help.
  5. do you know how to use functions? You use them the exact same way here...including a script in another script is pretty much for all intents and purposes the same as just cut-pasting the stuff in the main script. Example: functions.php function makeBold($string) { return "<b>" . $string . "</b>"; } index.php include ('functions.php'); echo makeBold('hello'); // or $string = makeBold('hello'); echo $string;
  6. that's what the array_merge does. Is there a particular reason why you can't do that (or the other things you mentioned)?
  7. if ($prev_cat_name != $row3['cat_name']) echo $row3['cat_name']; $prev_cat_name = $row3['cat_name'];
  8. select column from table where column not like '%out of stock%'
  9. oh man i feel you. I was up until 3a getting thoroughly wasted, only to have screaming kids jumping up and down on my bed at about 6a. My head hurts so much I wanna vomit my brain out
  10. .josh

    preg_replace

    You should try out the search function, there are literally thousands of threads asking this exact same thing, even with the same bbcode style tag.
  11. select distinct(author) from quote
  12. php is trying to execute getimagesize at the time that you are assigning the value to the array element, not when you are actually performing the preg_replace. Outside of preg_replace, $1 means nothing but a literal $1 so getimagesize is trying to find a file literally called '$1' You are going to have to reorganize your code. One way to do it would be to wrap the entire array element value in quotes (whole thing, function calls and all, so none of that stuff gets executed; php treats it as just some random string for now), and use the e modifier for preg_replace, which will cause php to parse the replacement argument in preg_replace as if you were running eval. Doing it this way will have that whole value "...getimagesize('$1')..." evaluated as php code, but since it is actually evaluated inside the preg_replace call, $1 will actually mean something. The danger to doing this though is if your preg_replace fails to make a match and capture, or if it captures something unexpected, or if the image just doesn't exist, you're going to get the same error thrown up at you, and there's nothing you can do to safeguard against that. In light of that concern, another, better way to do it would be to first preg_match for the pattern and then use the returned value from that, instead of $1. Somewhere in-between your preg_match and getimagesize, you can check to see if the image actually exists, before you try to getimagesize it.
  13. should probably strtolower the session var too... $moderators = array('Admin', 'banana', 'orange'); if (in_array(strtolower($_SESSION['user_name']), array_map('strtolower', $moderators))) print('Found it!');
  14. echo $uploadfile or view the output source and look at your href. Does it contain what you expect? My guess is you probably want to use $filename instead of that $_GET...
  15. You probably got the off-brand sharks-with-laser-pointers then. Next time, don't be so skimpy.
  16. oh come on now, why do you feel the need to lie? If you really tried sharks with lasers, you wouldn't have posted, as that would have definitely worked.
  17. php is a server-side language, parsed on the server. It cannot do this sort of thing.
  18. You could try telling them to stop. If that don't work, get a large dog, that usually scares people away. If that still doesn't work, I suggest looking into getting sharks with lasers.
  19. it always makes me loll when someone bitches about sci-fi not being realistic/believable (enough). I think many people forget what that "fi" is short for...
  20. so..you're saying out of all the things floating around out there, you consider 3-somes to be what is damaging the fabric of society, corrupting and perverting it? And I'm not quite sure I understand how you can say a 3-some is not immoral in an of itself, but the consequences from doing it, is? How does that work?
  21. This is not what we are here for. Read the rules.
  22. if I'm not mistaken, a windows 32-bit OS can only use up to about 3gb or ram. You will need to upgrade your processor (which may involve upgrading your mobo, which in turn may involve upgrading other things like your power box), and OS.
  23. And yet hating kids and being superficial is not morally wrong?
  24. how else do you plan on getting a 3-some? You can't seriously call yourself a man and not want a 3-some...
  25. what is the actual date? Is it a pre-1970 or post-2038 date?
×
×
  • 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.