Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Yes, when will we learn to leave well enough alone and stick to naturally manipulating it?
  2. Example: Pick the correct 2-answer combo:<br /> <form action = '' method = 'post'> <input type = 'checkbox' name = 'question[]' value = 'a'> a <br /> <input type = 'checkbox' name = 'question[]' value = 'b'> b <br /> <input type = 'checkbox' name = 'question[]' value = 'c'> c <br /> <input type = 'checkbox' name = 'question[]' value = 'd'> d <br /> <input type = 'submit' value = 'submit'> </form> <?php if ($_POST) { $answer = array('a','c'); if ($_POST['question'] == $answer) { echo "<br/>correct"; } // end if } // end if ?>
  3. Other alternatives: - You can make the values a string with a separator like "val1|val2" and then explode at the | - You can make one of the values the index name to modulename, if they are unique to each choice. <input name="modulename[val1a]" type="checkbox" value="val2a" /> <input name="modulename[val1b]" type="checkbox" value="val2b" /> - You can have a hidden field for each checkbox named something associated with the checkbox (so you know which one to match it up to) - Same thing as ^ but use sessions
  4. Well what I'm saying is that if you say you understand what the function does, then you should understand the numbers. -1, as the comment in the code says, is a flag to specify that no matches are found yet. 0 means you found a 100% match, >1 means the levenshtein distance between $string1 and $string2. The description in the manual tells you So for instance: cat vs. cat : nothing has to be changed, so the distance is 0. 0 == match. rat vs. cat : only 1 character has to be replaced to change rat to cat, so the distance would be 1. rats vs. cat : 1 character has to be changed (r to c) and one char has to be removed (s), so distance would be 2. dog vs. cat : all 3 characters in dog have to be changed to make cat, so the distance would be 3. So, the smaller the number, the closer a match there will be. It's up to you what's the maximum number returned to accept as an acceptable suggestion. You just have to look at the average length chars for your data.
  5. http://www.phpfreaks.com/tutorial/basic-pagination
  6. Always someone Else's fault... I wasn't blaming corbin. I was simply explaining the reasoning behind my words. I accepted responsibility; hence the apology.
  7. Your tooth falls out, oh nohs! Don't worry! You can put it under your pillow, close your eyes and forget about the problem, dream sweet dreams, and tomorrow, your tooth is magically replaced by money. I think I should rename this thread to Tooth Fairy Economics.
  8. Ah yeah, sorry. I knew Jeff designed it and you coded it. I just sort of used "design" in a more generic sense, because that's the word corbin used. Didn't mean to not give credit where credit's due!
  9. I thought the original hacker was a maker of small wooden things, like furniture? Through carving and hacking? That's where the surname comes from, I'm pretty sure Right, but it's easily concluded that it's not the case here from statements 1 through 5. You gots teh trolled
  10. He's talking about the example use of the function in the manual. levenshtein
  11. That makes no sense. If you understand how it works and what it does, then...well, what's left to understand? So what exactly do you mean by "actual numbers"
  12. Which there's a good possibility she will be going to him for that stuff, anyways.
  13. Dan designed it. And no we are not going to make any special effort to cater to previous browser versions. People argue that that cuts out a good chunk of the potential viewers. Well we reason that they are only potential viewers if there is a possibility they will be going to a site like this. Avg Joe internet surfer is not a coder, so he would not be looking for a site like this. The people who are interested in sites like these, will more than likely have the most up-to-date version of their browser installed. We cater to them, not Avg Joe surfer.
  14. Hey I'm just saying, it's all fun and games until something happens to you. Too many people have the mentality that it's not their fault they did something illegal, it's the other person's fault for not being protected. That's like the schoolyard bully saying it's not his fault he punched the little kid, it's the little kid's fault for being so small and not being able to defend himself. And then on top of that, you let him get in trouble for something you did. And again you say, it's not my fault the authorities are too stupid to catch me. And they know deep down they are wrong. That's why they constantly have to shift the blame onto others. Too many people do this. Too many. Too many people do no think of the person across the country or down the street or even the guy next door as a real person just like them. It's a sad, selfish world we live in.
  15. Come on now...google is your friend.
  16. example: page1.php <?php echo "<a href='page2.php?foo=bar'>page2.php</a>"; ?> page2.php <?php echo $_GET['foo']; // output: bar ?>
  17. okay well you could just like, have thumbnail.php run a query to grab all the info and echo out all the thumbnails in a loop, but make it them links, passing the filename in the url. Or some id associated with it, or whatever. Then when you click the link it takes you to output.php?foo=bar and in output.php you would use $_GET['foo'] to display the picture. If you passed some id you could run a query to grab the file info based on the id or if you passed the file name just echo an img with the GET var as the src or whatever.
  18. First off, if you have 200 columns in 1 table I'd sit down and reconsider your table structure. There's more than likely any number of ways to break that down into several tables. But disregarding all that, if you have 200 tables and you are going to actually use all but 1, then you may as well just select *.
  19. okay you posted: $a[endtime] is this: 1227633359 $a[startime] is this: 1227606359 so those vars are already unix timestamps, right? So no need to mktime them, as mktime is used to make unix timestamps
  20. use date
  21. so...do you have a list of checkboxes and you are passing the checked ones as a posted array and assigning it to $q so that $q looks like for instance, this: $q = array('2a','2c'); ? If so, you can do $match = array_diff($q, $correctanswer[2]['number2']); if (empty($match)) { echo "match"; }
  22. that line parses okay for me...
  23. actually, my bad. they are in echo $correctanswer[2]['number2'][0]; // 2a echo $correctanswer[2]['number2'][1]; // 2c
×
×
  • 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.