[PHP] Call to undefined function: dbase_open() in

2001-09-01 Thread yang

i want try to open the test.dbf files ..
but have the problem
Call to undefined function: dbase_open() in



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] virtual nulls include problem

2001-09-01 Thread Alfredo Yong

Hi. I use allways the include built in function to conditionally select 
the php script that build the web page.

I need to add a header at he beginning of an already working script, but 
the directive include don't work:



So I'm using

<% virtual ("../../../../headlvl4.shtml"); %>

This works fine for the header, but makes an error when the include 
built in function calls the php script that shows the main panel of the 
page:

Warning: Failed opening './barra.php' for inclusion 
(include_path='.:/usr/local/lib/php') in 
/www/public/blabla/bla/re-blah/another_blah/blahh/blahblahblah/main.php 
on line 44

I've tried to put the dot ahead the name but it is no working either.

Any help will be very much appreciated



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: problem with ereg() and ereg_replace()

2001-09-01 Thread CC Zona

In article <01b201c13354$0ca601c0$0105050a@pony>,
 [EMAIL PROTECTED] (Stonix) wrote:

> ereg_replace( "{key}", "word", $a_string);
> 
> The web server will return following warnning msg:
> 
> Warning: Invalid content of \{\} in /var/www/html/scrip.php on line #

In regex, the curly braces are special characters used to define the number 
of repetitions to be matched, either as an exact number or as a range.

"a{2}" #"aa"
"abc(2,3}" #"abcabc" or "abcabcabc"
"abc{,2}" #"","abc", or "abcabc"

Are you trying to match the literal string "{key}"?  'Cuz if so, you might 
as well just use str_replace since you're not really in need of ereg_*'s 
special pattern matching.  If you're trying to match a special character 
with a regex, don't forget to either escape it or put it in a character 
class:

ereg_replace( "\{key\}", "word", $a_string); 
ereg_replace( "[{]key[}]", "word", $a_string);

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Really weird problem: cross-server databasing *g*

2001-09-01 Thread Markus Mayer

Forgot to mention ... the only way to access the database on B is to connect
to "localhost" there.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Make Money For Sending E-mail

2001-09-01 Thread fred . bill

Dear [EMAIL PROTECTED],


> BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!! > >
> Before you say ''Bull'', please read the following.>
> This is the letter > you > have been hearing about
> on the news lately. Due to> the popularity of > this
> letter on the Internet, a national weekly news>
> program recently > devoted > an entire show to the
> investigation of this program> described below, to >
> see > if it really can make people money. The show
> also> investigated whether or > not the program was
> legal. Their findings proved once and for all
> that there> are ''absolutely NO > Laws > prohibiting
> the participation in the program and if> people can
> -follow > the > simple instructions, they are bound
> to make some> mega bucks with only > $25 out of
> pocket cost''. DUE TO THE RECENT INCREASE> OF >
> POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT
> IS CURRENTLY WORKING BETTER THAN EVER. > > This is
> what one had to say: ''Thanks to this> profitable
> opportunity. I > was approached many times before
> but each time I> passed on it. I am > so glad I
> finally joined just to see what one could> expect in
> return for > the > minimal effort and money
> required. To my> astonishment, I received total
> $610,470.00 in 21> weeks, with money still coming
> in." > Pam Hedland, Fort Lee, New Jersey. 
> ===
> > > Here is another testimonial: "This program has
> been> around for a long > time but I never believed
> in it. But one day when I> received this again > in
> the mail I decided to gamble my $25 on it. I>
> followed the simple > instructions and walaa . 3
> weeks later the money> started to come in. > First
> month I only made $240.00 but the next 2> months
> after that I made > a total of $290,000.00. So far,
> in the past 8 months> by re-entering the > program,
> I have made over $710,000.00 and I am> playing it
> again. The > key to success in this program is to
> follow the> simple steps and NOT > change >
> anything.'' More testimonials later but first, 
> = PRINT THIS NOW FOR YOUR FUTURE REFERENCE
>
>
$>
> > If you would like to make at least $500,000 every
> 4> to 5 months easily > and > comfortably, please
> read the following...THEN READ> IT AGAIN and
> AGAIN!!! >
>
$>
> > > FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR>
> FINANCIAL > DREAMS WILL COME TRUE, GUARANTEED!
> INSTRUCTIONS: > > =Order all 5 reports shown on
> the list below> = > > For each report, send $5
> CASH, THE NAME & NUMBER OF> THE REPORT > YOU ARE
> ORDERING and YOUR E-MAIL ADDRESS to the> person
> whose > name appears ON THAT LIST next to the
> report. MAKE> SURE YOUR RETURN > ADDRESS IS ON YOUR
> ENVELOPE TOP LEFT CORNER in case> of any mail >
> problems. > > === When you place your order, make
> sure you order> each of the 5 reports. > You will
> need all 5 reports so that you can save> them on  
> your computer > and resell them. YOUR TOTAL COST $5
> X 5=$25.00. > > Within a few days you will receive,
> vie e-mail, each> of the 5 reports > from > these 5
> different individuals. Save them on your> computer
> so they will be > accessible for you to send to the
> 1,000's of people> who will order them > from you.
> Also make a floppy of these reports and> keep it on
> your desk in case something happen to> your
> computer. > > IMPORTANT - DO NOT alter the names of
> the people who> are listed next > to each report, or
> their sequence on the list, in> any way other than
> what is instructed below in step> '' 1 through 6 ''
> or you will loose out on majority > of your profits.
> Once you understand the way this> works, you will
> also > see how it does not work if you change it.
> Remember,> this method has been > tested, and if you
> alter, it will NOT work !!!> People have tried to
> put > their > friends/relatives names on all five
> thinking they> could get all the > money. But it
> does not work this way. Believe us, we> all have
> tried to be greedy and then nothing> happened. So Do
> Not try to change anything other> than what is
> instructed. Because if you do, it will> not work for
> you. > > Remember, honesty reaps the reward!!! > >
> 1 After you have ordered all 5 reports, take>
> this advertisement and > REMOVE the name & address
> of the person in REPORT #> 5. This person > has made
> it through the cycle and is no doubt> counting their
> fortune. > 2 Move the name & address in REPORT #
> 4 down TO> REPORT # 5. > 3 Move the name &
> address in REPORT # 3 down TO> REPORT # 4. > 4
> Move the name & address in REPORT # 2 down TO>
> REPORT # 3. > 5 Move the name & address in
> REPORT # 1 down TO> REPORT # 2 > 6 Insert YOUR
> name & address in the REPORT # 1> Position. > >
> PLEASE MAKE SURE you copy every name & address>
> ACCURATELY! > >
>
=

