Re: [PHP] Searching for text in a file

2001-09-10 Thread David Robley

On Mon, 10 Sep 2001 16:41, Richard Kurth wrote:
> I am having a problem with searching through a file for a curtain
>   text. Like the text below [EMAIL PROTECTED] does not exists in the file
>   but when I run this it gives me a Match at line number.
>   I need to run three or four names at a time through this script
>   to see if they are already there. But it does not seam to work.
>   And I can not figure out way. A small sample of the file is below.
>
> $fd = fopen ("virtusertable", "r");
> $line_text= "[EMAIL PROTECTED]";
>$count = 1;
> while ($line_text = fgets($fd, 2048)) {
> if ($variable = trim($line_text)) {

You are assigning here - use == for comparison.

>echo "Match at line number $count";
> break;
> }
> ++$count;
> }
>


-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Figures won't lie, but liars will figure.

-- 
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] mail() ERROR - WHY, WHY, WHY

2001-09-10 Thread Kraa de Simon

What does phpinfo() think of it?



Search for sendmail_from, sendmail_path, SMTP under Configuration / PHP core
and see if the values are correct.

Simon.

> -Original Message-
> From: Badger [mailto:[EMAIL PROTECTED]]
> Sent: maandag 10 september 2001 9:24
> To: [EMAIL PROTECTED]
> Subject: [PHP] mail() ERROR - WHY, WHY, WHY
> 
> 
> Hello ,
> 
> 
> I drowing here and need a life-ring!  I have a site relying heavily on
> e-mail registration, forums, etc. and mail() is broken in my php
> install.  I've been using an smtp server other than sendmail, but
> based on recommendations I have removed that smtp server, removed php,
> installed sendmail, reinstalled php, and php still complains that
> "Warning: mail() is not supported in this PHP build" and sendmail is
> clearly in my /var/lib/php.ini sendmail_path and the location is
> correct.  I can send mail from the command line, but not via php's
> mail()
> 
> Need Heelp! real bad.
> 
> (beg, beg)
> -- 
> Best regards,
>  Badger  mailto:[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 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] Searching for text in a file

2001-09-10 Thread Kelly Barrett

Hi Richard,
First, I think it should be:
$variable = "[EMAIL PROTECTED]";
instead of:
> $line_text= "[EMAIL PROTECTED]";

as you overwrite $line_text with your fgets.

