Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. I see at one point in time you mentioned what you want, but then say that 'setup' does just that. So...was there a question in there somewhere?
  2. There are more than enough information and links provided to do what you want. We aren't here to write your code for you.
  3. http://www.phpfreaks.com/tutorial/php-add-text-to-image
  4. could be you (or user or whatever) entering it into the form. could be how you coded the form, perhaps with default values or something. Who knows? We can't begin to tell you without seeing that code.
  5. trim should work but fyi that code is not adding the space.
  6. So are all of the values of this array going to be 1, or else they are all going to be 0, as in, it's always going to be one of these? $array = array(1,1,1,1,1); or $array = array(0,0,0,0,0); ? If so.... $somevar = (array_sum($array) == count($array))? 0 : 1;
  7. Some may recall a thread a while back in which cloud computing was discussed. Here's a new article related to that: http://www.guardian.co.uk/technology/2009/jan/25/google-drive-gdrive-internet
  8. also your header call is not going to work if you have output before it. You have 3 files included in before it that may or may not have output.
  9. The problem is that he refuses to learn the basics so 5m from now he'll be asking for someone else to fish for him again instead of taking the time to learn how to fish. It is not technically against the rules to try and bum answers off people, but we promote learning, not bumming for handouts.
  10. I'm sure you'll figure out why soon enough.
  11. You need to use a database or a flatfile to keep track of which one was used last. The mechanics/coding is pretty much the same as a page hit counter (so google page hit counter tutorials for coding), except for that you will want to include a condition to check whether the last one was reached or not, and if so, reset the counter. You would just use the current number in the file as the array position for setting $driver.
  12. You need to have the watermark image and use the gd library functions to open the target image, superimpose the watermark over the image and save the result back to the image file.
  13. rand only calculates and returns a unsigned 32 bit integer so your number range is too high. To work around this, you can instead do something like this: $uniID = "FCP-"; for ($x = 0; $x < 10; $x++) { $uniID .= rand(0,9); } Note that this does not guarantee a unique id though. You will still have to check it against previously generated id numbers. If you want some kind of random number generation that does not depend on checking previously generated numbers, you can incorporate the current time into it, since the time will always be unique, compared to previous timestamps.
  14. well anyways, if ^^ is what you mean, then you can do this: <?php $string = ' newsText[0] = "News Headline 1"; newsLink[0] = "/link-to-story1.html"; newsText[1] = "News Headline 2"; newsLink[1] = "/link-to-story2.html"; newsText[2] = "News Headline 3"; newsLink[2] = "/link-to-story3.html"; '; $code = explode("\n",$string); $code = array_filter($code); foreach ($code as $key => $exp) { eval("$" . $exp); } echo "<pre>"; print_r($newsText); echo "</pre>"; echo "<pre>"; print_r($newsLink); echo "</pre>"; ?>
  15. so I think what you're saying is... is the literal text in your string or file or whatever, right? And you're wanting it to basically be as if you were writing physical code to assign those "....."; to those news...[..] arrays, right?
  16. .josh

    PHP trashing

    I heard microsoft.com runs on a linux server.
  17. well i can't tell you for sure, since I don't know what your code looks like overall. But I do see a bunch of variables that are named similar things, which means you probably could have used an array instead, and just done $catx = array(array of those vars); if (in_array($index, $catx)) { ... }
  18. Based on your variable names, I have a sneaking suspicion you could be writing your code a whole lot better in the first place, but working with what you have... foreach($cat as $index => $value) { if($cat1 == $index || $cat2 == $index || $cat3 == $index || $cat4 == $index || $cat5 == $index) { $output[] = '<a href="/directory/'.$index.'/">'.$value[2].'</a>'; } } $output = '- ' . implode(' | ',$output); echo $output;
  19. The 'karma' systems are usually limited in that there could be multiple people that helped in a thread, but you may only be able to give marks to one person in the thread, or hand out a certain amount of karma at a time, etc.. (most karma systems have some kind of limitation like this in place, to prevent abuse). And on that note, we found that, just like virtually every other site out there, people tend to abuse the karma system. It's not so bad on social oriented sites, but on support sites where it's intended to be used as a measure of helpfulness...well, you just can't filter out the marks that were given for social reasons. This makes the karma system not dependable for accuracy of helpfulness/knowledge. With hand-picking promotions, we don't have to worry about the b.s. involved with people giving out positive or negative marks to other people for arbitrary reasons. We allow for nominations and then we allow for thoughts and comments and voting on the nominee, even by his/her would be peers. We acknowledge that hand picking people is a slower process, but overall, it is more accurate.
  20. You already have a thread asking this same thing. Do not make multiple threads asking the same thing. Also, please stop making vague titles in all caps. Read the forum rules. Thread closed.
  21. what's in sdb_setup()?
  22. The fact that your mom and her friends talk about you being 'hung' doesn't bother you? Or openly telling people in public this, doesn't bother you? Oh boy, I think we have our next episode of Jerry Springer.
  23. If you are going to lie and pull the disability card, do yourself a favor and research what you're claiming first. People who really do have disabilities and are diagnosed with them tend to know all the facts behind it. If you really have Asperger syndrome, you would have known that people with Asperger syndrome need to have things spelled out for them moreso than others, because they tend to moreso not make connects on abstract levels, which is exactly the opposite of how you are claiming you learn things.
  24. the pcre regex functions (preg_xxx functions) requires the pattern to have a delimiter at the beginning and end of the pattern, so that it knows what the start and end of the pattern is. The reason it requires it is because the pattern modifiers are also specified in the pattern string, outside of the delimiters. You can use pretty much anything that is not a letter or number like / ! # ~ < [ and you have to use the same character you on the end of the pattern as you do the beginning, like /..../ or !...! or ~....~ Exception to this is the < and [ in which case you would use its closing counterpart, like so: <...> [....] What delimiter you choose to use is mostly a matter of style. Most people pick their poison and stick with it no matter what, but some people will alternate, depending on what kind of content they are working with. For instance, if you are scraping pages with html in it, and you are using / as your delimiter, you will have to escape / every time you want to use it in your actual pattern, so that the regex engine doesn't get confused and think you are ending the pattern. So, some people like to use something that won't be used in their regex pattern as their delimiter. Characters that must be escaped: As mentioned, whenever you want to use your delimiter in your pattern, you need to escape it. Also, you need to escape characters that have special meaning to the regex engine, if you want to use them literally. Special characters include meta-characters and quantifiers like . * ? + For example, a * means match 0 or more of something. If you are wanting the engine to specifically match a *, you would escape it \* Other things you need to escape are [ ] and ( ) because the engine uses those as ways to group things. If you see anything else escaped, like \s or \d or \1 or whatever, those are not really the same thing. You don't need to escape an 's' or 'd' or '1' or whatever. But some things take on special meaning when you do escape them. Some things are turned into wildcards that match a range of certain similar things. For instance, \s is shorthand for matching various 'spaces,' like a literal ' ' or tab or span. \d is shorthand for matching any one digit or exponent. Some escaped things act like variables for previously matched items (that you capture, not just match) in your pattern.
×
×
  • 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.