Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. ...or perhaps you don't fully understand the definition of "computer".
  2. You mean it hasn't already? No argument there...place is def a hellhole...but I was talking about beginning of Judgment Day: Jesus returns, believers raptured,all the worst parts of bible->revelation to start happening, etc...
  3. There are records detailing an account of a termite plague in ancient china that destroyed an entire shipment of abacuses to a university...does that count?
  4. According to some people, the world is due to go to shit by May 21st.
  5. That's because you make the rest of the parts optional. (.[a-z0-9-]+)* You require a single char and then one or more chars from the char class...but then group it (wrap it in parenthesis) and put a 0 or more quantifier on it, effectively making it optional. (:[0-9]+)? You require a : and then 1 or more numbers..but then group it and put a 0 or 1 quantifier on it, effectively making it optional. (/.*)? You require a / and then 0 or more of anything...but then group it and put a 0 or 1 quantifier on it, effectively making it optional. Just google "url regex" or similar, you will see literally a ton of results for some good url validation regexes you can use...it's a very common topic.
  6. $names = array_keys($ages); $who = rand(0,count($names)-1); $who = $ages[$names[$who]];
  7. need to add an underscore to your char class [a-zA-Z0-9_]
  8. well if you insist, look into calling a function onsubmit that utilizes window.open
  9. This whole "js enabled/disabled" argument is way outdated. Requiring a user to have js enabled in order to visit the site has not been "bad practice" for a very long time. Keep in mind that first and foremost, the percent of users who do NOT have js enabled is very low to begin with, and that % continues to decrease. I have worked with many big name high dollar clients/brands that have no issues with only catering to js enabled users...I mean seriously, we're talking like 1-6% of users that have it disabled, depending on what reports you wanna look at. The only thing that remains current/relevant about js dangers is to not solely rely on it for validating data, since a user can easily bypass it. And as far as having a "no js" message appear on a separate page vs. same page...that is moot. Even if you put a message in a noscript tag inside a div or whatever, the user would still have to reload the page in order to get any js on the page running. In my personal experience and opinion, the most "graceful" thing to do, and what I most commonly see, is to have a splash page or div use js to detect that it is enabled. Output a "loading.." type message. Use js to redirect/reload the page w/ a hidden form field or GET var like js=true or whatever. But also include in the loading message a message that says something like "if you are not redirected/page loaded/whatever in 5s then click this link" and have a link with js=false. Then have server-side logic that loads your page with js or no js, based on that js GET var. And that's if you even want to cater to non-js users to begin with: again, something that has been perfectly acceptable for a long time. IMO the only reason you would still want to do that is if you are planning to cater to mobile users, because there are still a fair amount of mobile users out there that do not have js enabled, or have extremely watered down versions of js.
  10. .josh

    ....

    Hey just cuz you can't fit in the pants, walkin' around havin' to hold them up lest they fall down, don't mean you have to be all spiteful. Don't worry, one day you'll grow into them.
  11. we told you the problem, pointed it out easy enough. You have what you need. We're hear to teach, not do your work for you.
  12. the form code looks okay and the php code you posted looks okay...I'm thinking that it's submitting and querying just fine but maybe not displaying results correctly in IE. Post more code, the part you snipped and put "echo " --rest of the code--"
  13. you also aren't actually capturing it. Need to wrap that part of the regex with parenthesis.
  14. .josh

    ....

    I thought you all loved me because of my obscenely large manhood...
  15. There's a space in your negative character class that's preventing the regex from matching when there is a space (I put a red X where the space is): "/<a\s[^>]*href=(\"??)([^\"X>]*?)\\1[^>]*>(.*)<\/a>/siU"
  16. to spam. You know, like how you get junk mail and spam in your email? Same thing.
  17. you are being hit by spam bots.
  18. .josh

    ....

    $auld = lang(sin(e));
  19. That doesn't matter. Putting '' around them would help PHP parse the code faster, and it also ensures that you aren't accidentally using a constant instead of array element (php would try to parse it as a constant first, then an array element...if there happens to be a constant by the same name, it would attempt to find the array element of the constant's value). IOW it's good practice, but not strictly necessary. His problem that his form is not using the same element names as his array elements he's using in his db query. If you compare the $_POST dump to his variables in his db query, you can see that they aren't the same.
  20. okay soo...compare those posted array elements with with you have in your $sql query string...does it look like they match up to you?
  21. do you see a new rows but no data for the cells? Or no rows at all? If it is empty rows, then check to make sure $_POST[...] has data... echo $sql out see what it shows the generated query string to be
  22. you sure it's not updating? The order in which you have your code setup it should make the update when you submit but since there is no $_GET when you submit, your code doesn't turn around and query for it so it looks like it shows up blank or not updated (because your condition only does one or the other, not both). Try refreshing the page after submit to test (or look directly in your db), you should see the updated. You will have to reorder/rewrite your code to do the query to show the data regardless of whether you posted or not. p.s. - use [ code] ...[ /code] tags when posting code.
  23. in general you would do something like this: // dunno how you personally map id numbers to file names..perhaps you query a page name from a db, using the id number, but here's an example array that maps id to page $pages = array (1 => 'a.php', 2 => 'b.php'); $id = (int) $_GET['id']; if (file_exists($pages[$id])) { header('Location: ' . $pages[$id]); exit(); }
  24. $new_string = preg_replace('/[^a-zA-Z0-9|]/', '', $string); most things don't need to be escaped inside a char class. pretty much just the delim you use and whatever quote you use for the pattern string.
×
×
  • 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.