Re: AW: [PHP] How to pipe a command output into another command

2001-02-23 Thread Martin Kong

Thanks!  After upgrading to the latest PHP, it's working now.

Sebastian Stadtlich wrote:
> 
> this one uses pipe
> 
> $command=`find $verzeichnis. -iname $DateiPattern |sort -f`;
> $verzeichnisliste = explode ("\n",$command);
> 
> sebastian
> 
> -Ursprungliche Nachricht-
> Von: Martin Kong [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 21. Februar 2001 15:45
> An: [EMAIL PROTECTED]
> Betreff: [PHP] How to pipe a command output into another command
> 
> >From within PHP, I'm trying to execute an external command and pipe (|)
> the result into another command, then capture the output.  I've tried
> everything, exec, system, passthru, popen and backtick, and still could
> get it to work.  Has anyone done it before?  Is it possible with PHP?
> 
> Running PHP 4.0.1pl2 as a Apache module.
> 
> Thanks.
> 
> --
> 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] isset()

2001-02-23 Thread PHPBeginner.com

the SOLUTION:

strlen() is the length of string, right? Then instead of doing

   1. comparison
   2. function execution

(I am talking here about your 1/bazillions of a second)

a perfect solution would be :

if($var!='')

and, this is only

   1. comparison

am I right?



Now, no matter how much you care of thinking that the variable you need to
match positive is a string longer then 0 characters

if($var!='')

will always do the same of strlen() but with less overhead and will add that
1/bazillion of a second to execution of your application...



I am so 'HOT' on this issue because it looks to me more silly then needed an
extra string function during execution of a conditional.

nice day, Joe!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:25 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> have I said it won't work, Joe?
>
> I said that using strlen() might not be necessary. (re-read my post)
> On my own opinion the same things could be done without using the string
> functions.
> Am I wrong in something there? then thanks for correcting me - will know
it
> for the feature.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:17 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You are COMPLETELY wrong here. isset() is designed to check if a variable
is
> SET - NOT if it has something in it. empty() is designed for strings NOT
for
> ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> problems
> when you do checks and variables aren't set.
>
> I do this, like I said before, because the extra 1 billionth of a second
is
> worth the overhead. I've programmed for sites ranging from a few hundered
> hits
> a day to a few million hits a day and this works ALL the time.
>
> --Joe
>
> On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > I don't agree with you in here,
> >
> > you usually know what kind of variable you're checking, so strlen() will
> > work just as well as
> >
> > $var ? 'OK' : 'Empty'
> >
> > will work or the isset() - common, it was made for checking the
> variables -
> > use it.
> >
> > strlen() is in fact an overhead, why would you allow your design to be
> some
> > sort of untraditional? I don't think there's any necessity for it
> >
> > a "good design" often would be something like this:
> >
> > $var = 'whatever';
> >
> > if($var)
> > ...do this
> > else
> > ERROR('no var') // some your func to output the error mess or to
continue
> > with debugging
> >
> > in most cases it will work better and simpler for you without spending
> these
> > bazillions of important for every developer seconds.
> >
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 3:07 AM
> > To: Steve Edberg
> > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > I stand firm on strlen() for the following reasons ...
> >
> > if(!$var) will sometimes act strangely (has for me in the past) when
> > variables
> > are set to something other than what you are expecting.
> >
> > if(isset($var)) will return true if your text field is declared but not
> > filled
> > in.
> >
> > if(empty($var)) will return true if $var is set to 0 (for obvious
reason)
> so
> > is
> > only good for certain instances.
> >
> > strlen() on the other hand converts the variable to a string and returns
a
> > count
> > of characters. It's never failed or acted funky. For this reason I use
it
> > religiously.
> >
> > Others might say "well it's extra overhead" to which I reply "I'll take
an
> > extra
> > bazillionth of a second to know for sure I have what I need"
> >
> > --Joe
> >
> > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > > I would do this:
> > >
> > > if (!$AgeChild) $AgeChild = 'NA';
> > >
> > > More compact, easier to read (to me, anyway). This presumes that a
> > > value of '' (empty string, interpreted by PHP as false) is NOT a
> > > valid value here.
> > >
> > > As far as your sniplet goes, it is possible that there may be some
> > > PHP type-casting issues here, depen

[PHP] Upload --Permission denied simple error...

2001-02-23 Thread Dhaval Desai

hi!


I have fws simple lines:




Warning: Unable to create 'C:\': Permission denied in
c:\phpdev2\www\upload\action.php on line 3



and I get this error..I tried coyping to D:\ too but
the same error..



Can u tell me what could be the problem possibly..

Thank you
Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.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]




RE: [PHP] Counter Help

2001-02-23 Thread PHPBeginner.com

Thanks, I still remember your reply on my test post
be in touch!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:26 PM
To: 'PHPBeginner.com'; 'PHP (E-mail)'
Subject: RE: [PHP] Counter Help


Sounds good to me, I should, and will, always keep that in mind. Thanks for
the tips. Also I want to say PHPBeginner.com is starting off very well, keep
up the good work. I've been watching over it to see when the grand opening
would be, and it's finally here. I hope it becomes a success someday. If I
was good at PHP, I would contribute some articles, but I'm just a newbie for
now. But maybe someday. Take it easy  :)

Sincerely,
Navid Yar

-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 12:16 AM
To: [EMAIL PROTECTED]; PHP (E-mail)
Subject: RE: [PHP] Counter Help


Yup, you need to have your key strings in quotes '',
so it doesn't think it's a constant.

ALWAYS use $array['key']
and not
$array[key]

except for the integrers



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:11 AM
To: PHP (E-mail)
Subject: [PHP] Counter Help


Can someone help me with this script? It is an example from weberdev.com. I
ran it and it gave me the following error...

-- Warning: Use of undefined constant count - assumed 'count' in
c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
25

The number 25 is the correct number for the counter, but how do I get rid of
that error message that keeps coming up before the counter number (25)? I am
testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
3.23.33. Here is the script:















-- Navid


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




RE: [PHP] isset()

2001-02-23 Thread PHPBeginner.com

Whatever they input is not the objects, right?