Also:
> if ($variable = trim($line_text)) {
Should be:
 if ($variable == trim($line_text)) {

Otherwise you are doing an assignment, which will always be true.

Finally, your while loop should probably be:
while(feof($fd) == false) {
$line_text = fgets($fd, 2048);

Because fgets returns EOF at the end of a file, not necessarily false (I
THINK EOF currently is false, though theoretically EOF could change to any
value).

Cheers,
Kelly.

> -Original Message-
> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 10 September 2001 5:12 PM
> To: php
> Subject: [PHP] Searching for text in a file
>
>
> I am having a problem with searching through a file for a curtain
>   text. Like the text below [EMAIL PROTECTED] does not exists in the file
>   but when I run this it gives me a Match at line number.
>   I need to run three or four names at a time through this script
>   to see if they are already there. But it does not seam to work.
>   And I can not figure out way. A small sample of the file is below.
>
> $fd = fopen ("virtusertable", "r");
> $line_text= "[EMAIL PROTECTED]";
>$count = 1;
> while ($line_text = fgets($fd, 2048)) {
> if ($variable = trim($line_text)) {
>echo "Match at line number $count";
> break;
> }
> ++$count;
> }
>
>
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
>  Richard
> mailto:[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 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[2]: [PHP] mail() ERROR - WHY, WHY, WHY

2001-09-10 Thread Badger

Hello Jason,

Monday, September 10, 2001, 12:26:30 AM, you wrote:

>> I drowing here and need a life-ring!  I have a site relying heavily on
>> e-mail registration, forums, etc. and mail() is broken in my php
>> install.  I've been using an smtp server other than sendmail, but
>> based on recommendations I have removed that smtp server, removed php,
>> installed sendmail, reinstalled php, and php still complains that
>> "Warning: mail() is not supported in this PHP build" and sendmail is
>> clearly in my /var/lib/php.ini sendmail_path and the location is
>> correct.  I can send mail from the command line, but not via php's
>> mail()
>>
>> Need Heelp! real bad.

JB> Hi

JB> Can you please provide more info about your php version, operating system,
JB> installation method, configure line (if compiled from source) etc?



Yes, running RH ditribution 7.1, PHP 4.0.6 compile from source, and
sendmail 8.10.11.0.rpm (note that I would like to use my dmail smtp
server and only installed sendmail to troublshoot this problem.

here in my php build:
--
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local \
--with-apache=/usr/local/src/Apachetoolbox-1.5.38/apache_1.3.20 \
--enable-exif \
--enable-track-vars \
--with-calendar=shared \
--enable-safe-mode \
--enable-magic-quotes \
--enable-trans-sid \
--enable-wddx \
--enable-ftp \
 --with-gd="/usr/local" \
--with-zlib \
--enable-gd-native-tt \
--with-t1lib="/usr/local/lib/php/t1libs" \
--with-jpeg-dir="/usr/local" \
--with-png-dir="/usr/local" \
--with-zlib-dir="/usr/local" \
--with-ttf \
--with-freetype-dir="/usr/local" \
 --with-imap=/usr/local \
 --with-mhash=/usr/local \
 --with-mcrypt=/usr/local \
 --with-unixODBC=/usr/local/unixODBC \
 --with-mysql \
 

 Here are the sendmail_path entries I've tried in my php.ini:

-
; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path =

sendmail_path = /usr/sbin

sendmail_path = ".:/usr/sbin"


After each change to my php.ini, I restart my Apache (1.3.20) server
and run phpinfo() to ensure changes are accpeted - they always are.







-- 
Best regards,
 Badgermailto:[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] cleaning up the uri

2001-09-10 Thread nayco

maybe by adding a unique ID like that :
somethin/somewhere/index.php?do=this&and=that&IDop=someMD5id

then, keeping logs of the operations in a db table  if the id already
exists in the table, nothing is done ...and maybe it's time to clean
parameters... then, the logs should be cleant every day ...

maybe a to heavy solution 



- Original Message -
From: Jon Thompson Coon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 10:22 AM
Subject: [PHP] cleaning up the uri


> I don't want to ask all these silly questions constantly time, but being
> lazy overcomes the urge not to do so.
>
> Having a page somethin/somewhere/index.php?do=this&and=that. This page
> does some updating and database queries. Hitting the reload button makes
> these things happen again (obviously). My question is, what are the
> usual ways of dealing with this problem?
>
> I don't want to separate my code into separe files, i.e. linking into a
> script that does the updating and redirects to the original page without
> the do=this&and=that part. When you require a html page modify itself,
> is it possible to remove the GET stuff from the result? By, f. ex. using
> header(whatnot: where) and then builing the material?
>
> I might not be very clear about this, but hopefully the meaning filters
> through.
>
> - Jon Thompson Coon
>
>
> --
> 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[2]: [PHP] Searching for text in a file

2001-09-10 Thread Richard Kurth

Hello Kelly,
Yes I noticed the variable after I sent the message
Now I have it like this.  But If I add something that is in the file it
does not find it.

$fd = fopen ("virtusertable", "r");
$variable= "[EMAIL PROTECTED]";
   $count = 1;
while(feof($fd) == false) {
$line_text = fgets($fd, 2048);
if ($variable == trim($line_text)) {
   echo "Match at line number $count";
break;
}
++$count;
}


Monday, September 10, 2001, 12:39:15 AM, you wrote:

Kelly Barrett> Hi Richard,
Kelly Barrett> First, I think it should be:
Kelly Barrett> $variable = "[EMAIL PROTECTED]";
Kelly Barrett> instead of:
>> $line_text= "[EMAIL PROTECTED]";

Kelly Barrett> as you overwrite $line_text with your fgets.

Kelly Barrett> Also:
>> if ($variable = trim($line_text)) {
Kelly Barrett> Should be:
Kelly Barrett>  if ($variable == trim($line_text)) {

Kelly Barrett> Otherwise you are doing an assignment, which will always be true.

Kelly Barrett> Finally, your while loop should probably be:
Kelly Barrett> while(feof($fd) == false) {
Kelly Barrett> $line_text = fgets($fd, 2048);

Kelly Barrett> Because fgets returns EOF at the end of a file, not necessarily false (I
Kelly Barrett> THINK EOF currently is false, though theoretically EOF could change to 
any
Kelly Barrett> value).

Kelly Barrett> Cheers,
Kelly Barrett> Kelly.

>> -Original Message-
>> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, 10 September 2001 5:12 PM
>> To: php
>> Subject: [PHP] Searching for text in a file
>>
>>
>> I am having a problem with searching through a file for a curtain
>>   text. Like the text below [EMAIL PROTECTED] does not exists in the file
>>   but when I run this it gives me a Match at line number.
>>   I need to run three or four names at a time through this script
>>   to see if they are already there. But it does not seam to work.
>>   And I can not figure out way. A small sample of the file is below.
>>
>> $fd = fopen ("virtusertable", "r");
>> $line_text= "[EMAIL PROTECTED]";
>>$count = 1;
>> while ($line_text = fgets($fd, 2048)) {
>> if ($variable = trim($line_text)) {
>>echo "Match at line number $count";
>> break;
>> }
>> ++$count;
>> }
>>
>>
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Best regards,
>>  Richard
>> mailto:[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]
>>
>>





-- 
Best regards,
 Richard  
mailto:[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] Why do form submissions need stripslashes() invocations?

2001-09-10 Thread nayco

Heloorghhh !!!

Well, try to make a script with :



then, look at the output to see where the error is 
well, php's got to know which of the quotes means "end of string" an which
is a part of the string...
so, parts of the string must be backslashed in every function using it 
when submitting a form php assumes that the string will be processed in a
function and protects it.

sorry for my medium english.



- Original Message -
From: Neil Zanella <[EMAIL PROTECTED]>
To: PHP General Mailing List <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 2:18 AM
Subject: [PHP] Why do form submissions need stripslashes() invocations?


>
> Hello,
>
> I would like to know why PHP adds slashes to the double quote,
> single quote, and backslash characters when submitting a form.
> In particular it would be nice if the PHP manual or some other
> manual mentioned this but I could not find any official
> documentation on this issue. Why does PHP add the
> slashes in the first place? (I'm using PHP 4.0.4pl1
> and don't know if this is just a bug or whether
> it was meant to be this way).
>
> Thanks,
>
> Neil
>
>
> --
> 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] Sessions getting broken

2001-09-10 Thread Niklas Lampén

I have a problem with sessions. My sessions work well except for one thing:
they keep getting broken from time to time. I have found no common thing
with these brokes so I'm quite lost with this problem. Any ideas?

It seems that all of the sessions brake at the same time. (I have a collegue
with me in same room and we have lost the session at the very same time
couple of times).


Niklas



[PHP] HELP!!!

2001-09-10 Thread Boris

I installed Red Hat 7 as server and get Apache and Php installed with that.
I have connect from my new Linux box (with dbisqlc) to ASA 7 database what
is on one Windows server and thats works fine.
My Apache also works fine with Php only problem is when I try to use
odbc_connect() or some other odbc funkctions I get "Fatal error: Call to
undefined function: odbc_connect() in ...".
I think my php is not compiled with odbc and I don't no how to do that.
Please help!

Best regards
Boris





-- 
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: Re[2]: [PHP] mail() ERROR - WHY, WHY, WHY

2001-09-10 Thread David Robley

On Mon, 10 Sep 2001 17:11, Badger wrote:

> Yes, running RH ditribution 7.1, PHP 4.0.6 compile from source, and
> sendmail 8.10.11.0.rpm (note that I would like to use my dmail smtp
> server and only installed sendmail to troublshoot this problem.
>
> here in my php build:
> --



>
>  Here are the sendmail_path entries I've tried in my php.ini:
>
> -
> ; For Unix only.  You may supply arguments as well (default: 'sendmail
> -t -i'). ;sendmail_path =
> 
> sendmail_path = /usr/sbin
> 
> sendmail_path = ".:/usr/sbin"
> 
>
> After each change to my php.ini, I restart my Apache (1.3.20) server
> and run phpinfo() to ensure changes are accpeted - they always are.


this could be a big part of your problem - you need the full path to 
sendmail, including the filename.

For example, mine is 
sendmail_path   =   /usr/sbin/sendmail -t -i 

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Press all the keys at once to continue...

-- 
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] PHP 4.0.6 bug

2001-09-10 Thread Stefan de Wal


"Jason Brooke" <[EMAIL PROTECTED]> schreef in bericht
02fc01c139c8$702aa550$0100a8c0@co3040297a">news:02fc01c139c8$702aa550$0100a8c0@co3040297a...
> > I upgraded from PHP 4.0.5 <> 4.0.6 and since i get openbasedir errors
all
> > over the place when i try to upload a file through a php script
> >
> > is this a bug?
> >
> > Stefan de Wal
> > dewal.nl
>
> Stefan, did you check your open_basedir and/or error_reporting settings in
> php.ini and apache config? What are the errors?
>
I did. No difference between the old php.ini and the new...the apache config
is also unchanged.

> Just because something worked before but doesn't now, doesn't mean it's a
> bug in php. It's often because of default settings being different from
the
> settings you had before upgrade. That's not to say there can't be a bug in
> php of course, but just jumping to that conclusion (apparently right away)
> is silly.
>
I do not find myself silly..
>
> You can probably help everyone by checking your side of things thouroughly
> first, and then when you do report problems, provide more info.
>
I think the problem lies in the person who made the rpm package which I run.
So i take back the possible bug report. I solved it by running an older php
package (4.0.5)
> jason
>
>
>
Thanks anyway.

Stefan de Wal



-- 
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[4]: [PHP] mail() ERROR - WHY, WHY, WHY

2001-09-10 Thread Badger

Hello David,

Monday, September 10, 2001, 1:02:37 AM, you wrote:

DR> On Mon, 10 Sep 2001 17:11, Badger wrote:

>> Yes, running RH ditribution 7.1, PHP 4.0.6 compile from source, and
>> sendmail 8.10.11.0.rpm (note that I would like to use my dmail smtp
>> server and only installed sendmail to troublshoot this problem.
>>
>> here in my php build:
>> --

DR> 

>>
>>  Here are the sendmail_path entries I've tried in my php.ini:
>>
>> -
>> ; For Unix only.  You may supply arguments as well (default: 'sendmail
>> -t -i'). ;sendmail_path =
>> 
>> sendmail_path = /usr/sbin
>> 
>> sendmail_path = ".:/usr/sbin"
>> 
>>
>> After each change to my php.ini, I restart my Apache (1.3.20) server
>> and run phpinfo() to ensure changes are accpeted - they always are.


DR> this could be a big part of your problem - you need the full path to 
DR> sendmail, including the filename.

DR> For example, mine is 
DR> sendmail_path   =   /usr/sbin/sendmail -t -i 


David,

But I did do that already and it still doesn't work.  I hope there are other
ideas, I am staying on this until the problem is solved :-(

-- 
Best regards,
 Badgermailto:[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] Quick File_Upload Example?

2001-09-10 Thread Hugh Danaher

will this do?
$filename="newfile.txt";   / / sets file name
variable
touch("./directory/$filename"); / / creates file in
specified directory if it doesn't already exist
 $fp=fopen("./directory/$filename","w");  / / opens file for writing
 $write="what ever you want\n"; / / copies contents of variable
and ends with a \n (end o'line marker)
 fwrite($fp,$write); / / writes contents of
variable to the file
 fclose($fp);   / / closes file.

hugh

- Original Message -
From: Smileyq <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 12:10 AM
Subject: [PHP] Quick File_Upload Example?


> After reading about file uploading on the PHP website it doesn't
> actually give an example to use for testing purposes. Can somebody
> provide me with a very simple and basic file upload example that I can
> start from and work with. Thanks for any help ahead of time.
> -Smileyq
>
>
> --
> 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: Re[2]: [PHP] Searching for text in a file

2001-09-10 Thread Kelly Barrett

Richard,
I just put together a script using that code exactly, and it worked.

All I can say is make sure that what you are searching for is actually in
the file you are searching.

Remember that the string you are searching for needs to match the entire
contents of the line, not just a substring of the line.

Try some simple tests that you know are sure to work. i.e. Make a
virtusertable file that is just a couple of lines.

> Hello Kelly,
> Yes I noticed the variable after I sent the message
> Now I have it like this.  But If I add something that is in the file it
> does not find it.
>
> $fd = fopen ("virtusertable", "r");
> $variable= "[EMAIL PROTECTED]";
>$count = 1;
> while(feof($fd) == false) {
> $line_text = fgets($fd, 2048);
> if ($variable == trim($line_text)) {
>echo "Match at line number $count";
> break;
> }
> ++$count;
> }
>
>
> Monday, September 10, 2001, 12:39:15 AM, you wrote:
>
> Kelly Barrett> Hi Richard,
> Kelly Barrett> First, I think it should be:
> Kelly Barrett> $variable = "[EMAIL PROTECTED]";
> Kelly Barrett> instead of:
> >> $line_text= "[EMAIL PROTECTED]";
>
> Kelly Barrett> as you overwrite $line_text with your fgets.
>
> Kelly Barrett> Also:
> >> if ($variable = trim($line_text)) {
> Kelly Barrett> Should be:
> Kelly Barrett>  if ($variable == trim($line_text)) {
>
> Kelly Barrett> Otherwise you are doing an assignment, which will
> always be true.
>
> Kelly Barrett> Finally, your while loop should probably be:
> Kelly Barrett> while(feof($fd) == false) {
> Kelly Barrett> $line_text = fgets($fd, 2048);
>
> Kelly Barrett> Because fgets returns EOF at the end of a file,
> not necessarily false (I
> Kelly Barrett> THINK EOF currently is false, though theoretically
> EOF could change to any
> Kelly Barrett> value).
>
> Kelly Barrett> Cheers,
> Kelly Barrett> Kelly.
>
> >> -Original Message-
> >> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
> >> Sent: Monday, 10 September 2001 5:12 PM
> >> To: php
> >> Subject: [PHP] Searching for text in a file
> >>
> >>
> >> I am having a problem with searching through a file for a curtain
> >>   text. Like the text below [EMAIL PROTECTED] does not exists in the file
> >>   but when I run this it gives me a Match at line number.
> >>   I need to run three or four names at a time through this script
> >>   to see if they are already there. But it does not seam to work.
> >>   And I can not figure out way. A small sample of the file is below.
> >>
> >> $fd = fopen ("virtusertable", "r");
> >> $line_text= "[EMAIL PROTECTED]";
> >>$count = 1;
> >> while ($line_text = fgets($fd, 2048)) {
> >> if ($variable = trim($line_text)) {
> >>echo "Match at line number $count";
> >> break;
> >> }
> >> ++$count;
> >> }
> >>
> >>
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >> [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> Best regards,
> >>  Richard
> >> mailto:[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]
> >>
> >>
>
>
>
>
>
> --
> Best regards,
>  Richard
> mailto:[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 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] Re: [PHP-DEV] Anagram Type Puzzle

2001-09-10 Thread nayco

WHA 
-> for school lessons ???

let's think about it ...

- Original Message -
From: Sebastian Bergmann <[EMAIL PROTECTED]>
To: Ralph Guzman <[EMAIL PROTECTED]>
Cc: PHP Developer Mailing List <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 10:27 AM
Subject: [PHP] Re: [PHP-DEV] Anagram Type Puzzle


>   The list <[EMAIL PROTECTED]> is dedicated to the development
>   _of_ PHP, not to developing _with_ PHP -- this is what the
>    list is for.
>
>   I forward your message there, thanks for your understanding.
>
>   Yours,
> Sebastian
>
> Ralph Guzman wrote:
> >
> > Im trying to figue out the following anagram using PHP. Here is the
> > problem:
> >
> > Using letters of the alphabet represented by a number, I have to come
> > up with words that add up to exactly 100.
> >
> > Numbers are in reverse where A=26 and Z=1, so for example:
> >
> > A = 26
> > B  = 25
> > C = 24
> > ...
> > ...
> > X = 3
> > Y = 2
> > Z = 1
> >
> > So let's say the word 'acronym'
> >
> > A + C+R+0+N+Y+M
> > 26 + 24 + 9+12+13+2+14  = 100
> >
> > My thoughts were to download a list of words in the dictionary, then
> > read the file and somehow replace each letter by its number, then add
> > each letter for each word and see which words would equal to 100.
> >
> > So I am emailing this list for any suggestions or examples of code
> > that I can use to accomplish this. Any help?
> >
> > Thanks much.
>
> --
>   Sebastian Bergmann  Measure Traffic & Usability
>   http://sebastian-bergmann.de/ http://phpOpenTracker.de/
>
>   Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/
>
> --
> 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] PHP 4.0.6 bug

2001-09-10 Thread Jason Brooke

> > Stefan, did you check your open_basedir and/or error_reporting settings
in
> > php.ini and apache config? What are the errors?
> >
> I did. No difference between the old php.ini and the new...the apache
config
> is also unchanged.

And the mentioned open basedir errors? What did they say?


> I think the problem lies in the person who made the rpm package which I
run.
> So i take back the possible bug report. I solved it by running an older
php
> package (4.0.5)

I'm glad you've got a workaround, but it'd be nice to get to the bottom of
the problem and fix it so you can run the latest version which is what you
probably wanted when you upgraded to it. What made you reach the new
conclusion that it's a problem with the rpm, and can we work out what's
wrong with it?

jason




-- 
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: PHP and MySQL

2001-09-10 Thread Stefan de Wal

check your connection string and if it something like mysql_pconnect change
it in mysql_connect

Stefan de Wal

"Pieter Philippaerts" <[EMAIL PROTECTED]> schreef in bericht
([EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Unfortunately, I can't access these settings. It's not our computer that
> hosts
> our website.
>
> Regards,
> Pieter Philippaerts
>
> "Richard Lynch" <[EMAIL PROTECTED]> wrote in message
> 01e501c138ce$f3008300$6401a8c0@Lynchux100">news:01e501c138ce$f3008300$6401a8c0@Lynchux100...
> > Options:
> > Increase the settings in MySQL that limit how many databases can be open
> at
> > once.
> > Decrease the number of Apache children running.
> >
> > Basically, as long as you have more Apache children than MySQL
connections
> > available, you can get this message.
> >
> > Actually, have a few spare MySQL connections, so you can telnet/SSH in
and
> > use the monitor as well, and cron jobs using MySQL can run.
> >
> > --
> > 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: Pieter Philippaerts <[EMAIL PROTECTED]>
> > Newsgroups: php.general
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, September 07, 2001 11:30 PM
> > Subject: PHP and MySQL
> >
> >
> > > Hello,
> > > we're using our MySQL database quite extensively from our PHP scripts,
> > > but sometimes everything stops working and it says "Too many
> connections".
> > > Is there a problem with MySQL support from within PHP? Doesn't it
close
> > > its connections with the database when the script stops executing?
> > > Is there anything I can do to resolve this problem?
> > >
> > > Regards,
> > > Pieter Philippaerts
> > >
> > >
> >
>
>



-- 
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] new to php

2001-09-10 Thread Krzysztof Kocjan

In head section of HTML page You can include meta tag like below:

http://domain.dot.com/loop.php";>

If loop. php contains that meta tag like it calls itself every 2 seconds.

Krzysztof Kocjan

Kostis Mentzelos wrote:

> Hi all,
> is it possible to create a table that automatically
> updates its contents every 30 seconds?
>
> Thanks in advance,
> Kostis Mentzelos.
>
> --
> 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]


--
Sledzie z tokajem? Ty decydujesz, co Ci smakuje.
Zobacz, jak lamac kulinarne stereotypy.
http://www.polki.interia.pl/mistrzyni/porady


-- 
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[4]: [PHP] Searching for text in a file

2001-09-10 Thread Richard Kurth

Hello Kelly,
Your right the script does work but my problem is this
the file I am searching looks like this below.
And if I search on [EMAIL PROTECTED] alone it does not find it but
if I search on [EMAIL PROTECTED]   yourns it finds it. I need it
to find just the email address not the stuff after it.


[EMAIL PROTECTED]   yourns
[EMAIL PROTECTED]  root
[EMAIL PROTECTED]   majordomo_site1
[EMAIL PROTECTED] owner-majordomo_site15
[EMAIL PROTECTED] sys


Monday, September 10, 2001, 1:26:44 AM, you wrote:

Kelly Barrett> Richard,
Kelly Barrett> I just put together a script using that code exactly, and it worked.

Kelly Barrett> All I can say is make sure that what you are searching for is actually 
in
Kelly Barrett> the file you are searching.

Kelly Barrett> Remember that the string you are searching for needs to match the entire
Kelly Barrett> contents of the line, not just a substring of the line.

Kelly Barrett> Try some simple tests that you know are sure to work. i.e. Make a
Kelly Barrett> virtusertable file that is just a couple of lines.

>> Hello Kelly,
>> Yes I noticed the variable after I sent the message
>> Now I have it like this.  But If I add something that is in the file it
>> does not find it.
>>
>> $fd = fopen ("virtusertable", "r");
>> $variable= "[EMAIL PROTECTED]";
>>$count = 1;
>> while(feof($fd) == false) {
>> $line_text = fgets($fd, 2048);
>> if ($variable == trim($line_text)) {
>>echo "Match at line number $count";
>> break;
>> }
>> ++$count;
>> }
>>
>>
>> Monday, September 10, 2001, 12:39:15 AM, you wrote:
>>
>> Kelly Barrett> Hi Richard,
>> Kelly Barrett> First, I think it should be:
>> Kelly Barrett> $variable = "[EMAIL PROTECTED]";
>> Kelly Barrett> instead of:
>> >> $line_text= "[EMAIL PROTECTED]";
>>
>> Kelly Barrett> as you overwrite $line_text with your fgets.
>>
>> Kelly Barrett> Also:
>> >> if ($variable = trim($line_text)) {
>> Kelly Barrett> Should be:
>> Kelly Barrett>  if ($variable == trim($line_text)) {
>>
>> Kelly Barrett> Otherwise you are doing an assignment, which will
>> always be true.
>>
>> Kelly Barrett> Finally, your while loop should probably be:
>> Kelly Barrett> while(feof($fd) == false) {
>> Kelly Barrett> $line_text = fgets($fd, 2048);
>>
>> Kelly Barrett> Because fgets returns EOF at the end of a file,
>> not necessarily false (I
>> Kelly Barrett> THINK EOF currently is false, though theoretically
>> EOF could change to any
>> Kelly Barrett> value).
>>
>> Kelly Barrett> Cheers,
>> Kelly Barrett> Kelly.
>>
>> >> -Original Message-
>> >> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
>> >> Sent: Monday, 10 September 2001 5:12 PM
>> >> To: php
>> >> Subject: [PHP] Searching for text in a file
>> >>
>> >>
>> >> I am having a problem with searching through a file for a curtain
>> >>   text. Like the text below [EMAIL PROTECTED] does not exists in the file
>> >>   but when I run this it gives me a Match at line number.
>> >>   I need to run three or four names at a time through this script
>> >>   to see if they are already there. But it does not seam to work.
>> >>   And I can not figure out way. A small sample of the file is below.
>> >>
>> >> $fd = fopen ("virtusertable", "r");
>> >> $line_text= "[EMAIL PROTECTED]";
>> >>$count = 1;
>> >> while ($line_text = fgets($fd, 2048)) {
>> >> if ($variable = trim($line_text)) {
>> >>echo "Match at line number $count";
>> >> break;
>> >> }
>> >> ++$count;
>> >> }
>> >>
>> >>
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED]
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Best regards,
>> >>  Richard
>> >> mailto:[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]
>> >>
>> >>
>>
>>
>>
>>
>>
>> --
>> Best regards,
>>  Richard
>> mailto:[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]
>>
>>





-- 
Best regards,
 Richard  
mailto:[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] Re: [PHP-DEV] Anagram Type Puzzle

2001-09-10 Thread Ralph Guzman

Wow, that was a quick response! It's no wonder PHP kicks butt, when we have
geniuses like you in the development team.

I did not realize I sent it to the wrong list until after I had sent it. I
apologize.

I will try this now.

Thanks a Million.

-Original Message-
From: James Moore [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 1:40 AM
To: PHP Developer Mailing List; Ralph Guzman
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: [PHP-DEV] Anagram Type Puzzle


This should really be sent to [EMAIL PROTECTED], this is the list
for the developers OF PHP not developing WITH PHP.

Anyway persuming you dictonary file has one word per line you could do
somthing along the lines of the following:

 26,
B => 25,
C => 24,
D => 23,
E => 22,
F => 21,
G => 20,
H => 19,
   .
   Z => 1);

$word_array = file('en.dict');

foreach($word_array as $word)
{
$sum = 0;

for($i = 0; $i < strlen($word) and $sum <= 100; $i ++
{
$sum += $letters[strtoupper($word[$i])];
}

if($sum == 100)
{
$correctwords[] = $word;
}
}

echo "Words that sum to 100\n";
foreach($correctwords as $word)
{
echo $word."\n";
}

?>

> Im trying to figue out the following anagram using PHP. Here is the
problem:
>
> Using letters of the alphabet represented by a number, I have to come up
> with words that add up to exactly 100.
>
> Numbers are in reverse where A=26 and Z=1, so for example:
>
> A = 26
> B  = 25
> C = 24
> ...
> ...
> X = 3
> Y = 2
> Z = 1
>
> So let's say the word 'acronym'
>
> A + C+R+0+N+Y+M
> 26 + 24 + 9+12+13+2+14  = 100
>
> My thoughts were to download a list of words in the dictionary, then read
> the file and somehow replace each letter by its number, then add each
letter
> for each word and see which words would equal to 100.
>
> So I am emailing this list for any suggestions or examples of code that I
> can use to accomplish this. Any help?
>
> Thanks much.
>
>
> --
> PHP Development Mailing List 
> 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 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: Question on the list() function

2001-09-10 Thread _lallous

I don't think this is correct!

You can't do this:

list($a, $b) = variable!
which is the case in: list($key, list($tag, $data)) = each($array)

you can use: list($key, $value) = each($array)


"D" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am a newbie and having some problems with a function I found in a
script:
>
> while(list($key,list($tag,$data))=each($array))
>
> From what I have read of list(), what I assume is happening here is that
its
> takeing a 2 dimensional array and assigning the key value pairs
accordingly,
> so that I can then work with the data using the $key, $tag, and $data
> variables while it cycles through each item in the array. Is this correct?
>
> If this is correct, which order is the dimension of the array? For example
> if the values of the variables were: $tag = 2 and $key = 1 would it be:
> $array[1][2] or $array[2][1]
>
> I have tried both, and dont get the $data (outside of the while loop I am
> trying to access specific parts of the array). Other thoughts?
>
> Thanks for the help,
>
> Ken
>
>
>



-- 
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] Can' connect to ldap server

2001-09-10 Thread Andre Konopka

Hi 

I compiled PHP_4.0.6 with LDAP support (openldap-2.0.12) without any
problems, but I can't connect to my locally
running LDAP-Server. The whole thing is running on a HP-UX11 box.

Here are my very simple two lines of code:


$ds=ldap_connect ("localhost");

print "connect result is ".$ds."";


If try to show the results I get error popup with

'Documents contained no data. Try again later, or contact the server's
administrator.'


If I comment out the 'connect' line the browser show the line
'connect result is'

I started slapd with debugging level 65535 and I can see that there are
no connection requests from PHP.


Any idea?

Andre

-- 
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] Never tried it but....

2001-09-10 Thread _lallous

Can sessions hold the $result resource of a mysql_query?
and the use that $result variable to fetch rows on other page?



-- 
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] hi

2001-09-10 Thread Balaji Ankem

Hi, what z wrong in this code??


>

\">view
source";

 ?>

>>>

I am getting the following error

Forbidden
You don't have permission to access /< on this server.

---
-

Apache/1.3.20 Server at ankem.wipro.com Port 80


How to rectify this thing??

Thanks in advance
Regards
-Balaji






--
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers
and is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail
from your records.
-



-- 
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] hi

2001-09-10 Thread Seb Frost

Fixed:

view
source";

?>

- seb

-Original Message-
From: Balaji Ankem [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2001 10:25
To: [EMAIL PROTECTED]
Subject: [PHP] hi


Hi, what z wrong in this code??


>

\">view
source";

 ?>

>>>

I am getting the following error

Forbidden
You don't have permission to access /< on this server.

---
-

Apache/1.3.20 Server at ankem.wipro.com Port 80


How to rectify this thing??

Thanks in advance
Regards
-Balaji




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


-- 
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] Re: [PHP-DEV] Anagram Type Puzzle

2001-09-10 Thread nicolas costes



26,"b"=>25,"c"=>24,"d"=>23,
"e"=>22,"f"=>21,"g"=>20,"h"=>19,
"i"=>18,"j"=>17,"k"=>16,"l"=>15,
"m"=>14,"n"=>13,"o"=>12,"p"=>11,
"q"=>10,"r"=>9,"s"=>8,"t"=>7,
"u"=>6,"v"=>5,"w"=>4,"x"=>3,
"y"=>2,"z"=>1);


 $fid=fopen("testfile.txt","r");

 $line_num=0;
 while (!feof($fid))
   {
   $line_num++;
   file://echo "ligne : $line_num\n\n";
   $line = strtolower(fgets($fid,4096));
   file://echo "contenu de la ligne : $line\n\n";
   $words= explode(" ",$line);
   while (list($foo,$word)=each($words))
  {
  $word_value=0;
  for ($car=0;$car\n";
   if ($word_value==100)
echo "the word $word on line $line_value of
the input file has a value of $word_value.\n";
   }
   }
 echo "\nIf nothing appears above, no word with
a value of 100 was found !!!\n";

?>




(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr


-- 
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] Re: [PHP-DEV] Anagram Type Puzzle

2001-09-10 Thread nayco

Sorry, my F outlook replaced '//' commentaries by 'file://' ... these
lines where for debugging, they can be deleted !!!
- Original Message -
From: nicolas costes <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 11:36 AM
Subject: Re: [PHP] Re: [PHP-DEV] Anagram Type Puzzle


> 
> 
> 
>  $tab=array("a"=>26,"b"=>25,"c"=>24,"d"=>23,
> "e"=>22,"f"=>21,"g"=>20,"h"=>19,
> "i"=>18,"j"=>17,"k"=>16,"l"=>15,
> "m"=>14,"n"=>13,"o"=>12,"p"=>11,
> "q"=>10,"r"=>9,"s"=>8,"t"=>7,
> "u"=>6,"v"=>5,"w"=>4,"x"=>3,
> "y"=>2,"z"=>1);
>
>
>  $fid=fopen("testfile.txt","r");
>
>  $line_num=0;
>  while (!feof($fid))
>{
>$line_num++;
>file://echo "ligne : $line_num\n\n";
>$line = strtolower(fgets($fid,4096));
>file://echo "contenu de la ligne : $line\n\n";
>$words= explode(" ",$line);
>while (list($foo,$word)=each($words))
>   {
>   $word_value=0;
>   for ($car=0;$car {
> file://echo "lettre : $word[$car] - \t";
> if ($letter_value=$tab[$word[$car]])
>  $word_value+=$letter_value;
> }
>file://echo "mot : $word; ";
>file://echo "valeur : $word_value\n\n";
>if ($word_value==100)
> echo "the word $word on line $line_value of
> the input file has a value of $word_value.\n";
>}
>}
>  echo "\nIf nothing appears above, no word
with
> a value of 100 was found !!!\n";
>
> ?>
> 
> 
>
>
> (°-Nayco,
> //\[EMAIL PROTECTED]
> v_/_ http://nayco.free.fr
>
>
> --
> 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] Re: preg_replace_callback()

2001-09-10 Thread Robin Vickery

[EMAIL PROTECTED] (Richard Lynch) writes:

> A "callback" is when you execute a function, and you provide to it a name of
> *another* function, which it will call on some data in the middle of its
> task.
> 
> It's a very handy way to provide extreme flexibility in functional
> languages.
> 
> For example:
> 
> function my_array_walk($array, $function){
> while (list($k, $v) = each($array)){
> # Here's the magic that implements a 'callback'
> $function($k, $v);
> }
> }
> 
> function your_echo($key, $value){
> echo "$key $value\n";
> }
> 
> $foo = array('a'=>1, 'b'=>2, 'c'=>3);
> 
> my_array_walk($foo, 'your_echo');
> 
> This rather silly example will "walk" the array and call 'your_echo' on each
> key/value pair.
> 
> Dunno exactly how preg_ uses it though...

It calls the callback function for each match, passing it an array.
The matching string is replaced by whatever the callback function returns.

Here's a fairly pointless example of names and email addresses being replaced
by mailto links with a bit of extra processing on their name...

  -robin

mailto:{$match[2]}\";>{$match[1]}";
}

$testString =<<
"Tommy Atkins" <[EMAIL PROTECTED]>
"Davey Jones" <[EMAIL PROTECTED]>
EOS;

$outputString = preg_replace_callback('/"(.+?)"\s*<(.+?)>/', 'mailto', $testString);

print " $outputString ";
?>

-- 
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: Re[4]: [PHP] Searching for text in a file

2001-09-10 Thread Kelly Barrett

Richard,
Then you need to use something like "explode()" to get only the part you
want.

e.g.  If the file is delimited by spaces, then have something like this:

$fd = fopen ("virtusertable", "r");
$variable= "[EMAIL PROTECTED]";
$count = 1;
while(feof($fd) == false) {
$line_text = fgets($fd, 2048);
$strings = explode(" ", $line_text);<--- Splits the line at
every space into an array of string
 if ($variable == trim($strings[0])) {
echo "Match at line number $count";
 break;
 }
 ++$count;
 }

If the file is tab delimited, you will need:
$strings = explode("\t", $line_text);

> Hello Kelly,
> Your right the script does work but my problem is this
> the file I am searching looks like this below.
> And if I search on [EMAIL PROTECTED] alone it does not find it but
> if I search on [EMAIL PROTECTED]   yourns it finds it. I need it
> to find just the email address not the stuff after it.
>
>
> [EMAIL PROTECTED]   yourns
> [EMAIL PROTECTED]  root
> [EMAIL PROTECTED]   majordomo_site1
> [EMAIL PROTECTED] owner-majordomo_site15
> [EMAIL PROTECTED] sys
>
>
> Monday, September 10, 2001, 1:26:44 AM, you wrote:
>
> Kelly Barrett> Richard,
> Kelly Barrett> I just put together a script using that code exactly, and
it worked.
>
> Kelly Barrett> All I can say is make sure that what you are searching for
is actually in
> Kelly Barrett> the file you are searching.
>
> Kelly Barrett> Remember that the string you are searching for needs to
match the entire
> Kelly Barrett> contents of the line, not just a substring of the line.
>
> Kelly Barrett> Try some simple tests that you know are sure to work. i.e.
Make a
> Kelly Barrett> virtusertable file that is just a couple of lines.
>
> >> Hello Kelly,
> >> Yes I noticed the variable after I sent the message
> >> Now I have it like this.  But If I add something that is in the file it
> >> does not find it.
> >>
> >> $fd = fopen ("virtusertable", "r");
> >> $variable= "[EMAIL PROTECTED]";
> >>$count = 1;
> >> while(feof($fd) == false) {
> >> $line_text = fgets($fd, 2048);
> >> if ($variable == trim($line_text)) {
> >>echo "Match at line number $count";
> >> break;
> >> }
> >> ++$count;
> >> }
> >>
> >>
> >> Monday, September 10, 2001, 12:39:15 AM, you wrote:
> >>
> >> Kelly Barrett> Hi Richard,
> >> Kelly Barrett> First, I think it should be:
> >> Kelly Barrett> $variable = "[EMAIL PROTECTED]";
> >> Kelly Barrett> instead of:
> >> >> $line_text= "[EMAIL PROTECTED]";
> >>
> >> Kelly Barrett> as you overwrite $line_text with your fgets.
> >>
> >> Kelly Barrett> Also:
> >> >> if ($variable = trim($line_text)) {
> >> Kelly Barrett> Should be:
> >> Kelly Barrett>  if ($variable == trim($line_text)) {
> >>
> >> Kelly Barrett> Otherwise you are doing an assignment, which will
> >> always be true.
> >>
> >> Kelly Barrett> Finally, your while loop should probably be:
> >> Kelly Barrett> while(feof($fd) == false) {
> >> Kelly Barrett> $line_text = fgets($fd, 2048);
> >>
> >> Kelly Barrett> Because fgets returns EOF at the end of a file,
> >> not necessarily false (I
> >> Kelly Barrett> THINK EOF currently is false, though theoretically
> >> EOF could change to any
> >> Kelly Barrett> value).
> >>
> >> Kelly Barrett> Cheers,
> >> Kelly Barrett> Kelly.
> >>
> >> >> -Original Message-
> >> >> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
> >> >> Sent: Monday, 10 September 2001 5:12 PM
> >> >> To: php
> >> >> Subject: [PHP] Searching for text in a file
> >> >>
> >> >>
> >> >> I am having a problem with searching through a file for a
curtain
> >> >>   text. Like the text below [EMAIL PROTECTED] does not exists in the
file
> >> >>   but when I run this it gives me a Match at line number.
> >> >>   I need to run three or four names at a time through this script
> >> >>   to see if they are already there. But it does not seam to work.
> >> >>   And I can not figure out way. A small sample of the file is below.
> >> >>
> >> >> $fd = fopen ("virtusertable", "r");
> >> >> $line_text= "[EMAIL PROTECTED]";
> >> >>$count = 1;
> >> >> while ($line_text = fgets($fd, 2048)) {
> >> >> if ($variable = trim($line_text)) {
> >> >>echo "Match at line number $count";
> >> >> break;
> >> >> }
> >> >> ++$count;
> >> >> }
> >> >>
> >> >>
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >> [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> Best regards,
> >> >>  Richard
> >> >> mailto:[EMAIL PROTECTED]
> >> >>
> >> >>
> >> >> --
> >> >> PHP 

RE: [PHP] hi

2001-09-10 Thread Lawrence . Sheed

It still won't work though.
(unless show_source is javascript, which I doubt)

You can't embed php in html like that.  HTML is for client side, and they
aren't running php in their browser.  Browsers generally support javascript
or vbscript ECMA style scripting on client side.

If you wanted to show the source for something you can't write a one line a
href, you'll have to make it some code.

eg.

sourceme.php




myhtml.html

View Source


-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: September 10, 2001 5:30 PM
To: Balaji Ankem; [EMAIL PROTECTED]
Subject: RE: [PHP] hi


Fixed:

view
source";

?>

- seb

-Original Message-
From: Balaji Ankem [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2001 10:25
To: [EMAIL PROTECTED]
Subject: [PHP] hi


Hi, what z wrong in this code??


>

\">view
source";

 ?>

>>>

I am getting the following error

Forbidden
You don't have permission to access /< on this server.

---
-

Apache/1.3.20 Server at ankem.wipro.com Port 80


How to rectify this thing??

Thanks in advance
Regards
-Balaji




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


-- 
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] Re: cleaning up the uri

2001-09-10 Thread Jon Thompson Coon

> ... so make the two pieces the same file... have the script redirect to
> itself minus the parameters.

I did, but somehow it soesn't feel like an elegant way of doing things, with
that extra reloading and all. But it'll do. Thanks.

- jon


-- 
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] Site Layouts/Designs

2001-09-10 Thread Justin French

Hi,


Just to throw in a curve-ball, IMHO, there is no point looking at
pre-built layouts and templates.


Why?

1. The end product will not look unique or different.  It will look the
same as the other 5000 sites who found that same template.  Worse still,
if your charging a client, they're paying for a non-unique design (even
if the "design" wasn't charged out).  if it was client based work, I'd
advise telling them that they're getting a freebie layout design.  Sure,
they may like that, but not when you tell them it'll be as generic as an
milk bottle, and probably already exists 100-5000 times elsewhere on the
net (where people are stuggling to stand out in the crowd already).  My
clients would rather pay for a few hours of design time and get
something even half original which meets their needs.

2. Out-of-the-box templates (especially free ones) tend to look like
just that.  Generic enough to be adaptable on a large number of sites,
with varied content, with minimal fuss.

2. In my 7+ years of interface design, graphic design, and web
development I have never designed the same site/page twice.  The fact
is, the client, the content, their identity and the site's needs will
allways dictate a different layout/design.


However LOOKING at them for ideas and inspiration may be just what you
need... in fact, I do it all the time... I'm contantly looking at
layout/interface design, cataloging it all in my brain.  When it comes
time for a new design, I can blend all those ideas up and build
something unique and purpose built for the client.


Just my two cents worth!!


Justin French

-- 
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: PHP and MySQL

2001-09-10 Thread Pieter Philippaerts

We have never used mysql_pconnect.

Regards,
Pieter Philippaerts

"Stefan De Wal" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> check your connection string and if it something like mysql_pconnect
change
> it in mysql_connect
>
> Stefan de Wal



-- 
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] Site Layouts/Designs

2001-09-10 Thread ReDucTor

I don't do site design for people, thats probley because i suck at design,
but i am good at the coding...just like apps, i suck with the GUI, which is
why i prefer to get some that are already done, or get them done, and i am a
poor bastard, so free ones(alot of them are just templates), are for me..

- James "ReDucTor" Mitchell
- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "Meir Kriheli" <[EMAIL PROTECTED]>; "php"
<[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 7:32 PM
Subject: Re: [PHP] Site Layouts/Designs


> Hi,
>
>
> Just to throw in a curve-ball, IMHO, there is no point looking at
> pre-built layouts and templates.
>
>
> Why?
>
> 1. The end product will not look unique or different.  It will look the
> same as the other 5000 sites who found that same template.  Worse still,
> if your charging a client, they're paying for a non-unique design (even
> if the "design" wasn't charged out).  if it was client based work, I'd
> advise telling them that they're getting a freebie layout design.  Sure,
> they may like that, but not when you tell them it'll be as generic as an
> milk bottle, and probably already exists 100-5000 times elsewhere on the
> net (where people are stuggling to stand out in the crowd already).  My
> clients would rather pay for a few hours of design time and get
> something even half original which meets their needs.
>
> 2. Out-of-the-box templates (especially free ones) tend to look like
> just that.  Generic enough to be adaptable on a large number of sites,
> with varied content, with minimal fuss.
>
> 2. In my 7+ years of interface design, graphic design, and web
> development I have never designed the same site/page twice.  The fact
> is, the client, the content, their identity and the site's needs will
> allways dictate a different layout/design.
>
>
> However LOOKING at them for ideas and inspiration may be just what you
> need... in fact, I do it all the time... I'm contantly looking at
> layout/interface design, cataloging it all in my brain.  When it comes
> time for a new design, I can blend all those ideas up and build
> something unique and purpose built for the client.
>
>
> Just my two cents worth!!
>
>
> Justin French
>
> --
> 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] hi

2001-09-10 Thread Ing. Lalka Peter

and what about this one?

view source";?>


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 12:19 PM
Subject: RE: [PHP] hi


> It still won't work though.
> (unless show_source is javascript, which I doubt)
>
> You can't embed php in html like that.  HTML is for client side, and they
> aren't running php in their browser.  Browsers generally support
javascript
> or vbscript ECMA style scripting on client side.
>
> If you wanted to show the source for something you can't write a one line
a
> href, you'll have to make it some code.
>
> eg.
>
> sourceme.php
>
>  show_source('source.php');
> ?>
>
>
> myhtml.html
>
> View Source
>
>
> -Original Message-
> From: Seb Frost [mailto:[EMAIL PROTECTED]]
> Sent: September 10, 2001 5:30 PM
> To: Balaji Ankem; [EMAIL PROTECTED]
> Subject: RE: [PHP] hi
>
>
> Fixed:
>
> 
> echo "view
> source";
>
> ?>
>
> - seb
>
> -Original Message-
> From: Balaji Ankem [mailto:[EMAIL PROTECTED]]
> Sent: 10 September 2001 10:25
> To: [EMAIL PROTECTED]
> Subject: [PHP] hi
>
>
> Hi, what z wrong in this code??
>
>
> >
>
> 
> echo "\">view
> source";
>
>  ?>
>
> >>>
>
> I am getting the following error
>
> Forbidden
> You don't have permission to access /< on this server.
>
> --
-
> -
>
> Apache/1.3.20 Server at ankem.wipro.com Port 80
>
>
> How to rectify this thing??
>
> Thanks in advance
> Regards
> -Balaji
>
>
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001
>
>
> --
> 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 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] PHP4 in .html. HELP!

2001-09-10 Thread Max Kluev


Please, help.

I write in httpd.conf:
AddType application/x-httpd-php .html

And see result in browser - browser get reply with content-type: 
application/x-httpd-php and suggest to save it.
If I rename script to *.php and call it from browser it works Ok.

How and where can I explain httpd and apache reply with content-type: text/html for 
.html PHP4 documents.

Apache Version Apache/1.3.20 PHP/4.0.6

Could you help me, please.


-- 
Max Kluev

-- 
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] Email Processors Wanted!!!

2001-09-10 Thread Tim Constable

9/10/2001

EMAIL PROCESSING COMPANY LOOKING FOR EMAIL PROCESSORS IMMEDIATELY, TO SUSTAIN
EXPLOSIVE GROWTH.  EARN $2,000-$6,000 
(PART-TIME) AND $5,000-$10,000 (FULL TIME) MONTHLY.  FREE START-UP, NOT MLM,
NO EXPERIENCE NECESSARY.  SEND AN EMAIL 
TO [EMAIL PROTECTED] WITH SUBJECT: "SHOW ME".WE WANT SERIOUS INQUIRIES FROM
PEOPLE WHO WANT TO MAKE SERIOUS MONEY!

Tim C. - Web Direct

-- 
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] How to connect Excel as a database from mysql

2001-09-10 Thread Balaji Ankem

Hi,
I am generating a report in exel sheet.
For this i am planing to use exel as a data base.
can you send the statements to connect exel sheet as a database and
relate queries.
Thanks in advance.
Regards
Balaji





--
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers
and is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail
from your records.
-



-- 
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] How to connect Excel as a database from mysql

2001-09-10 Thread Ing. Lalka Peter

Try ODBC connection...
- Original Message -
From: "Balaji Ankem" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 1:00 PM
Subject: [PHP] How to connect Excel as a database from mysql


> Hi,
> I am generating a report in exel sheet.
> For this i am planing to use exel as a data base.
> can you send the statements to connect exel sheet as a database and
> relate queries.
> Thanks in advance.
> Regards
> Balaji
>
>
>






> --
> 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] How to connect Excel as a database from mysql

2001-09-10 Thread bard

nope. go with COM.


On Mon, 10 Sep 2001, Ing. Lalka Peter wrote:

> Try ODBC connection...
> - Original Message -
> From: "Balaji Ankem" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 10, 2001 1:00 PM
> Subject: [PHP] How to connect Excel as a database from mysql
> 
> 
> > Hi,
> > I am generating a report in exel sheet.
> > For this i am planing to use exel as a data base.
> > can you send the statements to connect exel sheet as a database and
> > relate queries.
> > Thanks in advance.
> > Regards
> > Balaji
> >
> >
> >
> 
> 
> 
> 
> 
> 
> > --
> > 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] Unique Array

2001-09-10 Thread Deirdre Mc Cann

Hi

Can anyone help me? I need to produce a random and uniques array using 
numbersbetween 0 and 9. I tried to create a random array and them make it 
unique.

for ($i = 0; $i<100; $i++){
$a[$i] = rand(0,9);
$test=$a[$i];
}

$ra = array_unique($test);

I keep getting an error saying $test is the incorrect type. Can someone 
please explain why this doesn't work. And does anyone know how to get a 
unique and random array, every time the page is refreshed.

Thanks
Deirdre

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
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: Unique Array

2001-09-10 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Deirdre Mc Cann) wrote:

> for ($i = 0; $i<100; $i++){
>   $a[$i] = rand(0,9);
>   $test=$a[$i];
>   }
> 
> $ra = array_unique($test);
> 
> I keep getting an error saying $test is the incorrect type. Can someone 
> please explain why this doesn't work.

$test is a string variable, not an array.  To add elements to an array, 
either use $varname[], array_push(), or array_unshift().

BTW, when an error message says that a variable is not the right type, this 
is a good time to use gettype() and/or var_dump() in order to check that 
the variable really has the type and value(s) what that you expect.

-- 
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]




RE: [PHP] hi

2001-09-10 Thread Seb Frost

Well you can't just have a link to this function.  Make a page like so:

showsource.php
**


yourfile.php
**

view source";

?>



- seb


-Original Message-
From: Balaji Ankem [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2001 10:25
To: [EMAIL PROTECTED]
Subject: [PHP] hi


Hi, what z wrong in this code??


>

\">view
source";

 ?>

>>>

I am getting the following error

Forbidden
You don't have permission to access /< on this server.

---
-

Apache/1.3.20 Server at ankem.wipro.com Port 80


How to rectify this thing??

Thanks in advance
Regards
-Balaji




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


-- 
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: Unique Array

2001-09-10 Thread _lallous

and more practically your code get corrected to this:
 for ($i = 0; $i<100; $i++)
{
   $a[$i] = rand(0,9);
   $test[]=$a[$i];
 }

 $ra = array_unique($test);

and your code get optimized to this: (mostly of the manual!;))
$numbers = range (0,9);
srand ((double)microtime()*100);
shuffle ($numbers);

"Cc Zona" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Deirdre Mc Cann) wrote:
>
> > for ($i = 0; $i<100; $i++){
> > $a[$i] = rand(0,9);
> > $test=$a[$i];
> > }
> >
> > $ra = array_unique($test);
> >
> > I keep getting an error saying $test is the incorrect type. Can someone
> > please explain why this doesn't work.
>
> $test is a string variable, not an array.  To add elements to an array,
> either use $varname[], array_push(), or array_unshift().
>
> BTW, when an error message says that a variable is not the right type,
this
> is a good time to use gettype() and/or var_dump() in order to check that
> the variable really has the type and value(s) what that you expect.
>
> --
> 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] Anagram Solution in PHP

2001-09-10 Thread Ralph Guzman

Im trying to figue out the following anagram using PHP. Here is the problem:

Using letters of the alphabet represented by a number, I have to come up
with words that add up to exactly 100.

Numbers are in reverse where A=26 and Z=1, so for example:

A  B  C...X  Y  Z
26 25 24..3  2  1

So let's say the word 'acronym'

A  + C  + R + 0  + N  + Y + M
26 + 24 + 9 + 12 + 13 + 2 + 14  = 100

My thoughts were to download a list of words in the dictionary, then read
the file and somehow replace each letter by its number, then add each letter
for each word and see which words would equal to 100.

So I am emailing this list for any suggestions or examples of code that I
can use to accomplish this. Any help?

Thanks much.




-- 
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: Anagram Solution in PHP

2001-09-10 Thread _lallous

I have no idea how anagrams work, but is it true as you say/imply:
"If the same of the characters of a string is same as the sum of other
characters in another string THEN the last is an anagram of the first?"

"Ralph Guzman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Im trying to figue out the following anagram using PHP. Here is the
problem:
>
> Using letters of the alphabet represented by a number, I have to come up
> with words that add up to exactly 100.
>
> Numbers are in reverse where A=26 and Z=1, so for example:
>
> A  B  C...X  Y  Z
> 26 25 24..3  2  1
>
> So let's say the word 'acronym'
>
> A  + C  + R + 0  + N  + Y + M
> 26 + 24 + 9 + 12 + 13 + 2 + 14  = 100
>
> My thoughts were to download a list of words in the dictionary, then read
> the file and somehow replace each letter by its number, then add each
letter
> for each word and see which words would equal to 100.
>
> So I am emailing this list for any suggestions or examples of code that I
> can use to accomplish this. Any help?
>
> Thanks much.
>
>
>



-- 
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] include path-problem

2001-09-10 Thread mail

Hi

I have a problem with the include command.I want to include a txt file in a php 
file.But this txt file must include in every php file on the server and these phpfiles 
are in different directories.
Here is the Problem :
www.domain.com/index2.php and www.domain.com/support/shop.php must include the txt 
file from www.domain.com/includes/news.txt.

So i used for this problem  for 
every php file.But this works only for the www.domain.com/index2.php file.

So what should i do to get the txt file in the www.domain.com/support/shop.php file ?
Thank you very much for support !!!

chris 



RE: [PHP] HELP!!!

2001-09-10 Thread Andrew Hill

Boris,

Compiling with ODBC translates to linking with an ODBC Driver Manager.
An Open Source Driver Manager is iODBC - www.iodbc.org
There is also a HOWTO on the site for PHP compiling --with-iodbc.

You will still need a driver for your ASA, but it appears you have this.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access & Data Integration Technology Providers

> -Original Message-
> From: Boris [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 10, 2001 4:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] HELP!!!
>
>
> I installed Red Hat 7 as server and get Apache and Php installed
> with that.
> I have connect from my new Linux box (with dbisqlc) to ASA 7 database what
> is on one Windows server and thats works fine.
> My Apache also works fine with Php only problem is when I try to use
> odbc_connect() or some other odbc funkctions I get "Fatal error: Call to
> undefined function: odbc_connect() in ...".
> I think my php is not compiled with odbc and I don't no how to do that.
> Please help!
>
> Best regards
> Boris
>
>
>
>
>
> --
> 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] Re: include path-problem

2001-09-10 Thread _lallous

Try use absolute path reference,

I can't see your problem!?
If you have this file:
/home/websitename/www/include/news.txt
whether you access it from /index2.php or /support/shop.php all the same!

You might also want to refer yourself to the "include_path" variable
configuration.


<[EMAIL PROTECTED]> wrote in message
001201c139f6$e1d51220$0100a8c0@pentium333">news:001201c139f6$e1d51220$0100a8c0@pentium333...
Hi

I have a problem with the include command.I want to include a txt file in a
php file.But this txt file must include in every php file on the server and
these phpfiles are in different directories.
Here is the Problem :
www.domain.com/index2.php and www.domain.com/support/shop.php must include
the txt file from www.domain.com/includes/news.txt.

So i used for this problem  for every php file.But this works only for the www.domain.com/index2.php
file.

So what should i do to get the txt file in the
www.domain.com/support/shop.php file ?
Thank you very much for support !!!

chris




-- 
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 in downloading manual

2001-09-10 Thread S.Maria Goretti\(jouhou\)20010808

Hi All,
I am trying to download php mauals. but I couldn't suceed as the server
is displaying the message
as "Server is Busy and try later". Even  I tried by using the link
with port number.

Can anybody help me in downloading the manulas?

Regards,
Maria


-- 
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 in downloading manual

2001-09-10 Thread _lallous

Did you try to dload the manual from PHP site's mirrors?

"S.Maria Goretti20010808" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All,
> I am trying to download php mauals. but I couldn't suceed as the server
> is displaying the message
> as "Server is Busy and try later". Even  I tried by using the link
> with port number.
>
> Can anybody help me in downloading the manulas?
>
> Regards,
> Maria
>



-- 
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] R: Quick File_Upload Example?

2001-09-10 Thread ---

1. HTML file:






2. PHP file (file upload handler):

if ($myfile != "none") {
   print "File uploaded:";
   print "Name: ".$file_name;
   print "Size: ".$file_size;
   etcetc..

move_uploaded_file("/PATH/WHERE/YOU/WANT/THE/FILE/".basename($myfile_name);
}

these snipplets could be useful...i hope you enjoy them.


Federico
[EMAIL PROTECTED]


Smileyq <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]
> After reading about file uploading on the PHP website it doesn't
> actually give an example to use for testing purposes. Can somebody
> provide me with a very simple and basic file upload example that I can
> start from and work with. Thanks for any help ahead of time.
> -Smileyq
>



-- 
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] Anagram Solution in PHP

2001-09-10 Thread Seb Frost

Sounds like you know exactly what you want to do :-)

1)  Obtain a text file, csv or whatever of a dictionary (easy enough -
www.google.com).
2)  Find the ascii values for a-z or A-Z, your choice.
3)  Read in a word at a time.
4)  Convert to upper or lower case to reflect part (2)
5)  Create a simple formula that converts the ascii codes into the range
1-26.
Something like ascii code of "z" - ascii code of letter + 1 should do the
trick.
6) add them all up.

