Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. well that looks like it's part of the flash object, so it's probably just a simple counter function that updates a text area on the flash stage every 1 second, and resets every time new data is retrieved. You can do something similar with javascript using settimeout() to call a function that recursively calls itself, setting settimeout over and over. just google for a javascript clock tutorial to get the idea as far as counting in general, and as far as it resetting on last update, well you would have that reset back to 0 every time the page makes a new request or through ajax or whatever.
  2. sounds like you want a CMS like wordpress.
  3. perhaps the spaces between the columns aren't really spaces, but something else, like a tab? When you explode ' ' it will explode only a literal space, so if it is actually a tab char (may look like a space char) it will not recognize and explode it. You can try doing this instead of explode: $Data = preg_split('~\s~',$File[0]); preg_split works much the same way as explode, but throws ability to use regular expressions into the mix. \s is a shorthand character class for all "space" type characters.
  4. actually I think the problem is probably the space getting coded as it passes. Apparently it's okay to have $_SESSION['foo bar'] you might wanna try html_entity_decode or urldecode on it.
  5. well it looks like you answered your own question..
  6. You know it would help if you were a bit less ambiguous than "I can't get it to work." First thing I see is $fi = '$i.txt'; single quotes do not parse variables. You need to do this: $fi = "{$i}.txt"; or $fi = $i . '.txt';
  7. Because I am dedicated and determined to be an outstanding pillar of this community, I have scoured the internet for a way for us to talk. http://www.moushigo.com/index.php/the-loler-project/ Ahem: I HAEV NO IEDA WUT U R SAYNG!1!111!1 OMG LOL SPAAK 3NGLISH LIEK A NURMAL HUMAN BNG THAN W3L TOK
  8. Orly, and why's that? Brb editing. Because I only understand English. So I have no idea what you're asking.
  9. I was all excited about helping you out until I got to
  10. you can use website tracking tools like omniture's sitecatalyst or yahoo web analytics to gain insight into what people do on your site, what paths they take throughout your site, specify conversion points when user performs an action, gets to a page, etc.. and see what pages/paths produce highest conversion rates, etc..
  11. Last time I checked, S comes after O.
  12. $new_string = preg_replace('~[^a-z0-9\s]~i', '', $string_to_be_stripped);
  13. and that right there pretty much sums it up. "ZOMG I HAZ PROBLAM U HELP NAO PLZ!!11!1!!ONE!! URGNT!!" <bump> <bump> <bump> <bump> != interesting.
  14. your own parents reading your blog doesn't count, as they are obligated to do so and tell you how awesome it is.
  15. You have got to be kidding. That's almost worth banning you over. That shows an obvious lack of respect for the people who volunteer their time and knowledge to help other people. If you want to make demands and expect things, go to a paid service. You can start by reading the rules. Take special note about the parts where it mentions making some kind of effort to type like a normal human being (read: no half spelled script kiddie crap). Also, in the rules, if you manage to make it as far as #17, there is a link to a well known article about how to ask questions the smart way.
  16. ..and you would store it in the db so....you can make it that much harder to select/filter information...why?
  17. $string = "some random text"; $string = explode(" ",$string); foreach ($string as $w) { $sql = "insert into table (column) values ('$w')"; $result = mysql_query($sql); }
  18. You do not need to wrap brackets around it if it's only one line of code being executed. His code is syntactically correct. As gevans mentioned, echo $pulmonologist to see if it contains what you are expecting it to contain.
  19. I started a myspace account a while back. I'm usually against social networking sites like that but then I got to thinking, as retarded as I think it is, I'll be damned if someone violates my namespace, even on a hellhole like that. The only thing I really ever do with it is occasionally post a few pics of the kids to keep the family off my back.
  20. It is the simplest, and as secure as you can make it. It's a whitelist. You're not on the list, you don't get in. The End. But I wouldn't say its the best. It does not track people who attempt to get around it. MadTechie's latest post takes the whitelist concept and expands on it and adds on to it error/security logging.
  21. It's no more dangerous than any allowing any other user input to reach the database. You would of course sanitize the user input before it goes to your database.
  22. <?php $allowed = array('home','page1','page2','page3'); if (in_array($_GET['page'],$allowed)) { include("{$_SERVER['DOCUMENT_ROOT']}/includes/{$_GET['page']}.php"); } else { include("{$_SERVER['DOCUMENT_ROOT']}/includes/home.php"); } ?>
  23. Kind of bulky, but here's the general principle. Also, a lot of search engines do things like only search words that are n length and/or omit common words like 'a' 'the' 'an' etc... to avoid returning a million results. Also I have a preg_replace in there that strips out all non-alphanumeric chars. That may or may not suit you (like for instance if you were wanting to search for email addresses or urls, that's not going to work for you). Another thing you can do to make it more efficient is to offer options like "exact" vs. "partial" matches. This query string builder will search for all words in the search string that are in the columns, regardless of where it is in the string. If you have an option to do exact matches you can streamline it to do for example select * from table where column1 in ('word1','word2',etc..) This will significantly reduce processing time. <?php $searchString = "foo bar"; // example search string $table = "tablename"; // enter table name here $columns = array('column1','column2'); // enter columns here $searchString = explode(" ",$searchString); // break string into individual words // for each column... foreach ($columns as $c) { // for each word... foreach($searchString as $w) { // remove all non-alphanumeric chars $w = preg_replace('~[^-0-9a-z_]~i','',$w); // add condition to string $querySearchStringParams .= " $c LIKE '%$w%' OR"; } // end foreach word } // end foreach column // remove last ' OR' from the loop $querySearchStringParams = substr($querySearchStringParams,0,-3); // build query string $queryString = "SELECT * FROM $table WHERE" . $querySearchStringParams; ?>
  24. $string = "a.php.txt"; $string = substr($string,0,-4); as far as those "annoying periods at each end" can you please elaborate?
  25. preg_match_all('/"([^"]*)"/', $str, $matches); print_r($matches[1]);
×
×
  • 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.