then (I've just double-checked it, to be sure I am not saying some 'BULL')


$var = 0;

if($var)
echo 'var matched';

if(isset($var))
echo 'var is set';


when the $var is 0 the second condition will return true, the first will be
false instead...
Obviously if they enter anything else then 0 and NULL (I mean nothing) it
will return true in both cases, if($var.., if(isset($var... if(strle($var
...

What's wrong with isset() in here?
I am on PHP4.0.4!

explain me again, why on user input strlen() would do better then isset() ?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:25 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> have I said it won't work, Joe?
>
> I said that using strlen() might not be necessary. (re-read my post)
> On my own opinion the same things could be done without using the string
> functions.
> Am I wrong in something there? then thanks for correcting me - will know
it
> for the feature.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:17 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You are COMPLETELY wrong here. isset() is designed to check if a variable
is
> SET - NOT if it has something in it. empty() is designed for strings NOT
for
> ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> problems
> when you do checks and variables aren't set.
>
> I do this, like I said before, because the extra 1 billionth of a second
is
> worth the overhead. I've programmed for sites ranging from a few hundered
> hits
> a day to a few million hits a day and this works ALL the time.
>
> --Joe
>
> On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > I don't agree with you in here,
> >
> > you usually know what kind of variable you're checking, so strlen() will
> > work just as well as
> >
> > $var ? 'OK' : 'Empty'
> >
> > will work or the isset() - common, it was made for checking the
> variables -
> > use it.
> >
> > strlen() is in fact an overhead, why would you allow your design to be
> some
> > sort of untraditional? I don't think there's any necessity for it
> >
> > a "good design" often would be something like this:
> >
> > $var = 'whatever';
> >
> > if($var)
> > ...do this
> > else
> > ERROR('no var') // some your func to output the error mess or to
continue
> > with debugging
> >
> > in most cases it will work better and simpler for you without spending
> these
> > bazillions of important for every developer seconds.
> >
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 3:07 AM
> > To: Steve Edberg
> > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > I stand firm on strlen() for the following reasons ...
> >
> > if(!$var) will sometimes act strangely (has for me in the past) when
> > variables
> > are set to something other than what you are expecting.
> >
> > if(isset($var)) will return true if your text field is declared but not
> > filled
> > in.
> >
> > if(empty($var)) will return true if $var is set to 0 (for obvious
reason)
> so
> > is
> > only good for certain instances.
> >
> > strlen() on the other hand converts the variable to a string and returns
a
> > count
> > of characters. It's never failed or acted funky. For this reason I use
it
> > religiously.
> >
> > Others might say "well it's extra overhead" to which I reply "I'll take
an
> > extra
> > bazillionth of a second to know for sure I have what I need"
> >
> > --Joe
> >
> > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > > I would do this:
> > >
> > > if (!$AgeChild) $AgeChild = 'NA';
> > >
> > > More compact, easier to read (to me, anyway). This presumes that a
> > > value of '' (empty string, interpreted by PHP as false) is NOT a
> > > valid value here.
> > >
> > > As far as your sniplet goes, it is possible that there may be some
> > > PHP type-casting issues here, depending on: whether $AgeChild is
> > > numeric or string; the fact that the STRING "false" isn't equivalent
> > > t

RE: [PHP] Counter Help

2001-02-23 Thread Navid Yar

Sounds good to me, I should, and will, always keep that in mind. Thanks for
the tips. Also I want to say PHPBeginner.com is starting off very well, keep
up the good work. I've been watching over it to see when the grand opening
would be, and it's finally here. I hope it becomes a success someday. If I
was good at PHP, I would contribute some articles, but I'm just a newbie for
now. But maybe someday. Take it easy  :)

Sincerely,
Navid Yar

-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 12:16 AM
To: [EMAIL PROTECTED]; PHP (E-mail)
Subject: RE: [PHP] Counter Help


Yup, you need to have your key strings in quotes '',
so it doesn't think it's a constant.

ALWAYS use $array['key']
and not
$array[key]

except for the integrers



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:11 AM
To: PHP (E-mail)
Subject: [PHP] Counter Help


Can someone help me with this script? It is an example from weberdev.com. I
ran it and it gave me the following error...

-- Warning: Use of undefined constant count - assumed 'count' in
c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
25

The number 25 is the correct number for the counter, but how do I get rid of
that error message that keeps coming up before the counter number (25)? I am
testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
3.23.33. Here is the script:















-- Navid


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




Re: [PHP] isset()

2001-02-23 Thread Joe Stump

You're wrong in saying that you "usually know what the variable will be" - you
never know what it's going to be. You aren't entering it you need to 
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> have I said it won't work, Joe?
> 
> I said that using strlen() might not be necessary. (re-read my post)
> On my own opinion the same things could be done without using the string
> functions.
> Am I wrong in something there? then thanks for correcting me - will know it
> for the feature.
> 
> 
> Sincerely,
> 
>  Maxim Maletsky
>  Founder, Chief Developer
> 
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> 
> 
> 
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:17 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
> 
> 
> You are COMPLETELY wrong here. isset() is designed to check if a variable is
> SET - NOT if it has something in it. empty() is designed for strings NOT for
> ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> problems
> when you do checks and variables aren't set.
> 
> I do this, like I said before, because the extra 1 billionth of a second is
> worth the overhead. I've programmed for sites ranging from a few hundered
> hits
> a day to a few million hits a day and this works ALL the time.
> 
> --Joe
> 
> On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > I don't agree with you in here,
> >
> > you usually know what kind of variable you're checking, so strlen() will
> > work just as well as
> >
> > $var ? 'OK' : 'Empty'
> >
> > will work or the isset() - common, it was made for checking the
> variables -
> > use it.
> >
> > strlen() is in fact an overhead, why would you allow your design to be
> some
> > sort of untraditional? I don't think there's any necessity for it
> >
> > a "good design" often would be something like this:
> >
> > $var = 'whatever';
> >
> > if($var)
> > ...do this
> > else
> > ERROR('no var') // some your func to output the error mess or to continue
> > with debugging
> >
> > in most cases it will work better and simpler for you without spending
> these
> > bazillions of important for every developer seconds.
> >
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 3:07 AM
> > To: Steve Edberg
> > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > I stand firm on strlen() for the following reasons ...
> >
> > if(!$var) will sometimes act strangely (has for me in the past) when
> > variables
> > are set to something other than what you are expecting.
> >
> > if(isset($var)) will return true if your text field is declared but not
> > filled
> > in.
> >
> > if(empty($var)) will return true if $var is set to 0 (for obvious reason)
> so
> > is
> > only good for certain instances.
> >
> > strlen() on the other hand converts the variable to a string and returns a
> > count
> > of characters. It's never failed or acted funky. For this reason I use it
> > religiously.
> >
> > Others might say "well it's extra overhead" to which I reply "I'll take an
> > extra
> > bazillionth of a second to know for sure I have what I need"
> >
> > --Joe
> >
> > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > > I would do this:
> > >
> > > if (!$AgeChild) $AgeChild = 'NA';
> > >
> > > More compact, easier to read (to me, anyway). This presumes that a
> > > value of '' (empty string, interpreted by PHP as false) is NOT a
> > > valid value here.
> > >
> > > As far as your sniplet goes, it is possible that there may be some
> > > PHP type-casting issues here, depending on: whether $AgeChild is
> > > numeric or string; the fact that the STRING "false" isn't equivalent
> > > to the CONSTANT false, the use of == vs. ===.
> > >
> > > Time to check out the docs - specifically the types and variables
> > > sections (also the functions->variables section)...
> > >
> > >   - steve
> > >
> > >
> > >
> > > At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> > > >People
> > > >I tried to check if teh field has set a vaule in it before submit
> > > >using isset with the sniplet below
> > > >
> > > >if ((isset($AgeChild))=="false") {
> > > >$AgeChild = "NA";
> > > >}
> > > >
> > > >The resule is that it always displays NA whether or not it has vaule
> > > >in the field, what is the correct way of using isset for this
> > > >purpose? Or should I use empty() ?
> > > >Jack
> > > >[EMAIL PROTECTED]
> > > >"There is nothing more rewarding than reaching the goal you set for
> > yourself"
> > >
> > >
> > > --
> > > +--- "They've got a cherry pie there, that'll kill
> ya" ---

RE: [PHP] isset()

2001-02-23 Thread PHPBeginner.com

have I said it won't work, Joe?

I said that using strlen() might not be necessary. (re-read my post)
On my own opinion the same things could be done without using the string
functions.
Am I wrong in something there? then thanks for correcting me - will know it
for the feature.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:17 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You are COMPLETELY wrong here. isset() is designed to check if a variable is
SET - NOT if it has something in it. empty() is designed for strings NOT for
ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
problems
when you do checks and variables aren't set.

I do this, like I said before, because the extra 1 billionth of a second is
worth the overhead. I've programmed for sites ranging from a few hundered
hits
a day to a few million hits a day and this works ALL the time.

--Joe

On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> I don't agree with you in here,
>
> you usually know what kind of variable you're checking, so strlen() will
> work just as well as
>
> $var ? 'OK' : 'Empty'
>
> will work or the isset() - common, it was made for checking the
variables -
> use it.
>
> strlen() is in fact an overhead, why would you allow your design to be
some
> sort of untraditional? I don't think there's any necessity for it
>
> a "good design" often would be something like this:
>
> $var = 'whatever';
>
> if($var)
>   ...do this
> else
>   ERROR('no var') // some your func to output the error mess or to continue
> with debugging
>
> in most cases it will work better and simpler for you without spending
these
> bazillions of important for every developer seconds.
>
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 3:07 AM
> To: Steve Edberg
> Cc: Jacky@lilst; [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> I stand firm on strlen() for the following reasons ...
>
> if(!$var) will sometimes act strangely (has for me in the past) when
> variables
> are set to something other than what you are expecting.
>
> if(isset($var)) will return true if your text field is declared but not
> filled
> in.
>
> if(empty($var)) will return true if $var is set to 0 (for obvious reason)
so
> is
> only good for certain instances.
>
> strlen() on the other hand converts the variable to a string and returns a
> count
> of characters. It's never failed or acted funky. For this reason I use it
> religiously.
>
> Others might say "well it's extra overhead" to which I reply "I'll take an
> extra
> bazillionth of a second to know for sure I have what I need"
>
> --Joe
>
> On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > I would do this:
> >
> > if (!$AgeChild) $AgeChild = 'NA';
> >
> > More compact, easier to read (to me, anyway). This presumes that a
> > value of '' (empty string, interpreted by PHP as false) is NOT a
> > valid value here.
> >
> > As far as your sniplet goes, it is possible that there may be some
> > PHP type-casting issues here, depending on: whether $AgeChild is
> > numeric or string; the fact that the STRING "false" isn't equivalent
> > to the CONSTANT false, the use of == vs. ===.
> >
> > Time to check out the docs - specifically the types and variables
> > sections (also the functions->variables section)...
> >
> > - steve
> >
> >
> >
> > At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> > >People
> > >I tried to check if teh field has set a vaule in it before submit
> > >using isset with the sniplet below
> > >
> > >if ((isset($AgeChild))=="false") {
> > >$AgeChild = "NA";
> > >}
> > >
> > >The resule is that it always displays NA whether or not it has vaule
> > >in the field, what is the correct way of using isset for this
> > >purpose? Or should I use empty() ?
> > >Jack
> > >[EMAIL PROTECTED]
> > >"There is nothing more rewarding than reaching the goal you set for
> yourself"
> >
> >
> > --
> > +--- "They've got a cherry pie there, that'll kill
ya" --+
> > | Steve Edberg   University of California, Davis
|
> > | [EMAIL PROTECTED]   Computer Consultant
|
> > | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/
|
> > +-- FBI Special Agent Dale
Cooper ---+
> >
> > --
> > 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] isset()

2001-02-23 Thread Joe Stump

You are COMPLETELY wrong here. isset() is designed to check if a variable is 
SET - NOT if it has something in it. empty() is designed for strings NOT for
ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have problems
when you do checks and variables aren't set. 

I do this, like I said before, because the extra 1 billionth of a second is
worth the overhead. I've programmed for sites ranging from a few hundered hits
a day to a few million hits a day and this works ALL the time.

--Joe

On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> I don't agree with you in here,
> 
> you usually know what kind of variable you're checking, so strlen() will
> work just as well as
> 
> $var ? 'OK' : 'Empty'
> 
> will work or the isset() - common, it was made for checking the variables -
> use it.
> 
> strlen() is in fact an overhead, why would you allow your design to be some
> sort of untraditional? I don't think there's any necessity for it
> 
> a "good design" often would be something like this:
> 
> $var = 'whatever';
> 
> if($var)
>   ...do this
> else
>   ERROR('no var') // some your func to output the error mess or to continue
> with debugging
> 
> in most cases it will work better and simpler for you without spending these
> bazillions of important for every developer seconds.
> 
> 
> 
> Sincerely,
> 
>  Maxim Maletsky
>  Founder, Chief Developer
> 
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> 
> 
> 
> 
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 3:07 AM
> To: Steve Edberg
> Cc: Jacky@lilst; [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
> 
> 
> I stand firm on strlen() for the following reasons ...
> 
> if(!$var) will sometimes act strangely (has for me in the past) when
> variables
> are set to something other than what you are expecting.
> 
> if(isset($var)) will return true if your text field is declared but not
> filled
> in.
> 
> if(empty($var)) will return true if $var is set to 0 (for obvious reason) so
> is
> only good for certain instances.
> 
> strlen() on the other hand converts the variable to a string and returns a
> count
> of characters. It's never failed or acted funky. For this reason I use it
> religiously.
> 
> Others might say "well it's extra overhead" to which I reply "I'll take an
> extra
> bazillionth of a second to know for sure I have what I need"
> 
> --Joe
> 
> On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > I would do this:
> >
> > if (!$AgeChild) $AgeChild = 'NA';
> >
> > More compact, easier to read (to me, anyway). This presumes that a
> > value of '' (empty string, interpreted by PHP as false) is NOT a
> > valid value here.
> >
> > As far as your sniplet goes, it is possible that there may be some
> > PHP type-casting issues here, depending on: whether $AgeChild is
> > numeric or string; the fact that the STRING "false" isn't equivalent
> > to the CONSTANT false, the use of == vs. ===.
> >
> > Time to check out the docs - specifically the types and variables
> > sections (also the functions->variables section)...
> >
> > - steve
> >
> >
> >
> > At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> > >People
> > >I tried to check if teh field has set a vaule in it before submit
> > >using isset with the sniplet below
> > >
> > >if ((isset($AgeChild))=="false") {
> > >$AgeChild = "NA";
> > >}
> > >
> > >The resule is that it always displays NA whether or not it has vaule
> > >in the field, what is the correct way of using isset for this
> > >purpose? Or should I use empty() ?
> > >Jack
> > >[EMAIL PROTECTED]
> > >"There is nothing more rewarding than reaching the goal you set for
> yourself"
> >
> >
> > --
> > +--- "They've got a cherry pie there, that'll kill ya" --+
> > | Steve Edberg   University of California, Davis |
> > | [EMAIL PROTECTED]   Computer Consultant |
> > | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
> > +-- FBI Special Agent Dale Cooper ---+
> >
> > --
> > 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]
> 
> --
> 
> 
> ---
> Joe Stump, PHP Hacker,
>  -o)
> http://www.miester.org http://www.care2.com
> /\\
> "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
> _\_V
> 
> ---
> 
> 
> --
> 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: [PHP] special characters with perl,mysql,php

2001-02-23 Thread Mitchell Hagerty

The special character I'm concerned with at the moment is the back tick ` which mysql 
doesn't like on an insert. I 
was looking for a way not to parse the entire file evertime I inserted or extracted 
them from the database. Its 
simple enough todo in perl and php just seems like it would burn alot of cpu time.

I was actually hoping mysql would have a way to encode it on the way in and decode on 
the way out. That way 
php or perl would be irrelevant. Guess not :\

tks for your help
mitch

> i use a regexp to slash-out single quotes for
> inclusion into an SQL query:
> 
> // quote a value to make it appropriate for inclusion in an SQL string
> function db_quote($value) {
>  return ereg_replace("'","\\'",$value);
> }
> 
> 
> 
> > -Original Message-
> > From: Mitchell Hagerty [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 18:54
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] special characters with perl,mysql,php
> > 
> > 
> > Hey All,
> > 
> > What would be a good method for inserting data into a blob field
> > that contained special characters using perl then retrieving that
> > data with php?
> > 
> > URI::Escape has worked well with perl but now that php has
> > gotten into the picture I need a new method.
> > 
> > any suggestions?
> > 
> > tks
> > mitch
> > 
> > 
> > 
> > -- 
> > 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: php-list-
> [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: php-list-
> [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] encrypt and decrypt in standard PHP

2001-02-23 Thread Mukul Sabharwal

Hi,

You can also use an RC4Encryption / Decryption class
made in PHP.

http://www.devhome.net/php/tutorials/230101.html

it's pretty easy to use.

--- Richard Lynch <[EMAIL PROTECTED]> wrote: > You
could use popen() to execute http://gnupg.org or
> PGP...
> 
> It would be easier to recompile PHP, though, and
> performance on popen() is
> going to suck.
> 
> You *might* be able to compile just the encryption
> module, and use
> dl("mcrypt.so") in your PHP script to load it up
> rather than recompile all
> of PHP, but again, it's going to be harder, and
> performance will suffer.
> 
> Compiling PHP the *second* time is *way* easier than
> the first time,
> especially if you've saved your previous PHP source
> tree and all the other
> source trees -- There's a file in the PHP source
> tree called config.status,
> and some other config.* files, that "remember" what
> you did last time.  So,
> copy those somewhere safe, and then look at them.
> 
> You'll probably be able to copy config.status to
> config.zhu, and then edit
> that to add --with-mcrypt (or whatever it is), and
> do:
> chmod 755 config.zhu
> ./config.zhu
> 
> --
> Visit the Zend Store at http://www.zend.com/store/
> 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: Zhu George-CZZ010 <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Friday, February 23, 2001 11:07 AM
> Subject: [PHP] encrypt and decrypt in standard PHP
> 
> 
> >   As the PHP manual indicates, we can use Mcrypt
> to do the encrypt and
> decrypt work in PHP, but that needs to download the
> encrypt module and
> recompile PHP.   Is there any other way to encrypt
> and decrypt the string in
> standard PHP4.0.4 without any extension module?
> >
> >   Thank you very 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]
> 


=
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.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]




RE: [PHP] Using while as for...

2001-02-23 Thread PHPBeginner.com

you can do

while($count<=10)
{
   echo "Number is $count \n";
   $count++;
}



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Felipe Lopes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 2:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Using while as for...


I was trying to code the following script using while instead of for,
but I'm havig a lot of problems...Is it possible to do what I want?  for
($count = 0; $count <= 10; $count++){ echo "Number is $count \n"; }
Could anyone tell me how is it with while instead of for?? Thank you!!
Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

--
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] URGENT: IE pops-up an Error and File Download Fails. Needs to be fixed NOW. Please advise.

2001-02-23 Thread PHPBeginner.com

Cheers!

I've fixed that by adding some extra characters (new lines actually) in a
loop... it worked...

my conclusion was - MSIE5.01 bug ... didn't read pockets well ...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 7:26 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


Read the http://php.net/FAQ about the NULL character problem.

I'm betting you have some funky character that confuses that browser in the
output that the other browsers just ignore.

--
Visit the Zend Store at http://www.zend.com/store/
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: Boaz Yahav <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, February 21, 2001 12:59 AM
Subject: RE: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


> What do you see in your web server logs?
> what webserver do you use?
>
> Sincerely
>
>   berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
>
> -Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 8:59 AM
> To: 'PHP General List. (E-mail)'
> Subject: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs
to
> be fixed NOW. Please advise.
>
>
> Hello guys,
> This is that time when I am in trouble ...
>
> One of our internal databases receives inputs from all kind of different
> places and stores them for later reviews.
> Since it's creation it was all going perfectly well, but now it has a
little
> problem:
>
> The Internet Explorer gives me this error while listing one of databases'
> tables:
>
> (it is a pop up message of internet explorer)
> 
> Internet Explorer Cannot Open the internet site
> http://that.damn.db/database.php 
> ?db=opp_post
>
> The download of the specified resource has filed.
> 
>
> What is it, PHP or IE? I suppose something is wrong with IE (5.01 for
> instance), but so far couldn't come with any solution. The output is
simply
> not there, source shows cuted off at the very beginning of file - after
few
> hundreds of bytes.
>
> This suggests me that one of the entries in Database is somehow corrupting
> IE. But I have not found anything strange. What to look for, guys?
>
> I tested it on Opera and Netscape - no probs whatsoever.
> I also tested it on Linux, and Mac (Opera, Netscape) - no probs
whatsoever.
> ...and (listen to this one)...
> I tested it on Mac, MSIE 5.(01)? (just the version I have on my Win2k) --
> and It gave me no errors at all.
>
> Why MSIE 5.01 of Win2k gives that message and breaks download?
>
> I've seen this messages already while browsing the web, and that's the
> reason I'm asking you: anyone had to fix that before? What are your
guesses
> on my problem?
>
> It is quite urgent since the database is not usable and I don't have much
> time for researches on this issue.
> The sad thing is that our office uses the exactly same configured machines
> (MSIE5 - Win2k) and no one can view the database from their PCs. All the
> sales and coordinators are staying here in line near my MAC while I am
> writing you this.
>
> Any help is greatly appreciated!
>
> Cheers,
> Maxim Maletsky
>
> P.S: if any friends of Bill are around the list, please forward him my
happy
> moments and eventual sweet words.
>
> Maxim Maletsky - [EMAIL PROTECTED] 
> Webmaster, J-Door.com / J@pan Inc.
> LINC Media, Inc.
> TEL: 03-3499-2175 x 1271
> FAX: 03-3499-3109
>
> http://www.j-door.com 
> http://www.japaninc.net 
> http://www.lincmedia.co.jp 
>
>
>
>
>
> --
> 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]




RE: [PHP] string question

2001-02-23 Thread PHPBeginner.com

check out php.net/number-format


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] string question


I have a string that contains a number such as: $string = '12345'

I want that to read 12,345 though.  Is there any way in which I can insert a
comma in there in the correct places?

-Matt


-- 
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] Problem with $REMOTE_ADDR

2001-02-23 Thread PHPBeginner.com

If you are developing on windows (save - refresh ie ... )

then sure, your IP is the IP of the machine ...

if someone connects to you from outside then the remote host won't be
127.0.0.1 .. it will be his own


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with $REMOTE_ADDR



Hi,
I have problem with using of "$REMOTE_ADDR" variable.
The variable always return me "127.0.0.1" ( localhost ),

How can I get the IP of the remote host ?

Thanks,
Rosen Marinov





--
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] Parsing a string

2001-02-23 Thread PHPBeginner.com

Oh, yeah... my favorite:

explode()!

$var = '1,2,3,4,5,6,7,8,9,10';
$var_array = explode(',',$var);

/*
   will become:
   $var_array[0] = '1';
   $var_array[1] = '2';
   $var_array[2] = '3';
   $var_array[3] = '4';
   ... and so on
*/

as you notice the array starts from 0



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parsing a string


I have a comma delimited string that I need to parse into an array.  Is
there a PHP function that will do that ?

Many thanks..

Todd

--
Todd Cary
Ariste Software
[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] PHP / Filemaker?

2001-02-23 Thread PHPBeginner.com

never heard of one...

is there any? I'm curious too...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: knaSen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 7:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP / Filemaker?


Hey

This is my first question and mail to this list...hope u treat me decent =)
My earlier work have been lasso/filemaker (mac)
I´ve been heard that PHP is coming strongly and I have no reason not to
join. How is the relation between PHP/Filemaker?

--*
[knaSen]
icq #23830427



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

2001-02-23 Thread PHPBeginner.com

You have compiled it as CGI, didn't ya?

recompile it as apache's module if you can so apache can give PHP_SELF the
right value,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php_self


Why does php self always show php4/php.exe? how do i take  it off?


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

2001-02-23 Thread PHPBeginner.com

just get some examples from php.net/mail

and pass the variables to it any way you wish - it all will work


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: W.D. [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 2:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mail prob


I'm using a remote host, and when I call mail() with all the var's pulling
values from form fields, it still shows as nobody in from header. Is this a
server situation? Theyre using php4 support and they claim its that I'm not
using appropriate variables in the function.

 _ 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 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] Counter Help

2001-02-23 Thread PHPBeginner.com

Yeah, this is very silly thing using arrays without quotes,

I once had this problem - learned it - and sticked to using quotes whenever
is not an integrer.


advising to everyone,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Simon Garner [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 1:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Counter Help


From: "Chris Lee" <[EMAIL PROTECTED]>

> change
>
> $row[count]
>
> to
>
> $row['count']
>
> it thinks the work [count] is some kind of conastant, it doesnt know you
> mean (string) 'count'
>




I have noticed a lot of people do not put quotes on their array indexes
(e.g. VBulletin is a prime offender) - imho this is a really bad practice
because your code becomes ambiguous.

Example:

"orange", "bar"=>"purple");

echo $test[foo];
?>

Now, I think that should print nothing (or an error), because there is no
index matching "donkey" (the value of the constant "foo"). But for some
reason PHP looks for an array index matching the string "foo" as well,
encouraging this kind of sloppy programming.


Regards

Simon Garner


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

2001-02-23 Thread PHPBeginner.com

No it will give you the same value twice...

you need a loop



ACT
VIC



looping the rows .,...{

   echo "".$row['state_abbr']."
";

}




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 1:17 PM
To: PHP MAIL GROUP
Subject: [PHP] 
ACT
VIC


can i change it to say

ACT
VIC


so that when the page loads it shows which ever option is in the Data base?

Peter Houchin
Sun Rentals
[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] Location

2001-02-23 Thread PHPBeginner.com

You need to have an array or db with file and description

in ca you use array :

$location = Array(
  '/index.php' => 'HOME',
  '/prod_info.php' => 'Product Information',
  ..etc

);

and then

if(isset($location[$PHP_SELF]))
echo $location[$PHP_SELF];


and so on ...

note: this is just a quick and dirty idea on how to do that, with a little
bit of logic you can write a very sweet function with does what you need.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com







-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 10:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Location


Im making a website and i want the viewer to know were he of she is,
what do i need to do to make a location bar (home > serverices ect...)
with the $PHP_SELF command, i wasent able to figure it out so i am
asking assistance from another person.


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

2001-02-23 Thread PHPBeginner.com

Yup, you need to have your key strings in quotes '',
so it doesn't think it's a constant.

ALWAYS use $array['key']
and not
$array[key]

except for the integrers



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:11 AM
To: PHP (E-mail)
Subject: [PHP] Counter Help