simple.

- seb

-Original Message-
From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2001 09:26
To: PHP General Mailing List
Subject: [PHP] Anagram Solution in PHP


Im trying to figue out the following anagram using PHP. Here is the problem:

Using letters of the alphabet represented by a number, I have to come up
with words that add up to exactly 100.

Numbers are in reverse where A=26 and Z=1, so for example:

A  B  C...X  Y  Z
26 25 24..3  2  1

So let's say the word 'acronym'

A  + C  + R + 0  + N  + Y + M
26 + 24 + 9 + 12 + 13 + 2 + 14  = 100

My thoughts were to download a list of words in the dictionary, then read
the file and somehow replace each letter by its number, then add each letter
for each word and see which words would equal to 100.

So I am emailing this list for any suggestions or examples of code that I
can use to accomplish this. Any help?

Thanks much.




--
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]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


-- 
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] New to PHP, just looking for resources is all =)

2001-09-10 Thread Pete Lopez

Hi there,

I am new to PHP and mySQL.  I am a fairly quick learner and have set up a
script to add/modify/delete entries from a mySQL database and display them
in a table.

My first question is, where or how can I get information on how to only
allow certain people to add and then modify what they have added based on
their user name and password?

Right now, anyone use the script and add/delete/modify all entries.  I need
to create a way for everyone to be able to register a username then be able
to login.