[PHP] Really weird problem: cross-server databasing *g*

2001-09-01 Thread Markus Mayer

Hi folks!

Let's say you have two servers, on the first one ("A") you have your website
containig all those nice php scripts and co but only a crazy small database
(2 megs), on the second one ("B") you have a really big database available
but the problem, that the provider won't allow you to access the database
from any other place than from your account on B. That wouldn't be the
problem, but B opens pop ups each time, you open a website there - and that
couldn't be the solution.

Has anyone an idea how to access the database on B without opening a webpage
there (and with this, without opening a popup) from server A?

ANY help much appreciated!

Markus Mayer



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problem with ereg() and ereg_replace()

2001-09-01 Thread Stonix

Hi,

I have a strange problem with ereg() and ereg_replace(). I have a 
Linux RH 7.1 machine running apache and php4. On this server, if 
use ereg() or ereg_replace() with "{" or "}", for example,

ereg_replace( "{key}", "word", $a_string);

The web server will return following warnning msg:

Warning: Invalid content of \{\} in /var/www/html/scrip.php on line #

* # stand for the line number of ereg or ereg_replace.

But I have used ereg/ereg_replace on many other php4 web servers
without any problem. I guess this must has something to do with
php configuration. I reviewed/compared phpinfo of my machine with
other machines, couldn't find anything signaficant difference.

Please, in these community, anyone can help me out. Thanks in
advance!

Alex





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: loop? or conditional problem

2001-09-01 Thread Richard Lynch

Your SELECT statement is returning way more rows than you expect, I think,
since it will return the number of users times the number of members minus
however many there are that have the same id...

I don't think you wanted that...

I suspect you want a sub-select where you don't get any users who are
members, or maybe no members who are users...

MySQL *might* let you do:

select ... from members where not id in (select id from users)

OTOH, I don't really understand what you are trying to do in the first
place, but I suspect there's a much easier way to do it...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Syaggie <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 01, 2001 8:26 AM
Subject: loop? or conditional problem