Can someone help me with this script? It is an example from weberdev.com. I
ran it and it gave me the following error...

-- Warning: Use of undefined constant count - assumed 'count' in
c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
25

The number 25 is the correct number for the counter, but how do I get rid of
that error message that keeps coming up before the counter number (25)? I am
testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
3.23.33. Here is the script:















-- Navid


--
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] Problems sending mail to aol with the mail() function

2001-02-23 Thread PHPBeginner.com

I cannot help you, but I KNOW you are not the only one,
I've been asked this question already, and, I think I've seen something on
php.net under mail() ...

I believe this is your XSender thing, but not sure ...



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: Steve Kenshalo [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems sending mail to aol with the mail() function


Hello,

I am working on a PHP script for an e-commerce site that mails out calling
card pin numbers after somebody purchases them online. Turing testing I not
noticed that aol users were not receiving the messages. AOL seems to be
filtering them out without sending a bounce or anything. We tried it with
multiple aol users, and nothing I tried when using the mail function got
through, but messages sent from the server with pine and the php mail
package SquirrelMail do get through. The messages are received on every
other mail system I have tried.

I know this is more of a mail question, but I was hoping somebody here and
encountered this before and knew of a workaround. I noticed that
SquirrelMail doesn't use the mail function, they chose to write their own
SMPT package. I wonder why?

Anyway, my test scripts look like this:


I tried playing around with different headers and nothing made any
difference. I sent them to myself and they sure look like valid email
messages to me. Does anybody else have this problem? What did you do about
it?

Thanks,

Steve


--
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] concatenate vars?

2001-02-23 Thread PHPBeginner.com

no, you need to do three different comparisons :

if( ... something ... )
(eregi("stuff1", $one) and eregi("stuff2", $two) and eregi("stuff3",
$three)) ? : do this : do that


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: W.D. [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 5:38 AM
To: Philip Olson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] concatenate vars?


Thanks,

do you know if making multiple statements to eregi in line 3  is possible?

1. if(...something...)
2.{
3. (eregi("stuff1", $one)("stuff2", $two)("stuff3", $three)) ?
4. do something : do something else;




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

2001-02-23 Thread PHPBeginner.com

Professional PHP Programming is a good one


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: grios [mailto:grios]On Behalf Of Gustavo Vieira Goncalves Coelho
Rios
Sent: Thursday, February 22, 2001 1:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] books


May some suggest a kick ass book on php?

Thanks a lot for your time and cooperation.

best regards,
Gustavo Rios


PS: Any one here from Brazil/South America ?

-- 
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@lists.php.net

2001-02-23 Thread PHPBeginner.com

use urlencode()

www.php.net/urlencode


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Tom Harris [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Passing values containing a ? and a &


I want to assign a value using the url however the value contains both a ?
and an & so PHP (or the browser) seems to get confused.

Here's an example:

http://www.mysite.com/index.php?id=23&url=http://www.anothersite.com/file.ph
p?qid=234&forum=4

Everything after url= should be the value of $url but this is not the case.
Is there a way to solve this?

Thanks



--
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] Templates & PHP

2001-02-23 Thread PHPBeginner.com

try these:

search google for fast templates
templates,

check out sourceforge.net

there's a whole bunch of this applications.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Maamiin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:06 AM
To: PHP General Newslist
Subject: [PHP] Templates & PHP


Where can I find some help, how to make & use page templates on my
webpages??? Needs this some add-ons to my PHP3(Linux-main)/PHP4(win98+pws)?

THNX


-- 
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] Sessions and naming a file with SID

2001-02-23 Thread PHPBeginner.com

PHP does it automatically for you.

YES your session id is $PHPSESSID

so creating a file called $PHPSESSID should work, I suppose


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:56 AM
To: PHP User Group
Subject: [PHP] Sessions and naming a file with SID


Hello,

Is there a way to start a session and then save a temp file with the name of
the Session ID?

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 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 do I request a new feature?

2001-02-23 Thread PHPBeginner.com

bugs.php.net



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Ide, Jim [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:49 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] How do I request a new feature?



Hi -

How can/should I contact the developers of PHP
to request that they add a new feature to PHP?

Thanks -
Jim



-- 
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] variable sent using pots is cat!

2001-02-23 Thread PHPBeginner.com

It shouldn't have happened,

can you give as a come sample to resolve your situation?



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable sent using pots is cat!


Hi!
i have a problem!
i send a variable from one page to another page using post method!
but when a variable is like composed of two words , the other page receives
only the first word !
can u please help?!
Thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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



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




RE: [PHP] International support

2001-02-23 Thread PHPBeginner.com

Hi (Soma Interesting?)

I am also a developer here in Tokyo and have done few I-Mode websites using
PHP and mySQL. (I've used PostgreSQL with Japanese, but not for I-Mode)
( see www.japaninc.com/i )

There's no particular problems of storing the 2-bit data in your databases,
the only thing is that to do sorting you have to compile the databases with
the language needed ( regardless of which database you use - see their docs
they all support that).

With PHP there's a little problem using string functions. strlen(), for
instance will return you the number of bytes. In Latin characters ASCII
1-255 a character is a byte, but that doesn't apply to Japanese which use
double bits (some characters are even three bits), so a strlen() will not
return you the number of Hiragana & Kanji in string - it will return you the
number of bits these Kanji were composed from - VERY, VERY UGLY

You need to use PHP3 Japanese interpretation to do that kind of tasks.

In our company we use a different server for Japanese characters running
PHP3 JIS, and the pages are being included form there.

IE: www.fusion-2000.net runs both PHP4 and PHP3 JIS with PostgreSQL at the
back end.

While www.japaninc.com/i goes on PHP4.0.1pl2 and mySQL, (check out that
game)

So, no worries, it is all possible to do, except there's a pain with
choosing PHP version for the server.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Soma Interesting [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP] International support


Hello everyone,

I'm currently working a project that is intended to handle Japanese
character sets - and now I'm told ideally iMode too. :) The iMode isn't
such an issue at the moment - but the article below has spooked me a
little. At an early point in the project we tested if putting some input
into a web form, which ultimately was handled by php then stored in
postgres would return fully intact - and it did. This left me comfortable
that PHP and Postgres don't seem to care what language they're storing in
fields or variables. I'm 'guessing' that this is because the data, whether
its English or Japanese is being stored in binary (or something else?). Of
course I wouldn't be able to sort the data or do anything else that would
require PHP/Postgres to be able to interpret the data. However if I compile
Postgres with locals support for the character set/language in question -
then postgres will be able to sort Japanese. Is this right?

Have I got this all right so far? I have attempted to do my research on
this - but finding a real beginners guide to international web development
has been a trick. And the best sources I have found on this topic generally
are specific to Oracle. Any links would be appreciated.

Ok the next part of this message is an article I thought would be generally
interesting so I'm not hesitating to post it entirely. It was forwarded to
me so I'm not sure of the source.

For the postgres folks, these developers went with MySQL - I've chosen
Postgres. Is there anything MySQL does that Postgres doesn't in terms of
language support that I should be aware of?

>Back to case study
>r-newbold.com
>
>George Baptista is riding the wave of the latest technology with his
>company's newest venture:
>r-newbold.com, a
>wireless i-Mode site created with PHP.
>
>Based in Tokyo, George is a Web developer and co-partner with Izumi
>Hiroshima at Studio Omame. He
>was part of the creative team behind the Japanese-language site, and he is
>finding that i-Mode is not only fashionable, but also the face of the
future.
>
>r-newbold.com was developed for British fashion designer, Paul Smith. NTT
>DoCoMo's i-Mode Web-browsing cellular phones, which already have over 10
>million users, offers a fast wireless data service with Internet access.
>In Japan, it's been a hit with the younger generation. And since
>r-newbold.com's target population is young, hip and fashionable, the
>decision to create an i-Mode site rather than a regular Web site made
>perfect sense.
>
>PHP and i-Mode: The perfect match
>"i-Mode is exploding in Japan," George adds. "It offers new and
>interesting challenges to the developer. The i18n J version of PHP is an
>increasingly popular choice for developers [in Japan] because of its
>overall performance, speed of development, and character set capability
>features."
>
>George and his team at Studio Omame have already been using PHP for about
>a year prior to developing the r-newbold site, and were very pleased with
>its performance. He cites several reasons for his company's choice of PHP
>including:
>* PHP's overall performance and reliability
>* ease with which to prototype in
>* PHP's large and growing develo

RE: [PHP] isset()

2001-02-23 Thread PHPBeginner.com

I don't agree with you in here,

you usually know what kind of variable you're checking, so strlen() will
work just as well as

$var ? 'OK' : 'Empty'

will work or the isset() - common, it was made for checking the variables -
use it.

strlen() is in fact an overhead, why would you allow your design to be some
sort of untraditional? I don't think there's any necessity for it

a "good design" often would be something like this:

$var = 'whatever';

if($var)
...do this
else
ERROR('no var') // some your func to output the error mess or to continue
with debugging

in most cases it will work better and simpler for you without spending these
bazillions of important for every developer seconds.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:07 AM
To: Steve Edberg
Cc: Jacky@lilst; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


I stand firm on strlen() for the following reasons ...

if(!$var) will sometimes act strangely (has for me in the past) when
variables
are set to something other than what you are expecting.

if(isset($var)) will return true if your text field is declared but not
filled
in.

if(empty($var)) will return true if $var is set to 0 (for obvious reason) so
is
only good for certain instances.

strlen() on the other hand converts the variable to a string and returns a
count
of characters. It's never failed or acted funky. For this reason I use it
religiously.

Others might say "well it's extra overhead" to which I reply "I'll take an
extra
bazillionth of a second to know for sure I have what I need"

--Joe

On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> I would do this:
>
> if (!$AgeChild) $AgeChild = 'NA';
>
> More compact, easier to read (to me, anyway). This presumes that a
> value of '' (empty string, interpreted by PHP as false) is NOT a
> valid value here.
>
> As far as your sniplet goes, it is possible that there may be some
> PHP type-casting issues here, depending on: whether $AgeChild is
> numeric or string; the fact that the STRING "false" isn't equivalent
> to the CONSTANT false, the use of == vs. ===.
>
> Time to check out the docs - specifically the types and variables
> sections (also the functions->variables section)...
>
>   - steve
>
>
>
> At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> >People
> >I tried to check if teh field has set a vaule in it before submit
> >using isset with the sniplet below
> >
> >if ((isset($AgeChild))=="false") {
> >$AgeChild = "NA";
> >}
> >
> >The resule is that it always displays NA whether or not it has vaule
> >in the field, what is the correct way of using isset for this
> >purpose? Or should I use empty() ?
> >Jack
> >[EMAIL PROTECTED]
> >"There is nothing more rewarding than reaching the goal you set for
yourself"
>
>
> --
> +--- "They've got a cherry pie there, that'll kill ya" --+
> | Steve Edberg   University of California, Davis |
> | [EMAIL PROTECTED]   Computer Consultant |
> | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
> +-- FBI Special Agent Dale Cooper ---+
>
> --
> 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]

--


---
Joe Stump, PHP Hacker,
 -o)
http://www.miester.org http://www.care2.com
/\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison
_\_V

---


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

2001-02-23 Thread Steve Werby

"Brandon Feldhahn" <[EMAIL PROTECTED]> wrote:
> Im making a website and i want the viewer to know were he of she is,
> what do i need to do to make a location bar (home > serverices ect...)
> with the $PHP_SELF command, i wasent able to figure it out so i am
> asking assistance from another person.

A simple solution for a site with a small number of pages would be to create
an array like the following:

$location['/index.php'] = "Home";
$location['/services.php'] = "Services";
$location['/products.php'] = "Products";

Then use $SCRIPT_URL or a similar environment variable to display the proper
label in the "location bar".



If you have a large number of pages (especially dynamically generated
"virtual" pages) or sublevels to your site you'll probably want to use a
more advanced solution.

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.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] Can't connect php to mysql on linux

2001-02-23 Thread George Alexander

Hi,

I working on Redhat Linux 6.1 and I've installed MySQL-3.23.33-1.i386.rpm and 
MySQL-client-3.23.33-1.i386.rpm.
MySql is working fine. I've even created a database also using MySqlAdmin.
Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for Apache : 
apache-1.3.14-2.6.2.i386.rpm.
I've even installed php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.

My problem is I can't connect PHP to Mysql Db using the 
mysyql_connect("localhost","root","mypassword") command.

Please help me asap.
Regards,
George




_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.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] Using while as for...

2001-02-23 Thread Andrew Hill

Whups, forgot a blasted semicolon...

$count = 1;

while($count < 10)
{
 echo "Number is $count \n";
 $count++;
}

Cheers,
Andrew

On 2/24/01 12:20 AM, "Andrew Hill" <[EMAIL PROTECTED]> wrote:

> $count = 1; 
> 
> while($count < 10)
>   {
>echo "Number is $count \n";
>$count++ 
>   }



-- 
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] Download PHP from Linux machine?

2001-02-23 Thread ..s.c.o.t.t..

well, you could load lynx, then type "G" (go) and
type in "www.php.net" on the address bar, then
navigate your way to the download page from there.
(it's only one page deep into the site)

that's how i did it at work on our linux machine.


> -Original Message-
> From: Simons [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 21:00
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Download PHP from Linux machine?
>
>
> try to "double quotes" the url
>
>
> ""Jorge Alvarez"" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
> 976k7t$2t2$[EMAIL PROTECTED]">news:976k7t$2t2$[EMAIL PROTECTED]...
> > Hi there,
> >
> > I want to download PHP from my Linux server, but I can't just type "lynx
> >
> http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
> > site=www.php.net"
> >
> > This is the link in the PHP downloads page, but the shell gets confused by
> > the & character.
> >
> > What should I do?
> >
> > Best Regards,
> >
> > Jorge.
> >
> >
> >
> > --
> > 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]




Re: [PHP] Using while as for...

2001-02-23 Thread Andrew Hill

$count = 1; 

while($count < 10)
{
 echo "Number is $count \n";
 $count++ 
}

> for ($count = 0; $count <= 10; $count++){
> echo "Number is $count \n";
> }
> 
> Could anyone tell me how is it with while instead of for??
> Thank you!!

Best regards,
Andrew
---
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.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] Help INSERTing to MySQL

2001-02-23 Thread ..s.c.o.t.t..

you dont need to have a list of field names if you insert
the exact amount of fields that exist in the table...

if you have fields Name and Email, you can do:
INSERT INTO mytable VALUES ('myname','[EMAIL PROTECTED]')
without a problem.  however, if you have fields 
Name, Email and Password the previous code will break,
since MySQL would complain that you're inserting
too few (or too many) pieces of data into the table,
and it cant decide which data goes where

> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 17:21
> To: Clayton Dukes
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Help INSERTing to MySQL
> 
> 
> Before your VALUES you need to have a list of the fields ie:
> 
> insert into table (id,fname,lname) values ('$id','$fname','$lname')
> 
> --joe
> 
> On Fri, Feb 23, 2001 at 08:00:30PM -0500, Clayton Dukes wrote:
> > Hello,
> > This is my first attempt, so I'm prolly doing something stupid, but can 
> someone tell me why this doesn't work?
> > All it returns is "Unable to INSERT to database"
> > 
> > 
> > 
> > ---BEGIN---
> >  >$time = time();
> >$rand = Random_Password(5);
> >$docid = $time . $rand;
> > 
> > if (isset($email) && isset($docid)) {
> > mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> > 
> >$query = "INSERT INTO documents VALUES ('$docid', '$category', 
> '$subcategory', '$date', '$subject', '$title', '$author', '$email', 
> '$language', '$gr
> > ade', '$level', '$city', '$state', '$county', '$zip', 
> '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> > 
> >$result = mysql_db_query("$DATABASE", $query) or die("Unable to 
> INSERT to database");
> > 
> > if ($result) {
> > echo "$docid was added to the database";
> > }
> > }
> > ?>
> > 
> >  Submit a new document to the database
> >  
> >  Email Address: 
> >  Category: 
> >  Sub Category:  "$SUBCATEGORIES" ?>
> >  Date Document was written:  (xx-xx-)
> >  Document Subject: 
> >  Document Title: 
> >  Document Author: 
> >  Document Language: 
> >  Grade Received (Percentage):  size=3> (xx/100)
> >  Grade Level of Paper: High 
> SchoolCollegeOther
> >  City in which paper was submitted:  value=Jacksonville>
> >  State in which paper was submitted:  value=FL>
> >  County in which paper was submitted:  name=county value=Duval> (County, not Country!)
> >  School at which paper was submitted:  name=school value="Mandarin High School">
> >  ZIP code:  (Put 
> your ZIP code in if you don't know your school's)
> >  Author's Comments: 
> >  Teacher's Comments: 
> >  Document (ASCII TEXT ONLY):
> >  Paste document text 
> here
> >  
> >  
> > 
> > -END-
> > 
> > 
> > 
> > TIA!
> > Clayton
> > 
> 
> > -- 
> > 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]
> 
> -- 
> 
> ---
> Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
> http://www.miester.org http://www.care2.com /\\
> "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
> ---
> 
> 
> -- 
> 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] Help INSERTing to MySQL