The other thing I wanted to know was where I could get any information on
building a completely database driven site.  A lot of sites have references
to content but none that I have come across tell you how to use the database
to display things like images, imagebars, buttons, and so on.

I am not asking for any one-on-one help here(I realize most of you have
lives and dont have the time for that, although I would most certainly
appreciate it, heh =))  Any links or references you could provide would be
MOST helpful.  Also any good books on PHP and building database driven
websites using PHP and mySQL.

Thanks in advance,
Pete



-- 
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] Anagram Solution in PHP

2001-09-10 Thread nayco

I tried that code this morning :



26,"b"=>25,"c"=>24,"d"=>23,
"e"=>22,"f"=>21,"g"=>20,"h"=>19,
"i"=>18,"j"=>17,"k"=>16,"l"=>15,
"m"=>14,"n"=>13,"o"=>12,"p"=>11,
"q"=>10,"r"=>9,"s"=>8,"t"=>7,
"u"=>6,"v"=>5,"w"=>4,"x"=>3,
"y"=>2,"z"=>1);


 $fid=fopen("testfile.txt","r");

 $line_num=0;
 while (!feof($fid))
   {
   $line_num++;
   $line = strtolower(fgets($fid,4096));
   $words= explode(" ",$line);
   while (list($foo,$word)=each($words))
  {
  $word_value=0;
  for ($car=0;$car$word on line $line_value of
the input file has a value of $word_value.\n";
   }
   }
 echo "\nIf nothing appears above, no word with
a value of 100 was found !!!\n";

?>




(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr

- Original Message -
From: Ralph Guzman <[EMAIL PROTECTED]>
To: PHP General Mailing List <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 10:25 AM
Subject: [PHP] Anagram Solution in PHP


> Im trying to figue out the following anagram using PHP. Here is the
problem:
>
> Using letters of the alphabet represented by a number, I have to come up
> with words that add up to exactly 100.
>
> Numbers are in reverse where A=26 and Z=1, so for example:
>
> A  B  C...X  Y  Z
> 26 25 24..3  2  1
>
> So let's say the word 'acronym'
>
> A  + C  + R + 0  + N  + Y + M
> 26 + 24 + 9 + 12 + 13 + 2 + 14  = 100
>
> My thoughts were to download a list of words in the dictionary, then read
> the file and somehow replace each letter by its number, then add each
letter
> for each word and see which words would equal to 100.
>
> So I am emailing this list for any suggestions or examples of code that I
> can use to accomplish this. Any help?
>
> Thanks much.
>
>
>
>
> --
> 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] Windows mail() emalloc() Error

2001-09-10 Thread Simon Myers

We've been getting an error message when trying to call the mail()
function:

  FATAL: emalloc(): Unable to allocate -5675919 bytes

Treating that large negative number as an unsigned integer makes that
just over 4 gigabytes, which the server blatantly doesn't have.  But it
doesn't make sense for anything to be requesting that much memory.

The script works fine on Linux/Apache, only behaving like this on
Windows/IIS.  But there are other PHP scripts that send mail
successfully on both servers.  It isn't a server config issue, because
the SMTP and sendmail_from variables are ini_set() in a standard file
which is include-ed from both scripts that will send mail and the one
which won't.

I've been trying to isolate the problem, and can reproduce it completely
in a test script which just sends a constant mail -- no database
lookups, reading input, fancy HTML output, merely trying to send exactly
the same mail each time the script is run.

Then I changed things like the `To' and `Subject' headers and the body
of the mail.  It still doesn't send mail on Windows, but gives a
different message:

  Warning: Server Error in mailo.php on line 40

Now the mail() function does complete, returning false.

Has anybody any suggestion as to what could be causing these problems?

My entire script (42 lines) is below; most of it is merely debugging
print lines so I can see that mail() really is being called with the
parameters that I think it is.

\n";
print "##To: [$to] " . strlen($to) . " characters.\n";
print "##Subject: [$subject] " . strlen($subject) . " characters.\n";
print "##Extra Header: [$headers] " . strlen($headers) . " characters.\n";
print "##SMTP Server: [$smtp] " . strlen($smtp) . " characters.\n";
print "##Sendmail From: [$sendmail_from] " . strlen($sendmail_from) . 
" characters.\n";
$body_lngth = strlen($msg_body);
print "##Body (" . $body_lngth . " characters):\n";
$char_num = 0;
while ($char_num < $body_lngth)
{
  $col_num = 0;
  $hex = '';
  $ascii = '';
  while ($col_num++ < 0x10 && $char_num < $body_lngth)
  {
$char = $msg_body[$char_num];
$hex .= sprintf('%02X ', ord($char));
$ascii .= preg_match('/[\w .,:]/i', $char) ? $char : '#';
$char_num++;
  }
  printf("%-48s   %s\n", $hex, $ascii);
}
print "";
print "##Just about to send the mail, as the next statement.\n";
$sent = mail($to, $subject, $msg_body, $headers);
print "##The mail command has completed and returned [$sent].\n";
?>

Thanks for help with this.

Simon
-- 
Simon Myers * GBdirect
http://www.gbdirect.co.uk/
tel: +44 1274 772277  fax: +44 1274 772281


-- 
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] Reprise of dissapearing session variables