> Okay the the script is attached below.  i am baffled at the problem.  as
you
> can see the script does a rather simplistic generation of passwords.  it
> then writes them into two files.
>
> the problem is the first time i run (i am running it stand alone)  it
works
> fine and the result is two files with 32 entries (and the mysql entries
are
> also correct).  the second time i run it.  i (there should be 44 new
entries
> make one file with 76 entries and another with 44)
>
> however what i get is a file with 1233 entries and another with 1201.
>
> now i admit the code is not beautiful but my concern is more of what is
> causing this.  i have checked the variables both $i and $rows appear fine.
>
> when i look at the text files what i see is it assigns the 44 entries and
> then repeats them.  all i can figure is it is the conditional or whiel
loop?
> why does it work perfect the first time??
>
>
>  mysql_connect("localhost:/var/run/mysql/mysql.sock");
> mysql_select_db("VQRGDATA");
> $letter = array("Gob", "Lol", "woZ", "Kop", "MoS", "tRu", "SAw", "NoR",
> "TEf","TaF", "JoP", "lOg", "tAn", "FiSH", "cAT", "VAn", "bAb", "Mob",
> "KorN", "BeAt", "roSe", "KlaP", "iZ", "GEr", "HaT", "ZaaM", "toAd",
"emU");
> $results = mysql_query("SELECT members.id, members.lname FROM members,
users
> WHERE users.id <> members.id");
> $rows= mysql_num_rows($results);
> if($rows != 0)
> {
> while($info = mysql_fetch_array($results))
> {
> if($info[0] != 0)
> {
> $ids[] = $info[0];
> $lnames[] = $info[1];
> }
> }
> mysql_free_result($results);
> $i=0;
> while($i < $rows-1)
> {
> srand((double) microtime() * 100);
> $pass_letter_key = array_rand($letter);
> srand((double) microtime() * 100);
> $pass_num1 = mt_rand(0, 26);
> srand((double) microtime() * 100);
> $pass_num2 = mt_rand(100, 926);
> $strip = trim($lnames[$i]);
> $lower = strtolower($strip);
> $infochop = substr($lower, -5, 4);
> $username = $infochop.$pass_num2;
> $password = $pass_num1. $letter[$pass_letter_key].$pass_num2;
> $respass = mysql_query("SELECT password FROM users WHERE
> password='$password'");
> $pass_row = mysql_num_rows($respass);
> if(!$pass_row)
> {
> mysql_query("INSERT INTO users(id, username,password) VALUES('$ids[$i]',
> '$username', '$password') ");
> $complete = fopen("complete.txt", "a+");
> $input[] = $ids[$i]."\t".$username."\t".$password."\n";
> fputs($complete, $input[$i]);
> fclose($complete);
> $i++;
> }
> mysql_free_result($respass);
>
> }
> }
> $new = implode("", $input);
> $newtxt = fopen("new.txt", "w");
> fputs($newtxt, $new);
> fclose($newtxt);
> ?>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: chmod and ps ef |grep httpd

2001-09-01 Thread Richard Lynch

> i've been told that the files must be owned by the

Which files?  For what?...

> same person that owns the httpd. using ps ef |grep
> httpd, it says "grep httpd USERNAME=
> ENV=/home/police/.bashrc HISTSIZE="
> my unix login is police. so, what does this mean as
> far as trying to get my chmod command to work?

Probably nothing at all.  You need to look in httpd.conf to see what User is
set to.  If you can't look in httpd.conf (at an ISP)  may
tell you.

If all else fails, you can *probably* do:

echo implode("\n", $results);
if ($errorcode){
echo "OSError $errorcode.  Usually path/permissions.  man
errno.\nMaybe don't even have permission to exec whoami... :-(\n";
}

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ereg question

2001-09-01 Thread js

In the Leon Atkinson Core PHP book, in his ereg example he states that ereg 
will only return the first match on a line.  Can anyone confirm or deny this?

Thanks,
Josh


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] FREE Internet Business --- Start Immediately...

2001-09-01 Thread cici429

--->How To Make It *BIG* on the Net...QUICKLY...with NO Money! 
   
This is NEW and INCREDIBLY EXCITING!! Join Free, WORLD-WIDE!

(Zero investment!) No hassles, no selling, no pressure.
 
Like NOTHING you have ever seen on the net today! No limits...
 
You can join for FREE and MAKE MONEY!!  We will Help YOU!
 
Once your earnings START, they NEVER STOP! 
 
Check out this EXCITING OPPORTUNITY.  Start immediately.

===> I'll email you free details. <=== 

Just send a blank e-mail to:
 
[EMAIL PROTECTED]-->and type "JoinFree" in subject line.
  
(DO NOT HIT REPLY or It will be automatically purged or bounced.)

Hope you don't miss this one.

=

(DO NOT HIT REPLY or It will be automatically purged or bounced.)


--



--
*(REMOVAL INSTRUCTIONS BELOW)**
--
-
If you wish to be removed from future mailings, please send
an email to:  [EMAIL PROTECTED] 
with the subject "Remove" and you will automatically be blocked 
from any future mailings.
 





















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 2 Sep 2001 01:19:48 -0000 Issue 851

2001-09-01 Thread php-general-digest-help


php-general Digest 2 Sep 2001 01:19:48 - Issue 851

Topics (messages 65598 through 65619):

loop?  or conditional problem
65598 by: syaggie

FULLTEXT search sorting results
65599 by: BRACK
65617 by: Mark Maggelet

Re: The future of PHP
65600 by: Christian Reiniger
65602 by: Zeev Suraski
65603 by: Zeev Suraski

Re: formating numbers to two decimal points - money - best ways
65601 by: fx

Mdb conversion
65604 by: Rogerio Coelho - Equipeweb - CompuLand ISP
65606 by: Jeff Lewis
65607 by: Adi Wibowo

Re: Reg-Variables
65605 by: Papp Gyozo

*Great Mortgage Rates*
65608 by: turboduck.mails.ch

Re: File Upload Problem Solving?
65609 by: Marc Davenport

generate random ascii string
65610 by: bill
65611 by: Sean C. McCarthy
65612 by: Philip Olson
65613 by: bill

Re: $str[0] vs $str{0} was : generate random ascii string
65614 by: Philip Olson
65616 by: bill

Memory Usage
65615 by: Prottoss

potential preg_replace bug; unsure however
65618 by: alvarez.sto13.st-oneline.de

Re: seeking good annotate script
65619 by: Matthew A. Schneider

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--



Okay the the script is attached below.  i am baffled at the problem.  as you
can see the script does a rather simplistic generation of passwords.  it
then writes them into two files.

the problem is the first time i run (i am running it stand alone)  it works
fine and the result is two files with 32 entries (and the mysql entries are
also correct).  the second time i run it.  i (there should be 44 new entries
make one file with 76 entries and another with 44)

however what i get is a file with 1233 entries and another with 1201.

now i admit the code is not beautiful but my concern is more of what is
causing this.  i have checked the variables both $i and $rows appear fine.

when i look at the text files what i see is it assigns the 44 entries and
then repeats them.  all i can figure is it is the conditional or whiel loop?
why does it work perfect the first time??


 members.id");
$rows= mysql_num_rows($results);
if($rows != 0)
{
while($info = mysql_fetch_array($results))
{
if($info[0] != 0)
{
$ids[] = $info[0];
$lnames[] = $info[1];
}
}
mysql_free_result($results);
$i=0;
while($i < $rows-1)
{
srand((double) microtime() * 100);
$pass_letter_key = array_rand($letter);
srand((double) microtime() * 100);
$pass_num1 = mt_rand(0, 26);
srand((double) microtime() * 100);
$pass_num2 = mt_rand(100, 926);
$strip = trim($lnames[$i]);
$lower = strtolower($strip);
$infochop = substr($lower, -5, 4);
$username = $infochop.$pass_num2;
$password = $pass_num1. $letter[$pass_letter_key].$pass_num2;
$respass = mysql_query("SELECT password FROM users WHERE
password='$password'");
$pass_row = mysql_num_rows($respass);
if(!$pass_row)
{
mysql_query("INSERT INTO users(id, username,password) VALUES('$ids[$i]',
'$username', '$password') ");
$complete = fopen("complete.txt", "a+");
$input[] = $ids[$i]."\t".$username."\t".$password."\n";
fputs($complete, $input[$i]);
fclose($complete);
$i++;
}
mysql_free_result($respass);

}
}
$new = implode("", $input);
$newtxt = fopen("new.txt", "w");
fputs($newtxt, $new);
fclose($newtxt);
?>





I have query -

$res = mysql_query("SELECT 
skits.*,category.cat_id,category.cat_name FROM skits,category WHERE 
MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang 
like 'English' and skits.category like category.cat_id  limit $limit,10 ");

I expect to get results sorted by relevance and it actually does BUT (!) 
inside of categories =( I mean it sorts result first by category and 
second by relevance. How do I make it to be sorted by only relevance?

Thank you in advance,

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org




On Sat, 1 Sep 2001 14:01:57 +0200, BRACK ([EMAIL PROTECTED]) wrote:
>I have query -
>
>$res = mysql_query("SELECT
>skits.*,category.cat_id,category.cat_name FROM skits,category WHERE
>MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang
>like 'English' and skits.category like category.cat_id  limit
>$limit,10 ");
>
>I expect to get results sorted by relevance and it actually does BUT
>(!)
>inside of categories =( I mean it sorts result first by category and
>second by relevance. How do I make it to be sorted by only
relevance?

try it like this:
$res = mysql_query("SELECT
skits.*,category.cat_id,category.cat_name,MATCH (title,descr,skits)
AGAINST ('%$search_idea%') as relevance FROM skits,category WHERE
skits.lang like 'English' and skits.category like category.cat_id
having relevance>0 order by relevance desc limit $limit,10 ");



Re: [PHP] seeking good annotate script

2001-09-01 Thread Matthew A. Schneider

Daniel,

It doesn't get much easier than Philip Greenspun's "Loquacious"
(http://www.greenspun.com/com/home.html). Philip begins the description of
his free comment server thusly:

"You have a Web server with static pages.  You want users to be able to
add comments dynamically to any of your pages.  However, you don't
want to turn all of your Web pages into computer programs.  You don't
want to sweat your way through all of Web Tools Review and
learn how to run your own Relational Database Management System-backed
Web site.  You don't want to spend the rest of your life backing up
and maintaining the relational database."

Try it you'll like it. It's not PHP though (TCL likely).

Best regards,

Matthew A. Schneider
[EMAIL PROTECTED]


- Original Message -
From: "daniel goldin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 31, 2001 10:31 PM
Subject: [PHP] seeking good annotate script


>
> I'm looking for a good script that implements an
> annotation function--much like the manual at php.net. Anybody
> know where I could find such a beast?
>
>
> Daniel Goldin
> [EMAIL PROTECTED]
> 323-225-1926
>
> www.blue-lamp.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] potential preg_replace bug; unsure however

2001-09-01 Thread alvarez


I built a Perl-style regex to match function calls in C-like
languages where $name is the functions name. The functions
are assumed to accept a single string as parameter.

Here it is.

   /$name\s*\(\s*\"(.*)\"\s*\)\s*;/s

The expression is successfully preg_match'ed on a stream
of code, but when preg_replace is passed the same expression
it does not return. The piece of code I tested this with was
fairly small so that an increased demand of computation time
is unlikely be the reason for this behaviour.

Substituting the subexpression (.*) by ([^\"]*) remedies this.

The version of the PHP install is 4.05.


Any ideas?


  D. Alvarez Arribas <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] FULLTEXT search sorting results

2001-09-01 Thread Mark Maggelet

On Sat, 1 Sep 2001 14:01:57 +0200, BRACK ([EMAIL PROTECTED]) wrote:
>I have query -
>
>$res = mysql_query("SELECT
>skits.*,category.cat_id,category.cat_name FROM skits,category WHERE
>MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang
>like 'English' and skits.category like category.cat_id  limit
>$limit,10 ");
>
>I expect to get results sorted by relevance and it actually does BUT
>(!)
>inside of categories =( I mean it sorts result first by category and
>second by relevance. How do I make it to be sorted by only
relevance?

try it like this:
$res = mysql_query("SELECT
skits.*,category.cat_id,category.cat_name,MATCH (title,descr,skits)
AGAINST ('%$search_idea%') as relevance FROM skits,category WHERE
skits.lang like 'English' and skits.category like category.cat_id
having relevance>0 order by relevance desc limit $limit,10 ");


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] $str[0] vs $str{0} was : generate random ascii string

2001-09-01 Thread bill

Hi Philip,

Yes, I have a choice of PHP3 or 4 and this script happened to be in PHP 3 so
I just tweaked it.  I didn't realize that one day
$chars[mt_rand(0,$chars_len)] would "no longer work", but at least it is
backwards compatible now.  I've made a mental note of that for future
reference.

PHP 3 also barked at

is_numeric()

which I just changed to intval()

I should really do better bounds checking.  How about:

$len=intval($len);
if (!$len) $len=8;

kind regards,

bill

Philip Olson wrote:

> It appears the only change you made was :
>
> > $tmp .= $chars[mt_rand(0,$chars_len)];
>
> >From :
>
> > > $tmp .= $chars{mt_rand(0,$chars_len)};
>
> Which is strange.  the [] use on strings has been depreciated in favor
> of {} as of php4 but I don't know at what version {} came into being
> exactly. What version of PHP are you running, php3?  Or, does anyone know
> much about this?
>
> Anyway, glad it works :)
>
> For informational purposes, this depreciation is stated here :
>
>   http://www.php.net/manual/en/language.types.string.php
>
> And for those watching at home, am referring to :
>
>   $string = 'abc';
>
>   print $string[0]; // depreciated (might not work one day, when?)
>
> vs.
>
>   print $string{0};
>
> Both print 'a' though.
>
> Regards,
> Philip Olson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] $str[0] vs $str{0} was : generate random ascii string

2001-09-01 Thread Philip Olson


It appears the only change you made was :

> $tmp .= $chars[mt_rand(0,$chars_len)];

>From :

> > $tmp .= $chars{mt_rand(0,$chars_len)};

Which is strange.  the [] use on strings has been depreciated in favor
of {} as of php4 but I don't know at what version {} came into being
exactly. What version of PHP are you running, php3?  Or, does anyone know
much about this?

Anyway, glad it works :)

For informational purposes, this depreciation is stated here :

  http://www.php.net/manual/en/language.types.string.php

And for those watching at home, am referring to :

  $string = 'abc';

  print $string[0]; // depreciated (might not work one day, when?)

vs.

  print $string{0};

Both print 'a' though.


Regards,
Philip Olson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] generate random ascii string

2001-09-01 Thread bill

Philip,

With a few tweaks, it works great, thanks!

Here's what worked:

function randomString($len)
{
global $seed;

  $tmp = '';

  $chars  = 'abcdefghijklmnopqrstuvwxyz';
  $chars .= strtoupper($chars);
  $chars .= '0123456789';

  if (empty($seed)) {
mt_srand ((float) microtime() * 100);
$seed = TRUE;
  }

  // weak error checking mechanism
  if ($len < 1 || !intval($len)) $len = 8;

  $chars_len = strlen($chars);

  for ($a=1; $a <= $len; $a++) {
$tmp .= $chars[mt_rand(0,$chars_len)];
  }

  return $tmp;
}

Philip Olson wrote:

> Hi Bill,
>
> Here's a quick hack, should get you on your way :
>
> function randomString($len)
> {
> global $seed;
>
>   $tmp = '';
>
>   $chars  = 'abcdefghijklmnopqrstuvwxyz';
>   $chars .= strtoupper($chars);
>   $chars .= '0123456789';
>
>   if (empty($seed)) {
> mt_srand ((float) microtime() * 100);
> $seed = TRUE;
>   }
>
>   // weak error checking mechanism
>   if ($len < 1 || !is_numeric($len)) $len = 8;
>
>   $chars_len = strlen($chars);
>
>   for ($a=1; $a <= $len; $a++) {
> $tmp .= $chars{mt_rand(0,$chars_len)};
>   }
>
>   return $tmp;
> }
>
> That was fun :)
>
> Regards,
> Philip Olson
>
> On Sat, 1 Sep 2001, bill wrote:
>
> > How can a random string of only letters and numbers be generated?
> >
> > I'm stumped so far on how to avoid including symbols.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] generate random ascii string

2001-09-01 Thread Philip Olson

Hi Bill,

Here's a quick hack, should get you on your way :

function randomString($len)
{
global $seed;

  $tmp = '';

  $chars  = 'abcdefghijklmnopqrstuvwxyz';
  $chars .= strtoupper($chars);
  $chars .= '0123456789';

  if (empty($seed)) {
mt_srand ((float) microtime() * 100);
$seed = TRUE;
  }

  // weak error checking mechanism
  if ($len < 1 || !is_numeric($len)) $len = 8;

  $chars_len = strlen($chars);  

  for ($a=1; $a <= $len; $a++) {
$tmp .= $chars{mt_rand(0,$chars_len)};
  }

  return $tmp;
}


That was fun :)

Regards,
Philip Olson


On Sat, 1 Sep 2001, bill wrote:

> How can a random string of only letters and numbers be generated?
> 
> I'm stumped so far on how to avoid including symbols.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] generate random ascii string

2001-09-01 Thread Sean C. McCarthy

Hi, 

If you have random string including symbols just take them of with
regexp. Look at the manual for regular expresion functions. Hope it
helps.

Sean C. McCarthy
SCI, s.L. (www.sci-spain.com)


bill wrote:
> 
> How can a random string of only letters and numbers be generated?
> 
> I'm stumped so far on how to avoid including symbols.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] generate random ascii string

2001-09-01 Thread bill

How can a random string of only letters and numbers be generated?

I'm stumped so far on how to avoid including symbols.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File Upload Problem Solving?

2001-09-01 Thread Marc Davenport

On Fri, 31 Aug 2001, Jeff Oien wrote:

> I have a user who is unable to upload files but I don't know where
> to start with the troubleshooting process. I have this:
> 
> @copy("$img1", "/blah/$username/$img1_name") 
> or die("File upload didn't work."); 
> 
> and they are getting the die message. All but one person are able
> to upload.
> Jeff Oien

Check the following things.
1. Permissions. The Directory of the particular user might be set
different and therefore be the reason for the upload.
2. Max File Size. I'm assuming that you are trying the same file for all
people, but if not then the one person that can upload might just be
uploading a smaller file than the rest. Just a thought.

You may want to use is_uploaded_file() and move_uploaded_file() if you are
using PHP 4.0.2 or greater.

hope this helps
cheers,
marc davenport
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mdb conversion

2001-09-01 Thread Adi Wibowo


On Sat, 1 Sep 2001, Rogerio Coelho - Equipeweb - CompuLand ISP wrote:
>Hi, Folks !!
> 
>   I am in trouble. I need to convert a mdb database to mysql. 
> Can PHP handle this? Where can I learn about it?
> 
>   Thanks in advance.

It doesn't need PHP to convert access to mysql.
Just go to mysql.com and search for convertion script (vb) to be included
into mdb and run it.

You will get two text files (consist of SQL scripts that create tables and
insert data). Use those files as scripts for mysql.

Adi Wibowo -- http://dewey.petra.ac.id
* Work matter: [EMAIL PROTECTED]
* Private matter : [EMAIL PROTECTED]
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mdb conversion

2001-09-01 Thread Jeff Lewis

I needed this recently as well and found some converters right here:

http://www.mysql.com/documentation/mysql/bychapter/manual_Contrib.html#SEC60
7

They usually are run from within the MDB macros but it helped me convert my
database over :)

Jeff
- Original Message -
From: "Rogerio Coelho - Equipeweb - CompuLand ISP"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 01, 2001 9:40 AM
Subject: [PHP] Mdb conversion



   Hi, Folks !!

  I am in trouble. I need to convert a mdb database to mysql.
Can PHP handle this? Where can I learn about it?

  Thanks in advance.


[]´s
Rogerio Coelho.
Equipeweb - CompuLand Design
http://www.equipeweb.com.br
Tel/Fax:(xx) 24 237-2088

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Reg-Variables

2001-09-01 Thread Papp Gyozo

Hi,

On Linux/Unix systems you may use Semaphore and shared memory functions.
http://www.php.net/manual/en/ref-sem.php

or simply use sessions. However, session variables are stored in flat files
or in db.

- Original Message -
From: senthilvellan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 01, 2001 7:08 AM
Subject: [PHP] Reg-Variables


Hello Techies,

Is it possible to have our own global variables that can
be shared between more than one programs in php.Is there any other go to
share between programs(Other than flat files and database).Any help is
appreciate.

Thanks in advance,
Senthilvellan.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mdb conversion

2001-09-01 Thread Rogerio Coelho - Equipeweb - CompuLand ISP


   Hi, Folks !!

  I am in trouble. I need to convert a mdb database to mysql.
Can PHP handle this? Where can I learn about it?

  Thanks in advance.


[]´s
Rogerio Coelho.
Equipeweb - CompuLand Design
http://www.equipeweb.com.br
Tel/Fax:(xx) 24 237-2088

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP

2001-09-01 Thread Zeev Suraski

At 14:52 01-09-01, Christian Reiniger wrote:
>On Friday 31 August 2001 15:22, Manuel Lemos wrote:
> > > I actually mention PHP-GTK in my sessions.  I mention it as an
> > > anecdote, much like I mention some of the other interesting modules
> > > and projects in PHP (e.g., PEAR).  I'm really not sure why people
> > > think I'm trying to bury PHP-GTK.  Just because I don't see PHP-GTK
> > > as a main course of PHP, doesn't mean I don't think it's an important
> > > and useful project.
> >
> > Oh, man, do you really do that? That is worse than not mention it at
> > all. You may be joking but not everybody may understand it that way.
> > Doing that you ruining the credibility of those efforts that take PHP
> > far out what originally it was meant for. If you are going to just make
> > it a joke, you'd better not mention it at all. I think that is
>
>Heyheyhey, cool down. Anecdote != Joke. That's important. "Anecdote" in
>this context simply means an "and by the way, there also other
>interesting uses for PHP: ..."
>Actually that's just what you wanted him to say :)

Oh, so it *was* the right word? :)

Zeev


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP

2001-09-01 Thread Zeev Suraski

At 16:22 31-08-01, Manuel Lemos wrote:
>Oh, man, do you really do that? That is worse than not mention it at
>all. You may be joking but not everybody may understand it that way.
>Doing that you ruining the credibility of those efforts that take PHP
>far out what originally it was meant for. If you are going to just make
>it a joke, you'd better not mention it at all. I think that is extremely
>unfair for people like Andrei and other that worked so much on it! :-(

Uhm, I'm not joking.  Richard pointed out to me in a personal letter that 
anecdote may not be the right word here (thanks, Richard :).  I mention 
them (PHP-GTK, PEAR, etc) at the end of my presentations, as a list of 
pointers people should look into if they have interest in that particular 
subject.

Manuel, you should *REALLY* relax about this 'Zeev vs. PHP-GTK'.  This is 
absolutely the last time I'm going to say it - I have nothing against 
PHP-GTK, and Andrei and I work very well together.

>So, what? Even if it is like you say, because you have this perception
>that it is not that way in Europe and far east, you are not going to do
>anything to help people living in the Americas to make a better case for
>PHP in the corporate world?

No, that's not what I'm saying.  I'm not going to say what I was saying 
again, though.  Look in my old posts if you're interested...

Zeev


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: formating numbers to two decimal points - money - best ways

2001-09-01 Thread fx

if your datas are stored in a DB you should specify the precision of the
float in the table : float(8,2)

> Anyone have functions for formatting numbers being multiplied by variables
> and whatnot to two decimal points - rounded up? As for displaying total
> cost, etc?
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP

2001-09-01 Thread Christian Reiniger

On Friday 31 August 2001 15:22, Manuel Lemos wrote:
> > I actually mention PHP-GTK in my sessions.  I mention it as an
> > anecdote, much like I mention some of the other interesting modules
> > and projects in PHP (e.g., PEAR).  I'm really not sure why people
> > think I'm trying to bury PHP-GTK.  Just because I don't see PHP-GTK
> > as a main course of PHP, doesn't mean I don't think it's an important
> > and useful project.
>
> Oh, man, do you really do that? That is worse than not mention it at
> all. You may be joking but not everybody may understand it that way.
> Doing that you ruining the credibility of those efforts that take PHP
> far out what originally it was meant for. If you are going to just make
> it a joke, you'd better not mention it at all. I think that is

Heyheyhey, cool down. Anecdote != Joke. That's important. "Anecdote" in 
this context simply means an "and by the way, there also other 
interesting uses for PHP: ..."
Actually that's just what you wanted him to say :)

> > >In this company, they have choose Microsoft stuff because they think
> > > it is the right choice for what they do. For some things, PHP could
> > > be a better choice, but it would be hard to convince who is in
> > > charge above me because PHP does not benefit of a great credibility
> > > in the market that would help me to make a good case to switch to
> > > PHP.
> >
> > In the US (and perhaps in the rest of America), that's relatively
> > true.  That's not the case in Europe or the far east.  It has a lot
> > to do with mentality and corporate culture.
>
> So, what? Even if it is like you say, because you have this perception
> that it is not that way in Europe and far east, you are not going to do
> anything to help people living in the Americas to make a better case
> for PHP in the corporate world?

Much can be done - we all know that. But:
(1) Most of that requires either mucho $$ or heaps|truckloads|... of 
time. Rasmus certainly has neither and the zend people already spend 
their time doing the really important thing (improving the language).
So such marketing campaigns have to come from other people.

(2) American corporate culture (hmm, rhymes with "vulture"... :) listens 
to the players with the most money. MS, Sun, Oracle, ...
So the only marketing plan that has a good chance to work is "Somehow 
make about 5 billion dollars within a year and burn half of it for glossy 
ads etc".
I certainly won't do this...

(3) http://php.net/usage.php
Period.
Marketing really isn't the most important thing to do :)


Conclusion:
PHP's future looks bright, everyone is working hard to make it even 
brighter, and we all can dance happily around on the flowery meadows 
(except when working of course :)

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] FULLTEXT search sorting results

2001-09-01 Thread BRACK

I have query -

$res = mysql_query("SELECT 
skits.*,category.cat_id,category.cat_name FROM skits,category WHERE 
MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang 
like 'English' and skits.category like category.cat_id  limit $limit,10 ");

I expect to get results sorted by relevance and it actually does BUT (!) 
inside of categories =( I mean it sorts result first by category and 
second by relevance. How do I make it to be sorted by only relevance?

Thank you in advance,

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] loop? or conditional problem

2001-09-01 Thread syaggie

Okay the the script is attached below.  i am baffled at the problem.  as you
can see the script does a rather simplistic generation of passwords.  it
then writes them into two files.

the problem is the first time i run (i am running it stand alone)  it works
fine and the result is two files with 32 entries (and the mysql entries are
also correct).  the second time i run it.  i (there should be 44 new entries
make one file with 76 entries and another with 44)

however what i get is a file with 1233 entries and another with 1201.

now i admit the code is not beautiful but my concern is more of what is
causing this.  i have checked the variables both $i and $rows appear fine.

when i look at the text files what i see is it assigns the 44 entries and
then repeats them.  all i can figure is it is the conditional or whiel loop?
why does it work perfect the first time??


 members.id");
$rows= mysql_num_rows($results);
if($rows != 0)
{
while($info = mysql_fetch_array($results))
{
if($info[0] != 0)
{
$ids[] = $info[0];
$lnames[] = $info[1];
}
}
mysql_free_result($results);
$i=0;
while($i < $rows-1)
{
srand((double) microtime() * 100);
$pass_letter_key = array_rand($letter);
srand((double) microtime() * 100);
$pass_num1 = mt_rand(0, 26);
srand((double) microtime() * 100);
$pass_num2 = mt_rand(100, 926);
$strip = trim($lnames[$i]);
$lower = strtolower($strip);
$infochop = substr($lower, -5, 4);
$username = $infochop.$pass_num2;
$password = $pass_num1. $letter[$pass_letter_key].$pass_num2;
$respass = mysql_query("SELECT password FROM users WHERE
password='$password'");
$pass_row = mysql_num_rows($respass);
if(!$pass_row)
{
mysql_query("INSERT INTO users(id, username,password) VALUES('$ids[$i]',
'$username', '$password') ");
$complete = fopen("complete.txt", "a+");
$input[] = $ids[$i]."\t".$username."\t".$password."\n";
fputs($complete, $input[$i]);
fclose($complete);
$i++;
}
mysql_free_result($respass);

}
}
$new = implode("", $input);
$newtxt = fopen("new.txt", "w");
fputs($newtxt, $new);
fclose($newtxt);
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] chmod and ps ef |grep httpd

2001-09-01 Thread Police Trainee

i've been told that the files must be owned by the
same person that owns the httpd. using ps ef |grep
httpd, it says "grep httpd USERNAME=
ENV=/home/police/.bashrc HISTSIZE="
my unix login is police. so, what does this mean as
far as trying to get my chmod command to work?

thanx

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]