2001-02-23 Thread ..s.c.o.t.t..

0 also works for AUTO_INCREMENT fields...

> -Original Message-
> From: Philip Olson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 18:41
> To: Clayton Dukes
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Help INSERTing to MySQL
> 
> 
> 
> > If I knew I could get answers that easy here, I woudn't have worked on this
> > for 20 hours :-)
> > 
> > THANKS
> > 
> > btw, field one is an ID field set to auto increment, how can I insert that
> > if I don't know what it is?
> 
> In this case use NULL as the value for id and it'll auto increment nicely.
> Using a blank  ''  will work too.  Regarding use of NULL, it's NULL and
> not 'NULL'.
> 
> Regards,
> 
> Philip
> 
> 
> -- 
> 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] special characters with perl,mysql,php

2001-02-23 Thread ..s.c.o.t.t..

i use a regexp to slash-out single quotes for
inclusion into an SQL query:

// quote a value to make it appropriate for inclusion in an SQL string
function db_quote($value) {
  return ereg_replace("'","\\'",$value);
}



> -Original Message-
> From: Mitchell Hagerty [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 18:54
> To: [EMAIL PROTECTED]
> Subject: [PHP] special characters with perl,mysql,php
> 
> 
> Hey All,
> 
> What would be a good method for inserting data into a blob field
> that contained special characters using perl then retrieving that
> data with php?
> 
> URI::Escape has worked well with perl but now that php has
> gotten into the picture I need a new method.
> 
> any suggestions?
> 
> tks
> mitch
> 
> 
> 
> -- 
> 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] Using while as for...

2001-02-23 Thread ..s.c.o.t.t..

this is how you'd do it, in any of three ways,
depending on the values you want to start/stop with.

//counts from 0 to 10
$count=0;
while ($count <= 10) {
echo "$count, ";
$count++;
}
print "";

//counts from 1 to 10
$count=0;
while (++$count <= 10) {
echo "$count, ";
}
print "";

//counts from 1 to 11
$count=0;
while ($count++ <= 10) {
echo "$count, ";
}



> -Original Message-
> From: Felipe Lopes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 24, 2001 02:46
> To: [EMAIL PROTECTED]
> Subject: [PHP] Using while as for...
>
>
> I was trying to code the following script using while instead of for,
> but I'm havig a lot of problems...Is it possible to do what I want?
>
> for ($count = 0; $count <= 10; $count++){
> echo "Number is $count \n";
> }
>
> Could anyone tell me how is it with while instead of for??
> Thank you!!
>
> Felipe Lopes
> MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
> Faça já o seu. É gratuito!!!
>
> --
> 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] Download PHP from Linux machine?

2001-02-23 Thread Simons

try to "double quotes" the url


""Jorge Alvarez"" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
976k7t$2t2$[EMAIL PROTECTED]">news:976k7t$2t2$[EMAIL PROTECTED]...
> Hi there,
>
> I want to download PHP from my Linux server, but I can't just type "lynx
>
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
> site=www.php.net"
>
> This is the link in the PHP downloads page, but the shell gets confused by
> the & character.
>
> What should I do?
>
> Best Regards,
>
> Jorge.
>
>
>
> --
> 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 Digest 24 Feb 2001 04:43:15 -0000 Issue 530

2001-02-23 Thread php-general-digest-help


php-general Digest 24 Feb 2001 04:43:15 - Issue 530

Topics (messages 41318 through 41430):

Re: PHP and PAM 
41318 by: Krznaric Michael

Re: Problem with $REMOTE_ADDR
41319 by: Jeff Oien
41320 by: Rosen

Re: trouble getting .php3 files to work in php4.0.4pl1 (static)
41321 by: Hunter Kelly
41323 by: Hoover, Josh
41325 by: Hunter Kelly

Re: [PHP-INST] Re: [PHP] trouble getting .php3 files to work in php4.0.4pl1 (static)
41322 by: Geordon VanTassle

Re: apache+php on MacOSX
41324 by: Thierry Coopman
41331 by: Michael Stearne
41339 by: Andrew Hill

Problemas con php
41326 by: Oscar Pinto

array question
41327 by: Jeff
41338 by: Christian Reiniger

Re: MySQL execution order?
41328 by: Don Johnson
41336 by: Christian Reiniger

Re: File content type
41329 by: Matt

Re: PHP / Filemaker?
41330 by: Michael Stearne
41344 by: Hoover, Josh

Latest PHP CVS binaries
41332 by: Peter
41333 by: James Moore

Re: Parsing a string
41334 by: Christian Reiniger
41340 by: mjriding.wcoil.com
41341 by: Todd Cary
41380 by: Simon Garner

Array Help
41335 by: Brian V Bonini
41348 by: php3.developersdesk.com

encrypt and decrypt in standard PHP
41337 by: Zhu George-CZZ010
41413 by: Richard Lynch

Undefinded Index on Mysql Result under Win98/PWS
41342 by: Greg Kopp
41345 by: Jason Stechschulte
41346 by: mjriding.wcoil.com
41350 by: php3.developersdesk.com
41362 by: Jason Stechschulte
41364 by: Greg Kopp

Need socket help!!!
41343 by: Todd Cary
41414 by: Richard Lynch


41347 by: Don Johnson
41353 by: Christian Reiniger

regex help
41349 by: John Vanderbeck
41354 by: Christian Reiniger

Re: 
41351 by: Christian Reiniger

session question
41352 by: Jon Rosenberg
41378 by: Chris Lee
41415 by: Richard Lynch

posgres 7 functions not working with PHP4
41355 by: Phil Glatz

Header Location Frame Question
41356 by: Jeff Oien
41416 by: Richard Lynch

Explode a variable into each character
41357 by: Brandon Orther
41359 by: Rasmus Lerdorf
41361 by: Philip Olson

Re: Counter Help
41358 by: Navid Yar

php (cgi version) with Apache and suexec - help
41360 by: jhagan.binghamton.edu
41417 by: Richard Lynch

string question
41363 by: MinorThreatBmxxx.aol.com
41365 by: Philip Olson

Re: Problems sending mail to aol with the mail() function
41366 by: Steve Werby

Submitting Form Information
41367 by: Matthew Aznoe
41418 by: Richard Lynch

file test
41368 by: Kevin Beckford
41379 by: php3.developersdesk.com
41419 by: Richard Lynch

using DTDs and XML
41369 by: Mark Newnham
41370 by: Egon Schmid (.work)

Download PHP from Linux machine?
41371 by: Jorge Alvarez
41372 by: Joe Stump

chunk_split() doesnt seem to be working
41373 by: Chris Lee
41382 by: Chris Lee
41420 by: Richard Lynch

imagettfbbox and imagettftext
41374 by: Monte Ohrt

How to check if a current session is going?
41375 by: Michael Zornek
41376 by: Chris Lee

php and apache protected directories
41377 by: Marius David

specifying alternate host with imap-mail
41381 by: Mark Newnham

PHP not proccessing input?
41383 by: Chris

problems with mail()
41384 by: Chris Lee

ANSI to HTML with socket handling
41385 by: Kyndig

Order by Date (Newbie)
41386 by: Brian S. Drexler
41388 by: Joe Stump
41390 by: Kyndig

Re: Ok, this might make more sense
41387 by: YoBro

Help INSERTing to MySQL
41389 by: Clayton Dukes
41391 by: Joe Stump
41392 by: Philip Olson
41421 by: Clayton Dukes
41422 by: Kyndig
41423 by: Clayton Dukes
41424 by: php3.developersdesk.com
41425 by: Philip Olson

Re: URGENT: IE pops-up an Error and File Download Fails. Needs to be  fixed NOW. 
Please advise.
41393 by: Richard Lynch

Re: smtp protocol
41394 by: Richard Lynch

Re: cURL library and auto-loggin to a site
41395 by: Richard Lynch

Re: Database Paging using MSSQL 2000
41396 by: Richard Lynch

Re: Apache & php as a DSO module woes!
41397 by: Richard Lynch

Re: fopen
41398 by: Richard Lynch

Re: Encryption
41399 by: Richard Lynch

Re: fread over ftp
41400 by: Richard Lynch

Re: Saving changes to a file
41401 by: Richard Lynch

Re: Trans sid and form posts
41402 by: Richard Lynch

Re: file upload error w/internet exploder!
41403 by: Richard Lynch

Re: Problems with posix_getpwnam
41404 by: Richard Lynch

Re: Cookie stored but cannot trigger 

[PHP] Using while as for...

2001-02-23 Thread Felipe Lopes

I was trying to code the following script using while instead of for, 
but I'm havig a lot of problems...Is it possible to do what I want?

for ($count = 0; $count <= 10; $count++){
echo "Number is $count \n";
}

Could anyone tell me how is it with while instead of for??
Thank you!!

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

-- 
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] special characters with perl,mysql,php

2001-02-23 Thread Kyndig


If your refering to:  '  or "  just use:

addslashes($value);   to escape special characters.


On Fri, 23 Feb 2001, Mitchell Hagerty wrote:
> Hey All,
> 
> What would be a good method for inserting data into a blob field
> that contained special characters using perl then retrieving that
> data with php?
> 
> URI::Escape has worked well with perl but now that php has
> gotten into the picture I need a new method.
> 
> any suggestions?
> 
> tks
> mitch
> 
> 
> 
> -- 
> 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]
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#10451240


-- 
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] special characters with perl,mysql,php

2001-02-23 Thread Joe Stump

What type of special characters?

--Joe

On Fri, Feb 23, 2001 at 08:54:09PM -0600, Mitchell Hagerty wrote:
> Hey All,
> 
> What would be a good method for inserting data into a blob field
> that contained special characters using perl then retrieving that
> data with php?
> 
> URI::Escape has worked well with perl but now that php has
> gotten into the picture I need a new method.
> 
> any suggestions?
> 
> tks
> mitch
> 
> 
> 
> -- 
> 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]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


-- 
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] compliling imap support into php

2001-02-23 Thread Mitchell Hagerty


Does the fun ever stop?

This one has thrown me, I have imap install and running on my system but evidently not 
c.client.a (which i do) . Has 
anyone else has problems with this? What is a good imap src to point --imap= to?

apache 1.2.14
php 4.0.4pl1
bsd 4.2

any tips would be great
tks
mitch



-- 
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-CVS] cvs: CVSROOT / avail gen_acl_file.m4

2001-02-23 Thread Andrei Zmievski

At 02:50 AM 2/24/01 +, Rasmus Lerdorf wrote:
>rasmus  Fri Feb 23 18:50:13 2001 EDT
>
>   Modified files:
> /CVSROOTavail gen_acl_file.m4
>   Log:
>   More karma for Jesus

I am sorry, but I did a double take when I read that... :)


-Andrei


-- 
PHP CVS 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] special characters with perl,mysql,php

2001-02-23 Thread Mitchell Hagerty

Hey All,

What would be a good method for inserting data into a blob field
that contained special characters using perl then retrieving that
data with php?

URI::Escape has worked well with perl but now that php has
gotten into the picture I need a new method.

any suggestions?

tks
mitch



-- 
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-CVS] cvs: CVSROOT / avail gen_acl_file.m4

2001-02-23 Thread Rasmus Lerdorf

rasmus  Fri Feb 23 18:50:13 2001 EDT

  Modified files:  
/CVSROOTavail gen_acl_file.m4 
  Log:
  More karma for Jesus
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.98 CVSROOT/avail:1.99
--- CVSROOT/avail:1.98  Thu Feb 22 11:18:10 2001
+++ CVSROOT/avail   Fri Feb 23 18:50:13 2001
@@ -1,7 +1,7 @@
 
 unavail
 avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak|phpweb
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto|phpweb
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern|php4/pear,pearweb,pear
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile|php4,php3,php31,phpfi
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,hholzgra|functable
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.102 CVSROOT/gen_acl_file.m4:1.103
--- CVSROOT/gen_acl_file.m4:1.102   Thu Feb 22 11:18:10 2001
+++ CVSROOT/gen_acl_file.m4 Fri Feb 23 18:50:13 2001
@@ -9,7 +9,7 @@
 dnl PEAR Team
 define(`php_pear', 
`jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern')dnl
 dnl PHP.NET Website
-define(`php_web', 
`cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak')dnl
+define(`php_web', 
+`cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto')dnl
 dnl
 define(`php_pres', `rasmus,sterling,jimw')dnl
 dnl



-- 
PHP CVS 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] Help INSERTing to MySQL

2001-02-23 Thread Philip Olson


> If I knew I could get answers that easy here, I woudn't have worked on this
> for 20 hours :-)
> 
> THANKS
> 
> btw, field one is an ID field set to auto increment, how can I insert that
> if I don't know what it is?

In this case use NULL as the value for id and it'll auto increment nicely.
Using a blank  ''  will work too.  Regarding use of NULL, it's NULL and
not 'NULL'.

Regards,

Philip


-- 
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] Help INSERTing to MySQL

2001-02-23 Thread php3

Addressed to: Clayton Dukes <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from Philip Olson <[EMAIL PROTECTED]> Sat, 24 Feb 2001 01:31:30 
+ (GMT)
>
>
> > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > but can someone tell me why this doesn't work? All it returns is
> > "Unable to INSERT to database"
>
> Change : or die("Unable to INSERT to database");
> To : or die(mysql_error());
>
> And see what it tells you.  Odds are there's a field not being accounted
> for.  When not designating columns (just values) it's important to make
> sure all columns are accounted for.  See :
>
> http://www.sqlcourse.com/
>
> It'll provide some basic SQL help.  It's recommended to write out columns
> and values (easier to make sense of).

I find SET even easier:


   INSERT INTO Table SET

or

   UPDATE Table SET


then

  field1 = '$Field1',
  field2 = '$Field2',
  fieldN = '$FieldN'


That makes it very easy to keep track of what goes where.  It is
somewhat new to MySQL, but anything less than a year old should have it
available.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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] Help INSERTing to MySQL

2001-02-23 Thread Clayton Dukes

Thanks! :-)

Man, what a great list! You guys kick a$$



- Original Message -
From: "Kyndig" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>; "Philip Olson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 8:50 PM
Subject: Re: [PHP] Help INSERTing to MySQL


