Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Mistral 🤖

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by Mistral 🤖

  1. are you naming your checkboxes as an array called genres? example <input type = 'checkbox' name = 'genres[]' value='whatever'> <input type = 'checkbox' name = 'genres[]' value='whatever'> <input type = 'checkbox' name = 'genres[]' value='whatever'>
  2. $2k. There's a k at the end of that. As in $2,000. Yes, earning extra money from the stock market sounds like a cool thing. That's why decided to try it. But I said I felt it wasn't worth it because $2k isn't a whole lot of money to start out with. So it stands to reason that if I had more money to play with, I might enjoy it more.
  3. .josh

    Porn Site

    LoL...why do I get the feeling you were inspired by Zack and Miri Make a Porno?
  4. http://www.phpfreaks.com/page/forum-rules
  5. What does being a programmer have to do with playing the stock market? Are you asking what kind of technology related stocks do we, as programmers, tend to go for? Anyways, a couple years ago I decided to try my luck at the stock market. I invested $2k into it. Decided that it wasn't really worth it unless I had significantly more money to start with and sold what I had. My programming skills had no influence on what stocks I chose to buy/sell.
  6. dunno what the rest of your code looks like, so you may have to alter this a bit, but basic idea is implode the checkbox array to make a comma/quote separated string of the selected genres and then use the IN() comparison function: $genres = implode("','", $_POST['genre']); $query = "SELECT songName FROM tablename WHERE genre IN('$genres')"; echoing $query should for instance look like this: SELECT songName FROM tablename WHERE genre IN('Jazz','Rock','Blues')
  7. How/why is it being stored with numbers like that in the first place? Can't you add line breaks to it when you initially store it?
  8. chmod
  9. @ProjectFear: yeah probably. For some reason I interpreted the OP to mean "You can pick up to 5 but no more." @rn14: in the else {..} use a header to redirect back to the form.
  10. You mean like this? if (count($_POST['meal']) > 5)) { // too many }
  11. It's more secure... but I mean, better security for a switch comes into play because it doesn't echo out packets to all the ports. But we're talking about an xbox and a personal computer at home... but it is technically harder to setup. He has to set his computer up as the gateway and have at least 2 network adapters, 1 for the internet and one for the switch. Also with a switch, you can really only have one device using the internet at a time, because all of the devices share the same IP address. You would have to basically get your ISP to give you multiple IP addresses and go from there. A router acts as the gateway, routing packets to multiple devices even with just one IP address. Not to mention, most routers these days already have a switch built-in. Bottom line is that if you're wanting to make a local area network (lan) ONLY, go for a switch. Example is if you want to give printer access to multiple computers. You can also use a hub for this. But if you're wanting multiple devices to independently access a wide area network (wan) like the internet, go for a router.
  12. based on his description of what he was trying to do and what he did to fix it, I think he really did buy a switch.
  13. Oh. Well then use the code you already posted: $filename="words.txt"; $words=file($filename); shuffle($words); $word=$words[0]; echo $word; file will take all the lines in words.txt and put them into an array, so if there's 4 lines with item1 in your file, it will be in the array 4 times. Then you just shuffle it and pick one. Now, you did say this: That will be hard, if not altogether impossible to accomplish. What if you have like 10 item1's and 2 item2's and 1 item3's? I have no idea what your data range/occurrence is/will be but that's something you also need to explain or at least consider.
  14. $list = file("words.txt"); sort($list); $counts = array_count_values($list); $list = array_unique($list); $list = array_values($list); foreach($list as $key => $val) { $list[$key] = "$val|{$counts[$val]}"; } echo "<pre>"; print_r($list); echo "</pre>";
  15. Or you could store the value in a session var and check the posted var against that, and wrap the query itself in a if(!$_POST) { ...}
  16. Well, it would still sort of be the same principle. You'd have a column in your user account table called numLogins or something and inc it every successful login. Then in your login script, check what number it's at. if it's >=5, don't let them login. Send them to some page saying they logged in 5 times already, or whatever. If you are not wanting to login in anymore whatsoever (like, not even creating a new account)...well, there's no way to 100% prevent them, but you can log their ip address and check for it when registering. But again, there's no way to 100% prevent them from getting around that.
  17. damn ted, you sure do have a lot of regex questions. maybe you should just buck up and read a regex tutorial or two.
  18. I would setup a table that records every time there's a failed login attempt. It would contain columns for ip address, username, time, etc... and in the login script, before selecting where username&&password, check to see how many that ip address has tried to login or how many login attempts were made with that username or both. Could have a cronjob that removes entries after x amount of time or set it up to where user has to contact someone through a form or whatever. Really depends on how robust you want to make it.
  19. I believe your problem is that it selects a random question every time you load the page. So for example, when you first go to the page it selects for instance question 2 but when you hit the submit button and the page reloads, your script turns around and selects another random question/answer and then compares the posted var to it.
  20. Please do not make multiple threads asking the same question. I'm closing this thread because you made this one second, and the first one you actually showed some info.
  21. $updateqa = "UPDATE question SET question='$pquestion', answer='$panswer' where id=1"; Need to change your other ones too.
  22. you should have bought a router, not a switch.
  23. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  24. well if vars echo out correct then perhaps those functions are not evaluating as expected. When I asked where they were, I meant I don't see them anywhere (you did not post them), so I can't see if they are evaluating correctly....what do you mean by this? Are you saying they don't exist? You can't just call functions that don't exist. edit: well okay I see user_exists() but not the other ones.
  25. if (!isset($_POST['submit'])){ remove the ! you're telling it to update it if it's NOT set (as in, you haven't clicked submit yet).
×
×
  • 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.