Re: [PHP] need help with MySQL full text searching!!!!
I think you need to make a second index that just consists of the one column ALTER TABLE biblio ADD FULLTEXT (title) if you want to search on just that one column. ---John Holmes... Exactly! If you want to do a fultext search on a single column you must have a fulltext index on that column. If your query searches in more than one column, you have to add a multicolumn index on all those columns. And also, the string (word) you are matching must be over 4 characters (maybe not on MySQL 4.x, but surely on MySQL 3) Regards, -- Andrei BEJENARU - Developer InterAKT Online http://www.interakt.ro/ Tel: +4021 312.53.12 Tel/Fax: +4021 312.51.91 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GD library update
Yury B . [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I need to use function imagecreatetruecolor() in my script but it doesn't work on my local apache+php+mysql on XP server. It works fine on the real server though but i need to play with it around. What do I need to do to get it work? from docs I understand I need gd 2.0.1 or higher, well how to get it and how to install? Thank you, Yury The gd library is shipped with the PHP distribution, so you should simply upgrade to version 4.3.1 or 4.3.2. You must download the big zip distribution, as it has all the needed libraries. Follow the instructions in the install readme file and you should have no problems. Andrei BEJENARU -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: template engine
You must use $template = preg_replace(!{for loops=(.*)}(.*){/for}!U, code('\\1','\\2'), $template); since the references are of the form \\n Andrei BEJENARU Niels Uhlendorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Since I don't want to continue with Smarty I started with an own (little) template engine. In this first try it should only replace {for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs INTEGER times. This mission was sent to the function loop in this file: http://www.offucia.org/pages/template-engine/source.php?file=engine.php In this file I try to work with it http://www.offucia.org/pages/template-engine/source.php?file=test.php But the file loop() cannot be found and theres this mistake error: Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26 Line 26 is this one: $template = preg_replace(!{for loops=(.*)} (.*) {/for}!U,code($1,$2),$template); Many thx 4 help Niels Uhlendorf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Password generator
Here's a little function that could help you... It uses the ASCII table to generate the characters and it still needs to be customized for any length and to deny the use of the special characters... Don't forget to set the mt seed! function generatePassword() { $passwd = ; while(strlen($passwd)10) { switch(mt_rand(1,4)) { case 1: $tmp = chr(mt_rand(33,46)); if ($tmp!=' $tmp!=\) { $passwd .= $tmp; } break; case 2: $passwd .= chr(mt_rand(48,57)); break; case 3: $passwd .= chr(mt_rand(65,90)); break; case 4: $passwd .= chr(mt_rand(97,122)); break; } } return $passwd; } Davy Obdam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi people, I have to make a password generator, but i have a little problem. - It needs to generate password 8 characters long, and including 1 or 2 special characters(like #$%*@). - Those special characters can never appear as the first or last character in the string... anywhere between is fine. I have a password generator script now that does the first thing... but the special character can be in front or back of the string wich it shouldnt.. i have been looking on the web for this but i havent found the answer. Below is my scripts so far.. Any help is appreciated, thanks for your time, Best regards, Davy Obdam -- -- ?php // A function to generate random alphanumeric passwords in PHP // It expects to be passed a desired password length, but it // none is passed the default is set to 8 (you can change this) function generate_password($length = 8) { // This variable contains the list of allowable characters // for the password. Note that the number 0 and the letter // 'O' have been removed to avoid confusion between the two. // The same is true of 'I' and 1 $allowable_characters = abcdefghefghijklmnopqrstuvwxyz0123456789%#*; // We see how many characters are in the allowable list $ps_len = strlen($allowable_characters); // Seed the random number generator with the microtime stamp // (current UNIX timestamp, but in microseconds) mt_srand((double)microtime()*100); // Declare the password as a blank string. $pass = ; // Loop the number of times specified by $length for($i = 0; $i $length; $i++) { // Each iteration, pick a random character from the // allowable string and append it to the password. $pass .= $allowable_characters[mt_rand(0,$ps_len-1)]; } // Retun the password we've selected return $pass; } $password = generate_password(); echo $password; ? -- --- Davy Obdam Web application developer Networking4all email: [EMAIL PROTECTED] email: [EMAIL PROTECTED] internet: http://www.networking4all.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php