> On Fri, 23 Feb 2001, Clayton Dukes wrote:
> > Well sheesh,
> > If I knew I could get answers that easy here, I woudn't have worked on
this
> > for 20 hours :-)
> >
> > THANKS
> >
> > btw, field one is an ID field set to auto increment, how can I insert
that
> > if I don't know what it is?
> >
> You don't need to insert it. auto_increment will automatically
> increment every time you insert a record. In fact, you _really_
> don't want to ever set this field, as you would be modifying your
> primary key ( unless your modifying them all )
>
>  Note: You don't have to INSERT all fields mentioned below. If
> you have a 'default' value set..then it will default to that value,
> or in auto_increment case...it will automatically increment from
> the last record it reads.
>
> >
> > Here are the fields:
> > CREATE TABLE documents (
> >   id bigint(20) DEFAULT '0' NOT NULL auto_increment,
> >   docid varchar(20),
> >   category enum('Language Arts','Sciences','Humanities','Arts','Special
> > Subjects','Other'),
> >   subcategory enum('Physics','Biology','Chemistry','Math','Computers and
> >
Internet','History','Economics','Geography','Law','Religion','Philosophy','B
> > lack Awareness','Countries','Drugs','Education','Environmental
> > Awareness','Politics','Health','Sex and Sexuality','Female
> > Awareness','Art','Movies or TV','Music','Sports','Charles
> > Dickens','Shakespeare','Biography','Fictional
> > Stories','Astronomy','Mythology'),
> >   date varchar(10),
> >   subject varchar(200),
> >   title varchar(200),
> >   author varchar(200),
> >   email varchar(50),
> >   language
enum('English','Danish','Dutch','Finnish','German','Spanish'),
> >   grade int(3),
> >   level enum('High School','College','Other'),
> >   city varchar(15),
> >   state varchar(15),
> >   county varchar(15),
> >   school varchar(45),
> >   zip smallint(5),
> >   authorcomments varchar(200),
> >   teachercomments varchar(200),
> >   approve enum('Y','N'),
> >   docdata text,
> >   PRIMARY KEY (id),
> >   UNIQUE id (id)
> >
> >
> > - Original Message -
> > From: "Philip Olson" <[EMAIL PROTECTED]>
> > To: "Clayton Dukes" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, February 23, 2001 8:31 PM
> > Subject: Re: [PHP] Help INSERTing to MySQL
> >
> >
> > >
> > > > Hello, This is my first attempt, so I'm prolly doing something
stupid,
> > > > but can someone tell me why this doesn't work? All it returns is
> > > > "Unable to INSERT to database"
> > >
> > > Change : or die("Unable to INSERT to database");
> > > To : or die(mysql_error());
> > >
> > > And see what it tells you.  Odds are there's a field not being
accounted
> > > for.  When not designating columns (just values) it's important to
make
> > > sure all columns are accounted for.  See :
> > >
> > > http://www.sqlcourse.com/
> > >
> > > It'll provide some basic SQL help.  It's recommended to write out
columns
> > > and values (easier to make sense of).
> > >
> > >
> > > Regards,
> > >
> > > Philip Olson
> > > http://www.cornado.com/
> > >
> > > >
> > > >
> > > > ---BEGIN---
> > > >  > > >$time = time();
> > > >$rand = Random_Password(5);
> > > >$docid = $time . $rand;
> > > >
> > > > if (isset($email) && isset($docid)) {
> > > > mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> > > >
> > > >$query = "INSERT INTO documents VALUES ('$docid', '$category',
> > > > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > > > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > > > '$zip', '$authors_comments', '$teachers_comments', 'N',
'$docdata')";
> > > >
> > > >$result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > > > INSERT to database");
> > > >
> > > > if ($result) {
> > > > echo "$docid was added to the database";
> > > > }
> > > > }
> > > > ?>
> > >
> > >
> > > --
> > > 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]
> --
> Kind Regards,
> ---
> Kyndig
> Online Text Game Resource Site:  http://www.kyndig.com
> ICQ# 10451240


-- 
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] Help INSERTing to MySQL

2001-02-23 Thread Kyndig

On Fri, 23 Feb 2001, Clayton Dukes wrote:
> Well sheesh,
> If I knew I could get answers that easy here, I woudn't have worked on this
> for 20 hours :-)
> 
> THANKS
> 
> btw, field one is an ID field set to auto increment, how can I insert that
> if I don't know what it is?
>
You don't need to insert it. auto_increment will automatically
increment every time you insert a record. In fact, you _really_
don't want to ever set this field, as you would be modifying your
primary key ( unless your modifying them all )

 Note: You don't have to INSERT all fields mentioned below. If
you have a 'default' value set..then it will default to that value,
or in auto_increment case...it will automatically increment from
the last record it reads.

> 
> Here are the fields:
> CREATE TABLE documents (
>   id bigint(20) DEFAULT '0' NOT NULL auto_increment,
>   docid varchar(20),
>   category enum('Language Arts','Sciences','Humanities','Arts','Special
> Subjects','Other'),
>   subcategory enum('Physics','Biology','Chemistry','Math','Computers and
> Internet','History','Economics','Geography','Law','Religion','Philosophy','B
> lack Awareness','Countries','Drugs','Education','Environmental
> Awareness','Politics','Health','Sex and Sexuality','Female
> Awareness','Art','Movies or TV','Music','Sports','Charles
> Dickens','Shakespeare','Biography','Fictional
> Stories','Astronomy','Mythology'),
>   date varchar(10),
>   subject varchar(200),
>   title varchar(200),
>   author varchar(200),
>   email varchar(50),
>   language enum('English','Danish','Dutch','Finnish','German','Spanish'),
>   grade int(3),
>   level enum('High School','College','Other'),
>   city varchar(15),
>   state varchar(15),
>   county varchar(15),
>   school varchar(45),
>   zip smallint(5),
>   authorcomments varchar(200),
>   teachercomments varchar(200),
>   approve enum('Y','N'),
>   docdata text,
>   PRIMARY KEY (id),
>   UNIQUE id (id)
> 
> 
> - Original Message -
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Clayton Dukes" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, February 23, 2001 8:31 PM
> Subject: Re: [PHP] Help INSERTing to MySQL
> 
> 
> >
> > > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > > but can someone tell me why this doesn't work? All it returns is
> > > "Unable to INSERT to database"
> >
> > Change : or die("Unable to INSERT to database");
> > To : or die(mysql_error());
> >
> > And see what it tells you.  Odds are there's a field not being accounted
> > for.  When not designating columns (just values) it's important to make
> > sure all columns are accounted for.  See :
> >
> > http://www.sqlcourse.com/
> >
> > It'll provide some basic SQL help.  It's recommended to write out columns
> > and values (easier to make sense of).
> >
> >
> > Regards,
> >
> > Philip Olson
> > http://www.cornado.com/
> >
> > >
> > >
> > > ---BEGIN---
> > >  > >$time = time();
> > >$rand = Random_Password(5);
> > >$docid = $time . $rand;
> > >
> > > if (isset($email) && isset($docid)) {
> > > mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> > >
> > >$query = "INSERT INTO documents VALUES ('$docid', '$category',
> > > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > > '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> > >
> > >$result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > > INSERT to database");
> > >
> > > if ($result) {
> > > echo "$docid was added to the database";
> > > }
> > > }
> > > ?>
> >
> >
> > --
> > 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]
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#10451240


-- 
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] Help INSERTing to MySQL

2001-02-23 Thread Clayton Dukes

Well sheesh,
If I knew I could get answers that easy here, I woudn't have worked on this
for 20 hours :-)

THANKS

btw, field one is an ID field set to auto increment, how can I insert that
if I don't know what it is?


Here are the fields:
CREATE TABLE documents (
  id bigint(20) DEFAULT '0' NOT NULL auto_increment,
  docid varchar(20),
  category enum('Language Arts','Sciences','Humanities','Arts','Special
Subjects','Other'),
  subcategory enum('Physics','Biology','Chemistry','Math','Computers and
Internet','History','Economics','Geography','Law','Religion','Philosophy','B
lack Awareness','Countries','Drugs','Education','Environmental
Awareness','Politics','Health','Sex and Sexuality','Female
Awareness','Art','Movies or TV','Music','Sports','Charles
Dickens','Shakespeare','Biography','Fictional
Stories','Astronomy','Mythology'),
  date varchar(10),
  subject varchar(200),
  title varchar(200),
  author varchar(200),
  email varchar(50),
  language enum('English','Danish','Dutch','Finnish','German','Spanish'),
  grade int(3),
  level enum('High School','College','Other'),
  city varchar(15),
  state varchar(15),
  county varchar(15),
  school varchar(45),
  zip smallint(5),
  authorcomments varchar(200),
  teachercomments varchar(200),
  approve enum('Y','N'),
  docdata text,
  PRIMARY KEY (id),
  UNIQUE id (id)


- Original Message -
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 8:31 PM
Subject: Re: [PHP] Help INSERTing to MySQL


>
> > Hello, This is my first attempt, so I'm prolly doing something stupid,
> > but can someone tell me why this doesn't work? All it returns is
> > "Unable to INSERT to database"
>
> Change : or die("Unable to INSERT to database");
> To : or die(mysql_error());
>
> And see what it tells you.  Odds are there's a field not being accounted
> for.  When not designating columns (just values) it's important to make
> sure all columns are accounted for.  See :
>
> http://www.sqlcourse.com/
>
> It'll provide some basic SQL help.  It's recommended to write out columns
> and values (easier to make sense of).
>
>
> Regards,
>
> Philip Olson
> http://www.cornado.com/
>
> >
> >
> > ---BEGIN---
> >  >$time = time();
> >$rand = Random_Password(5);
> >$docid = $time . $rand;
> >
> > if (isset($email) && isset($docid)) {
> > mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> >
> >$query = "INSERT INTO documents VALUES ('$docid', '$category',
> > '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> > '$language', '$gr ade', '$level', '$city', '$state', '$county',
> > '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> >
> >$result = mysql_db_query("$DATABASE", $query) or die("Unable to
> > INSERT to database");
> >
> > if ($result) {
> > echo "$docid was added to the database";
> > }
> > }
> > ?>
>
>
> --
> 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] chunk_split() doesnt seem to be working

2001-02-23 Thread Richard Lynch



> Im running php 4.0.4pl1
> 
> Fatal error:  Call to undefined function:   chunk_split() in
> /home/httpd/vhosts/myhearingstore/mail.egn on line 33
> 
> is there a configure option  im supposed to compile in ?

What version of PHP does  claim you are running?...

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] file test

2001-02-23 Thread Richard Lynch

> I am opening the top level of a a directory structure with dir. I want
make
> a list of the subdirectories, but not the files. Is there a file test
> operator like perl's -d in php? I will then have to go into the sub
> directories to perform actions on non directory files

http://php.net/is_dir

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Submitting Form Information

2001-02-23 Thread Richard Lynch

Search the net for Rasmus Lerdorf's "posttohost" function from long, long
ago.

--
Visit the Zend Store at http://www.zend.com/store/
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: "Matthew Aznoe" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 2:37 PM
Subject: [PHP] Submitting Form Information


> Is there a way to simulate a form submission to a cgi-script using PHP?  I
> am trying to write a script that will replace the frontend of another CGI
> script with a customized one of my own, but I need to be able to pass form
> data into the next page in the cgi (including a password).
>
>
> Matthew Aznoe
> Fuzz Technologies
> [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] php (cgi version) with Apache and suexec - help

2001-02-23 Thread Richard Lynch

Don't use safe-mode in your suExec PHP CGI configure.

suExec pretty much does everything safe mode does anyway, and more.

--
Visit the Zend Store at http://www.zend.com/store/
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: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 1:18 PM
Subject: [PHP] php (cgi version) with Apache and suexec - help


>
> I've been trying to get the cgi version of php working with Apache and
> suexec but so far I have not had much success.  I've installed the Apache
> module version of php and it seems to work fine. I then installed the
> cgi version of php and it too seems to work fine as long as it
> doesn't run through suexec.  Suexec works fine for other (perl, c,
> etc...) cgi's.
>
> Here's what I have in Apache's httpd.conf:
> AddType application/x-httpd-php .php
> Action application/x-httpd-php /cgi-bin/php.cgi
>
> When I try to access a .php file I get an error about the command not
> being in the document root.  This is one of the tests suexec performs and
> it is true, the cgi-bin directory (and hence the php binary) is not under
> the document root (although the .php file is).
>
> If I change httpd.conf to this:
> ScriptAlias /php-bin/ "/local/www/php/"
> AddType application/x-httpd-php .php
> Action application/x-httpd-php /php-bin/php.cgi
>
> Now the php binary is under the document root but when I try to access a
> .php file I get an error that the target uid/gid does not match that of
> the directory or program.  This is also true since the php binary is owned
> by the web server and the .php file is owned by another user.
>
> So my question is "What am I missing?".  How can I ever get the cgi
> version of php to work with suexec?  The php binary is owned by the web
> server but the .php files will be owned by other users.
>
> Here is some more information about the environment in which I am working
> in case it is relevant:
>
> Solaris 7
> Apache 1.3.17
> php 4.04pl1
>
> I'm just about ready to give up on this one.  Thanks in advance for any
> and all help.
>
> -john
>
>
>
> --
> 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] Header Location Frame Question

2001-02-23 Thread Richard Lynch

> Is it possible to target a frame in the Location: of
> a header? Sorry if this has been brought up a
> million times before.

No.

You *can* pass enough information to the FRAMESET page that it will load the
right content for each sub-FRAME.

http://yoursite.com/main.php?nav=a.php&top=b.php&content=c.php

 main.php ---

 ...>
 ...>
 ...>


In essence, you are "losing" the feature of frames that lets only one change
on a given HTTP interchange, but you still have frames (God knows why you
want them) and each FRAME gets the right content in it...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] encrypt and decrypt in standard PHP

2001-02-23 Thread Richard Lynch

You could use popen() to execute http://gnupg.org or PGP...

It would be easier to recompile PHP, though, and performance on popen() is
going to suck.

You *might* be able to compile just the encryption module, and use
dl("mcrypt.so") in your PHP script to load it up rather than recompile all
of PHP, but again, it's going to be harder, and performance will suffer.

Compiling PHP the *second* time is *way* easier than the first time,
especially if you've saved your previous PHP source tree and all the other
source trees -- There's a file in the PHP source tree called config.status,
and some other config.* files, that "remember" what you did last time.  So,
copy those somewhere safe, and then look at them.

You'll probably be able to copy config.status to config.zhu, and then edit
that to add --with-mcrypt (or whatever it is), and do:
chmod 755 config.zhu
./config.zhu

--
Visit the Zend Store at http://www.zend.com/store/
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: Zhu George-CZZ010 <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, February 23, 2001 11:07 AM
Subject: [PHP] encrypt and decrypt in standard PHP


>   As the PHP manual indicates, we can use Mcrypt to do the encrypt and
decrypt work in PHP, but that needs to download the encrypt module and
recompile PHP.   Is there any other way to encrypt and decrypt the string in
standard PHP4.0.4 without any extension module?
>
>   Thank you very 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]




Re: [PHP] Need socket help!!!

2001-02-23 Thread Richard Lynch

> Now I cannot go any further.
> I need to go to a page, password.php!!
> All efforts give an error message.

What error message?

Would it perchance, be the one about "headers already sent"?

You need to *NOT* have *ANY* output to the browser before you attempt to do:
header("Location: password.php");

Output includes "echo" or "print" statements, error messages, , or
*EVEN* (and this is the killer) blank lines outside  tags.

Specifically, if you include a file, and that file has a newline after the
?> at the end, you can't do a header after that.  Get rid of the trailing
newline.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] session question

2001-02-23 Thread Richard Lynch

> index.php where they log in from
>  session_start();  file://first line of file

Okay.

> ?>
> 
> 
> Username  

 ?  You been typing too much XML?... :-)

Shouldn't hurt.

> Password   />
>    
>
> code from main.php
>  session_register();

Register what?  You're supposed to register a variable name...

> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
>  session_start();

Doing this after you registered a variable is bogus -- The
session_register() automatically calls this if you haven't yet.

> SQL to select user info from db
> $access = $row[access_level]; file://etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);

Doing session_start() (and, by extension, session_register()) in the same
file as a header("Location:") won't work on some browsers.  You'll either
get the cookie but no redirection or vice versa, depending on which browser
you are using.

And there should be a space after 'Location:'
And you probably need SID= for the SID to get passed on.
header("Location: http://www.blah.com/index2.php?SID=".SID);

> exit;
> ?>
>
> index2.php code
>  session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] mysql.sock

2001-02-23 Thread Richard Lynch

>can someone please send me   mysql.sock
>( unix redhat 6.2 )
>
>i had a crash - reinstalled the rpm 3.22.32  but this file is missing

Unless I'm grossly mistaken, that file should only exist while MySQL is
actually running, and should contain the socket number that MySQL happens to
be using at the moment.

So, (A) their mysql.sock is not going to do you any good, and (B) it will
get created when you start MySQL, and (C) you really don't want to try to
change it by hand.

You may need to *delete* the old mysql.sock file, if MySQL didn't "know" the
computer crashed, and is complaining about that old one being there.  It's
basically just MySQL thinking that MySQL must already be running since you
have one of those files.

Or, you may just need to start MySQL to have a mysql.sock file show up where
you think there should be one.

Or, *maybe* the *path* where MySQL wants to store mysql.sock somehow got
trashed/changed during your RPM install, since it is configurable, and you
just need to create the directory where mysql.sock wants to live.  WARNING:
If you messed this up with your RPM, you may have also not told the new
MySQL install where your databases live.  Don't panic if you fire up MySQL
and all your databases are "gone".  You probably just need to configure
MySQL to look for the database files in the right place.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




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




Re: [PHP] php_self

2001-02-23 Thread Richard Lynch

> Why does php self always show php4/php.exe? how do i take  it off?

This is a known bug under *some* Win32 installations.

Use  to figure out which variable has what you need in it,
and use that variable.

