Chroder · Senior Member

About

Username
Chroder
Joined
Visits
0
Last Active
Roles
Registered Users
Thanked
0
Badges
0

Comments

  • Well now you know to make regular backups :p
  • On second thought, if you already have 10,000 paragraphs loaded into memory (that is, in a $var), then exploding it into an array shouldn't be much more intensive then it already is. If it needed to be fast and light, you should either 1) read the …
  • You could use explode() to get each paragraph by iteself, then just use mt_rand() to get a random paragraph from the array. But considering there are 10,000 of them -- this isn't very efficient. First, you'll have to count how many paragraphs there…
  • Just use strip_tags() to strip all HTML from the content.
  • Rails is a very nice framework indeed. Granted, there are other frameworks on virtually every platform that do much the same thing, but Rails is still nice :) What makes it better is the fact it's built in Ruby. Ruby has got to be my favorite scrip…
  • Note that CGI is not Perl. CGI is simply an interface for a program to communicate with the web server. That program could Perl, PHP, Ruby, C, C++, Visual Basic, Python... Anything. So as per the question: I use Ruby and thus I use CGI. There is mo…
  • It should work just fine. What is the context you are using it in? That is, how in the HTML document is it being called etc.
    in Arrays Comment by Chroder January 2006
  • I don't think it is possible to maniplulate selections outside of form elements.
  • I comply with standards when it makes the code clean. But I don't stress over compliancy. For example, I sometimes use the non-standard '-moz-border-radius' CSS property on some elements. While this is not compliant, it gives a nice effect for Moz b…
  • PHP has a collection of string functions that when combined can let you do just about anything. Depending on how you want to go about things, there are usually more then one way to achieve the result you wish. For example, you could simply use som…
  • I have an 80gig IDE and a 160gig SATA. I'm probably going to buy another soon, as I still have to clear out old files continuously.
  • I have an Intel right now, though any subsequent computers I will ever buy in the near future will undoubtedly be powered by an AMD chip. That is, unless I buy an Apple computer in which it's apparent I'll be using Intel.
  • I use a Logitech MX1000 lazer cordless mouse. Love it.
  • I prefer the effects of stimulants (caffeine) to those of depressants (alcohol).
  • Since you say "recently downloaded ... Express Edition", I assume you are referring to MS's .NET solutions. If so, VB.NET has the exact same capabilities as C#, C++.NET etc. The only difference between the languages is syntax. There are a…
  • http://php.net/manual/en/function.session-set-cookie-params.php
  • You must be passing it to htmlspecialchars() or related function for this to happen. The string returned by nl2br() will be valid, renderable HTML. [php]$str = "Hello\nWorld."; $str = nl2br($str); // $str is now: // Hello // <br /&g…
  • Use nl2br(). If you were to use str_replace, remember you must search and replace not only \n, but \r and \r\n as well (\n for *nix, \r\n for Windows, \r for Mac).
  • I own both IPB and vB, and I prefer vB. I've used SMF, too (helping a friend run a forum with SMF, actually) and if I had to choose a free board, it'd be that. IPB is almost on par with vB feature-wise (though I know for a fact that I wouldn't be a…
  • Just make PHP output some javascript that will write the number. [php]<?php //...get num from database, assume its in $num echo 'document.write("' . $num . '");'; ?>[/php] Then the code snippet you tell them: [html]<script typ…
  • Well doing 50 reads and 50 writes in one script can be handled fine, that's not really the problem. It's the amount of users that are doing it all at once. One read and one write should work well even under high traffic, though. When you start look…
  • Should be okay. 500,000 is not that large for a DBMS. For example, you see vB forums with 5 million+ posts, which should give you an idea. What you need to watch for is the amount of times you access the table. If you have too many read/writes goin…
  • Just use fopen with write mode. If the file doesn't exist, it will be created. Note the directory must have write permissions.
  • My favorite is FlashFXP. Missing features from clients like SmartFTP, but I like the simple interface.
  • First, create an array of the possible actions you want to take. Then loops through the array, testing each value to see if the index exists in the $_REQUEST superglobal. [php]//// Possible actions //$actions = array( 'main', 'login', 'foobar' );…
  • What do you want =/ $_GET and $_GET will hold the values...
  • To create a 'remember me' cookie, just make sure to include both the username/id and a password, and authenticate both on every page load. Though you obviously don't want the password to be in plain text, you'd want to hash it in the very least (wi…
  • I hate winter and I hate the cold :)
  • "Head First Java" by O'Reilly.
  • Creating a chat server and client isn't hard at all. In fact, a book I have on Java has a step-by-step walk through.