2001-09-10 Thread Johnson, Kirk

> The session  variables will remain set, but will it looks 
> like my session gets lost every now and then  if you want 
> to see an example, go to http://northpointless.org/test.php  
> and hit refresh several times. I cannot figure out what is happening.

Did you get this figured out? It looks like you are running on a
load-balanced web farm. If so, and you are saving session data in files,
there's your problem. The session file is saved on the server that handles
the first request. When later requests go to a different machine, the
session file can't be found, since it is on the first server.

Kirk

-- 
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: New to PHP, just looking for resources is all =)

2001-09-10 Thread _lallous

http://www.weberdev.com/
http://www.phpbuilder.com
http://www.zend.com


"Pete Lopez" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I am new to PHP and mySQL.  I am a fairly quick learner and have set up a
> script to add/modify/delete entries from a mySQL database and display them
> in a table.
>
> My first question is, where or how can I get information on how to only
> allow certain people to add and then modify what they have added based on
> their user name and password?
>
> Right now, anyone use the script and add/delete/modify all entries.  I
need
> to create a way for everyone to be able to register a username then be
able
> to login.
>
> The other thing I wanted to know was where I could get any information on
> building a completely database driven site.  A lot of sites have
references
> to content but none that I have come across tell you how to use the
database
> to display things like images, imagebars, buttons, and so on.
>
> I am not asking for any one-on-one help here(I realize most of you have
> lives and dont have the time for that, although I would most certainly
> appreciate it, heh =))  Any links or references you could provide would be
> MOST helpful.  Also any good books on PHP and building database driven
> websites using PHP and mySQL.
>
> Thanks in advance,
> Pete
>
>



