Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Everything posted by spiderwell

  1. $i is undefined so first time around its not 0 but just nothing, soon as you add 1 it becomes 1, so you dont see the array[0] if that makes sense
  2. a very enjoyable and informative read, however i still have insomnia and need to find another good thread like this one
  3. i would agree on the sessions thing, array passing in a form seems like extra work to me
  4. so did this actually get solved, its a very confusing thread
  5. never mind
  6. Also there's no closing tag on the </form>. or i couldnt see one, not sure if that would affect anything
  7. 3rd time lucky (god i hope so!) <?php $words = array('ass','fuck','shit'); $string = 'Blah blah blah ass blah blah fuck blah blah shit!'; foreach ($words as $value) { if (strpos($string,$value)) { echo "naughty words limit"; break; } } ?>
  8. this should do the trick, the mistake i made was with instr() it didnt count number of times a rude word might appear, so was looking for 3 different rude words, rather than a total of 3 rude words, be they all different or the same. EDIT*** i should be shot for skim reading, this allows you to have 2 rude words and not more, really as soon as you get a hit of 1 curse word you want it to stop. i will post YET A?NOTHER solution haha i think i need to go to bed!! ****** <?php $i = 0; $limit = false; $words = array('ass','fuck','shit'); $string = 'ass ass blah blah ass blah blah shit blah ass!'; foreach ($words as $value) { $i += substr_count($string,$value);// includes multiple counts of the same naughty word if($i>=3) { $limit = true; echo "naughty word limit"; } if ($limit)break;// stops the search going any further } ?>
  9. actually that is flawed too, give me a few more mins, haha
  10. try this mate, no offence to other poster, but I can't see that snippet working, or maybe I am just going mad: <?php $i = 0; $words = array('ass','fuck','shit'); $string = 'Blah blah blah ass blah blah fuck blah blah shit!'; foreach ($words as $value) { if (strpos($string,$value)) { $i ++; } if($i>3) echo "naughty words limit"; } ?>
  11. hehe cool, i would offer up a solution but am actually trying to work on a project.
  12. all that does is check the bad words array , not the string.
  13. you arent getting the include file as you havent filled variable $fun with a $_GET['fun'] request, so it will never meet the comparison if($fun=="upload")
  14. in my experience its better to do it and not need it than the other way around
  15. you could put a count variable into the loop and use that to trigger your break
  16. the same way you store their details when they first register!
  17. I couldnt see a value for $loginPage
  18. the error message is your clue to the problem, its stating that file already exists. echo out the $secure_folder on the line before so you can see what it is.
  19. do a simple if file exists check before trying to include it.
  20. the obvious answer is to put the missing file in there?
  21. to have it checked just echo 'checked', not checked=checked?
  22. find more about mail() here http://php.net/manual/en/function.mail.php
  23. yeh of course dont put the real name into the field, but I am the worst person for taking my own advice! lol
  24. have you tried to send mail with hard coded values first?, something like this: mail("myownemailaddress@blah.com", "my subject", "my body", "from@me.text.com") try it in its own page, thus keeping the non sending issue seperate from all the other code.
  25. what about a hidden field specifying the table associated with the form?
×
×
  • 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.