If you need to deploy on multiple platforms, you'll have to compare/contrast
the two server's  outputs and find a common variable with
the info you need, or using some sort of if/else with the other variables to
detect which platform is running.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] is there a way to set apache's auth_user from php?

2001-02-23 Thread Richard Lynch

> I would like to have the authenticated user name
> appear in my apache access web logs but I am not using
> HTTP authentication.  I am using phplib to have better
> control over the authentication process.
> Is there a way to set this apache api variable
> from php code so that apache will log these user names?

I think not.

That variable is sent/set by the *browser* to Apache on each URL request.

What you *could* do is log stuff yourself from PHP using
http://php.net/error-log

You could log the time, their IP, and their user_agent using that, and then
later mix-and-match those entries with Apache entries to figure out who
asked for what.

For that matter, you could turn off Apache logging, and use PHP's to log
everything you need.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] security and php

2001-02-23 Thread Richard Lynch

> I am a system administrator and currently we are playing to migrate all
> our CGI (written in C) to php! But playing a little with php i got
> worried about how services that need to keep username/password are
> handled by php, for instance:

For starters, you *could* have PHP running as a CGI wrapped by suExec
(http://apache.org)

Performance, however, would be not-so-hot, particularly after custom C code
as your previous experience.

Rumor had it at one point that Apache 2.0 would allow Modules to execute in
a similar fashion to suExec -- Whether this feature has survived
development/debug/QA phases is unknown to me.  But it *might* be worth
checking out.  WARNING:  You'd be way past the envelope of tested source
code at that point.  Not just with Apache as Beta software, but with
PHP/Apache/MySQL interaction.  OpenSource QA mostly consists of quantity of
users pounding on stuff, versus a planned organized QA team.

You *could* write a tiny C-module using PEAR, or even alter PHP's source
code, to have the passord encoded as part of your PHP Module binary.  Your
username/password would then be buried somewhere in the binary of that
module, so only a C disassembler would get it out.  I *think* libphp4.so
just needs to be executable for Apache, right?...

Many admins set up different username/passwords for MySQL, depending on what
"classes" of users need select/update/insert/delete access to which
tables -- And the one username/password combo that is for general everyday
access through your public site is stored in a file that the PHP user
(default 'nobody') can read, but is in a directory tree that is not in the
web tree and that other users cannot 'cd' to.  PHP can
http://php.net/include such a file, even though it is not visible in the
web-tree via a browser, if the include_path is set properly in php.ini.
Still, other users on the same server can read that file using PHP or Perl
or anything else than can run as user 'nobody', so it's not great
protection.

Another option would be to buy the Zend Encoder, and encode the file that
contains username/password info.  Rather expensive for what you need right
now, but it would save you writing/testing the C code to bury the
username/password in a large enough block of binary, and you can move on to
your "real" application.  Of course, if at some point you want to install
PHP code on somebody else's server, or just keep a lot of files on your own
server protected, the Zend Encoder price becomes more reasonable.  Again,
only somebody with a lot of time on their hands, a thorough knowledge of the
Zend engine, and a disassembler is going to be able to reverse-engineer
this.

Still, if they want it bad enough, they *can* -- There's pretty much *no*
*way* to have your web server capable of reading/executing a file, and yet
not have some other user on that machine capable of doing the same to
masquerade as that MySQL user, if they work at it enough.  It will be as as
good as your CGI programs were, but no better.  Well, maybe a little better,
since C crackers/disassembler-experts exist, but I don't think there are any
ZendEncoder cracker specialists yet...

> All our CGI programs execute sql queries to a mysql server, they
> contains the user name and password in order to login into the database.
> Since these programs need only to be executed its read flags are turned
> off. I need such a funcionality with php, but how can this be done?

It seems to me though, that the barrier difference between nobody-executable
and nobody-readable is not *that* different:  If I can write a Perl/PHP
script to execute your connect.cgi, it ain't all that more difficult from
being able to read the username/password in your connect.php.  Yeah, I have
to write a little shell script.  Not that big a deal, really, in most
real-world scenarios.

> PHP scripts not owned by the user that runs the web server are required
> to have the read flag for all tuned on, ok? this makes its contents
> readable by all my system users, right ? So how to put user
> name/password information into such script in order to get it accessing
> mysql, but without allowing any other user to get into its contents and
> reading login/password information ?

It doesn't have to be *world* readable -- You can chown -R your site to be
the user that PHP runs as, and chomd -R 400 it.  See  to
find out what that user is, and edit httpd.conf to change it with "User"
directive.  So now, only people who can su to 'nobody' or who have access to
write PHP/Perl/C code on your server are able to snarf those passwords.
Let's face it -- If they can write PHP/Perl/C code and execute it on your
server, your MySQL passwords for data that web-surfers can read is probably
not your biggest worry.

Also, check out "safe mode"  That makes it harder for one user on a shared
server to read another user's files with username/password info in them.
This is more for use in a VirtualHost ISP environment, which I get the
feeling you're not, b

Re: [PHP] I have a great problem with sessions, can anybody help me!!!

2001-02-23 Thread Richard Lynch

>  session_start();
> 
> if( !isset( $c)) {
> session_register("c");
> $c = 1;
> }
> 
> echo $c . "";
> 
> ?>
> reload
> 
> In the new machine this code every show 1, don't save session data.
> I see in /tmp and all the sess_* files are empty.
> I check configuration, etc, and don't found anything.
> 
> I check the same code in other machine with the same configuration, and
> works fine.
> 
> Can anybody help me??

Move the session_register() outside (before) the if()

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] cached fasttemplates permissions prob

2001-02-23 Thread Richard Lynch

You may need chmod 666 instead, for the cache directory...
./menu.cache needs to be *WRITABLE*, not *exectuable*.
Seems pretty scary to me to have world-writable files in your web-site
though...

--
Visit the Zend Store at http://www.zend.com/store/
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: Peter Van Dijck <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, February 22, 2001 11:05 AM
Subject: [PHP] cached fasttemplates permissions prob


> I'm trying to get cachedfasttemplates to work.
> I chmodded the entire directory and everything in it 775 (using -R), I
> still get
> Warning: fopen("./menu.cache","w") - Permission denied in
> ../includes/classes/fasttemplate/cachedfasttemplate.class.php on line 73
>
> Any ideas at all? I've been stuck on this for the entire afternoon...
> thanks
> Peter
>
> ~
> http://liga1.com  ,a weblog on:
> - Localisation
> - Internationalisation
> - Globalisation
> - Accessibility
>
>
> --
> 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] Alternate 2 schedules...

2001-02-23 Thread Richard Lynch

>I' m searching a way to programmatically alternate  2 schedules each sunday
at 00:00. >Schedule1 start on first sunday and seven days later, schedule2
replace schedule1,and seven >days later, schedule1 replace schedule2 etc...

The *easiest* thing to do would be to run a cron job every Sunday at
midnight to flip something...

But, assuming you want to avoid that:

= $newyeardayofweek)) ||
(!($weeknumber % 2) && ($dayofweek < $newyeardayofweek))){
include 'schedule1';
}
else{
include 'schedule2';
}
?>

Somebody else probably has a one-line answer.  Oh well. :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Cookie stored but cannot trigger the function...

2001-02-23 Thread Richard Lynch

> Before redirecting it will also store a cookie in the
> browser named camefrom.
>
> SO then On the login.php page a user enters username
> and pasword and Submits.. if user is found then It has
> to get the Cookie value like this:
>
> $goto = $HTTP_COOKIE_VARS['camefrom'];
>
> header ("Location: $goto");

Only some browsers will accept a Cookies *and* a redirect in the headers in
a single page.

Don't use a cookie to do the "camefrom".

Use $HTTP_REFERER or use:
header("Location: login.php?camefrom=thispage.php");

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] file upload error w/internet exploder!

2001-02-23 Thread Richard Lynch

> I've created a simple form that uploads file to my server. I noticed that
> I'm having problems when I use Internet Explorer 4.5 and 5.0 on the Mac (I
> haven't checked it yet on the pc). It may have something to do with the
path
> to the file. When I use Netscape, the entire path is displayed in the form
> field prior to upload. IE only displays the file name, no path. Is there a
> way that I could force the path along, echo maybe?

You aren't necessarily supposed to see the full path or not, nor does your
script need it.

You should only get the filename by the time it reaches PHP.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Problems with posix_getpwnam

2001-02-23 Thread Richard Lynch

> What does it mean when I get the line 'posix_getpwnam(username) failed
with
> "Error number not set" in /xx.php3 on line ##' printed? It doesn't return
> anything anymore.

Whomever contributed the posix_getpwnam() function probably encountered an
error of some kind, but has not specified what error it is...

Can the PHP user (default 'nobody') actually execute this funtion?
Use  to find out what user PHP runs as.
If you have 'root' access, su to that username, and try to find some shell
commands to get info about that user.
If 'nobody' can't get the info, neither can PHP.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Trans sid and form posts

2001-02-23 Thread Richard Lynch

> Can anyone tell me if trans sid is supposed to work through form posts,

It is supposed to work.

> and
> if so how to make it work right?  It is working fine through normal links,
> but we have quite a few posts, and they lose the session. :(

Use "View Source" in your browser on one of your FORM pages.

I forget if trans sid puts the ID into the URL (ie, mixes GET/POST) or adds
it as a INPUT TYPE=HIDDEN form element...

If, as I suspect, it is being put into the URL, you may be accidentally not
getting the mixed GET/POST data...  Perhaps just adding
enctype=multipart/form-data would help...  Or maybe something in your
web-server is tromping on the mixed data types.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Saving changes to a file

2001-02-23 Thread Richard Lynch

> I am trying to make am admin page for a few other pages in PHP but I dont
> know how to save the changes made.
>
> ie. The page has a few checkboxes & select boxes that when changed, change
> some variables that are then used in other pages.
>
> However I want the changes in the admin page to be permanent, until they
are
> changed again. Not just for that session or user, but if the change is
made
> it stays changed until the administrator decideds to go back in and change
> it again.
>
> How do you save the changes in that file on the server, by just using a
> browser?

The *easiest* way to do this is to store those changable values and their
possible settings in a database.  Really.  Even if you've never used a
database before, it's the easiest.  Honest.

Then just have the pages access the database to get their settings.

*HOWEVER*, if you are not already using a database, opening a database
connection can be expensive time and resource-wise.

So, if you don't already use a database, and *IF* (*huge* *IF* there) you
can guarantee that no two administrators will attempt to alter settings at
the same time, and *IF* you really, really need to worry about performance,
you could fopen() the file to write the current settings to it.

This comes with a security penalty -- You have a file somewhere on your file
system that PHP's user (usually 'nobody') can write to and that gets read by
all your pages to set your variables.

In an ideal world, you should *at* *least* make sure that:
o This file is *not* in your web-tree, but is somewhere else
o This file does *not* have .php extension
o All settings are explicitly checked for by the reader code, not this file.

To further explain this third point:
You *could* (bad idea) just have your file look like this:
- settings.inc -


And you *could* (bad idea) just include() it in your scripts.

But, this file is essentially world-writable.  (Well, okay, it's only
'nobody' writable, but any other person on your server can write to that, so
it's pretty darn close to world-writable.)

So, they could put all sorts of malicious code in there.

Far better to have your nobody-writable settings file look like this:
-- settings.ini ---
forecolor = 'FF'
backcolor = '00FF00'

And have another file you include() that looks like this:


You can even be more cautious by validating the individual inputs for the
settings.
IE, forecolor should be exactly 8 characters, starting with ' and ending
with ' and only [0-9a-fA-F] in between.  (Regex is your buddy here.)

The point is to make it harder for a hacker to exploit this file they can
all too easily write into.  *YOU* make sure that the data you have there is
what you expect, and you are only setting variables you expect, not just
executing what is essentially arbitrary code that anybody else on your
server could alter.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] fread over ftp

2001-02-23 Thread Richard Lynch

> if( !($fd = @fopen($ftp_url, "r")) ){
>   $error = true;
>   $error_msg = "Unable to connect to server.";
> }
> else {
>   $file_contents = fread($fd, 10);
>   fclose($fd);
> }
>
> if( empty($file_contents) ){
>   $error = true;
>   $error_msg = "Did not read file.";
> }
>
>
> The problem is that the fread doesn't always succeed; about about half
> the time the $file_contents string tests as empty.  There is never a
> problem with the fopen, and there doesn't seem to be any consistancy in
> the failure...  The same file may be loaded into the string on run one,
> and missing the next.  The remote server is NT-based.
>
> Does anybody know what is going wrong here?  I don't have to add any logic
> to "wait" for the fread to complete, do I?

You do not need to "wait" for fread().  It blocks by default.  Unless you've
messed around with set_socket_blocking() somewhere else in your code?...

What *exactly* is the value of $file_contents when it fails?

echo "'$file_contents' ", gettype($file_contents), "\n";

If it is 0 or 'false' you can at least detect the problem and try again a
time or two...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Encryption

2001-02-23 Thread Richard Lynch

>I am trying to do a simple encryption on a credit card number to store in a
mysql text field.
>I also have to de-crypt the number after exporting to an access db.
>I tried to use xor encryption, but it seems to only work half the time, the
other half, I >can't seem to de-crypt the # properly, some of the numbers
end up screwed.
>Is this because of the way mysql is storing the field? Mabye it can't
recognize some of the >characters that are generated from the xor
encryption?
>
>Ex: 123456789123 may end up 1 YdR  and then de-crypts to
1234(*$8912#
>
>Is it the  that are the problem?  Or is the the access database that isn't
properly storing >the   ?

Yes, those are the problems.  You are XOR-ing and getting invalid
characters.  You could URLEncode/URLDecode it, or
Base64_Encode/Base64_Decode or some other way of guaranteeing that your
databases don't have to deal with funky characters.

>Is there a better way to do this?

This is a *really* bad idea, all around.  Either the place you are storing
the credit card numbers is "secure enough" that encrypting them is
pointless, or it's not secure enough at all, and your encryption won't stop
anybody who wants those numbers.

You shouldn't be storing nor transporting credit card numbers insecurely.
XOR-encryption is not secure, by definition.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




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




Re: [PHP] fopen

2001-02-23 Thread Richard Lynch

> I'm trying to fopen a URL that I have no problems getting to
> if I just past it into the address field of my browser.  However,
> when I use it in my fopen() function call, I'm getting an "Error
> 0" (zero) message.
> I've looked all over the documentation and I could not find what
> 'Error 0' means.

Your browser is probably configured to use "anonymous/youremailhere" as
usename/password to FTP.

Are you using those values in your PHP code?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Apache & php as a DSO module woes!

2001-02-23 Thread Richard Lynch

> apxs:Break: Command failed with rc=65536

Search the mailing list archives for "rc=65536"

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Database Paging using MSSQL 2000

2001-02-23 Thread Richard Lynch

>I wanted to know if there is some syntax in the MSSQL Select statement
which can allow me to >limit the no. of records being returned. I am lookin
at functionality which is similar to >LIMIT in Mysql.

Look up "cursor" in your MS SQL documentation.

It's not as mind-numbingly simple as LIMIT, but it works.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




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




Re: [PHP] cURL library and auto-loggin to a site

2001-02-23 Thread Richard Lynch

> Does anyone know if it is possible to use PHP and cURL to auto-login into
a
> site (which sets a cookie) and then fill in a form to send an sms message?
> I need to do this to test a site automatically and check response times
for
> sending the SMS.

I have no idea what SMS is.

You *can* probably use PHP and cURL to send and receive the appropriate data
to initiate and continue a cookie session to fake out the server and fill
out the form.  You just might have to work at it a bit.

Tip:  Set up a page that works the way you think their page works, and then
use  in it to figure out what a "normal" browser sends to
a server that's doing what you think they are doing.  Send exactly the same
stuff to their server that worked on your server, and see what happens.

If you work hard enough at it, there is *no* *way* they can detect that your
program is not a human.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] smtp protocol

2001-02-23 Thread Richard Lynch

> Hi...anybody can help me about sending email directly using local smtp
port
> (25). I've read some articles, still, i don't have a clear explanation.
i.e
> : some using \n to separate between each header, but others use \r\n.

The ones using \n haven't read the spec very carefully, and are using Un*x
mail servers that are forgiving.

The ones that use \r\n either read the spec, or are using very rigid
unforgiving Microsoft products.

Use the \r\n ones if you care about portability.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs to be fixed NOW. Please advise.

2001-02-23 Thread Richard Lynch

Read the http://php.net/FAQ about the NULL character problem.

I'm betting you have some funky character that confuses that browser in the
output that the other browsers just ignore.

--
Visit the Zend Store at http://www.zend.com/store/
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: Boaz Yahav <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, February 21, 2001 12:59 AM
Subject: RE: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


> What do you see in your web server logs?
> what webserver do you use?
>
> Sincerely
>
>   berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
>
> -Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 8:59 AM
> To: 'PHP General List. (E-mail)'
> Subject: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs
to
> be fixed NOW. Please advise.
>
>
> Hello guys,
> This is that time when I am in trouble ...
>
> One of our internal databases receives inputs from all kind of different
> places and stores them for later reviews.
> Since it's creation it was all going perfectly well, but now it has a
little
> problem:
>
> The Internet Explorer gives me this error while listing one of databases'
> tables:
>
> (it is a pop up message of internet explorer)
> 
> Internet Explorer Cannot Open the internet site
> http://that.damn.db/database.php 
> ?db=opp_post
>
> The download of the specified resource has filed.
> 
>
> What is it, PHP or IE? I suppose something is wrong with IE (5.01 for
> instance), but so far couldn't come with any solution. The output is
simply
> not there, source shows cuted off at the very beginning of file - after
few
> hundreds of bytes.
>
> This suggests me that one of the entries in Database is somehow corrupting
> IE. But I have not found anything strange. What to look for, guys?
>
> I tested it on Opera and Netscape - no probs whatsoever.
> I also tested it on Linux, and Mac (Opera, Netscape) - no probs
whatsoever.
> ...and (listen to this one)...
> I tested it on Mac, MSIE 5.(01)? (just the version I have on my Win2k) --
> and It gave me no errors at all.
>
> Why MSIE 5.01 of Win2k gives that message and breaks download?
>
> I've seen this messages already while browsing the web, and that's the
> reason I'm asking you: anyone had to fix that before? What are your
guesses
> on my problem?
>
> It is quite urgent since the database is not usable and I don't have much
> time for researches on this issue.
> The sad thing is that our office uses the exactly same configured machines
> (MSIE5 - Win2k) and no one can view the database from their PCs. All the
> sales and coordinators are staying here in line near my MAC while I am
> writing you this.
>
> Any help is greatly appreciated!
>
> Cheers,
> Maxim Maletsky
>
> P.S: if any friends of Bill are around the list, please forward him my
happy
> moments and eventual sweet words.
>
> Maxim Maletsky - [EMAIL PROTECTED] 
> Webmaster, J-Door.com / J@pan Inc.
> LINC Media, Inc.
> TEL: 03-3499-2175 x 1271
> FAX: 03-3499-3109
>
> http://www.j-door.com 
> http://www.japaninc.net 
> http://www.lincmedia.co.jp 
>
>
>
>
>
> --
> 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] Help INSERTing to MySQL