-- 
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] check box help.

2001-09-10 Thread Chris Worth


Hey gang I'm using a checkbox in a form that has its values dumped into a mysql 
database.  for some odd reason, the checkbox information is "lost"

It worked earlier so I'm guessing I introduced a typo someplace.

this is the code in the form.  I figure if this looks ok to you all. I just need to go 
search 
through my code more carefully.


Recurring Seminar: Recurring 
seminars are displayed with a different color text in 
listings 


I create the form as a variable that is displayed.

thanks,

chris



-- 
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] Zend or not to Zend

2001-09-10 Thread Power Programmer

Anybody using the zend optimizer in a production environment?

Is Zend Cache worth the money?

thanks

Randy


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001


-- 
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] Code Red Catcher

2001-09-10 Thread billfarr

Hi All!
 
I had to unsubscribe for a little while due to the volume but did want to
follow up on the Code Red catcher script.  Anyone wanting a new copy of the
script, please email me directly.  I made a gob of changes to the original
code, slimming it down some and improving the lookups just a bit.
 
What I DIDN'T expect was the reporting of over 100 Code Red attack reports
per day.  My word!!  Obviously, the problem is STILL ongoing and far worse
than has been reported in the news.
 
Mind you, I run a teeny-tiny, no-great-shakes, niche-ISP business.  We're
hardly mentioned in search engines and due to the type of data mining and
collation we do, we're also hardly interesting.  This leads me to believe
that Code Red is still rampant and hungrily devouring as much of the 'net's
bandwidth as it can grab from as many locations as it can.  Those large
ISP's serving millions of hits a day (as opposed to our meager 20 million a
month) must be suffering!
 
Never have I been so grateful for Linux, Apache, and PHP.  Having a little
door-guard watching the fort written in a language all-but immune to the
attacks has certainly opened my eyes and made me aware that even still, many
people on the net are completely irresponsible about their updates and their
security.
 
I won't lay the blame entirely at Microsoft for leaving such inexcusably
wide holes in products destined for interaction with the Web, but I'll
certainly lay a god bit of it on those who insist on using M$ software,
putting it directly on the net with no firewall and no updates.  Putting the
PHP Code Red detector script online has really shown me how bad the problem
really is...and STILL is!
 
Bottom line, Hooray for PHP and Hooray for Apache... what a great
combination!
 
Best regards,
 
Bill
   



[PHP] R: JavaScript, PHP cooperation.

2001-09-10 Thread ---

yes, you can popup a html form with target = _parent, like this:

First page:



1
2
".$opt."";
?>

add another opt


Popup page:






this should be work, i write it very fast, i don't test it, but this is a
start point :)

-
Federico
[EMAIL PROTECTED]
-


Alexander Deruwe <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]
> Hewwo,
>
> When selecting a value from a combobox, I always have a link that allows
> adding a record to the table the combobox pulls it's data from. Here is my
> problem:
>
> Is it possible in any way to window.open() a popup window (JavaScript),
fill
> in a record, add it to the database (PHP) and then reload the caller page
so
> that the just added record appears in the combobox where the user can
select
> it for completing the file? Or add it to the combobox manually with
> JavaScript to avoid a reload?
>
> Alexander Deruwe.



-- 
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] R: difference between

2001-09-10 Thread ---

if you know the xml language, you notice that all tags that start with 



my text
etc.

between  wrote in message
[EMAIL PROTECTED]
> Hi,
>
> I am a newbie at this PHP thing and I have been working from information
> on the web and from books.
>
> I noticed that some start the PHP script with   book uses both methods interchangeably.
>
> Is there a real difference between the two?
>
> Or maybe I just haven't noticed something.
>
> Peter
>



-- 
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] reading arrays within a field from mysql and separating the values

2001-09-10 Thread Robert Trembath

Hello everyone,

Ran into a problem trying to get this to work. I have multiple names in a
mysql field (DCD_Access) that contains "name1, name2, name3, name4" and I
want read this information as an array so I can use these values to populate
a pull-down list using a while or foreach loop. Below is the code I used,
but I get the values as a single entry no matter what I try. This query
brings a single result row "name1, name2, name3, name4". Here's the code:

$result4 = mysql_query( "SELECT DCD_Access FROM userdb WHERE ID =
'$user_ID'");
$DCD = mysql_fetch_array ( $result4 );

print " \n
\n
\n
None\n
Within Gel\n";
foreach ( $DCD as $val )
{
print "$val\n";
}
print "   \n
  \n";

This returns HTML like:




None
Within Gel
name1, name2, name3,
name4
name1, name2, name3,
name4
name1, name2, name3,
name4
name1, name2, name3,
name4
 
 

What I need is to get:




None
Within Gel
name1
name2
name3
name4
 
 

Anyone know how to fix this?
Robert




-- 
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] Code Red Catcher

2001-09-10 Thread Christopher CM Allen

B-,

I get 4-5 new ip's daily on each of my machines. It's ridiculous and I have
given up trying ot notify each of these machines that they have a problem.

-ccma



-- 
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] Code Red Catcher

2001-09-10 Thread Mattias Segerdahl

Why invent the wheel twice, this has been around since the first day
code red was discovered.. See code-red.php


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: den 10 september 2001 16:22
To: [EMAIL PROTECTED]
Subject: [PHP] Code Red Catcher

Hi All!
 
I had to unsubscribe for a little while due to the volume but did want
to
follow up on the Code Red catcher script.  Anyone wanting a new copy of
the
script, please email me directly.  I made a gob of changes to the
original
code, slimming it down some and improving the lookups just a bit.
 
What I DIDN'T expect was the reporting of over 100 Code Red attack
reports
per day.  My word!!  Obviously, the problem is STILL ongoing and far
worse
than has been reported in the news.
 
Mind you, I run a teeny-tiny, no-great-shakes, niche-ISP business.
We're
hardly mentioned in search engines and due to the type of data mining
and
collation we do, we're also hardly interesting.  This leads me to
believe
that Code Red is still rampant and hungrily devouring as much of the
'net's
bandwidth as it can grab from as many locations as it can.  Those large
ISP's serving millions of hits a day (as opposed to our meager 20
million a
month) must be suffering!
 
Never have I been so grateful for Linux, Apache, and PHP.  Having a
little
door-guard watching the fort written in a language all-but immune to the
attacks has certainly opened my eyes and made me aware that even still,
many
people on the net are completely irresponsible about their updates and
their
security.
 
I won't lay the blame entirely at Microsoft for leaving such inexcusably
wide holes in products destined for interaction with the Web, but I'll
certainly lay a god bit of it on those who insist on using M$ software,
putting it directly on the net with no firewall and no updates.  Putting
the
PHP Code Red detector script online has really shown me how bad the
problem
really is...and STILL is!
 
Bottom line, Hooray for PHP and Hooray for Apache... what a great
combination!
 
Best regards,
 
Bill
   


http://www.microsoft.com/technet/security/bulletin/MS01-033.asp\n\n";;

  $message .= "Because of the importance of this threat, ";
  $message .= "this alert is being made jointly by: \n";
  $message .= "Microsoft \n";
  $message .= "The National Infrastructure Protection Center \n";
  $message .= "Federal Computer Incident Response Center (FedCIRC) \n";
  $message .= "Information Technology Association of America (ITAA) \n";
  $message .= "CERT Coordination Center \n";
  $message .= "SANS Institute \n";
  $message .= "Internet Security Systems \n";
  $message .= "Internet Security Alliance \n";

  $headers .= "From: $name <$from>\n";
  $headers .= "X-Mailer: PHP\n"; // mailer
  $headers .= "X-Priority: 1\n"; // Urgent message!
  $headers .= "Return-Path: <$from>\n";  // Return path for errors

  /* Get a whois output from whois.ripe.net */
  @exec("/usr/bin/whois $[EMAIL PROTECTED]",$whois,$status);

  /* Parse the email addresses from the output */
  while(list($key,$value) = each($whois)) 
  {
   if(strstr($value,"abuse@")) 
   {
$email = strstr($value,"abuse@");
$email = chop(trim($email));
$abuse[] = $email;
   } 
   elseif(substr($value,0,6) == "e-mail" || substr($value,0,6) == "notify") 
   {
$email = strstr($value," ");
$email = chop(trim($email));
$notabuse[] = $email;
   }
  }

  if($logt == "file")
  {
   $fp = fopen($path . "/code-red_ips.txt","a+");
  }
  elseif($logt == "syslog")
  {
   define_syslog_variables();
   openlog("httpd", LOG_PERROR, LOG_DAEMON);
  }

  /* Email the offender */
  if(!empty($abuse)) 
  {
   while(list($key,$var) = each($abuse)) 
{
mail($var, $subject, $message, $headers);
if($logt == "file")
{
 fputs($fp,"$host " . date(r) . " - Email sent to $var\n"); 
}
elseif($logt == "syslog") 
{
 syslog(LOG_WARNING,"Code red from $host email sent to $var");
}
   }
  } 
  elseif(!empty($notabuse)) 
  {
   while(list($key,$var) = each($notabuse)) 
   {
mail($var, $subject, $message, $headers);
if($logt == "file")  
{
 fputs($fp, "$host " . date(r) . " - Email sent to $var\n");
}
elseif($logt == "syslog") 
{
 syslog(LOG_WARNING,"Code red from $host email sent to $var");
}
   }
  } 
  else 
  {
   fputs($fp, "$host " . date(r) . " - Email not sent!\n");
  }

  if($logt == "file")
  {
   fclose($fp);
  }
  elseif($logt == "syslog")
  {
   closelog();
  }

?>


-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Andrew Penniman

I am trying to figure out how to use PHP to redirect the user to a new
location *after* processing and most likely outputting a bunch of code.
Because this redirection would happen late in the game I can't use
header("Location: ".$redirect_to);

I come from a ColdFusion background and am used to CFAS' 
tag.  Does PHP have an equivalent function?

I am really hoping not to use JavaScript, I want this redirection to
happen at the server and not the client.

