Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. except that that isn't case insensitive like you specified.
  2. btw str_ireplace will be much faster than preg_replace, but you have to have php5+ to use it. You could, but alternation is "a lot" slower.
  3. $array = array('unit','qty','amount'); $string = "unit something qty amount more something unit blah qty"; foreach ($array as $word) { $string = preg_replace("~$word~i","<b>$0</b>",$string); }
  4. well considering mine was hacked and I didn't install any 3rd party components...
  5. I think your problem somehow stems from this: $specialid = $id.";".$sizenum; Or another piece of code similar. You're using "& #59 ;" entity instead of an actual semicolon. It's causing it to explode correctly but nonetheless show the semicolon. change it to a literal semicolon instead of entity value. You probably should have seen it in the view source if you had looked....
  6. right click > view source and look at the var_dump etc.. maybe there is some kind of or some other of that type that snuck in there?
  7. I just copy and pasted your code and changed the session var to "11;5 5/8" since that's what you say $cart displays. Your code displays: 11;5 5/8ID is 11 and Size is 5 5/8 bolded part is from the $cart echo, so disregard that. It's echoing out $id and $size just fine. Snart said the same thing. At this point in time, I suggest you make sure you're running the right script. Perhaps you didn't save your most recent version, or accidentally uploaded it into some other directory or editing some old version etc... so make sure you are running the right script in the right location.
  8. The bug is happening somewhere before that explode. $string = "5;1 1/2"; $string = explode(";",$string); print_r($string); as expected, produces: This explode is coming from $var being exploded at a ',' which ultimately comes from $cart. You have echo "$cart"; up there at the beginning; what does that echo?
  9. find a good watermark tutorial. Same principle. Just make an image in your image editor that's white with a transparency of whatever and use that as the watermark.
  10. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  11. I vaguely recall having some version of phpbb on my server like 3 or 4 years ago. It was just a test install to poke at the code, nothing anybody should have cared about, no registered users or nothin'. I remember some tard used the exploit of the day to make himself an admin account and post how l33t he was and deleted all the current posts...read: 1 test post, lol. I was just like, wtf, of all the places to crack, you pick some random test install, delete one stupid "test" post, and then brag about it? I didn't even delete his admin account. How can anybody that retarded by dangerous? I let him hang around for a while and he started posting stupid stuff trying to be my friend I guess. "So...what kind of music do you listen to?" etc... Eventually he got bored and left.
  12. I don't really keep up with news too well, but hasn't phpbb been victim of cracks many times in the past?
  13. Even if you don't personally care to use it (or a js framework in general), having some idea of how they work/are set up will expand your list of potential clients. Would be a shame if you had to waste time or worse, turn down a solid job because you had to work with/around something like that and didn't know anything about it.
  14. Haha, j/k. You have to be pretty to be a phpfreak whore. BURN.
  15. If you really truly want to hardcode serial numbers into your code, just do this: <div class="problemProduct"> <?php $serialNumbers = array('2468','1234'); $error = (in_array($_POST['serialNumber'], $serialNumbers))? null : 'Invalid Serial Number!'; ?> <label for="serialNumber"><span class="product_label">Serial Number.</span></label> <input type="text" name="serialNumber" id="serial" class="serial_numberField" <?php if (isset($missing)) { echo 'value="'.htmlentities($_POST['serialNumber']).'"';} ?> /> <span class="warning"> <?php echo $error; ?></span> </div> All you have to do is add more numbers to the array. You don't need to check the format, as the in_array compares the posted info with what's in the string.
  16. What do you think you are?
  17. Oh and p.s.- I guarantee you 99.999% of the posts that are 'overlooked,' 'neglected,' 'never solved' etc.. are a direct result of the OP failing to make a proper post explaining the situation clearly, wanting people to do their work for them or it's obvious they aren't really making an effort, dumping an assload of code and expecting people to sort through it, it's clear they are trying to build a house when they don't even know what bricks are, etc...; stuff like that.
  18. We already have sql category that has several of the most popular sql databases. Also, we've tried dividing php help into sub-forums in the past, and nobody bothers to try and figure out where their post should go. We used to have a php oop and php noobie forum and got rid of them. It's only a matter of time until we get rid of php math. As far as 'processing' strings and arrays...a lot of them would actually go into our regex forum.
  19. If numeric array... foreach ($rows as $key => $row) { if (!$rows[$key+1]) { // this is last loop iteration, do something } // end if } // end foreach If associative array... $count = count($rows) - 1; foreach($rows as $row) { if ($count == 0) { // this is last loop iteration, do something } else { $count--; } // end if...else } // end foreach
  20. so...starbuck has some dead doppleganger on earth. I think going through that wormhole thing back in season 3 brought her back in time and it inadvertently caused the destruction of earth, and the resurrection ship at earth somehow rezzed her and spewed back through the wormhole to the present. That kind of explains the whole "All this has happened before" thing going on. Discuss....
  21. okay wait wait wait...so is this still your barcode thing? And you're saying all those 1's and 0's are in an array for example, like this: array(0,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,0) and you're wanting to end up with this? array(1,0,1,1,0,0,1,0,1) See I thought you had them in a string, that's why I mentioned trim in some other thread (and why did you start a new thread for this?). If that's what the goal is, then do this: $string = array(0,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,0); $string = implode('',$string); $string = trim($string,'0'); $string = str_split($string);
  22. lol http://www.telegraph.co.uk/scienceandtechnology/technology/google/4413065/Millions-hit-by-Google-breakdown.html made it to the drudgereport top story and in big bolded red, to boot!
  23. homework?
  24. thread locked. You already made a post about this and it was moved to the 3rd party forums where it belongs.
  25. .josh

    question

    yeah...when you were asking earlier about it...I guess everybody kind of assumed you could run it from the command line. Since this is a windows program, there's a possibility you could use com to interact with it.
×
×
  • 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.