2001-02-23 Thread Philip Olson


> Hello, This is my first attempt, so I'm prolly doing something stupid,
> but can someone tell me why this doesn't work? All it returns is
> "Unable to INSERT to database"

Change : or die("Unable to INSERT to database");
To : or die(mysql_error());

And see what it tells you.  Odds are there's a field not being accounted
for.  When not designating columns (just values) it's important to make
sure all columns are accounted for.  See :

http://www.sqlcourse.com/

It'll provide some basic SQL help.  It's recommended to write out columns
and values (easier to make sense of).


Regards,

Philip Olson
http://www.cornado.com/
 
> 
> 
> ---BEGIN---
> $time = time();
>$rand = Random_Password(5);
>$docid = $time . $rand;
> 
> if (isset($email) && isset($docid)) {
> mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> 
>$query = "INSERT INTO documents VALUES ('$docid', '$category',
> '$subcategory', '$date', '$subject', '$title', '$author', '$email',
> '$language', '$gr ade', '$level', '$city', '$state', '$county',
> '$zip', '$authors_comments', '$teachers_comments', 'N', '$docdata')";
> 
>$result = mysql_db_query("$DATABASE", $query) or die("Unable to
> INSERT to database");
> 
> if ($result) {
> echo "$docid was added to the database";
> }
> }
> ?>


-- 
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] Help INSERTing to MySQL

2001-02-23 Thread Joe Stump

Before your VALUES you need to have a list of the fields ie:

insert into table (id,fname,lname) values ('$id','$fname','$lname')

--joe

On Fri, Feb 23, 2001 at 08:00:30PM -0500, Clayton Dukes wrote:
> Hello,
> This is my first attempt, so I'm prolly doing something stupid, but can someone tell 
>me why this doesn't work?
> All it returns is "Unable to INSERT to database"
> 
> 
> 
> ---BEGIN---
> $time = time();
>$rand = Random_Password(5);
>$docid = $time . $rand;
> 
> if (isset($email) && isset($docid)) {
> mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
> 
>$query = "INSERT INTO documents VALUES ('$docid', '$category', '$subcategory', 
>'$date', '$subject', '$title', '$author', '$email', '$language', '$gr
> ade', '$level', '$city', '$state', '$county', '$zip', '$authors_comments', 
>'$teachers_comments', 'N', '$docdata')";
> 
>$result = mysql_db_query("$DATABASE", $query) or die("Unable to INSERT to 
>database");
> 
> if ($result) {
> echo "$docid was added to the database";
> }
> }
> ?>
> 
>  Submit a new document to the database
>  
>  Email Address: 
>  Category: 
>  Sub Category: ?>
>  Date Document was written:  (xx-xx-)
>  Document Subject: 
>  Document Title: 
>  Document Author: 
>  Document Language: 
>  Grade Received (Percentage):  
>(xx/100)
>  Grade Level of Paper: High 
>SchoolCollegeOther
>  City in which paper was submitted: value=Jacksonville>
>  State in which paper was submitted: value=FL>
>  County in which paper was submitted: value=Duval> (County, not Country!)
>  School at which paper was submitted: value="Mandarin High School">
>  ZIP code:  (Put your ZIP 
>code in if you don't know your school's)
>  Author's Comments: 
>  Teacher's Comments: 
>  Document (ASCII TEXT ONLY):
>  Paste document text here
>  
>  
> 
> -END-
> 
> 
> 
> TIA!
> Clayton
> 

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

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


-- 
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] Order by Date (Newbie)

2001-02-23 Thread Kyndig

On Fri, 23 Feb 2001, Brian S. Drexler wrote:
> Ok, I must be missing something, but does anyone have a script that will
> order by the closest date in the future that hasn't been here yet.  Did that
> make sense?
> 
> Brian
> 
$plusten = mktime(0,0,0,date("m"),date("d")+10,date("Y") );

Will take todays day, and add 10 days to it.
-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#10451240


-- 
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] Help INSERTing to MySQL

2001-02-23 Thread Clayton Dukes



Hello,
This is my first attempt, so I'm prolly doing 
something stupid, but can someone tell me why this doesn't work?
All it returns is "Unable to INSERT to database"
 
 
 
---BEGIN---
   $time = 
time();   $rand = Random_Password(5);   $docid = 
$time . $rand;
 
    if (isset($email) && 
isset($docid)) {    
mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS");
 
   $query = "INSERT INTO documents VALUES 
('$docid', '$category', '$subcategory', '$date', '$subject', '$title', 
'$author', '$email', '$language', '$grade', '$level', '$city', '$state', 
'$county', '$zip', '$authors_comments', '$teachers_comments', 'N', 
'$docdata')";
 
   $result = mysql_db_query("$DATABASE", 
$query) or die("Unable to INSERT to database");
 
    if ($result) 
{    echo "$docid was added 
to the database";    }}?>
 
 Submit a new 
document to the 
database 
 Email Address: 
 
Category:  
Sub Category:  
Date Document was written:  
(xx-xx-) 
Document Subject:  
Document Title:  
Document Author:  
Document Language:  
Grade Received (Percentage):  
(xx/100) Grade 
Level of Paper: High 
SchoolCollegeOther 
City in which paper was submitted:  
State in which paper was submitted:  
County in which paper was submitted:  (County, not 
Country!) 
School at which paper was submitted:  ZIP 
code:  (Put your ZIP 
code in if you don't know your 
school's) 
Author's Comments:  
Teacher's Comments:  
Document (ASCII TEXT 
ONLY): 
Paste document text 
here 
 

 
-END-
 
 
 
TIA!
Clayton

-- 
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] Order by Date (Newbie)

2001-02-23 Thread Joe Stump

To order by dates use SQL

select * from news order by PostDate DESC;

and then make sure that PostDate is a date or datetime - hell even an int with
a unix timestamp (aka time()) will work.

--Joe

On Fri, Feb 23, 2001 at 07:52:54PM -0500, Brian S. Drexler wrote:
> Ok, I must be missing something, but does anyone have a script that will
> order by the closest date in the future that hasn't been here yet.  Did that
> make sense?
> 
> Brian
> 
> 
> -- 
> 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]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


-- 
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] Ok, this might make more sense

2001-02-23 Thread YoBro

Thanks for your help.

I do work with MySql and that was going to be my final option. But because I
am still in the learning stages of PHP I was hoping for a simple save
command.

Not to worry. MySql it is.


Thanks,

Yobro


""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
9748a0$5o2$[EMAIL PROTECTED]">news:9748a0$5o2$[EMAIL PROTECTED]...
: Your asking a huge question and expecting a small answer ie.
:
: php_save();
:
: the anser your looking or is not small, im sorry. your asking a big
: question, and with all big questions comes a big answer.
:
: Do you know how to use db's ? mysql? postgres? I'll assume you do. save
you
: changes in a db, pull those variables rom the db and arange the client
pages
: around this data.
:
: http://phpbuilder.com/columns/jesus19990308.php3
:
: has an article on learning to use mysql.
:
: if you dont have a db you can use, you could use xml, I would recommend
: installing a db before you tackeled this, you said you have till monday,
: this doesnt leave alot of time to learn xml and all that is assisiated
with
: it. your going to be pushing it to learn a db language by then.
:
: when php is run all the variables are rememberd, untill... php stops
: running, then all is lost, this is why you need a db, to remember all the
: data. you could use sessions, but this is not what your looking for.
: sessions are for remebering *one* persons info, not many people's, and not
: for long term, short term.
:
: --
:
:  Chris Lee
:  Mediawaveonline.com
:
:  ph. 250.377.1095
:  ph. 250.376.2690
:  fx. 250.554.1120
:
:  [EMAIL PROTECTED]
:
:
: ""YoBro"" <[EMAIL PROTECTED]> wrote in message
: 9746nm$gh3$[EMAIL PROTECTED]">news:9746nm$gh3$[EMAIL PROTECTED]...
: > Hi,
: >
: > My last message on this topic was a bit hard to translate. So here is
the
: > thought out version.
: >
: > 1.I have a page on a server called admin.php (protected by htaccess
: for
: > admin use only)
: > 2.This page holds variables that are changed by form elements.
: > (Checkboxes etc)
: >And this in turn effects different parts of the site it is being
: used
: > in.
: > 3.I want to know how to keep the changes to the form.
: >
: > Example: If i bring up the admin.php page in my browser and click a
: > checkbox, it permantly keeps it changed until i decide to change it
again.
: >
: > 4.Is there some sort of PHP save command, that saves the state of a
: > page.
: > 5.Any ideas?
: >
: > Please help, I gotta have this worked out by Monday or I'm dead.
: >
: > --
: > Regards,
: >
: >
: > YoBro
: > -
: > DO NOT REPLY TO THIS VIA EMAIL
: > PLEASE USE THE NEWSGROUP
: > All emails sent to this address are automatically deleted.
: > This is to avoid SPAM!
: > -
: >
: >
: >
: > --
: > 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] Order by Date (Newbie)

2001-02-23 Thread Brian S. Drexler

Ok, I must be missing something, but does anyone have a script that will
order by the closest date in the future that hasn't been here yet.  Did that
make sense?

Brian


-- 
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-CVS] cvs: php4 /ext/midgard mgd_preparser.h

2001-02-23 Thread David Guerizec

davidg  Fri Feb 23 16:48:44 2001 EDT

  Modified files:  
/php4/ext/midgard   mgd_preparser.h 
  Log:
  Fixed some potential and real segfaults.
  
  
Index: php4/ext/midgard/mgd_preparser.h
diff -u php4/ext/midgard/mgd_preparser.h:1.4 php4/ext/midgard/mgd_preparser.h:1.5
--- php4/ext/midgard/mgd_preparser.h:1.4Tue Feb 20 03:29:52 2001
+++ php4/ext/midgard/mgd_preparser.hFri Feb 23 16:48:43 2001
@@ -1,4 +1,4 @@
-/* $Id: mgd_preparser.h,v 1.4 2001/02/20 11:29:52 emile Exp $
+/* $Id: mgd_preparser.h,v 1.5 2001/02/24 00:48:43 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -43,15 +43,15 @@
} \
 }
 
-#define mgd_free_buffer(buffer) g_byte_array_free((buffer), TRUE)
-#define mgd_append_buffer(buffer, str) if(strlen(str) > 0 )\
-   g_byte_array_append((buffer), (str), strlen(str));
-#define mgd_append_output_buffer_const(str) if(sizeof(str) > 0 )\
-   g_byte_array_append(mgd_output_buffer, (str), (sizeof(str) == 1) ? 1 : 
sizeof(str)-1 );
-#define mgd_append_output_buffer(str) if(strlen(str) > 0 )\
-   g_byte_array_append(mgd_output_buffer, (str), strlen(str));
-#define mgd_append_output_buffer_data(gstr) if((gstr)->len > 0 )\
-   g_byte_array_append(mgd_output_buffer, (gstr)->data, (gstr)->len);
+#define mgd_free_buffer(buffer) {if(buffer) g_byte_array_free((buffer), TRUE);}
+#define mgd_append_buffer(buffer, str) { if(str && strlen(str) > 0 )\
+   g_byte_array_append((buffer), (str), strlen(str)); }
+#define mgd_append_output_buffer_const(str) { if(sizeof(str) > 0 )\
+   g_byte_array_append(mgd_output_buffer, (str), (sizeof(str) == 1) ? 1 : 
+sizeof(str)-1 ); }
+#define mgd_append_output_buffer(str) { if(str && strlen(str) > 0 )\
+   g_byte_array_append(mgd_output_buffer, (str), strlen(str)); }
+#define mgd_append_output_buffer_data(gstr) { if(gstr && (gstr)->len > 0 )\
+   g_byte_array_append(mgd_output_buffer, (gstr)->data, (gstr)->len); }
 
 //#define MGD_PREPARSER_LOG
 



-- 
PHP CVS 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] ANSI to HTML with socket handling

2001-02-23 Thread Kyndig

venin all,

   Appologies in advance for the lengthy email. I have been
working on an ANSI to HTML converter for over 3 months now.
I am trying to get a socket to open up, read in the buffer,
and if any ANSI color codes are found, convert them to their
proper FONT tags. The socket callin is working fine. ( Though
I can't seem to get it to close properly after the login
screen of a game is completed ) This script is made to call
MUD's ( multi user dungeon ) games. Some of these muds have
color capable logins, and I'd like to convert those login
screens to HTML FONT.

   The purpose of this email is to request any help at
all in the completion of this small script. My string
function handling in any language is rusty at best. If
any on this list can give me some pointers, helpfull hints,
or debugging statements, it would be most appreciated.



The below script calls a host and a specific port ( I
hard coded in my game as an example ). If you save
this script, and run it, you will see what I am referring
to. It calls the game, and retrieves the login screen.


---script begins below--

  



"; break;
 case '1':  return ""; break;
 case '2':  return "Dim"; break;
 case '4':  return ""; break;  
 case '5':  return ""; break;
 case '7':  return "Reverse"; break;
 case '8':  return "Hidden"; break;
 case '30':  return ""; break;
 case '31':  return ""; break;
 case '32':  return ""; break;
 case '33':  return ""; break;
 case '34':  return ""; break;
 case '35':  return ""; break;
 case '36':  return ""; break;
 case '37':  return ""; break;
 case '40':  return "Black"; break;
 case '41':  return "Red"; break;
 case '42':  return "Green"; break;
 case '43':  return "Yellow"; break;
 case '44':  return "Blue"; break;
 case '45':  return "Magenta"; break;
 case '46':  return "Cyan"; break;
 case '47':  return "White"; break;
 default: return "UKNOWN"; break;
}
}

$query_str= "Memory";

 
$fp = fsockopen("kyndig.com", 9000, &$errno, &$errstr);
if (!$fp) 
{
echo "ERROR: $errno - $errstr\n";
exit;
} 
else 
{
fputs($fp, "\n");
while(!feof($fp)) 
{
$buf = fgets($fp,4096);

/* Lets store what it really looks like in another
variable */
$actual .= $buf;