-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread George Pitcher

Andrew,

I am in a similar position witha Lasso site, which I am considering php-ing.
I need to do conditional redirects.

George P, Edinburgh

- Original Message -
From: "Andrew Penniman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 3:37 PM
Subject: [PHP] PHP Redirect in the middle of code?


> I am trying to figure out how to use PHP to redirect the user to a new
> location *after* processing and most likely outputting a bunch of code.
> Because this redirection would happen late in the game I can't use
> header("Location: ".$redirect_to);
>
> I come from a ColdFusion background and am used to CFAS' 
> tag.  Does PHP have an equivalent function?
>
> I am really hoping not to use JavaScript, I want this redirection to
> happen at the server and not the client.
>
> --
> 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]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.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]




[PHP] PHP and IIS4

2001-09-10 Thread pong-TC

Hello All

I am using ASP on IIS4, and interested in PHP.  I would like to know that
if I install PHP on IIS4, can I still use ASP as well?

Thank you.
Pong


-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Jordan Elver

Hi,
If you put ob_start(); at the top of the page you can use header() anywhere 
you want.

HTH,

Jord

On Monday 10 September 2001 10:18, you wrote:
> Andrew,
>
> I am in a similar position witha Lasso site, which I am considering
> php-ing. I need to do conditional redirects.
>
> George P, Edinburgh
>
> - Original Message -
> From: "Andrew Penniman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 10, 2001 3:37 PM
> Subject: [PHP] PHP Redirect in the middle of code?
>
> > I am trying to figure out how to use PHP to redirect the user to a new
> > location *after* processing and most likely outputting a bunch of code.
> > Because this redirection would happen late in the game I can't use
> > header("Location: ".$redirect_to);
> >
> > I come from a ColdFusion background and am used to CFAS' 
> > tag.  Does PHP have an equivalent function?
> >
> > I am really hoping not to use JavaScript, I want this redirection to
> > happen at the server and not the client.
> >
> > --
> > 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]
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com

-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd

-- 
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] PHP and IIS4

2001-09-10 Thread Jack Dempsey

you won't want to, but yes...

-Original Message-
From: pong-TC [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 10:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and IIS4


Hello All

I am using ASP on IIS4, and interested in PHP.  I would like to know that
if I install PHP on IIS4, can I still use ASP as well?

Thank you.
Pong


-- 
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] Re: creating ZIP file from mySQL content?

2001-09-10 Thread BRACK

But isn't it about gzip formate? Will I be able to make it .zip 
extension? will windows users be able to unpack my files?

Youri
> http://php.net/zlib
> 
> --
> 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:
> Brack <[EMAIL PROTECTED]> Newsgroups: php.general To:
> <[EMAIL PROTECTED]> Sent: Saturday, September 08, 2001 6:57 AM
> Subject: creating ZIP file from mySQL content?
> 
> 
> > I have a site where ppl can upload their text-based ideas in real
> > time, so that I have new records in db every day. When I did
> > uploading by hands and had over 200 files on that site I distributed
> > all site content in downloadable for of zipped win-help formate.
> > Well, I don't think that I can do help file dinamically but what
> > about normal zip file. Can I create the script which would do it for
> > me (creating zip-file of all records in db dynamically)?
> >
> > Youri
> > <>< <>< <>< <>< God is our provider ><> ><> ><> ><>
> > http://www.body-builders.org
> 


<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
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] New to PHP, just looking for resources is all =)

2001-09-10 Thread B. van Ouwerkerk


>I am not asking for any one-on-one help here(I realize most of you have
>lives and dont have the time for that, although I would most certainly
>appreciate it,

Forget it, to much fun to figure it our yourself. :-)

>   Any links or references you could provide would be
>MOST helpful.  Also any good books on PHP and building database driven
>websites using PHP and mySQL.


http://www.php.net/links.php

MySQL written by Paul DuBois
PHP4 bible written by Tim Converse and Joyce Park
Professional PHP programming, Wrox


Don't forget to check this lists archive. Do a search for books and you'll 
find much much more.

Bye,


B.


-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Robin Vickery

[EMAIL PROTECTED] (George Pitcher) writes:

> Andrew,
> 
> I am in a similar position witha Lasso site, which I am considering php-ing.
> I need to do conditional redirects.
> 
> George P, Edinburgh
> 
> - Original Message -
> From: "Andrew Penniman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 10, 2001 3:37 PM
> Subject: [PHP] PHP Redirect in the middle of code?
> 
> 
> > I am trying to figure out how to use PHP to redirect the user to a new
> > location *after* processing and most likely outputting a bunch of code.
> > Because this redirection would happen late in the game I can't use
> > header("Location: ".$redirect_to);

You should probably look at ouput buffering; the php manual has a section
on the subject at http://uk.php.net/manual/en/ref.outcontrol.php and Zeev
Suraski wrote an article at Zend http://zend.com/zend/art/buffering.php

  -robin

-- 
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] PHP and IIS4

2001-09-10 Thread George Pitcher

Yes, it will. But try not to mix and match.

George
- Original Message - 
From: "pong-TC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 3:53 PM
Subject: [PHP] PHP and IIS4


> Hello All
> 
> I am using ASP on IIS4, and interested in PHP.  I would like to know that
> if I install PHP on IIS4, can I still use ASP as well?
> 
> Thank you.
> Pong
> 
> 
> -- 
> 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]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.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]




[PHP] R: creating ZIP file from mySQL content?

2001-09-10 Thread ---

zip support in php is read-only.
but keep in mind that zip is not simply a compressed file, is a compressed
archive, like .tar.gz or .tar.bz2

you can use zlib for gzip files or bzip2 for bzip2 files...

if you need absolutely a zip file format you need to pipe it to a program
like the unix program zip, passing the text via stdin.

Look at the php manual...

Brack <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]
> I have a site where ppl can upload their text-based ideas in real
> time, so that I have new records in db every day. When I did
> uploading by hands and had over 200 files on that site I distributed
> all site content in downloadable for of zipped win-help formate.
> Well, I don't think that I can do help file dinamically but what about
> normal zip file. Can I create the script which would do it for me
> (creating zip-file of all records in db dynamically)?
>
> 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]




Re: [PHP] PHP Redirect in the middle of code?

2001-09-10 Thread Steve Edberg

Right off the top of my head, you have three options that I can see:

(1) Rewrite the code to avoid any output before the redirect.

(2) Use output buffering (available only in PHP4). I haven't used 
this, but check out

http://www.php.net/manual/en/ref.outcontrol.php

(3) Use a META REFRESH tag. For example:



where 1 is the time (in seconds) before you want the redirect, and 
'page.php' is where you want the redirect to. Of course, this tag 
needs to be in the  section, so it might not help you much.

As far as I know, though, cold fusion's  tag only works 
because CF does output buffering implicitly. So, I'd guess you need 
to do option (2).

-steve



At 10:37 AM -0400 9/10/01, Andrew Penniman wrote:
>I am trying to figure out how to use PHP to redirect the user to a new
>location *after* processing and most likely outputting a bunch of code.
>Because this redirection would happen late in the game I can't use
>header("Location: ".$redirect_to);
>
>I come from a ColdFusion background and am used to CFAS' 
>tag.  Does PHP have an equivalent function?
>
>I am really hoping not to use JavaScript, I want this redirection to
>happen at the server and not the client.


-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Jason Brooke

> Right off the top of my head, you have three options that I can see:
> 
> (1) Rewrite the code to avoid any output before the redirect.

I'd recommend this one myself 

jason 




-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Michael Kimsal

As others have mentioned, output buffering is
what you want to look at.  

I've been doing some minor research on CF the past couple weeks,
and it seems that CF, by default, always has output buffering on.  While
it's great for allowing redirects/header info to be pushed out wherever
in a script, it apparently also consumes more memory, as the engine
needs to keep a full copy of the output in memory before pushing it down.

While there are definitely systems where this is desired, it's an option 
in PHP,
but doesn't seem to be one in CF.  (If anyone can tell me differently - 
which CF
tag to use to toggle it on/off - please let me know).

http://www.php.net/ob_start would be a place to start reading about
output buffering, and the zend.com article is good as well.


Andrew Penniman wrote:

>I am trying to figure out how to use PHP to redirect the user to a new
>location *after* processing and most likely outputting a bunch of code.
>Because this redirection would happen late in the game I can't use
>header("Location: ".$redirect_to);
>
>I come from a ColdFusion background and am used to CFAS' 
>tag.  Does PHP have an equivalent function?
>
>I am really hoping not to use JavaScript, I want this redirection to
>happen at the server and not the client.
>



-- 
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] << Previous / Next Buttons >>

2001-09-10 Thread Michael O'Neal

on 9/6/01 11:52 PM, [EMAIL PROTECTED] went and wrote:

> I'll show you what I did but realize I'm an advanced beginner/intermediate
> programmer. This may not be the most efficient way to do it but seems to
> be the simplest code compared to other ways of doing it that I've seen. Not
> sure if I will explain this well enough either. And this is for a fairly small
> database. With a larger one it may be too inefficient.
> 
> First count how many records are in the database for the album and put
> it in $count.
> 
> Then loop through all the records in the album, place the id for each record
> in an array and find out where in the array the current record is. $photo_id
> is fed to this script which tells it which picture to display:
> 
> $x = 0;
> while ($row = mysql_fetch_array($result)) {
> $photo_id1 = $row['photoid'];
> $array[$x] =  $photo_id1;
> if ($photo_id1 == $photo_id) {
> $position = $x;

Thanks a lot, Jeff & Chris.  I'll try it this morning!


mto

-- 

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


-- 
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] Accessing Variable !!!

2001-09-10 Thread Girish P

Hi,
 I am trying to use value of the text box  for the querying ..The
query is defined with in the a javaScript .
I am not able to get the Value.. inside the function.. However
"document.form.text.value" is getting the value.
How do we assign the value of javscript to PHP??? Is there a better way
,,,
 
 
Php is as follows:
 
 


Search result

 

\n";
echo "function getNames()\n";
echo "{\n";
echo "alert(\"Inside the FUcntion\");\n";
$connection = mssql_connect("girishp", "sa", "") or die
("could not connect to server.");
$db = mssql_select_db("AZADMINGROUP", $connection) or die 
("Could not select database");
$sql_employee = "Select E_Number,E_First_Name,E_Last_Name from
T_Employee where E_First_Name = \"$searchName\"";
echo "alert(document.searchEmpl.searchName.value);\n"; 
$result_employee = mssql_query($sql_employee, $connection) or die
("Coule not execute");  $count = 1;
while($row = mssql_fetch_array($result_employee)) {
$ENo = $row["E_Number"];
$val = $row["E_First_Name"];
$val = $val . $row["E_Last_Name"];
#echo "var val = document.searchEmpl.searchresult;\n";
$val = $val . " ( " . $ENo . " )";
echo "document.searchEmpl.searchResult.options[$count].value =
'$val';\n";
echo "document.searchEmpl.searchResult.options[$count].text =
'$val';\n";
$count++;
}
echo "}\n";
echo "\n";
echo "\n";
echo "Search :\n";
echo "\n";
echo "Employee Name : 
 \n";
echo "\n";
echo "\n";
echo "Search Result\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "   
\n";
 
echo "\n\n";
?>

 

 
 
TIA
Girish



[PHP] Re: Never tried it but....

2001-09-10 Thread lo-tek

No. It may be remotely possible (with a gross hack) for persistent
connections, but in general, resources are disposed of after every request,
so resource Ids are meaningless across pages.

i doubt that the session manager would let you store a resource anyway...

_lallous <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can sessions hold the $result resource of a mysql_query?
> and the use that $result variable to fetch rows on other page?
>
>



-- 
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] global $HTTP_SESSION_VARS not global ???

2001-09-10 Thread Thomas Watson

Hi all, 

After a bit of testing, I've noticed, that the $HTTP_SESSION_VARS array 
isn't as global as the manual makes it. The following piece of code should 
produce 2 blank lines and a "click here" link the first time it's loaded. 
When you click on the link, I would expect two lines saying "something", but 
only the second one works. 

---
\n");
}

foo();
print($HTTP_SESSION_VARS["test"] . "\n");

?>

Click here
---

I would expect the array $HTTP_SESSION_VARS to be global, and thereby 
available inside the foo() function.

Have I misunderstood something in the manual?

If you think of replying that I should use the "global" declaration please 
give a good argument why. I know it solves my problem, but it is still not 
right according to the manual ;)

/watson

-- 
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] Code Red Catcher

2001-09-10 Thread billfarr

Hi again, Everyone:

I didn't expect such a response so quickly.  With your indulgence, I'll
quote the code in this message.  I just found out that Outlook (which is
what I'm forced to use at Volvo) won't attach .ida files and I *think* this
list strips attachments in any case.

I don't remember offhand who put the link on this list for the original
code.  Most of it I didn't write, but have done some heavy carving and
additions in spots.  The IP-to-ISP lookup misses entirely about 2% of the
time and needs a tiny-bit better parsing to determing the "best" of several
provided email addresses for the ISP.  I just haven't got that far yet :-)
But the script works as intended, unattended.  BTW, do remember to insert
the AddType directive (near the top of the script in the propaganda) into
your Apache config and reload Apache else the script won't activate.

Be ready for your mailbox to fill.  Personally, I had to turn off CC'ing
myself on every complaint it generated, but I do check all the logs (syslog
and the Apache logs) several times a day and I do keep a running count in a
database for offline processing.

I'd appreciate any modifications or bug-fixes.  I'm not a spit-hot PHP
programmer YET, but maybe someday when I grow up with all of your help.  I
really appreciate the education and encouragement that is freely handed out
over this list.  THIS is more like a community of folks actually doing GOOD
things than any other list to which I've subscribed.

Best regards,
Bill

file: default.ida

http://www.microsoft.com/technet/security/bulletin/MS01-033.asp\n\n";;

  $message .= "For more information on this situation, \n";
  $message .= "point your browser here:\n";
  $message .=
"http://www.microsoft.com/technet/security/bulletin/MS01-033.asp\n";;
  $message .= "http://news.excite.com/news/ap/010805/20/code-red\n";;
  $message .= "http://news.cnet.com/news/0-1003-201-6625599-0.html\n";;
  $message .= "If you have are running this Operating System, Microsoft
suggests that \n";
  $message .= "you obtain and run the patch as soon as possible:\n";
  $message .= "For Windows NT:\n";
  $message .=
"http://www.microsoft.com/Downloads/Release.asp?ReleaseID=30833\n";;
  $message .= "For Windows 2000:\n";
  $message .=
"http://www.microsoft.com/Downloads/Release.asp?ReleaseID=30800\n";;

  $message .= "Because of the importance of this threat, ";
  $message .= "this alert is being made jointly by: \n";
  $message .= "Microsoft \n";
  $message .= "The National Infrastructure Protection Center \n";
  $message .= "Federal Computer Incident Response Center (FedCIRC) \n";
  $message .= "Information Technology Association of America (ITAA) \n";
  $message .= "CERT Coordination Center \n";
  $message .= "SANS Institute \n";
  $message .= "Internet Security Systems \n";
  $message .= "Internet Security Alliance \n";

  $headers .= "From: $name <$from>\n";
  $headers .= "Reply-To: Administrator <[EMAIL PROTECTED]>\n";
  $headers .= "X-Mailer: PHP\n"; // mailer
  $headers .= "X-Priority: 1\n"; // Urgent message!
  $headers .= "Return-Path: Administrator <[EMAIL PROTECTED]>\n";
// Return path for errors

$GotResponse = false;

// jwwf - major patching to accommodate multiple authority lookups

// ARIN makes a messy output.  To get what we want we have to requery using
the NIC 
// handle to get the email address for the contact.  First, replace this
skimpy output
// with the output that has the required data in it

foreach ( $Authorities as $Authority ) {
if ( $GotResponse ) { break; }
$RespondingAuthority = $Authority;
@exec("/usr/bin/whois $ip@$Authority", $WholeResponse, $status );
$UWholeResponse = strtoupper( join( " ", $WholeResponse) );
if ( ( strpos( $UWholeResponse, "NO ENTRIES" ) === false ) && (
strpos( $UWholeResponse, "NO MATCH" ) === false ) ) {
$GotResponse = true;
$Keepgoing = true;
foreach ( $WholeResponse as $Line ) {
if ( ( $Authority == "whois.arin.net" ) && ( $Keepgoing ) )
{
$StartPos = strpos( $Line, chr(40) );
if ( !( $StartPos === false ) ) {
$StartPos++;
$RightSide = strpos( $Line, chr(41)
);
$RightSide = $RightSide - $StartPos;
$Query = substr( $Line, $StartPos,
$RightSide );
$Query .= "@whois.arin.net";
unset( $WholeResponse );
@exec( "/usr/bin/whois !$Query",
$WholeResponse, $status );
$Keepgoing = false;
break;  
}   
}   
}   
}   
}

// APNIC and RIPE pr

RE: [PHP] Unique Array

2001-09-10 Thread Mark Roedel

> -Original Message-
> From: Deirdre Mc Cann [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, September 10, 2001 6:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Unique Array
> 
> 
> Can anyone help me? I need to produce a random and uniques 
> array using numbers between 0 and 9. I tried to create a
> random array and them make it unique.
> 
> for ($i = 0; $i<100; $i++){
>   $a[$i] = rand(0,9);
>   $test=$a[$i];
>   }
> 
> $ra = array_unique($test);
> 
> I keep getting an error saying $test is the incorrect type. 

Because you've set $test equal to one element of $a (making it an
integer).  Array_unique() wants to operate on an entire array.

What I'd do, assuming I'm understanding the question correctly, would be
something more like:

$a = range(0,9);
srand((double)microtime()*100);
shuffle($a);

(That is, get all your values loaded first, then just randomly rearrange
the order.)


---
Mark Roedel |  "Blessed is he who has learned to laugh
Systems Programmer  |   at himself, for he shall never cease
LeTourneau University   |   to be entertained."
Longview, Texas, USA|   -- John Powell 

--
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] Convert a string so it is valid for a sql query

2001-09-10 Thread Brandon Orther

Hello,
 
Is there a function to convert a string so it is a valid string of text
for a SQL query?  AN example would be a string of text that has ' in it
would be converted to \'
 
Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
  
 



Re(2): [PHP] PHP and IIS4

2001-09-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>Yes, it will. But try not to mix and match.

Can you explain more about this?  I would like to know more about the
impact of having and using ASP and PHP together.

Thank you.
Pong
>
>
>George
>- Original Message - 
>From: "pong-TC" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, September 10, 2001 3:53 PM
>Subject: [PHP] PHP and IIS4
>
>
>> Hello All
>> 
>> I am using ASP on IIS4, and interested in PHP.  I would like to know
>that
>> if I install PHP on IIS4, can I still use ASP as well?
>> 
>> Thank you.
>> Pong
>> 
>> 
>> -- 
>> 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]
>
>
>
>_
>
>Do You Yahoo!?
>
>Get your free @yahoo.com address at http://mail.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]




[PHP] NT?

2001-09-10 Thread Jeremy Morano

Hello, 
Sorry to bother everyone. I was just wondering if php runs on NT?

-- 
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: NT?

2001-09-10 Thread Alistair Austen

Yep, check here, http://www.php.net/downloads.php and look under Win32.

Alistair

"Jeremy Morano" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> Sorry to bother everyone. I was just wondering if php runs on NT?



-- 
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: Convert a string so it is valid for a sql query

2001-09-10 Thread Alistair Austen

Use AddSlashes;

string addslashes (string str)

This will add slashes to all characters that require them for SQL queries.

Alistair

"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
00b401c13a12$fde59b30$0a00a8c0@webintel">news:00b401c13a12$fde59b30$0a00a8c0@webintel...
> Hello,
>
> Is there a function to convert a string so it is a valid string of text
> for a SQL query?  AN example would be a string of text that has ' in it
> would be converted to \'
>
> Thank you,
>
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.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] Re: Convert a string so it is valid for a sql query

2001-09-10 Thread Moody

> Is there a function to convert a string so it is a valid string of text
> for a SQL query?  AN example would be a string of text that has ' in it
> would be converted to \'

http://www.php.net/manual/en/function.addslashes.php





-- 
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] passing args to function?

2001-09-10 Thread Jaxon

Hi,

I'm having a bit of a hard time passing in a constant to a user-defined
function.

the calling page - index.php:




define_foo.php:
$titleblock";

if (is_null($result)) break;

//iterate through array, outputting info based on value type
if ($value != "bar")
{
while (list ($text, $link) = mysql_fetch_row ($result))
{
echo "$text";
}
}
elseif ($value ="eek")
{
while (list ($text, $link) = mysql_fetch_row ($result))
{
echo "$text";
}
}
}
?>

any pointers much appreciated!!!

cheers,
jaxon


-- 
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] Convert a string so it is valid for a sql query

2001-09-10 Thread nayco

$corrected_string=addslashes($string_to_correct)   

I think this function does it...

or maybe :

$corrected_string=ereg_replace("/'/","\'",$string_to_correct)   >(i'm
not sure of the syntax).


(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr
- Original Message -
From: Brandon Orther <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 6:09 PM
Subject: [PHP] Convert a string so it is valid for a sql query


> Hello,
>
> Is there a function to convert a string so it is a valid string of text
> for a SQL query?  AN example would be a string of text that has ' in it
> would be converted to \'
>
> Thank you,
>
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.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] NT?

2001-09-10 Thread nayco

I don't think that will be a problem : try zend.com 'apache + php4' > go
and see http://zend.com

Anyone tried under NT ???

I won't say : 'try Linux' 

(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr


- Original Message -
From: Jeremy Morano <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 6:26 PM
Subject: [PHP] NT?


> Hello,
> Sorry to bother everyone. I was just wondering if php runs on NT?
>
> --
> 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] Re: passing args to function?

2001-09-10 Thread Moody

> I'm having a bit of a hard time passing in a constant to a user-defined
> function.
>
> the calling page - index.php:
> 
>  include define_foo.php;
> function_foo(bar);
  ^
should be:
   foo("bar");

[snip]

>  function foo($value)
> {
> global $value, $page_id, $usr, $pass, $database, $host;
   ^
No need to declare $value as global . Already passed as arg

[snip]



-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Ken

At 08:11 AM 9/10/01 -0700, Steve Edberg wrote:
>Right off the top of my head, you have three options that I can see:
>(3) Use a META REFRESH tag. For example:
>
> 
>
>where 1 is the time (in seconds) before you want the redirect, and 'page.php' is 
>where you want the redirect to. Of course, this tag needs to be in the  
>section, so it might not help you much.

Not necessarily true, the  part.  My application outputs a  
line really late in the HTML document - definitely inside the  section - and the 
refresh seems to be working for all.

- Ken
[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] PHP Redirect in the middle of code?

2001-09-10 Thread Philip Olson


On Tue, 11 Sep 2001, Jason Brooke wrote:

> > Right off the top of my head, you have three options that I can see:
> > 
> > (1) Rewrite the code to avoid any output before the redirect.
> 
> I'd recommend this one myself 

Me too, I can't think of a valid reason to use a Location header while
having output also as the user will only have about .0002 seconds to
read the output before being redirected.

  if ($foo == 'example') {  // I'm not output

header('Location: http://www.example.com/');
exit;
  }

is perfectly valid.  Now, why would someone need to do :

  if ($foo == 'example') {

echo 'Hope you find example.com pleasing, have fun!';

header('Location: http://www.example.com/');
exit;
  }

If such an announcement is needed, using html Meta Refresh tag works as
one can also implement the delay (some of our users are slow readers :).

Also, headers_sent() can be useful.  I'd personally avoid output buffering
for this.

Regards,
Philip Olson

> 
> jason 
> 
> 
> 
> 
> -- 
> 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] PHP Redirect in the middle of code?

2001-09-10 Thread Steve Edberg

I learn something every day, here :)

According to my McGraw-Hill HTML Programmer's Reference [please, no 
messages about HTML not being 'programming'!], the META tag _should_ 
only occur in the  container. Of course, we all know how 
closely browsers adhere to the HTML specs ;P

-steve


At 1:00 PM -0400 9/10/01, Ken wrote:
>At 08:11 AM 9/10/01 -0700, Steve Edberg wrote:
>>Right off the top of my head, you have three options that I can see:
>>(3) Use a META REFRESH tag. For example:
>>
>>  
>>
>>where 1 is the time (in seconds) before you want the redirect, and 
>>'page.php' is where you want the redirect to. Of course, this tag 
>>needs to be in the  section, so it might not help you much.
>
>Not necessarily true, the  part.  My application outputs a 
> line really late in the HTML document - 
>definitely inside the  section - and the refresh seems to be 
>working for all.
>
>- Ken
>[EMAIL PROTECTED]
>

-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Andrew Penniman

The Steve Edberg (option #2) and Michael Kimsal suggestions to use
ob_start() output buffering work like a charm.  Thanks so much!  I would
have been a long time coming before I mad this connection on my own.
Guess I need to hone my archive querying skills...

I think it would be _really_ swell if the documention for header()
mentioned output buffering as a means of tweaking the headers,
especially header("Location: ".$redirect_to), in mid-code.

I Fusebox my pages (www.fusebox.org) so I only need to add a single
ob_start() and ob_end_flush() call to my source tree.  If I'm
redirecting then I call ob_end_clean(); header("Location:
".$redirect_to); and everything works like a charm!

Cheers!

-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Michael Kimsal

Good to hear.  How's fusebox working for you?



Andrew Penniman wrote:

>The Steve Edberg (option #2) and Michael Kimsal suggestions to use
>ob_start() output buffering work like a charm.  Thanks so much!  I would
>have been a long time coming before I mad this connection on my own.
>Guess I need to hone my archive querying skills...
>
>I think it would be _really_ swell if the documention for header()
>mentioned output buffering as a means of tweaking the headers,
>especially header("Location: ".$redirect_to), in mid-code.
>
>I Fusebox my pages (www.fusebox.org) so I only need to add a single
>ob_start() and ob_end_flush() call to my source tree.  If I'm
>redirecting then I call ob_end_clean(); header("Location:
>".$redirect_to); and everything works like a charm!
>
>Cheers!
>



-- 
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]




  1   2   >