/* We are looking for the most standard ANSI color
 * codes here: example: [1;33;4m
 */
if (preg_match("/\[\d+(;\d+)+m/",$buf))
{
/* we don't want to reset the 'buf' we are
reading in */

$buffer = $buf;
/* first we pull out the matches and stick them
in an array   
 * we also get rid of the [ at this point
 */
preg_match_all("/\d+(;\d+)+m/",$buffer,
$matches);

for ($i=0; $i< count($matches[0]); $i++)
{
/* TEST is just a reference */
/* $TEST .= "matched:
".$matches[0][$i]."\n";*/

/* We have isolated all color in a
single line in its own array now
 * It looks like:  [1;33;4m   or
[1;33mFor those that are [#m ANSI
 * code, the next ifcheck takes care of
them. Now lets go through each
 * code we have, split it up, and
convert it to HTML
 */
$code = $matches[0][$i];
list( $color1 , $color2, $color3 ) =
split( ";", $code);
$two = intval($color2);
$three = intval($color3);

$setting = convert($color1);
$foreground = convert($two);
if( $three != 0 )
{
$background = convert($three);
}
if( $three == 0 )
{
$background = "";
}

/* We now have the colors converter to
proper HTML format
 * Now we have to bring our buffer back,
and place all
 * the text around the ANSI code,
example: [1;33mt would
 * be t
 

[PHP] problems with mail()

2001-02-23 Thread Chris Lee

mail seems to be just throwing the 'extra headers' in with the body...



  $email_text_body = "Hello {$people->people_name[$pos]} how are you
today?";

  $email_html_body  = "";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "Hello
{$people->people_name[$pos]} How are you today?";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "";
  $email_html_body .= "";

  $email_boundary = uniqid('HTML');

  $email_headers  = "From: MyHearingStore.com
<[EMAIL PROTECTED]>\r\n";
  $email_headers .= "Return-Path: <[EMAIL PROTECTED]>\r\n";
  $email_headers .= "MIME-Version: 1.0\r\n";
  $email_headers .= "Content-Type: multipart/alternative;\r\n
boundary='$email_boundary'\r\n";
  $email_headers .= "This is a multi-part message in MIME format.\r\n\r\n";

  $email_body  = "--$email_boundary\r\n";
  $email_body .= "Content-Type: text/plain;\r\n  charset='ISO-8859-1'\r\n";
  $email_body .= "Content-Transfer-Encoding: ISO-8859-1\r\n\r\n";
  $email_body .= $email_text_body;

  $email_body .= "--$email_boundary\r\n";
  $email_body .= "Content-Type: text/html;\r\n  charset=ISO-8859-1\r\n";
  $email_body .= "Content-Transfer-Encoding: ISO-8859-1\r\n\r\n";
  $email_body .= $email_html_body;

  mail($people->people_email[$pos], 'An HTML Message', $email_body,
$email_headers);




outputs this.





Return-Path: 
Received: (from nobody@localhost)
 by server.mediawaveonline.com (8.9.3/8.9.3) id PAA30279;
 Fri, 23 Feb 2001 15:55:53 -0800
Date: Fri, 23 Feb 2001 15:55:53 -0800
From: Nobody <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Status:

Subject: An HTML Message
From: MyHearingStore.com <[EMAIL PROTECTED]>
Return-Path: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary='HTML3a96f889828b4'
This is a multi-part message in MIME format.



--HTML3a96f889828b4
Content-Type: text/plain;
  charset='ISO-8859-1'
Content-Transfer-Encoding: ISO-8859-1

Hello test how are you today?--HTML3a96f889828b4
Content-Type: text/html;
  charset=ISO-8859-1
Content-Transfer-Encoding: ISO-8859-1

Hello
test How are you today?



its supposed to be this.


Return-Path: 
Received: (from nobody@localhost)
 by server.mediawaveonline.com (8.9.3/8.9.3) id PAA30279;
 Fri, 23 Feb 2001 15:55:53 -0800
Date: Fri, 23 Feb 2001 15:55:53 -0800
From: Nobody <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: An HTML Message
From: MyHearingStore.com <[EMAIL PROTECTED]>
Return-Path: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary='HTML3a96f889828b4'
This is a multi-part message in MIME format.
Status:


--HTML3a96f889828b4
Content-Type: text/plain;
  charset='ISO-8859-1'
Content-Transfer-Encoding: ISO-8859-1

Hello test how are you today?--HTML3a96f889828b4
Content-Type: text/html;
  charset=ISO-8859-1
Content-Transfer-Encoding: ISO-8859-1

Hello
test How are you today?



any idea's ???


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [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] PHP not proccessing input?

2001-02-23 Thread Chris

Help!
I am trying to post some info to my php script using the microsoft internet control:

strurl = http://www.myserver.com/test.asp
strdata = "lah=sd&dta=test
Inet1.Execute strurl, "POST", strdata

PHP returns HTTP_POST_VARS as being empty.
Yet, if I use PERL, I can read the posted info just fine.

PHP does work fine with normal php forms.

Why can PERL recognize my data, but PHP not, how are they handling the posted info 
differently?

Is there a way I can get PHP to display the raw data that the script receives so I can 
see what is happening?

Thanks for any help, 
Chris




Re: [PHP] chunk_split() doesnt seem to be working

2001-02-23 Thread Chris Lee

ok, works now, strange stuff, cut and paste from opera and you'll get
problems like this, strange strange


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
976kjm$8cl$[EMAIL PROTECTED]">news:976kjm$8cl$[EMAIL PROTECTED]...
> Im running php 4.0.4pl1
>
> Fatal error:  Call to undefined function:   chunk_split() in
> /home/httpd/vhosts/myhearingstore/mail.egn on line 33
>
> is there a configure option  im supposed to compile in ?
>
>
> --
>
>  Chris Lee
>  Mediawaveonline.com
>
>  ph. 250.377.1095
>  ph. 250.376.2690
>  fx. 250.554.1120
>
>  [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-CVS] cvs: php4 /ext/midgard preparser-parser.y preparser-scanner.l

2001-02-23 Thread David Guerizec

davidg  Fri Feb 23 16:01:00 2001 EDT

  Modified files:  
/php4/ext/midgard   preparser-parser.y preparser-scanner.l 
  Log:
  passing include()'ed files thru the preparser.
  
  
Index: php4/ext/midgard/preparser-parser.y
diff -u php4/ext/midgard/preparser-parser.y:1.4 php4/ext/midgard/preparser-parser.y:1.5
--- php4/ext/midgard/preparser-parser.y:1.4 Tue Feb 20 03:14:55 2001
+++ php4/ext/midgard/preparser-parser.y Fri Feb 23 16:00:59 2001
@@ -1,5 +1,5 @@
 %{
-/* $Id: preparser-parser.y,v 1.4 2001/02/20 11:14:55 emile Exp $
+/* $Id: preparser-parser.y,v 1.5 2001/02/24 00:00:59 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -42,7 +42,7 @@
 %token MGD_SNIP
 %token MGD_SNIPE
 %token MGD_EVAL
-%token MGD_EVALE
+%token MGD_INCLUDE
 
 %%
 
@@ -183,6 +183,17 @@
mgd_append_output_buffer_const("mgd_eval(");
mgd_append_output_buffer_data($2);
mgd_append_output_buffer_const(")");
+   mgd_free_buffer($2);
+ }
+ | MGD_INCLUDE STRING {
+#ifdef PARSER_DEBUG
+   mgd_append_output_buffer_const("parsed include: ");
+   mgd_append_output_buffer_data($2);
+#endif
+   mgd_append_output_buffer_const("$midgard->pp_tmp=\"?>\"."
+  
+ "implode(\"\\n\",file(");
+   mgd_append_output_buffer_data($2);
+   mgd_append_output_buffer_const(")).\"pp_tmp);");
mgd_free_buffer($2);
  }
 ;
Index: php4/ext/midgard/preparser-scanner.l
diff -u php4/ext/midgard/preparser-scanner.l:1.4 
php4/ext/midgard/preparser-scanner.l:1.5
--- php4/ext/midgard/preparser-scanner.l:1.4Thu Feb 22 17:08:43 2001
+++ php4/ext/midgard/preparser-scanner.lFri Feb 23 16:00:59 2001
@@ -1,6 +1,6 @@
 
 %{
-/* $Id: preparser-scanner.l,v 1.4 2001/02/23 01:08:43 davidg Exp $
+/* $Id: preparser-scanner.l,v 1.5 2001/02/24 00:00:59 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -48,6 +48,9 @@
 %x IN_EVAL
 %x IN_EVALQ
 %x IN_EVALQQ
+%x IN_INCLUDE
+%x IN_INCLUDEQ
+%x IN_INCLUDEQQ
 
 %option stack
 %option noyywrap
@@ -259,6 +262,67 @@
 }
 
 {ANY} {
+  if(yytext[0] == '(') par_stack++;
+  if(yytext[0] == ')') par_stack--;
+  if(par_stack < 0) {
+yy_pop_state();
+return STRING;
+  }
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+}
+
+[^a-zA-Z0-9_]"include"{WHITESPACE}*"(" {
+/* TODO: change the [^_] to make it conditional, so it's not part of the match
+ */
+  mgd_append_byte(mgd_output_buffer, mgdtext);
+  yy_push_state(IN_INCLUDE);
+  par_stack=0;
+  in_string = 0;
+  mgdlval.gstring = g_byte_array_new();
+  return MGD_INCLUDE;
+}
+
+{quote} {
+  yy_push_state(IN_INCLUDEQ);
+  in_string = mgdtext[0];
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+}
+
+{dquote} {
+  yy_push_state(IN_INCLUDEQQ);
+  in_string = mgdtext[0];
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+}
+
+[\\]{quote} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+  mgd_append_byte(mgdlval.gstring, mgdtext+1);
+}
+
+{quote} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+  yy_pop_state();
+}
+
+{ANY} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+}
+
+[\\]{dquote} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+  mgd_append_byte(mgdlval.gstring, mgdtext+1);
+}
+
+{dquote} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+  yy_pop_state();
+}
+
+{ANY} {
+  mgd_append_byte(mgdlval.gstring, mgdtext);
+}
+
+{ANY} {
   if(yytext[0] == '(') par_stack++;
   if(yytext[0] == ')') par_stack--;
   if(par_stack < 0) {



-- 
PHP CVS 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] specifying alternate host with imap-mail

2001-02-23 Thread Mark Newnham

Is it possible to specify an alternate SMTP host for use with imap_mail? Is
this what the rpath parameter is for? If so, what would the syntax be.

Thanks

Mark

-- 
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] Parsing a string

2001-02-23 Thread Simon Garner

From: "Todd Cary" <[EMAIL PROTECTED]>

> Thanks all!!
>
> split() works like a champ!!
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
>


If you're just tokenising by a comma, don't use split(), use explode().

split() accepts a regular expression for the separator, whereas explode()
accepts just a normal string. The difference is, split() is slower.



Cheers

Simon Garner


-- 
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-CVS] cvs: php4 /ext/midgard config.m4 preparser.c

2001-02-23 Thread David Guerizec

davidg  Fri Feb 23 15:14:42 2001 EDT

  Modified files:  
/php4/ext/midgard   preparser.c config.m4 
  Log:
  - workaround for the function mgd_eval() to return a value like the PHP eval().
  - changed --with-mgd-experimental to --enable-mgd-experimental
  
  
Index: php4/ext/midgard/preparser.c
diff -u php4/ext/midgard/preparser.c:1.5 php4/ext/midgard/preparser.c:1.6
--- php4/ext/midgard/preparser.c:1.5Tue Feb 20 03:14:55 2001
+++ php4/ext/midgard/preparser.cFri Feb 23 15:14:42 2001
@@ -1,4 +1,4 @@
-/* $Id: preparser.c,v 1.5 2001/02/20 11:14:55 emile Exp $
+/* $Id: preparser.c,v 1.6 2001/02/23 23:14:42 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -345,6 +345,77 @@
mgd_free_pool(pool);
 }
 
+/* DG {HACK ALERT}: Since the function zend_eval_string does not behave like
+ * the statement eval(), thie following function is the exact copy of the
+ * function zend_eval_string with some lines commented out.
+ * This is necessary to keep the compatibility between eval() and mgd_eval()
+ */
+static int mgd_eval_string(char *str, zval *retval_ptr, char *string_name CLS_DC 
+ELS_DC)
+{
+   zval pv;
+   zend_op_array *new_op_array;
+   zend_op_array *original_active_op_array = EG(active_op_array);
+   zend_function_state *original_function_state_ptr = EG(function_state_ptr);
+   int original_handle_op_arrays;
+   int retval;
+
+// if (retval_ptr) {
+// pv.value.str.len = strlen(str)+sizeof("return  ;")-1;
+// pv.value.str.val = emalloc(pv.value.str.len+1);
+// strcpy(pv.value.str.val, "return ");
+// strcat(pv.value.str.val, str);
+// strcat(pv.value.str.val, " ;");
+// } else {
+   pv.value.str.len = strlen(str);
+   pv.value.str.val = estrndup(str, pv.value.str.len);
+// }
+   pv.type = IS_STRING;
+
+   /*printf("Evaluating '%s'\n", pv.value.str.val);*/
+
+   original_handle_op_arrays = CG(handle_op_arrays);
+   CG(handle_op_arrays) = 0;
+   new_op_array = compile_string(&pv, string_name CLS_CC);
+   CG(handle_op_arrays) = original_handle_op_arrays;
+
+   if (new_op_array) {
+   zval *local_retval_ptr=NULL;
+   zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
+   zend_op **original_opline_ptr = EG(opline_ptr);
+   
+   EG(return_value_ptr_ptr) = &local_retval_ptr;
+   EG(active_op_array) = new_op_array;
+   EG(no_extensions)=1;
+
+   zend_execute(new_op_array ELS_CC);
+
+   if (local_retval_ptr) {
+   if (retval_ptr) {
+   COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
+   } else {
+   zval_ptr_dtor(&local_retval_ptr);
+   }
+   } else {
+   if (retval_ptr) {
+   INIT_ZVAL(*retval_ptr);
+   }
+   }
+
+   EG(no_extensions)=0;
+   EG(opline_ptr) = original_opline_ptr;
+   EG(active_op_array) = original_active_op_array;
+   EG(function_state_ptr) = original_function_state_ptr;
+   destroy_op_array(new_op_array);
+   efree(new_op_array);
+   EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
+   retval = SUCCESS;
+   } else {
+   retval = FAILURE;
+   }
+   zval_dtor(&pv);
+   return retval;
+}
+
 MGD_FUNCTION(eval)
 {
zval **string, **name;
@@ -370,20 +441,9 @@
WRONG_PARAM_COUNT;
}
if((*string)->value.str.len) {
-#ifdef MGD_PREPARSER_LOG
-   zend_syntax_highlighter_ini syntax_highlighter_ini;
-   php_get_highlight_struct(&syntax_highlighter_ini);
-// highlight_string(*string, &syntax_highlighter_ini, tmp);
-#endif
pool = mgd_alloc_pool();
value = php_eval_midgard(pool, tmp, (*string)->value.str.val, 0);
-#ifdef MGD_PREPARSER_LOG
-MGD_LOG_START("mgd_eval(%s) '%s'\n\n\n\n\n\n\n\n")
-   MGD_LOG_ARG(tmp)
-   MGD_LOG_ARG(value)
-MGD_LOG_END()
-#endif
-   if(zend_eval_string(value, NULL /* return_value */, tmp CLS_CC ELS_CC) 
!= SUCCESS) {
+   if(mgd_eval_string(value, return_value, tmp CLS_CC ELS_CC) != SUCCESS) 
+{
 /* DG: we probably want to turn that off when stable and ready to release
  * or at least offer the user an option to turn it off, as it exposes the
  * PHP source (security issue here)
@@ -449,4 +509,5 @@
}
}
 }
+
 #endif /* HAVE_MIDGARD */
Index: php4/ext/midgard/config.m4
diff -u php4/ext/midgard/config.m4:1.9 php4/ext/midgard/config.m4:1.10
--- php4/ext/midgard/c

  1   2   3   >