RE: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

you could save the password to a database, associated with
an ID number, then pass the ID number.

DATABASE:
- 
id| password
12345 | blah$$

URL:
form.php?id=12345

- 
Scott Hurring - Internet Programmer
GraphicType Services
tel: 973.667.9486
web: http://www.graphictype.com/ 
pgp: http://graphictype.com/scott/pgp.txt
- 


> -Original Message-
> From: Floyd Baker [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 1:36 PM
> To: Jason Wong
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Passing vars w/refresh w/register globals off?
> 
> 
> On Fri, 18 Jan 2002 01:03:19 +0800, you wrote:
> 
> >On Friday 18 January 2002 00:41, Floyd Baker wrote:
> >> On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:
> >> >What do you mean by 'hidden'? If you're talking about a hidden form
> >> >input, how can it not be post?
> >> >
> >> >Bogdan
> >>
> >> Just saying I've tried it.  Figured it wouldn't work but wasn't sure
> >> how 'refresh' might relate to 'post'.  Post passing works fine with
> >> $_request on the other end but I've got a lot of this refresh kind of
> >> passing that doesn't work, and not sure how best to fix it.
> >>
> >> I don't want to rewrite the entire method to not include refresh.  :-<
> >
> >If they are refresh redirects as in using the META tags then you're not
> >going  to get any form (POST) data. Perhaps you can elaborate on what you're
> >trying  to do. And if appropriate, post some code.
> >
> >
> >-- 
> >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >
> >/*
> >Sorry, no fortune this time.
> >*/
> 
> 
> Jason.  
> 
> The thing is, I *was* using GET in the refresh line and I guess I
> wasn't saying that.  Moreover I want to pass passwords in the same
> transfer but obviously letting them show up in the url is not cool...
> 
> My question should be more like, how can one pass variables in a way
> that doesn't use a form but is still secure? 
> 
> 
> And thanks too for asking.  I hope everyone understands that even
> questions make it easier for a person to focus their thoughts.  I hate
> to ask dumb questions, or put things the wrong way, but the problem is
> I don't know they're dumb at first.  One little question I didn't
> think to ask myself can make it all come clear.   
> 
> Floyd
> 
> --
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPEccKsaXTGgZdrSUEQIFuwCfZOI5Ct1iozF86nS3/MziIRo6UlMAoIUb
qZV9tkmSWBOXkiqBkE5TwfFe
=qb1c
-END PGP SIGNATURE-



-- 
PHP General Mailing List (http://www.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 variables

2002-01-17 Thread scott [gts]

there's one example of var-of-vars along with arrays below my rant


var-of-var is almost always an evil thing.  there are some
rare instances where they're necessary, but i assure you
that your script would be MUCH cleaner and easier to modify
in the future if you used a simple array.

compare: $value = $form[$temp . $i];
to: eval('$valueofsize = $'. $temp . $i .';');


$form['size1'] = "hey";
$form['size2'] = "there";

$size1 = "hey";
$size2 = "there";
$loopcounter = 2;

while ($i++ < $loopcounter) {
$temp = "size";
eval('$valueofsize = $'. $temp . $i .';');
print $valueofsize;
print $form[$temp . $i];
}


Scott Hurring - Internet Programmer
GraphicType Services
tel: 973.667.9486
web: http://www.graphictype.com/
pgp: http://graphictype.com/scott/pgp.txt



> -Original Message-
> From: Mike Krisher [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] variable variables
>
>
> I can not wrap my head around variable variables today, not awake yet or
> something.
>
> For instance I trying something like this:
>
> while ($i<$loopcounter) {
>   $temp = "size";
>   $valueofsize = $$temp$i;
>   $i++;
> }
>
> this doesn't work obviously, $valueofsize ends up with a literal value of
> "$size1". But I need it to equal the value of a variable named $size1. Do I
> need to use a eval() or something?
>
> Thanks in advance,
> » Michael Krisher
>   [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] How would you code: $r = func() or return 0?

2001-09-26 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

i'm not worried about speed of execution or actual
number of statements. (although i am looking to shave
some typing and make my code a little clearer)

i think that using: $r = function() or return 0; is more
readable and easier on the wrists than the other two ways
and i'm looking for an equally terse way of accomplishing
the same thing with PHP

> -Original Message-
> From: Sterling Hughes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 26, 2001 4:57 PM
> To: scott [gts]
> Cc: php
> Subject: Re: [PHP] How would you code: $r = func() or return 0?
> 
> 
> On Wed, 26 Sep 2001, scott [gts] wrote:
> 
> >
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > I thought i'd ask for your comments on how you'd code this
> > common perl code with PHP:
> >
> > $value = some_function() or return 0;
> >
> > i usually code my functions to return 0 or "" on error, but
> > have to use the following code to handle it... neither seem
> > like a good solution to me.
> >
> > this way decreses the readability of the code:
> > if (!$value = some_function)
> > return 0;
> >
> > and this way adds an unnecessary if() statement:
> > $value = some_function()
> > if (!$value) {
> > return 0;
> > }
> 
> The last way is how you would do it...  And FYI, its an extra if
> statement in the Perl code too (speed wise)...
> 
> -Sterling
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO7JLW8aXTGgZdrSUEQKjQACg4GdkrVjTodv/wV3IUCTAKHidCIYAoKUs
xzlYjq4KIbblwukkixk1gfCC
=jUzq
-END PGP SIGNATURE-


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




[PHP] How would you code: $r = func() or return 0?

2001-09-26 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I thought i'd ask for your comments on how you'd code this
common perl code with PHP:

$value = some_function() or return 0;

i usually code my functions to return 0 or "" on error, but
have to use the following code to handle it... neither seem
like a good solution to me.

this way decreses the readability of the code:
if (!$value = some_function)
return 0;

and this way adds an unnecessary if() statement:
$value = some_function()
if (!$value) {
return 0;
}

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO7I+l8aXTGgZdrSUEQLW3wCbBhH8w+P+EgJxvs46H9JUtx9q0iUAoKeg
pRwrJ6NH230r0EQZl3Wvc5Wl
=sUof
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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] Have y'all seen this?

2001-09-14 Thread scott [gts]

it's also a joke, in case anyone happens to
take is seriously  :-)

> -Original Message-
> From: Jon Farmer [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 14, 2001 10:01 AM
> To: Thomas Deliduka; PHP List
> Subject: Re: [PHP] Have y'all seen this?
> 
> 
> > This is a pretty funny article:
> > 
> > http://www.bbspot.com/News/2000/6/php_suspend.html
> 
> 
> Yes, and its also a very old story... been doing the rounds for months.
> 
> Regards
> 
> Jon
> 
> --
> Jon Farmer
> Systems Programmer, Entanet www.enta.net
> Tel 01952 428969 Mob 07968 524175 
> PGP Key available, send blank email to [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] is_numeric for php3

2001-08-28 Thread scott [gts]

my understanding is that numeric is a broad term for 
number values (any value with only numbers and a 
decimal point) like 1, 5.6, 332, 0.5532, for example.

integers are a sub-set of numerics, so any integer is
a numeric value, but any numeric value is not
necessarily an integer.

$num=123 is an integer *and* numeric value.

$num='123' might not be an integer, but it is
a numeric.

now the problem of how to devise a proper test for
numeric values (without using regexps) is what i'd
like to see.


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] is_numeric for php3
> 
> Hi Philip,
> 
> By definition, any string that does not contain
> alpha-characters is numeric.  I mean, '123' is an
> integer, if only because it isn't 'onetwothree', you
> know?


-- 
PHP General Mailing List (http://www.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_numeric for php3

2001-08-28 Thread scott [gts]

well.  sure, is_numeric() will work, but the point of the
exercise is to try and determine if a number is numeric
without actually calling is_numeric() or regexps.

personally, i think that regexps are swiss-army knives,
they can do almost anything -- i use them all the time,
although it took me a few months to fully understand them
and get over regexp-heebie-jeebies of my own.

> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:42 PM
> To: scott [gts]; php
> Subject: RE: [PHP] is_numeric for php3
> 
> 
> Ahhh, in that context, with is_integer(), i think
> you're partially right.  however, i looked it up, and
> is_numeric() will work fine.
> 
> http://www.php.net/manual/en/function.is-numeric.php
> 
> btw-- as for the regexps, none for me, thanks ;) 
> those things give me the heebie-jeebies.
> 
> --- "scott [gts]" <[EMAIL PROTECTED]> wrote:
> > i think he's asking for a numeric test, not an
> > integer test.
> > 
> > your example looks like it should fail "3.50" (for
> > example),
> > even though "3.50" is a perfectly valid numeric
> > value.
> > 
> > personally, i think you should just use regexps. ;-)
> > 
> > i tried to write a little is_num() type function,
> > but i kept
> > getting caught on split();  it seems that split()
> > converts
> > everything to string, no matter what.  so if you try
> > to split
> > on the decimal point of 45.67 ... you get two
> > strings, "45" and "67"
> > not 45 and 67, so subsequent is_integer() calls fail
> > 
> > (since is_integer() checks the *type* of the
> > variable,
> > not the *value* -- very important to keep in mind)
> > 
> > here's what i came up with... perhaps it will be of
> > some
> > help to you (even though it doesnt work)
> > 
> > 
> > function is_num($number) {
> > 
> >   // $x contains number, $y contains any decimal
> > value
> >   list ($x, $y) = split("\.", $number);
> > 
> >   // if there's no decimal value
> >   if ( empty($y) ) {
> > return is_int($x);
> >   }
> >   else {
> > return ( is_int($x) && is_int($y) );
> >   }
> > 
> > }
> > 
> > 
> > > -Original Message-
> > > From: daniel james [mailto:[EMAIL PROTECTED]]
> > > Subject: Re: [PHP] is_numeric for php3
> > > 
> > > do you mean, as in,
> > > 
> > > if !is_integer($var) {
> > > print("$var is not an integer");
> > > }
> > > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.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] Check if a word is in my string.

2001-08-28 Thread scott [gts]

use regexps.  that's what their specialty is ;-)

// case insensitive
if ( preg_match("/$text/i", $string) ) {
print "$text is in $string";
}

// case sensitive
if ( preg_match("/$text/", $string) ) {
print "$text is in $string";
}

> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:11 PM
> To: Brandon Orther; PHP User Group
> Subject: Re: [PHP] Check if a word is in my string.
> 
> 
> if you're just looking for the 1st occurrence of the
> string, it's--
> 
> $check = "good";
> $var = "This is a good...";
> 
> if (!strstr($var, $check)) {
> print("$check not found");
> }
> 
> also, i think strstr() is case-insensitive, so it
> won't be able to differentiate between 'Good' and
> 'good', and will NOT return FALSE if 'Good' precedes
> 'good' in the string...
> 
> -dj
> 
> 
> --- Brandon Orther <[EMAIL PROTECTED]> wrote:
> > Hello,
> >  
> > I have a variable with a string in it.  I want to
> > check if in that
> > string a certain word is in it.  Example
> >  
> > $var = "This is a good sentence";
> >  
> > $check = look("good", $var);
> >  
> >  
> > and $check would equal 1 since "good" is in that
> > string
> >  
> >  
> >  
> >  
> > does anyone know how to do this?
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.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] Link Checker

2001-08-28 Thread scott [gts]

although it's a bit klunky (and not entirely correct) to do
things this way, but a simple fopen(); will tell you if
the URL is retrievable or not.

(although i dont think that fopen() handles redirects or any
of those esoteric HTTP features)

but if you want to make sure that a link is there, with
no SSL, redirects, or any other stuff, fopen() should
be more than sufficient.

> -Original Message-
> From: Adam Plocher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:09 PM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] Link Checker
> 
> 
> Is there any function that will allow me to check to see if a link is valid?
> 

-- 
PHP General Mailing List (http://www.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_numeric for php3

2001-08-28 Thread scott [gts]

i think he's asking for a numeric test, not an integer test.

your example looks like it should fail "3.50" (for example),
even though "3.50" is a perfectly valid numeric value.

personally, i think you should just use regexps. ;-)

i tried to write a little is_num() type function, but i kept
getting caught on split();  it seems that split() converts
everything to string, no matter what.  so if you try to split
on the decimal point of 45.67 ... you get two strings, "45" and "67"
not 45 and 67, so subsequent is_integer() calls fail 
(since is_integer() checks the *type* of the variable,
not the *value* -- very important to keep in mind)

here's what i came up with... perhaps it will be of some
help to you (even though it doesnt work)


function is_num($number) {

  // $x contains number, $y contains any decimal value
  list ($x, $y) = split("\.", $number);

  // if there's no decimal value
  if ( empty($y) ) {
return is_int($x);
  }
  else {
return ( is_int($x) && is_int($y) );
  }

}


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] is_numeric for php3
> 
> do you mean, as in,
> 
> if !is_integer($var) {
> print("$var is not an integer");
> }
> 

-- 
PHP General Mailing List (http://www.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] Last Modified question..

2001-08-28 Thread scott [gts]

did you try stat()'ing the file?

as long as you have read permission to the file,
you should be able to run a stat() on the file
with no problems

> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Last Modified question..
> 
> I have a problem... I want to check the last modified time that a file was
> changed/updated.  Actually, it's an employee database that I'm working on
> and I thought about just checking the last modified date on the file that
> the information was stored on.  However, I get a permission denied error and
> I don't want to change the permissions of the file.  Is there an easy way to
> check to see when the last time anyone logged in and updated their
> 'employee' information?
> 
> Thanks,
> jay


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




RE: [PHP] The future of PHP

2001-08-23 Thread scott [gts]

:-)

for the type of sites that i develop (non-mission-critical,
non-financial), i find PHP's simplicity and elegance more than
offsets a lack of things like strong typing and a harshly
BDSM compiler (and whatever else Java/JSP has that PHP
doesn't)

for most websites out there, Java is probably overkill, and
using it would complicate the task at hand... but as with
everything in life, JSP/XML has it's place, and PHP has it's.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Subject: Re: [PHP] The future of PHP
> 
> I guess that there are places to use PHP and others to use Java, you
> decide what will suit better your needs.


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




RE: [PHP] Re: Mem and variables

2001-08-22 Thread scott [gts]

amen.   :-)

> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Re: Mem and variables
> 
> At any rate -- The right way to worry about perforance is to figure out
> where your code is spending 90% of its time, and to optimize that.  I'm
> betting it ain't in variable lookups for most of us :-)


-- 
PHP General Mailing List (http://www.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() not working.

2001-08-21 Thread scott [gts]

header() works.

it's the text that header() is printing
that's causing problems.

what are you outputting via header() ?

> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 21, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] header() not working.
> 
> 
> anyone know why the header() wouldn't work?  I don't have anything being 
> printed out before or after I call the header().  The only thing that does 
> happen is when it tries to redirect the user it sends them to a 404 page 
> error.  Also, when I check the web server log it says it's trying to call 
> ".php" (note no file name in front of the '.php').  I'm not sure what's 
> going on but any suggestions?
> 
> Thanks,
> Jay
> 

-- 
PHP General Mailing List (http://www.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] PNG support...

2001-08-20 Thread scott [gts]

looks like some GD options were changed between builds.

check phpinfo() to find out how PHP was compiled,
and what version GD it's using.

> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 10:21 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PNG support...
> 
> 
> With 4.04 I had PNG working fine and could create images in a cron job I 
> was running.  When we upgraded to 4.06 we seemed to have lost the ability. 
>  While calling my PHP file up in the browser, it creates the image but my 
> cron job keeps failing with this error:
> 
> ImageCreateFromPng: No PNG support in this PHP build 
> 
> Anyone have any hints on how to fix this?
> 
> Jeff
> 

-- 
PHP General Mailing List (http://www.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] build button with php

2001-08-15 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

just output the proper HTML codes.



> -Original Message-
> From: nafiseh saberi [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 15, 2001 3:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] build button with php
> 
> 
> 
> hi.
> I want to build buttons with php
> and when click eavh of them ,
> one special work ,do for me.
> 
> how can I do it???
> 
> 
> best regards.
> nafiseh
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3rIJsaXTGgZdrSUEQIF7ACfau9m2CdHGcS53cQSWFPPT8eQENkAoOr5
MK3JVnUD5bSfDvxlnYrcFF2m
=xcnL
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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 real expert (geting outer files) *english/german*

2001-08-15 Thread scott [gts]

> -Original Message-
> From: Chris Hayes [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] need real expert (geting outer files)
> 
> hi Patrick,
> your question is not entirely clear. 
>  
> > I try to get a URL like: www.server.com?var=xyz
> 
> i would recommend www.server.com/x.php?var=xyz as with a link as 
> www.server.com you are relying on the server (by the way, which server do 
> you use and is the error only at home or only online or...?)  to find a 
> standard file in the root directory of www.server.com. And i'm not sure the 
> ?var=xyz is being passed on to that file then.

AFAIK, apache (at least) will honor this syntax and give
the arguments to the "index" file for the directory --
look in httpd.conf to find out what files are "index" files.

perhaps the problem with your script is that "index.php"
is not being loaded properly by apache (or does not exist)
etc. etc... (or perhaps you're not fread()ing enough of
the return data back into your script).

there could be a million things going on... but, as a first
step, take chris's suggestion and fully specify the filename
like so http://www.server.com/index.php?var=xyz


-- 
PHP General Mailing List (http://www.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] large external script to include in many pages

2001-08-13 Thread scott [gts]


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

here docs also work good for big blocks of text
(although interpolation will occur, which you might
not want)

$mytext = < -Original Message-
> From: Web Manager [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 13, 2001 3:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] large external script to include in many pages
>
>
> Hello,
>
> I am testing a new DHTML code for navigation menus. I plan to use it
> throughout my web pages made with PHP. The script is about 600 lines
> long!
>
> Beside making a :
>
> define (script1, "" .
> "" .
> "" .
> "");
>
> and calling the script1 name in my PHP pages...
>
> this will be very, very long, is there a another way to create a kind of
> variable ($myscript == 600 lines of the DHTML) that I could simply call
> out in all my pages. Something like a 

RE: [PHP] UPDATE syntax

2001-08-13 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

try this syntax:

UPDATE table SET col=value, col2=value2 ... WHERE ID=$id;

> -Original Message-
> From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 13, 2001 3:20 PM
> To: PHP
> Subject: [PHP] UPDATE syntax
> 
> 
> I have a database with 5 columns and cols 1,2,3 & 5 are filled.  I want 
> to insert into 4 and change 5.  Could I use an UPDATE command to do 
> this..  Here is what I have ==>
> 
> $query = "UPDATE mpn_asklee (Reply, Post) VALUES
> ('$Reply[$i]', '$post[$i]') WHERE ID = '$counts'";
> $result = mysql_query($query);
> 
> If Im talking jibberish, let me know..
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3gpWsaXTGgZdrSUEQIQhQCg2bPek8JQFQYtMsl0+ltUrYu1jVAAmwf4
FQP9++hgdLDuHup2v7aUij5n
=B6jL
-END PGP SIGNATURE-


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




RE: [PHP] new one is it ??

2001-08-13 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

you could, of course, throw a few sleep() stmnts in there
to get the script to output a few bytes every few seconds
and keep the connection active... :-)

> -Original Message-
> From: Scott Brown [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] new one is it ??
> 
> 
> Unfortunately, you're punishing the infected person, rather than the
> instigator of the worm.
> 
> I've read of people developing perl scriptlets that basically hold the
> connection open as long as possible by fooling the other side into thinking
> that it's got a host it's infecting... thereby slowing down the propagation
> of the worm.  The numbers I saw indicated that with version 1 of the worm,
> and it's 100 threads, holding a connection as long as possible before timing
> out (which is what, 5 minutes?) slows the propagation of the worm 265,000%
> 
> But (personally) I dont think it's appropriate to lash back against an
> infected machine (though a quick "why dont you patch your @#(*)( machines"
> to the network owner has been known to occur on occasion when I get hit by
> many many servers within a given netblock).
> 
> > -Original Message-
> > From: scott [gts] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, August 13, 2001 10:38 AM
> > To: php
> > Subject: RE: [PHP] new one is it ??
> >
> >
> >
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > what about something like this ?
> > (just configure apache to have PHP handle *.ida files)
> >
> >  > // this is so our script won't time out
> > set_time_limit(0);
> >
> > // how many bytes of junk to generate
> > $jsize = 1024 * 10;
> > // how many times to print $junk
> > $jout  = 1;
> >
> > // generate some random junk
> > $n = 0;
> > while ($n++ < $jsize) {
> > $junk .= chr( rand(1,200) );
> > }
> >
> > $i = 0;
> > while ( $i++ < $jout ) {
> > print $junk;
> > }
> >
> > ?>
> >
> > > -Original Message-
> > > From: Tim [mailto:[EMAIL PROTECTED]]
> > > Subject: Re: [PHP] new one is it ??
> > >
> > >
> > > Boy that looks familiar...my (apache) logs are full of 'em.
> > >
> > > I wonder if we can make a PHP script called default.ida
> > that sends back
> > > a big chunk of data and causes the worm to get a buffer
> > overflow? :) :)
> > >
> > > - Tim (glad I don't run IIS :)
> > >
> > > On 13 Aug 2001 22:27:06 +0800, Mark Lo wrote:
> > > > 208.251.146.123 - - [13/Aug/2001:22:24:27 +0800] "GET
> > > >
> > /default.ida?N
> > NN
> > > >
> > NN
> > NN
> > > >
> > NN
> > NN
> > > >
> > N%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u909
> > 0%u6858%ucbd3%
> > > >
> > u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u0
> > 000%u00=a
> > > > HTTP/1.0" 400 333 - "-" "-"
> >
> > -BEGIN PGP SIGNATURE-
> > Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
> >
> > iQA/AwUBO3fmM8aXTGgZdrSUEQKRAgCgrGf+r6Fma17L39tEVp8lwanC+FwAoJlz
> > l7k1s47s8EdDHnM+jLZzDuL2
> > =z2GG
> > -END PGP SIGNATURE-
> >
> >
> > --
> > PHP General Mailing List (http://www.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]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO3foz8aXTGgZdrSUEQITGQCgwxmL0KexmBSj+FBC4uyv6XXhr30AoJie
j67nEMhjOm2Jh8w4tLaofCSq
=CpO9
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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] Having trouble with PHP exec function calling CGI program

2001-08-13 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

it could be that the webserver chroot()'s to some "secure" path,
and thus your script cannot find `date`.

perhaps all you have to do is to copy the binaries
that you need into the "safe" directory (if you can
first find out where the server is chroot()ing to)

if you think that your server is doing this, 
read up on "sandboxing", it might help you get a better
picture of what's going on.

> -Original Message-
> From: Lara J. Fabans [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Having trouble with PHP exec function calling CGI
> 
> Hi, Tony,
> 
> I added in `date`;   to see if I could execute anything & nothing happened,
> so I fear this.
> Now all I need to do is read up on suid in the PHP manual.Thankfully,
> this is just a tool
> for the client, and not something the world will see.
> 
> Any other suggestions?
> 
> Lara

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3fnh8aXTGgZdrSUEQJRDACfdgGqeflDgZwq195fCsXnnDEUwNYAnjoR
Z6MO47A8h5YdcECWy9ANrJdb
=WoFm
-END PGP SIGNATURE-


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




RE: [PHP] The secrecy of PHP code

2001-08-13 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

they are kinda safe if the webserver is the only way that
your files can be viewed if people can log into the
machine, they could just view the plaintext of your PHP
script.

hint: security thru obscurity is not secure.

> -Original Message-
> From: James Shaker [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] The secrecy of PHP code
> 
> Greetings,
> 
> How safe is the code written in PHP?  For instance, if I have an equation or
> some algorithm with some constants for calculations and I code them in PHP
> for use on a website are they safe from being viewed or taken?
> 
> Thanks
> James

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3fmwMaXTGgZdrSUEQLANQCg5dnsmDdp9rouyXmk1Wuy7/NHd3YAoIBs
A2zlBYvpjbk/K35h54V97r/x
=+Sy4
-END PGP SIGNATURE-


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




RE: [PHP] new one is it ??

2001-08-13 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

what about something like this ?
(just configure apache to have PHP handle *.ida files)



> -Original Message-
> From: Tim [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] new one is it ??
> 
> 
> Boy that looks familiar...my (apache) logs are full of 'em.
> 
> I wonder if we can make a PHP script called default.ida that sends back
> a big chunk of data and causes the worm to get a buffer overflow? :) :)
> 
> - Tim (glad I don't run IIS :)
> 
> On 13 Aug 2001 22:27:06 +0800, Mark Lo wrote:
> > 208.251.146.123 - - [13/Aug/2001:22:24:27 +0800] "GET
> > /default.ida?NNN
> > 
> > 
> > N%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%
> > u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u%u00=a
> > HTTP/1.0" 400 333 - "-" "-"

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3fmM8aXTGgZdrSUEQKRAgCgrGf+r6Fma17L39tEVp8lwanC+FwAoJlz
l7k1s47s8EdDHnM+jLZzDuL2
=z2GG
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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 in corporate settings?

2001-08-09 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

a big reason i use PHP as much as i do is becuase of
the excellent documentation and ease of finding it all...


> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 1:02 PM
> To: Rasmus Lerdorf; Sean C. McCarthy
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP in corporate settings?
> 
> 
> Yes I had wondered if someone was going to make that claim :)
> 
> So far I haven't seen much in perl or Java that I CAN'T do in PHP.  The user
> community is much more helpful, the PHP manual online is IMO simply amazing.
> I love that guide :)
> 
> I just rarely see any jobs posted for PHP.  Mostly ASP and Java.
> 
> Jeff
> 
> - Original Message -
> From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
> To: "Sean C. McCarthy" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, August 09, 2001 12:20 PM
> Subject: Re: [PHP] PHP in corporate settings?
> 
> 
> > > Just one point Java is actually open source, because you can get the
> > > source code for the JVM. It is not GPL what means that if you want to
> > > make money with it you have to pay for it (but after all Sun is a
> > > bussiness, and bussiness are for making money).
> >
> > Access to source code has very little to do with being "Open Source".
> > Access to source code is 1 out of 9 requirements for something to be open
> > source.  Please see http://www.opensource.org/docs/definition.html
> >
> > -Rasmus
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3LXhMaXTGgZdrSUEQJfmACfY9aepUvwf1fl7VJbFJwk1OEvdR4AnRDF
i3qL9uw4YnlYFAS+UjXyRtX2
=yQlA
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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] Copy function usage ?

2001-08-09 Thread scott [gts]


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

look in httpd.conf to get the user name,
then chown the directory to that user

ex.

chown apache:apache ./dir/
chmod 755 ./dir/

and make sure that you change permissions to all
files that you write into the directory to be
read-write only (not executable),
chown 644 filename

and that you put newly uploaded files into a
directory *outside* the document root of your
webserver (so some random person cannot just
upload any random file to your server and have
immediate access to it)


> -Original Message-
> From: Jon Farmer [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 11:41 AM
> To: Tamas Bucsu; [EMAIL PROTECTED]
> Subject: RE: [PHP] Copy function usage ?
>
>
> You need to make sure that what ever user the webserver/php runs under has
> permissions to read from the source folder/file and write permission for the
> destination folder/file.
>
> Common users for apache/php are "nobody" or "apache"
>
> regards
>
> Jon
>
> Jon Farmer
> Systems Programmer
> Entanet International Ltd www.enta.net
> Tel 01952 428969
> Mob 07968 524175
>
> -Original Message-
> From: Tamas Bucsu [mailto:[EMAIL PROTECTED]]
> Sent: 09 August 2001 16:36
> To: [EMAIL PROTECTED]
> Subject: [PHP] Copy function usage ?
>
>
> Hi guys,
>
> I have a problem that's killin' me. As I'm not very good at Linux I don't
> know how to set the properties of the folder pics to be able to use the copy
> function. (If I'm right and the problem is not some else) Please help.
> Here's the code:
>
> if (file_exists($userfile)) {
> copy("$userfile","pics/".$userfile);
> } else {
> echo "Nem sikerül a következõ file-t feltölteni:".$userfile;
> }
>
> thx
>
> Tamas Bucsu
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO3KwG8aXTGgZdrSUEQLcsACfaWVByz/Q+Tu5WZgWp+JkwZ+mkOMAnRlG
TTQNXq4GlF6pDxl+ufAbNoZw
=1pnp
-END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.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] regexps

2001-08-08 Thread scott [gts]

here are two regexps that might do what you want

"\w" matches alphanum (1-9a-zA-z)

IMO, the best way to check for non-alphanum chars is
to check for "\W" (upper case is negation of alphanum,
which will match only non-alphanum).



if (preg_match('/^\w+$/', $data)) {
print "entirely alphanum
}
if (preg_match('/\W+/', $data)) {
print "Contains non-alphanum!!";
}


> -Original Message-
> From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 08, 2001 4:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] regexps
> 
> 
> i need to find out if a string (user imputed) conatins numbers.  I want 
> only a-zA-Z to be in a field.  (their name for exampleand city)...i 
> have the following however my regexps are VERY weak as i am a beginner.
> 
> function validatetext($text){
>   if  (is_string($text)== 1){
>   return "good";
>   }else{
>   return "bad";
>   }
> }
> 
> ~kurth
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Spot the difference?

2001-08-03 Thread scott [gts]

ASP is basically like PHP, only it uses a VB-based
language instead of perl/c-based one.

which means it sucks - vb is evil.

> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Spot the difference?
> 
> isnt this fact a good enough reason to believe it worthless???
> 


-- 
PHP General Mailing List (http://www.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] <----- BEING AN ASS CLICK HERE NOT ABOVE!!!!!

2001-08-03 Thread scott [gts]

and since you're running Win32, i'd *highly* suggest
running apache to a service... so that you dont have 
to spawn a console window everytime you want to 
use your webserver.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 5:52 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] <- BEING AN ASS CLICK HERE NOT ABOVE!
> 
> 
> Oops, Correction - You'll need to run apache first, leave it running, and
> then try the below.
> 
> not enough coffee today...
> 
> -Original Message-
> From: Sheed, Lawrence -SHNGI -AG 
> Sent: August 2, 2001 5:51 PM
> To: 'Kyle Smith'; [EMAIL PROTECTED]
> Subject: RE: [PHP] <- BEING AN ASS CLICK HERE NOT ABOVE!
> 
> 
> Kyle,
> 
> Apache runs as a background program.
> 
> When you've installed apache, and php, you don't actually run them from the
> commmand line.
> 
> What you have to do is open up a browser window, and point it to your
> computer.
> 
> Open up Internet Explorer (you're running windows it looks like),
> 
> and type in  http://127.0.0.1  or http://localhost
> 
> This should bring up a screen saying you've installed apache correctly.
> 
> If apache is installed in the default directories, then most likely you'll
> need to put some webpages into
> 
> c:\apache\htdocs
> 
> I would recommend making a file called test.php with the following lines in
> 
>  
> phpinfo();
> 
> ?>
> 
> Save it into c:\apache\htdocs
> 
> now go to your webbrowser, and go to  http://localhost/test.php
> 
> If php shows the phpinfo screen then you've installed everything correctly.
> If it doesn't work, we'll need to look at your apache settings and php
> settings.  Try the stuff above first, then tell me what happens.
> 
> Cheers,
> 
> Lawrence.
> 
> -Original Message-
> From: Kyle Smith [mailto:[EMAIL PROTECTED]]
> Sent: August 3, 2001 1:46 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] <- BEING AN ASS CLICK HERE NOT ABOVE!
> 
> 
> (the damn thing took my attatchement off!!!)
> 
> Ok I have installed PHPTriad, when i run apache (gulp) dos opens, all fine
> BUT when i run PHP.exe well look down
> 
> http://www.stupeedstudios.f2s.com/probs.gif
> 
> 
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
> 
> ICQ: 115852509
> MSN: [EMAIL PROTECTED]
> AIM: legokiller666
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] How to Compare dates?

2001-08-03 Thread scott [gts]

or, if the field is a MySQL DATE field, try comparing to
"-00-00", since that's what a blank date defaults to.


> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 10:34 AM
> To: Jack Sasportas
> Cc: php
> Subject: Re: [PHP] How to Compare dates?
> 
> 
> > if ( (  mysql_result($db_result,$db_record,'order_date')=00)
> 
> Uh, huh?  Just try ==0 there.  Not =000
> 
> -Rasmus
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Oh and one more thing

2001-08-02 Thread scott [gts]

it's a little bit complicated, but here goes.

1) format your harddrive
2) take out your motherboard and spraypaint it
bright orange.
3) dance around the desk three times holding the
motherboard above your head chanting
"mail mail, give me mail"
"date date, give me date"
"ga booga woooga shooga"
4) install linux 
5) install apache
6) install PHP


> -Original Message-
> From: Kyle Smith [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 8:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Oh and one more thing
> 
> 
> How do i set up extra functions on my computer like mail() and date()
> 
> 
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
> 
> ICQ: 115852509
> MSN: [EMAIL PROTECTED]
> AIM: legokiller666
> 
> 
> 

-- 
PHP General Mailing List (http://www.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] Q: Hiding Folder Directories from public while still...

2001-08-02 Thread scott [gts]

if you're using apache, there's a *much* easier/secure way
of doing this.

setup an .htaccess file to restrict access to certain
username/passwords.

check out both:
man htaccess
man htpasswd


> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 1:34 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Q: Hiding Folder Directories from public while
> still...
> 
> 
> i dont know if this is elagant but ti works.  but a fake index.htmlin your
> directory for browsers to default to.   . ..
> 
> 
> - Original Message -
> From: "Marcus James Christian" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, August 03, 2001 12:30 AM
> Subject: [PHP] Q: Hiding Folder Directories from public while still...
> 
> 
> > Hello,
> >
> > How does one do the trick of hiding a  folder's directory listing from a
> > public browser?
> >
> > i.e.  Lets say the full address is  www.mysite.com/php/magicphppage.php
> >
> > Well I still need some other files to read and write to
> > magicphppage.php   I don't want the public to be able to simply type
> > www.mysite.com/php/ and have all of my php files show up on a funky
> > "virtual directory".
> >
> > Thanks,
> > Marcus
> >
> > --
> > Marcus James Christian - UNLIMITED -
> > Multimedia Internet Design
> > http://mjchristianunlimited.com
> >
> > Proudly presents the music of CHROMATICUS
> > at http://chromaticus.com
> > and http://artists.mp3s.com/artists/275/chromaticus.html
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] How to Compare dates?

2001-08-02 Thread scott [gts]

it also appears that you're checking for the same thing
over and over and over

'0' is the same as "0"
and 00 is the same as 0
and "00" is the same as '00'

try checking for either 0 or "-00-00"


> -Original Message-
> From: Tim [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 12:23 PM
> To: Jack Sasportas
> Cc: php
> Subject: Re: [PHP] How to Compare dates?
> 
> 
> To my eyeballs, it looks like you have too many closing parenthesis on
> all of those examples.
> 
> - Tim
> 
> On 02 Aug 2001 12:08:22 -0400, Jack Sasportas wrote:
> > OK I actually tried several things prior to the post, here are some of them and
> > the errors
> > 
> > if ( (  mysql_result($db_result,$db_record,'order_date')==0) ) ) {
> > if ( (  mysql_result($db_result,$db_record,'order_date')=="0") ) ) {
> > if ( (  mysql_result($db_result,$db_record,'order_date')=='0') ) ) {
> > -or-
> > if ( (  mysql_result($db_result,$db_record,'order_date')=="00") ) )
> > {
> > if ( (  mysql_result($db_result,$db_record,'order_date')==00) ) ) {
> > -or-
> > if ( (
> > mysql_result($db_result,$db_record,'order_date')==strtotime("00")) )
> > ) {
> > 
> > Parse error is the result in all these attempts...with quotes, single or double,
> > no quotes, zero or multiple zeros...by the way the timestamp returns all those
> > zeros so I was being specific
> > 
> > Any ideas ?
> > 
> > Thanks !
> > 
> > 
> > 
> > 
> > 
> > "Johnson, Kirk" wrote:
> > 
> > > > Can someone tell me how to properly compare the value
> > > > returned from the
> > > > db to see if it is blank ?
> > >
> > > > if ( (
> > > > mysql_result($db_result,$db_record,'order_date')=00)
> > > > ) ) {
> > >
> > > Two things, Jack. Enclose 00 in quotes, since it is a string,
> > > but more importantly, use '==' instead of '=' for comparison. I hate it when
> > > I do that :)
> > >
> > > Kirk
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > 
> > --
> > ___
> > Jack Sasportas
> > Innovative Internet Solutions
> > Phone 305.665.2500
> > Fax 305.665.2551
> > www.innovativeinternet.com
> > www.web56.net
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.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] Replacing template variables with values?

2001-08-02 Thread scott [gts]

try using single quotes :

preg_replace("/\$(\w+)/e", '${$1}', $template);

> -Original Message-
> From: Ryan Fischer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 6:37 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Replacing template variables with values?
> 
> 
> Hello!  :)
> 
> I have a form with a textarea that contains a template e-mail with
> variables in it.  I would like to be able to replace those variables
> with values.  The variables named in the template are actual variables
> in my script.  This doesn't seem to work:
> 
> $newmail = preg_replace("/\$(\w+)/e", ${$1}, $template);
> 
> ...and neither does anything I've tried to do as far as eval() goes.  I
> either get a parse error like this:
> 
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> c:\path\file.php on line 16
> 
> ...or some other sort of eval() error.  Any ideas?  TIA!  :)
> 
> --
>  -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Installing PHP probs

2001-08-01 Thread scott [gts]

you dont have to have a server running.

just use the CGI binary.

...and if you're using windows - why not just use apache...
it's free, easier to install/configure than PWS (yech!)
and it has *MUCH* better documentation and support
than microsoft can ever offer.  :-)



> -Original Message-
> From: Matt Greer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 3:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Installing PHP probs
> 
> 
> on 8/1/01 9:57 PM, Kyle Smith at [EMAIL PROTECTED] wrote:
> 
> > well what if i want to set up the computer im using to be able to run php
> > acripts, but NOT be an internet server?
> > 
> You can't. You need a webserver on your computer to run php locally. If
> you're running windows98/me you can use Personal Web Server, which is free
> and included on your Win98/me cd. It's no big deal once its set up, you
> still see the scripts' output through your web browser. You can forget about
> the web server once its in place and working.
> 
> 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]
> 

-- 
PHP General Mailing List (http://www.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 INSTALL (please, im too young to die!!!)

2001-08-01 Thread scott [gts]

get the windows ZIP

> -Original Message-
> From: Kyle Smith [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 11:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP INSTALL (please, im too young to die!!!)
> 
> 
> ok i really need to get this sorted quickly so could somebody please tell 
> me which of the below (taken off php.net) i should download to install PHP 
> on my WIN ME comeputer (im not using my computer as an insternet server i 
> need it to test scripts)
> 
> Complete Source Code
>   a.. PHP 4.0.6 [3,083Kb] - 23 June 2001 
> Win32 Binaries
>   a.. PHP 4.0.6 zip package [4,859Kb] - 23 June 2001
>   (CGI binary plus server API versions for Apache, AOLserver, ISAPI and 
> NSAPI. MySQL support built-in, many extensions included, packaged as zip) 
>   b.. PHP 4.0.6 installer [755Kb] - 23 June 2001
>   (CGI only, MySQL support built-in, packaged as Windows installer to 
> install and configure PHP, and automatically configure IIS, PWS and 
> Xitami, with manual configuration for other servers. N.B. no external 
> extensions included) 
> Patches
>   a.. PHP 4.0.6 memory limit fix [0Kb] - 1 July 2001
>   (This patch fixes a bug in the 4.0.6 memory limit option. This is only 
> needed when configuring PHP with --enable-memory-limit). If you have 
> problems applying the patch try using GNU patch. 
> 
> 
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
> 
> ICQ: 115852509
> MSN: [EMAIL PROTECTED]
> AIM: legokiller666
> 
> 
> 

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




RE: [PHP] Re: How can I make a Loading... screen?

2001-08-01 Thread scott [gts]

make the same window say "Loading"?

not unless you used DHTML to create an IFRAME
or DIV or some similar HMTL element (i havent
kept up on DHTML, so i dont know exactly what
you'd need to use).

set it to be the entire size of the browser
width and height = 100%, then, at the bottom
of the page, put in a javascript statement
to hide it.

i did something very similar to this once,
and i don't reccomend it.  it's a bad kludge...

but it does work, so definately check it out
if really want to have the "Loading" message
in the same browser window as the document
that's being loaded

my suggestion is to start with IFRAME, DIV, and FRAME
HTML elements and experiment.


> -Original Message-
> From: Michael Champagne [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Re: How can I make a Loading... screen?
> 
> 
> Thanks for the response.  The only problem is that the page that I'm waiting
> on is already a popped up window, so I'd hate to open up another popup window
> on top of that to say that the first one is loading.  Is there a way to do
> this within the same window?
> 
> Thanks!
> Mike
> 
> > I did this myself, for the exact same reason.  First I define this
> > javascript in my page:
> >
> > function itsThinkingOpen() {
> >
> > imgWindow=window.open("thinking.htm","thinkingWindow","toolbar=no,scrollbars
> > =no,resizable=no,width=400,height=200");
> > }
> >
> > function itsThinkingClose() {
> >  imgWindow.close();
> > }
> >
> > and then at the beginning of the page, before the search begins, in php I
> > put
> >   echo "itsThinkingOpen()";
> >
> > and after the code to search the database I put
> >   echo "itsThinkingClose()";
> >
> > It works fine here.
> >
> > Keith Jeffery
> > [EMAIL PROTECTED]
> >
> > "Michael Champagne" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I have a popup window that populates a table with rows from a database and
> > it
> > > normally takes about 15 to 20 seconds to load.  Does anyone know how I can
> > > display a 'Loading... Please Wait.' that will disappear once the data
> > comes
> > > up?
> > >
> > > Thanks in advance for any responses,
> > > Mike
> > >
> > >
> > >
> > > **
> > > This communication is for informational purposes only.  It is not
> > > intended as an offer or solicitation for the purchase or sale of
> > > any financial instrument or as an official confirmation of any
> > > transaction, unless specifically agreed otherwise.  All market
> > > prices, data and other information are not warranted as to
> > > completeness or accuracy and are subject to change without
> > > notice.  Any comments or statements made herein do not
> > > necessarily reflect the views or opinions of Capital Institutional
> > > Services, Inc.  Capital Institutional Services, Inc. accepts no
> > > liability for any errors or omissions arising as a result of
> > > transmission.  Use of this communication by other than intended
> > > recipients is prohibited.
> > > **
> >
> >
> >
> >
> 
> -- 
> Michael Champagne, Software Engineer
> Capital Institutional Services, Inc.
> wk: [EMAIL PROTECTED]
> hm: [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] How can I make a Loading... screen?

2001-08-01 Thread scott [gts]

use javascript.

put this at the top of your big document:
var waitwin = window.open( ... );

and this at the end:
waitwin.close();


you might have to double-check the syntax,
as i dont really use javascript too often,
but that should work fine.

> -Original Message-
> From: Michael Champagne [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 2:01 PM
> To: PHP General Mailing List
> Subject: [PHP] How can I make a Loading... screen?
> 
> 
> I have a popup window that populates a table with rows from a database and it
> normally takes about 15 to 20 seconds to load.  Does anyone know how I can
> display a 'Loading... Please Wait.' that will disappear once the data comes
> up?
> 
> Thanks in advance for any responses,
> Mike
> 
> 
> 
> **
> This communication is for informational purposes only.  It is not
> intended as an offer or solicitation for the purchase or sale of 
> any financial instrument or as an official confirmation of any 
> transaction, unless specifically agreed otherwise.  All market 
> prices, data and other information are not warranted as to 
> completeness or accuracy and are subject to change without
> notice.  Any comments or statements made herein do not 
> necessarily reflect the views or opinions of Capital Institutional
> Services, Inc.  Capital Institutional Services, Inc. accepts no
> liability for any errors or omissions arising as a result of
> transmission.  Use of this communication by other than intended
> recipients is prohibited.
> **
> 
> -- 
> PHP General Mailing List (http://www.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] Installing PHP probs

2001-08-01 Thread scott [gts]

it's a piece of cake for windows... two steps:

1)
download the .EXE and double-click on it
or
download the .ZIP and unzip it somewhere
  (usually C:\php)

2) configure & restart your webserver

if you download the .EXE it'll configure
any non-apache server for you.  if you use
apache, you'll have to configure a few
things manually.

read the README and INSTALL files and documents
and things... all the info you really need is
in the documentation... 


> -Original Message-
> From: Kyle Smith [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 9:26 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Installing PHP probs
> 
> 
> Can someone quide me through the process of installing PHP on a windows 
> system (my computer) because ive followed what it says in the doc files 
> but it doesnt work so anyone who has done it, please help!
> 
> 
> -lk6-
> http://www.StupeedStudios.f2s.com
> Home of the burning lego man!
> 
> ICQ: 115852509
> MSN: [EMAIL PROTECTED]
> AIM: legokiller666
> 
> 
> 

-- 
PHP General Mailing List (http://www.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] Testing if Scripting has been disabled

2001-08-01 Thread scott [gts]

not at all.  the only kind of "scripting" that the
client controlls is client-side scripting.  browsers
do not have any control over server-side scripting.

PHP, Perl, C++, etc. are server-side.
Javascript is client-side.

if you disable scripting in MSIE, absolutely
nothing related with PHP will be affected, but
javascript will not work...

that's why i asked for a better definition of
your question - becuase "Scripting" can mean
so many different things.

PS: just remember that client and server are
completely separate.

> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Testing if Scripting has been disabled
> 
> Well, yes, but if I disable scripting in I.E., won't PHP scripts not work as
> well?
>
> - Original Message -
> From: "scott [gts]" <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Testing if Scripting has been disabled
> 
> > "Scripting" is a rather large word...
> >
> > do you mean javascript?
> >
> > > -Original Message-
> > > From: Don [mailto:[EMAIL PROTECTED]]
> > > Subject: [PHP] Testing if Scripting has been disabled
> > >
> > > Is there a method to test if Scripting has been disabled in the browser?
> > >
> > > Thanks,
> > > Don


-- 
PHP General Mailing List (http://www.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] SQL syntax error in PHP script. dunno what's wrong

2001-08-01 Thread scott [gts]

no offense to you sam, but please dont ever simply place
single quotes around values.  you have to escape the values
*themselves*.

what if someone submitted the form field title as:
$title = "'; DELETE FROM seminar; "

if you didn't escape the single quotes in there, it
would get interpreted as a valid DELETE statement
and your seminar table would get wiped.

however, if you escaped $title, you'd end up setting
title to "\'; DELETE FROM SEMINAR; " 
(rather than have the contents of $title interpreted
as SQL commands)

> -Original Message-
> From: Sam Masiello [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] SQL syntax error in PHP script. dunno what's wrong 
> 
> 
> You will need to put single quotes around your variables in your SQL
> statement.  Like this:
> 
> $sql = "UPDATE TABLE seminar SET
> title='$title',speaker='$speaker',event_date='$tdate',time='$time',bldg='$bu
> ilding'
> ,rm='$room'  WHERE id='$id'";
> 
> Without the quotes, SQL doesn't know that Something Amazing is supposed to
> go together in the same string.
> 
> HTH


-- 
PHP General Mailing List (http://www.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] Testing if Scripting has been disabled

2001-08-01 Thread scott [gts]

"Scripting" is a rather large word...

do you mean javascript?

> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 12:58 PM
> To: php list
> Subject: [PHP] Testing if Scripting has been disabled
> 
> 
> Is there a method to test if Scripting has been disabled in the browser?
> 
> Thanks,
> Don
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] Re: Hmmm?

2001-08-01 Thread scott [gts]

oh man... it gives me such a headache when i have
to try and make sense of scripts with no indentation
(or arbitrary indentation)... 

it's always fun dealing with things like this  :-)

if ($this){
print "
hi
  ";}
  else {print "
bye
";
}

> -Original Message-
> From: Fredrik Arild Takle [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 12:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Hmmm?
> 
> 
> I think it's impossible to read/understand my own scripts if i don't do it.
> 
> Do:
> 
>if ($submit) {
> echo "Counting from 1-32";
> for ($ii = '1'; $ii <= '32' $ii++) {
>   echo $ii." ";
> }
>   }
>   echo "All done!";
> ?>
> 
> instead of:
> 
>  if ($submit) {
> echo "Counting from 1-32";
> for ($ii = '1'; $ii <= '32' $ii++) {
> echo $ii." ";
> }
> }
> echo "All done!";
> ?>
> 
> Best Regards
> Fredrik A. Takle
> 
> "Keith Jeffery" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Simply indent formatting for readability.  I personally don't indent after
> > the  >
> >
> > "Kyle Smith" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Whenever i get a php script off a website why is it that most of the main
> > parts in the script have a space from the left border. eg
> >
> >  > echo"spazzz";
> > ?>
> >
> > 
> >
> > -lk6-
> > http://www.StupeedStudios.f2s.com
> > Home of the burning lego man!
> >
> > ICQ: 115852509
> > MSN: [EMAIL PROTECTED]
> > AIM: legokiller666
> >
> >
> >
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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] env var

2001-08-01 Thread scott [gts]

a lot of people send the reply to the list and
Cc: a copy to the sender so you end up getting
two copies.

> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 12:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] env var
> 
> 
> thanks dave and phillip,
> (accidentally emailed dave instead of the list the first time)
> 
> i found it in the manual just before i got the messages.
> 
> is there a reson i get soem of these twice  is it the fault of the
> people sending them?  the list?  or my mail program???
> 
> 
> 
> - Original Message -
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Jon Yaggie" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 01, 2001 11:36 PM
> Subject: Re: [PHP] env var
> 
> 
> > See :
> >
> >   http://www.php.net/manual/en/ref.session.php
> >
> > Note the use of $HTTP_SESSION_VARS within the examples, this may be what
> > you're referring to.
> >
> > Regards,
> > Philip
> >
> >
> > On Wed, 1 Aug 2001, Jon Yaggie wrote:
> >
> > > is there not an array that saves all session variables?  I just got
> > > done looking for it and though i am sure there is a list of all these
> > > variable i am not sure where (it is not in my info file).  thanks
> > >
> > >
> > > btw if you are the RTM (RTF(antastic)M) guy no need reply.
> > >
> > >
> > >
> > >
> > >
> > > Thank You,
> > >
> > > Jon Yaggie
> > > www.design-monster.com
> > >
> > > And they were singing . . .
> > >
> > > '100 little bugs in the code
> > > 100 bugs in the code
> > > fix one bug, compile it again
> > > 101 little bugs in the code
> > >
> > > 101 little bugs in the code . . .'
> > >
> > > And it continued until they reached 0
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.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] SQL syntax error in PHP script. dunno what's wrong

2001-08-01 Thread scott [gts]

*always always always* quote everything in SQL statements.
you run the risk of letting people insert arbitrary 
SQL statements into your script if you dont quote values.

if you're using MySQL, try mysql_escape_string
http://php.net/manual/en/function.mysql-escape-string.php

or you could roll your own with relative ease:

function db_quote($value) {
return "'". preg_replace("/'/", "''", $value) ."'"
}


> -Original Message-
> From: Matt Greer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 12:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] SQL syntax error in PHP script. dunno what's wrong 
> 
> 
> on 8/1/01 11:35 AM, Chris Worth at [EMAIL PROTECTED] wrote:
> 
> > 
> > 
> > hey gang. 
> > 
> > here is my sql statement from my php script.
> > 
> > $sql = "UPDATE TABLE seminar SET
> > title=$title,speaker=$speaker,event_date=$tdate,time=$time,bldg=$building
> > ,rm=$room  WHERE id=$id";
> >
> 
> strings in a mysql query need to be quoted. So change it to
> 
> $sql = "UPDATE TABLE seminar SET title='$title',speaker='$speaker',...";
> 
> 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]
> 

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




RE: [PHP] Re: FAQ

2001-08-01 Thread scott [gts]

and adding a little explanation of the 
http://php.net/function syntax for searching
the php.net site would be a big help too. 


> -Original Message-
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 11:32 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: FAQ
> 
> 
> > I know of 3 php faqs (I know there are tons), maybe we should 
> > make a faq on how to
> > find faqs? :)
> > 
> > http://alt-php-faq.org/
> > http://www.php.net/manual/en/faq.php
> > http://php.faqts.com
> 
> Rasmus, do you think there would be any value in adding these 3 links to the
> "PHP General Mailing List" trailer that is added to each post?
> 
> Just a thought.
> 
> Kirk
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] Re: issues with __sleep() and __wakeup()

2001-08-01 Thread scott [gts]

i added a (hopefully helpfull) addition to the
online notes regarding magic-functions:
http://www.php.net/manual/en/language.oop.magic-functions.php

Here's what i posted, if anyone's interested:

Here is a sample class and some test statements to 
demonstrate how __sleep() is used. 

If you do not return anything from __sleep(), your 
object will *not* be serialized. You must return 
something from __sleep() to tell serialize what 
to serialize. 

svar['Hello'] = "World"; 
} 

function __sleep() { 
  $this->svar['Hello'] = "Yawn"; 
  // return list of instance-variables to be serialized 
  return array('error', 'svar'); 
} 

function __wakeup() { 
  $this->svar['test'] = "I'm here!"; 
} 

}// end class 
?>


> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 3:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: issues with __sleep() and __wakeup()
> 
> 
> > class Scott {
> >   var $svar = array(); // free-form hash for whatever data
> >   function Scott( )
> >   {
> > return $this;
> 
> Like, I don't think you're supposed to return $this from your constructor...
> 
> >   }
> >   function __sleep()
> >   {
> 
> According to the manual, this is supposed to return an array of the variable
> names you want serialized.
> 
> return(array('svar'));
> 
> in this case, I think, would be what you want...
> 
> >   }
> >   function __wakeup()
> >   {
> > $this->svar['sleep'] = "I am waking up";
> >   }
> > }// end class
> 
> Once you get it working, post your sample to the User Contributed notes
> please :-)
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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 and push buttons

2001-08-01 Thread scott [gts]

if i understand your question correctly, this should help... 

name the buttons different things





then, even thought the form is posted to one place,
you can determine which button the user pressed by
checking the value of $action;

> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 11:16 AM
> To: php list
> Subject: [PHP] PHP and push buttons
> 
> 
> Hi,
> 
> How do I make a Push Button call a PHP script?  This is not a POST operation
> per say as I already have "Submit" and "Reset" buttons.
> 
> What I'd like is to have my third button call a PHP script and process all
> the form data in an alternative manner to what the "Submit" does.  As a FORM
> tag can only have one POST operation, I'm in a quandary here.
> 
> Thanks,
> Don
> 
> 
> -- 
> PHP General Mailing List (http://www.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] writing while reading

2001-08-01 Thread scott [gts]

try only locking the file on a write, *not* on a read.
you are going to have many times more reads than writes,
even on the busiest day 

what you need to have is a blocking-lock your writes
and not bother with locks for reading.

the way you have it setup now, there's no locking
for writes, so you could definately have two instances
of PHP trying to write to the same file simultaneously
and corrupt your data.

besides, if you lock only for writing, and not for
reading, you can read the file while it's being written -
but you can never write twice.

> -Original Message-
> From: Rui Barreiros [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] writing while reading
>   hi all,
> 
>   i'm writing a web chat, the frame that presents the text, has a very fast 
> refresh (has to) it's about from 2 in 2 seconds, my problem is writing to the 
> file (chat is file based), when the refresh read the file, it doesn't let php 
> write. i made comething like this.
> 
> Function chat2file($filename, $str) {
>   $fp = fopen("chats/$filename", "a");
>   fputs($fp, $str);
>   close($fp);
> }
> 
> Function file2chat($filename) {
>   if(file_exists("chats/$filename")) {
> $fd = fopen("chats/$filename", "r");
> flock($fd, LOCK_UN);
> $content = fread($fd, filesize("chats/$filename"));
> fclose($fd);
> return $content;
>   } else {
> return "";
>   }
> }
> 
> i put the non blocking option in flock while reading but still blocks and 
> doesn't write, my question is it possible to write to a file while reading?!, 
> if so how?
> 
> thx.


-- 
PHP General Mailing List (http://www.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] Example high-profile PHP sites

2001-08-01 Thread scott [gts]

www.audiogalaxy.com is almost entirely PHP


> -Original Message-
> From: CC Zona [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 4:57 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Example high-profile PHP sites
> 
> 
> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Ralph Guzman) wrote:
> 
> > Incase you still need it. Here is a big one I forgot to mention:
> > 
> > http://www.dialpad.com/
> > 
> > Not sure how much of their site is PHP, but their user registration and
> > member backend is PHP driven.
> 
> Entertainment site thewb.com uses PHP for the interactive areas (mesage 
> boards, polls, etc.).
> 
> -- 
> CC
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.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] Visual Login

2001-08-01 Thread scott [gts]

if you go this route, you would, however, have to check
for valid-login users on every page that you want to
have security on.

> -Original Message-
> From: Ben Bleything [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] Visual Login
> 
> One way would be to use a database (of any type) to store
> username/password data, present the user with a form to fill out,
> authenticate against the database, set session variable if they are
> valid, and let them use the application.. if they fail, do whatever.
> 
> =>  EXTREMELY brief.  Can give more detail if you like =>
> 
> Ben


-- 
PHP General Mailing List (http://www.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] Attitude of B van Ouwerkerk

2001-08-01 Thread scott [gts]

so now it's shifted from his attitude to your seeming
inability to cope with "words related to sexual intercourse"?

we all need to calm down and relax.

> -Original Message-
> From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Attitude of B van Ouwerkerk
> 
> B. van Ouwerkerk wrote:
> > Ask yourself.. who has an attitude problem here.. Someone who didn't
> > read the manual.. or someone (/me) who wrote to RTFM.
> 
> You didn't even RTFM him. I found it to be more like RTM, the more 
> gentle version (the one without words connected to sexual intercourse).
> Your answer was short, but not harsh. I thought so, anyway.
> 
> regards
> Wagner

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




RE: [PHP] Re: issues with __sleep() and __wakeup()

2001-08-01 Thread scott [gts]

> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 3:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: issues with __sleep() and __wakeup()
> 
> 
> > class Scott {
> >   var $svar = array(); // free-form hash for whatever data
> >   function Scott( )
> >   {
> > return $this;
> 
> Like, I don't think you're supposed to return $this from your constructor...

thanks for letting me know, it's an outdated habit from perl...
 
> >   }
> >   function __sleep()
> >   {
> 
> According to the manual, this is supposed to return an array of the variable
> names you want serialized.
> 
> return(array('svar'));

so it seems that there's no way to specify *all* my
variables without naming them explicitly in __sleep() ?
 
> in this case, I think, would be what you want...
> 
> >   }
> >   function __wakeup()
> >   {
> > $this->svar['sleep'] = "I am waking up";
> >   }
> > }// end class
> 
> Once you get it working, post your sample to the User Contributed notes
> please :-)

i definately will.

thanks for the suggestions everyone.

-- 
PHP General Mailing List (http://www.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] references... found it

2001-07-31 Thread scott [gts]

im sorry, but i was trying to do that the hard
way.  i figured out how to execute a function
name in a variable.

$x ="test";

print "Hello: $x\n\n";

$x();

function test() {
print "yee haw";
}

-- 
PHP General Mailing List (http://www.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] references

2001-07-31 Thread scott [gts]

i've been reading over the docs on references, and i
can't see anyway to pass around functions as references.
i know how to do this easily with perl, but i cannot
seem to find the correct syntax for creating a reference
to a function in PHP.

what i'd like to do is something like this:

// X is now a reference to test() 
// but i dont want test() to be executed now
$x =& test();

// Now, i want to execute test() with 
// something like this and see "Hello World"
&$x();

function test() {
print "Hello World";
}

any and all help is appreciated.
thanks a lot.

-- 
PHP General Mailing List (http://www.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] issues with __sleep() and __wakeup()

2001-07-31 Thread scott [gts]

I am having a problem with __sleep();
there mere existance of it is causing my object
to not get serialized at all.  __wakeup() works fine.

i am using PHP v4.0.6 / apache / win2k.

If i keep __sleep() in the object, it will not serialize,
but if i remove it, it serialized fine.  Does anyone
know why this happens?

Here's my object:

class Scott {
  var $svar = array();  // free-form hash for whatever data
  function Scott( )
  {
return $this;
  }
  function __sleep() 
  {
  }
  function __wakeup() 
  {
$this->svar['sleep'] = "I am waking up";
  }
}// end class


and now a test script

require_once('class.Scott.php');

$scott = new Scott();
$scott->svar['blah'] = "bacon";

print "object = ". $scott ."\n";
print "blah = ". $scott->svar['blah'] ."\n";
print "\n";

// serialize
$ser = serialize($scott);
print "serialized = ". $ser ."\n";

// trash the object
unset($scott);
print "unset object = ". $scott ."\n\n";

// unserialize
$scott = unserialize($ser);
print "object = ". $scott ."\n";
print "blah = ". $scott->svar['blah'] ."\n";
print "sleep = ". $scott->svar['sleep'] ."\n";


-- 
PHP General Mailing List (http://www.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] FAQ - was "Attitude of B van Ouwerkerk"

2001-07-31 Thread scott [gts]

An actual "Question and Answer" FAQ is probably not
necessary, since there are so many other good
information resources out there already, but what
seems to be necessary is to provide newbies with
a current list of some really good PHP-related sites.

(like http://php.net/function -- i use it everyday,
but not too many newbies seem to know about it)

> -Original Message-
> From: mike cullerton [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Attitude of B van Ouwerkerk
> 
> on 7/31/01 12:37 PM, scott [gts] at [EMAIL PROTECTED] wrote:
> 
> > there's a fine line between being terse and being nasty.
> > 
> > please don't misinterpret this, but i think that we
> > could all benefit from being less sensitive of the
> > style each of us express ourselves in...
> 
> once again, scott, you seem to have a nice concise way of putting things :)
> 
> newbies are part of internet communities, as are old curmudgeons.
> thankfully, so too are the wise, willing to share their knowledge.
> 
> recently, Brian White mentioned a propsed faq for the "headers already sent"
> question. also, Philip Olson mentioned a link at php.faqts.
> 
> what is up with a faq for this list? is there one? i have been saving good
> responses to faq type questions with the intent of putting a faq together.
> now is as good a time as any. i'll post something in a couple days.
> 
> that way, we can politley say to newcomers. "hey, nice to have you around.
> hope we can help you out some. two places you should go to get started are
> php.net and link.to.list.faq"
> 
> let me know if there already is one.
> 
> have a day,
> mike
> 
> 
>  -- mike cullerton
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] RE: php_oci8.dll

2001-07-31 Thread scott [gts]

try using:
extension_dir = c:\php\extensions

that's what i use on my Win32 machine
with an identical install as Liviu.

> -Original Message-
> From: Liviu Popescu2 [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] RE: php_oci8.dll
> 
> 
> I've installed php in c:\php\ folder:
> 
>  Volume in drive C has no label.
>  Volume Serial Number is E422-FD1C
> 
>  Directory of C:\php
> 
> 07/31/2001  03:06p.
> 07/31/2001  03:06p..
> 07/19/2001  09:31adlls
> 07/19/2001  09:31aextensions
> 06/21/2001  06:31p  25,632 install.txt
> 07/19/2001  09:31ajava
> 05/22/2000  05:56p   3,747 License
> 07/19/2001  09:31aMIBS
> 07/19/2001  09:31apdf-related
> 07/19/2001  09:31apear
> 06/22/2001  09:54a  20,480 php.exe
> 06/01/2001  05:20a  24,992 php.ini-dist
> 06/01/2001  05:20a  25,482 php.ini-optimized
> 07/24/1999  09:00p   2,123 php4.gif
> 06/22/2001  09:54a   1,036,288 php4ts.dll
> 06/22/2001  02:58p 121,318 php4ts.lib
> 07/31/2001  03:06p   0 php_files.txt
> 06/22/2001  03:27p  53,248 php_oci8.dll
> 07/19/2001  09:31asapi
> 07/31/2001  02:19psessiondata
> 07/31/2001  02:19puploadtemp
>   10 File(s)  1,313,310 bytes
>   11 Dir(s)   2,438,704,128 bytes free
> 
> and in php.ini I have:
> ==
> 
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = c:\php
> 
> 
> 
> 
> 
> -Original Message-
> From: Dragos Roua [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 2:29 PM
> To: Liviu Popescu2
> Subject: Re: [PHP] php_oci8.dll
> 
> 
> Try to see if the specified library is in the location specified,
> meaning
> c:\php\, maybe you named the folder php4 or something like this
> 
> 
> > I have installed PHP4 manually to use it with Win2000 
> > I did everything according to installation guide specifications.
> > I uncommented,  in php.ini, the line:
> > extension=php_oci8.dll 
> > Afer I stopped and started the Web server, and try to load a page, I
> > get: 
> > "PHP Warning: Unable to load dynamic library 'c:\php/php_oci8.dll' -
> The
> > specified procedure could not be found. in Unknown on line 0".
> > What should I do? 
> > 
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> 
> -- 
> Dragos Roua
> Mirabilis Media,
> http://www.portal.ro  http://www.net-info.ro
> http://www.analyser.ro http://www.adserver.ro
> http://www.culinar.ro http://www.cartipostale.ro
> 
> 
>
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] Re: HELP!! What wrong with this code...

2001-07-31 Thread scott [gts]

or, if you're going to be dealing with a lot of data
that has lots of quotes in it, you could take the safe
route and just exit out of PHP mode
lots of times, it's easier than escaping every single "

php; code; here;
?>
Your feedback has been sent to 
 -Original Message-
> From: Inércia Sensorial [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: HELP!! What wrong with this code...
>
>
>   Escape the double quotes inside the 
>
> echo "Your feedback has been sent to  href=\"mailto:$address\";>$name";
>
>
> --
>
>   Julio Nobrega.
>
> 2B||!BB - That's the question.
>
> "Steve Wright" <[EMAIL PROTECTED]> wrote in message
> 02c401c119db$b76a1700$0615fea9@COM">news:02c401c119db$b76a1700$0615fea9@COM...
> Hey, i am getting an error passed back for this line of code, the rest of
> the code is below:
>
> echo "Your feedback has been sent to  href="mailto:$address";>$name";
>
> the error is:
>
> Parse error: parse error, expecting `','' or `';'' in
> /www/customers/stevewrightonline.co.uk/form/do_sendform.php on line 20
>
>
> Does anyone know y this is?? If i remove the a href tags it works fine. Can
> you not use links properly in PHP??
>
> --
>  $name = "Steven Wright";
> $address ="[EMAIL PROTECTED]";
> $recipient = $address;
> $subject = "Auto Form";
> $mailheaders = "From: Auto Form < $address > \n";
> $mailheaders = "Reply-To: $sender_email\n\n";
>
> /*The Message*/
> $msg = "Sender:\t mailto:$sender_email \t $sender_name\n\n";
> $msg = "Message:\t$message\n\n";
>
> /*Mail to Me*/
> mail($recipient, $subject, $msg, $mailheaders);
>
>
> /*Onscreen confirmation of sending*/
> echo "Form Sent!";
> echo "Thank You, $sender_name";
> echo "Your feedback has been sent to  href="mailto:$address";>$name";
> echo "";
> ?>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.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] Question on Commercial Offerings

2001-07-31 Thread scott [gts]

and not to mention that almost any form of script protection
or source-code encryption can be broken with minimal effort...
you'd probably be wasting valuble time trying to protect your
scripts that you could better spend improving and maintaining
the code.

IMO: it's better to spend your time working on the script
itself rather than hiding the source code... you'll come out
with a better product in the long run - even if the occasional
person can duplicate your source for devious purposes. :)

> -Original Message-
> From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, July 28, 2001 12:43 PM
> To: Thomas Deliduka
> Cc: PHP List
> Subject: Re: [PHP] Question on Commercial Offerings
> 
> 
> Thomas Deliduka wrote:
> 
> >I don't know quite how to word that subject but here's what we want to do.
> >
> >We have a shopping cart softwre (like a million others out there) which
> >based in windows NT with a COM+ object to guard the source code.
> >
> >We mainly offer this product to our hosting customers as an add-on solution
> >to their hosting.
> >
> >Well, we want to migrate this to PHP/MySQL and I don't know how to protect
> >the source code. My boss is suggesting to make a DSO but I really am not a C
> >programmer to do all that. I want to make it all in PHP but somehow protect
> >the code. Any ideas?
> >
> 
> We're in a similar situation, but probably will simply give the source 
> code with what we sell,
> and have purchasers agree to a moderately restrictive license.  They 
> will have the source code if
> they need to make changes for their own projects, but won't be able to 
> resell/redistribute.  Giving
> people access to the source code can actually be a positive to some 
> people.  Yes, you may lose
> some potential sales, but you'll gain sales to people coming over from 
> more restrictive carts - the kind
> where you don't get the source code.  :)
> 
> HTH
> 
> Michael Kimsal
> http://www.tapinternet.com/php
> PHP Training Courses
> 734-480-9961
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Failure Configuring 4.0.6 on SuSE 7.1

2001-07-31 Thread scott [gts]

it seems that your 'lex' is in a non-standard place,
and cannot be found in your PATH.

make sure you have 'lex' on your machine, find out where,
then open up the Makefile and change it's path to lex
to the correct one.

> -Original Message-
> From: Chris Anderson [mailto:null@YAST_ASK]
> Sent: Tuesday, July 31, 2001 11:44 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Failure Configuring 4.0.6 on SuSE 7.1
> 
> 
> When I try and configure php 4.0.6 I get the following msg:
> 
> checking for flex... lex
> checking for yywrap in -ll... no
> checking lex output file root ... ./configure: lex: command not found
> configure: error: cannot find output from lex; giving up
> 
> can anyone help?
> 
> 
> -- 
> PHP General Mailing List (http://www.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] fopen not opening url

2001-07-31 Thread scott [gts]

i wish i could help you out, but i tried your code (below)
and it worked perfectly... i'm running PHP Version 4.0.4pl1
on a Windows 2000 box.  perhaps it isn't the fopen() that's
failins.

$x =
fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml","r";)
or die("Cannot open!");
print fread($x , 4096);



> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 1:40 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] fopen not opening url
>
>
> yeah i've tried opening it directly in a browser and it works fine... i also
> tried your LoadFile function and the problem is when php calls the fopen()
> function.  It doesn't want to open that file.  Here are the errors i get
> back from PHP:
>
> Warning: php_hostconnect: connect failed in
> d:\files\htdocs\lbjs\new_websites\krox\xml.php on line 24
>
> Warning:
> fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";
> ,"r") - Bad file descriptor in
> d:\files\htdocs\lbjs\new_websites\krox\xml.php on line 24
>
> I have no idea as to why i'm getting these or what they mean.
>
> Thanks,
> jay
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 2:01 AM
> Subject: RE: [PHP] fopen not opening url
>
>
> > Are you still having problems?
> >
> > Things to try:
> >
> > 1.  Try and open the url directly in a browser.
> > eg http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml
> >
> > Does it return data (you may need to change the &o=xml to &o=html though).
> >
> > Some countries (like the one I'm in China, have moreover access banned via
> > some providers)
> >
> > 2.  socket blocking - you may need to enable or disable this dependant on
> > your server settings:
> > set_socket_blocking ($connection,false);
> >
> > function LoadFile ($filename,$block=false){
> > $fd = fopen( $filename, "r" );
> > if ($block) set_socket_blocking ($fd,true);
> > $contents = fread( $fd, filesize( $filename ) );
> > fclose( $fd );
> > return ($contents);
> > }
> >
> > Without socket blocking
> > LoadFile
> > ("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";);
> >
> >
> > With socket blocking
> > LoadFile
> >
> ("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml",true
> > );
> >
> > 3. I use something like this for reads on difficult servers (some china
> mail
> > servers are a p.i.a to get at sometimes).
> >
> > Function GetLine() {
> > $timeout=30;
> > $iStartTime = time();
> > set_socket_blocking($this->connection, false);
> >
> > $line = fread($this->connection,128);
> > while(empty($line)){
> > $line = fread($this->connection,128);
> > usleep(25);
> > }
> > if ($debug) {
> > print ($line) ."";
> > System("echo ''");
> > flush;
> > }
> >
> > return ($line);
> > }
> >
> >
> > Let me know how you do.
> >
> > Lawrence.
> > -Original Message-
> > From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> > Sent: July 31, 2001 5:17 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] fopen not opening url
> >
> >
> > here's the code i'm using below to try and open up the url.. :)
> >
> > thanks!
> > jay
> >
> > $fp =
> >
> fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";
> > , "r");
> > $length = filesize($fp);
> > $content = fread($fp,$length);
> > fclose($fp);
> > echo $content;
> >
> > - Original Message -
> > From: "Jack Dempsey" <[EMAIL PROTECTED]>
> > To: "'Jay Paulson'" <[EMAIL PROTECTED]>
> > Sent: Monday, July 30, 2001 1:52 PM
> > Subject: RE: [PHP] fopen not opening url
> >
> >
> > > Hi jay,
> > >
> > > I've done the exact thing you're trying, and it works...paste in some
> > > code so we can see where its going wrong...
> > >
> > > jack
> > >
> > > -Original Message-
> > > From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, July 30, 2001 2:08 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] fopen not opening url
> > >
> > > hello-
> > > I'm trying to use the fopen() command to open the url below and just
> > > read it
> > > into another $var. However, I'm having some problems the warning i
> > > get
> > > is below along with the url in the warning.  Anyone know what's going on
> > > here??
> > >
> > > Thanks,
> > > jay
> > >
> > > Warning: php_hostconnect: connect failed
> > > Warning:
> > > fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=
> > > xml"
> > > ,"r") - Bad file descriptor
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.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 PROTE

RE: [PHP] Attitude of B van Ouwerkerk

2001-07-31 Thread scott [gts]

there's a fine line between being terse and being nasty.

please don't misinterpret this, but i think that we
could all benefit from being less sensitive of the
style each of us express ourselves in...

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




RE: [PHP] Re: What tools do you use to develop PHP?

2001-07-31 Thread scott [gts]

TextPad is my personal favourite, but i've also tried 
ConTEXT and PHP Coder and liked them a lot, so i'd
recommend that you check out all three of them.

TextPad: http://textpad.com/
PHP Coder: http://synedit.sourceforge.net/
ConTEXT: http://www.fixedsys.com/context/

> -Original Message-
> From: Steve Wright [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 2:25 PM
> To: PHP List
> Subject: Re: [PHP] Re: What tools do you use to develop PHP?
> 
> 
> I personally use a program called EditPlus, because it supports every darn
> language that i can think of, Java, C, C++, PHP, Perl, HTMl, etc.. etc...
> 
> And it is really custimizable too!
> 
> - Original Message -
> From: Anton Stroganov <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 6:34 PM
> Subject: Re: [PHP] Re: What tools do you use to develop PHP?
> 
> 
> > FrontPage has PHP support built-in? who knew...
> >
> > At any rate, I recommend UltraEdit - it supports PHP syntax highlighting,
> > FTP save and get and quite a few other useful features.
> >
> > And if you HAVE to have graphical environment, Dreamweaver 4 is not half
> > bad, what with its customizeable tags and all, with a little work it can
> be
> > made work with PHP quite well.
> >
> > Anton Stroganov
> > webmaster
> > www.artwithin.com
> >
> > - Original Message -
> > From: Matt Rogers <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 31, 2001 10:40
> > Subject: Re: [PHP] Re: What tools do you use to develop PHP?
> >
> >
> > > Why would I pay $100 for something that I'd get sick of using anyway?
> > > FrontPage -- Now that's worth paying for!  I bought FP98 almost 4 years
> > ago
> > > and I still use it to this day.
> > >
> > >
> > > ---
> > > -- M&D Creations
> > > - Matt Rogers
> > > - Web Design Dept.
> > > - [EMAIL PROTECTED]
> > > "Ralph Guzman" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > Homesite: http://www.allaire.com/products/HomeSite/
> > > >
> > > > -Original Message-
> > > > From: Matt Rogers [mailto:[EMAIL PROTECTED]]
> > > > Sent: Monday, July 30, 2001 7:55 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] Re: What tools do you use to develop PHP?
> > > >
> > > > I like PHPCoder for Winblowz:
> > > >
> > > > http://www.phpide.de
> > > >
> > > >
> > > > There are a couple of others, but this one lets you do all kinds of
> > stuff
> > > > built-in.  Of course, it's for Windows and you have to download the
> > > > documentation (mySQL, PHP, and htmlhelp.com's HTML docs)
> > > >
> > > > And the fact that it's still kinda buggy But it works and keeps me
> > > from
> > > > having to load a bunch of different programs all at once to write,
> > upload,
> > > > and test my php scripts. =)
> > > >
> > > > (I'm a Beta enthuisiast)
> > > > ---
> > > > -- M&D Creations
> > > > - Matt Rogers
> > > > - Web Design Dept.
> > > > - [EMAIL PROTECTED]
> > > > "Gerry Kirk" <[EMAIL PROTECTED]> wrote in message
> > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > Hi,
> > > > >
> > > > > I'm putting together a PHP development framework for our small
> group.
> > We
> > > > > have worked on a couple of small apps, so now it's time to do things
> a
> > > > > little more methodically, i.e. make life easier for everyone. :)
> > > > >
> > > > > So, I scanned the web and found quite a few options for code
> > libraries,
> > > > > and a few for PHP code editors.
> > > > >
> > > > > I'm interested to know what tools / libraries people prefer -
> > > > >
> > > > > 1. Code libraries:
> > > > > a) Metabase (for database abstraction)
> > > > > b) PHPLib
> > > > > c) PEAR
> > > > > d) BinaryCloud
> > > > > e) other
> > > > >
> > > > > 2. What code editor do you use?
> > > > >
> > > > > 3. Source code control. CVS appears to be the only real option here.
> > > > >
> > > > > TIA,
> > > > > Gerry
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.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 General Mailing List (http://www.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 Mai

RE: [PHP] Good Tutorial

2001-07-31 Thread scott [gts]

The red WROX book, "Professional PHP Programming"
is really good.

> -Original Message-
> From: Steve Wright [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 11:12 AM
> To: PHP List
> Subject: [PHP] Good Tutorial
> 
> 
> 
> Hey,
> 
> I have done a few tutorials, but they aren't very long, and have only 
> covered a small amount of what i need to know.
> 
> Can anyone recommend any good comprehensive tutorials out thier, and/or 
> any good books that would be worth purchasing.
> 
> 
> Kind Regards,
> Steven Wright
> -
> [EMAIL PROTECTED]
> 
> ICQ Number:  47106748
> AOL IM:SchumieFSK
> MSN Messenger:   [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] MS SQL datetime format problem

2001-07-30 Thread scott [gts]

*how* are you putting it in?

> -Original Message-
> From: Brian Weisenthal [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 1:01 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] MS SQL datetime format problem
> 
> 
> Hi,
> 
> I am having trouble setting a datetime in a ms sql database. I can put in a
> date, but when I add the time i always get an error. this is likely
> something simple, any thoughts? thanks
> 
> 
>--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 General Mailing List (http://www.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] Revision Tracking - program concept

2001-07-30 Thread scott [gts]

you are severely re-inventing the wheel.

Look for CVS or RCS programs on the net.

you'll save yourself a ton of work.

> -Original Message-
> From: Dave Freeman [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 6:27 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Revision Tracking - program concept
> 
> 
> G'day All
> 
> I'm writing an application for an intranet environment.  At the moment I'm 
> writing a document control system.  The intention is that people will be 
> able to check in documents (generally created in MS Word from 
> templates) and the app will upload them to the server.
> 
> The process related to this involves other people then checking the 
> documents back out and making appropriate changes based on their 
> responsibilities and then checking the documents back into the system 
> again.
> 
> What I would like to do is keep track of each revision of these documents 
> (ie. actually provide a capability to review earlier revisions, or, indeed, 
> revert to earlier revisions).
> 
> At this stage I am planning to track information about each document in 
> an SQL table but not actually store the binary data in the table (there are 
> additional reasons behind this).
> 
> The only solution I've come up with that will easily implement some sort of 
> revision system would be to store only the last five, for example, revisions 
> and then use duplicate SQL tables to store older iterations of the 
> document with suitable links in the SQL back to the current version.
> 
> Can anyone suggest an alternate approach that will let me do this?
> 
> More from a program logic point of view than from an actual code example 
> point of view really.  I guess that makes this close to off-topic but there 
> you go - hopefully it won't be considered too out of place.
> 
> CYA, Dave
> 
> 
> ---
> Outback Queensland Internet - Longreach, Outback Queensland - Australia
> http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
> ---
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] php stand alone

2001-07-24 Thread scott [gts]

but remember, if you put your cron/admin scripts into
a directory on a publicly accessable webserver, you
run the risk of having anonymous websurfers run your
scripts at inopportune moments.

> -Original Message-
> From: Gunther E. Biernat [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 24, 2001 8:32 AM
> To: Adrian D'Costa; php general list
> Subject: Re: [PHP] php stand alone
>
>
> >How do I compile php to work as a stand alone.  Right now it is working
> >thru the web but need to run it from a cron job.
>
> Have a look at http://www.php.net/manual/en/install.commandline.php
>
> The easiest thing of course would be to just call lynx (or any other
> command line browser taht is able to do a HTTP request and exit (that's
> why the "-dump")) within your cron table, e.g.:
>
> 0 23 * * * lynx -dump localhost/path/to/some/php/robot.php > /dev/null
>
>
>
> mit freundlichen Gruessen / yours sincerely
>
>
> Gunther E. Biernat
> Web Application Engineer
> __
>
> RealNetworks GmbH   Tel.: +49-40-415204-24
> Weidestraße 128 Fax.: +49-40-415204-11
> 22083 Hamburg   Mail: [EMAIL PROTECTED]
> Germany URL : http://de.real.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] Email Software

2001-07-19 Thread scott [gts]

...and also a really sleazy way to annoy people.

> -Original Message-
> From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 3:35 PM
> To: Wee Chua; PHP (E-mail)
> Subject: Re: [PHP] Email Software
> 
> 
> On Wednesday 18 July 2001 14:50, Wee Chua wrote:
> > Hi all,
> > I need a little help from you guys. Can anyone tell what is the best
> > software for sending million emails at a time or something
> > like that? Where can I buy email addresses from? Thank
> > you!
> 
> Note that spamming is the cheapest way to make millions of people really 
> mad at you.
> 
> -- 
> Christian Reiniger
> LGDC Webmaster (http://lgdc.sunsite.dk/)
> 
> REALITY.SYS corrupted ... reboot Universe [Y,n]?
> 
> -- 
> PHP General Mailing List (http://www.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] A good PHP auto-reply system

2001-07-19 Thread scott [gts]

Can anyone reccomend a good PHP (or perl) Web-based
email auto-reply thingy.

I work at a company that hosts websites and provides
POP email accounts, and i'd like to allow our clients
to come to our website, log into a "clients" section
and have more control over their service...

I'd like to allow them to specify email accounts as
"away" and provide a little "i'm on vacation" type
message, and a date range associated with that message.

anyone know of any *free* or cheap it's a SOSB
(small office, small budget) software that will
allow users to create an auto-away message?

If i dont find a nice one, i'll probably end up writing
my own... but i'd prefer to save myself the work of
reinventing the wheel if i could possibly find a good
free one and work on hacking the code for my own needs.

-- 
PHP General Mailing List (http://www.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] set var in PHP

2001-07-18 Thread scott [gts]

u

$TITLE = "some title here";

> -Original Message-
> From: jessica lee tishmack [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 11:28 AM
> To: php
> Subject: [PHP] set var in PHP
> 
> 
> In html, I can do
> 
> 
> 
> How do I do this in PHP?
> 
> Thanks,
> Jessica
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Making php execute php

2001-07-18 Thread scott [gts]

It's failing becuase $abc is not valid PHP code, but is HTML.
to get eval to work correctly, only pass it valid PHP code.

This will print "Hello World";

$abc = '
print "$Message";
';

$Message="Hello World" ;

eval ($abc) ;


If you want to output HTML, enclose it within
a print "" statement, or something similar.

> -Original Message-
> From: Gord Gray [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 10:32 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Making php execute php
> 
> 
> I would like to store a mix of php and html in a database and then return
> the results.  I can't figure out how to do this.
> 
> $abc='' ;
> ...
> $Message="Hello World" ;
> ...
> echo eval ($abc) ;
> 
> where $abc is actually retrieved from a database.
> Does not work, but may illustrate what I am trying to accompish.  If anyone
> has any hints on how I can do this, I would be very grateful.
> 
> Thanks,
> 
> Gord.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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 help with formatting time

2001-07-17 Thread scott [gts]

This will convert minutes to hours, then convert
to 12-hour am|pm based time.   all hours have 60
minutes.  it's simple mathematics to convert.

$m = 780;
$h = 0;

// convert to hours:minutes
while ($m >= 60) {
  $h++;
  $m -= 60;
}
print "$h:$m \n";

// convert to 12-hour am|pm 
if (!$h) {
  $suff = "am";
  $h = 12;
}
elseif ($h == 12) {
  $suff = "pm";
}
elseif ($h > 12) {
  $suff = "pm";
  $h -= 12;
}
print "$h:$m $suff";

> -Original Message-
> From: John Holcomb [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 3:53 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Need help with formatting time
> 
> 
> Hello and thank you.
> 
>   I'm trying to find a function(method) or existing
> code taht takes the number of minutes that have passed
> in a day and returns the time of the day.  For
> example:
> 
>  780 minutes == 1pm,
>  0 minutes == 12am,
>  etc,etc.
> 
> so I'm looking for code that when you enter the number
> of minutes, it returns the time of day.
> 
> example:   
>  
> $some_time = foo(780);
> 
> print($some_time);
> 
>//prints 1:00pm
> 
> 
> Thnaks again.
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from 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]
> 

-- 
PHP General Mailing List (http://www.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] wordwrap()

2001-07-17 Thread scott [gts]

i know this is a silly question, but you're
not looking at it thru a web browser, are you?
browsers are for HTML and markup code.

the output on my computer is the same as
the manual output:
A very
long
wooo
ord.

> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] wordwrap()
> 
> Maybe I'm not using it right, but I'm using the sample in the manual.
> Here's the code:
>  $text = "A very long wrd.";
> $newtext = wordwrap( $text, 8, "\n", 1);
> echo "$newtext\n";
> ?>
> 
> Here's the output:
> A very long wooo ord.
> 
> Here's what the manual says the output should be:
> A very
> long
> wooo
> ord.
> 
> Has anyone else had troubles with the wordwrap() function?  Do I need to
> compile php with another flag to get this to work properly?
> 
> Thanks,
> Tyler
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Exec, system, passthru didn't work

2001-07-16 Thread scott [gts]

did you try and capture error messages from the system calls?

webserver probably doesnt have permission to do what you want it to do.

> -Original Message-
> From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Exec, system, passthru didn't work
> 
> Hi,
> I tried to execute the following command from the web interface using a 
> system call
> /usr/bin/play a_wave_file.wav
> 
> I tried exec, system, passthru, and shell_exec. None of them worked, that is 
> I didn't hear any sound played. Note that I'm sitting here on the server 
> itself, and tried it with a web browser in the server. The command is 
> executed fine when I just copy it and run it in terminal. I also made sure 
> that nothing blocked the sound card, that is, the sound card was not in use.
> 
> However, if I tried to run the same file using php as command line, it works 
> find.
> 
> exec, system, passthru returns the value 2, which I don't know what it means. 
> 
> Any help on this will be appreciated. Thanks in advance.
> 
> Reuben D. Budiardja

-- 
PHP General Mailing List (http://www.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 free-form text to a database

2001-07-16 Thread scott [gts]

for the quotes thing.  you must have single quotes around the
values that will go to the database, and you must escape single
quotes inside the value with either "''" or "\'" (at least in 
MySQL, both work)

and as for the database... IMO, you should download MySQL now and
save yourself a ton of trouble porting/updating code later on.

MySQL is free, fast, good, stable, etc.  Everything i hear about
Microsoft databases leads me to believe that they're buggy, slow,
and incompatible with most other databases.  

if you write the entire thing for MS-access, you'll probably have
to re-write half the database access code when you decide to
switch to MySQL... so better to do it sooner than later and save
yourself the work down the road.  :-)

> -Original Message-
> From: garman [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] submitting free-form text to a database
> 
> 
> Hello.  I'm creating a simple "Classifieds" PHP application.  It allows users 
> to view classifieds by category, and add new items to the database.  For now, 
> I'm using MS Access 97 as my database (although eventually I would like to 
> switch to MySQL).
> 
> Anyway, one element of a classified is the description.  I have a "textarea" 
> box where the user enters a description of the item he is selling.  If the 
> user's input contains an apostrophe (aka a single quote "'") or even a double 
> quote, the code gets confused.
> 
> A single quote is used around values in an SQL update command.  So if the 
> value itself contains a single quote (or multiple single quotes) I get an SQL 
> error when trying to update the database (understandably so).
> 
> When the user input contains double quotes, PHP gets confused and thinks other 
> form variables aren't set, which then confuses the SQL update command.
> 
> What kind of form processing do I need to do to fix these things?
> 
> Thanks,
> 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] Do not get any PHP-binary in install?

2001-07-16 Thread scott [gts]

i know it's silly to ask -- 
but did you look for "php" in /usr/local/bin/

> -Original Message-
> From: Lasse Andersson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 2:49 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Do not get any PHP-binary in install?
> 
> 
> 
> Hi,
> 
> I'm trying to install GD(1.8.4) with PHP (4.04p1).
> The end of 'make install' script looks lik this:
> 
> for prog in phpize php-config pear; do \
> /opt/src/src/php-4.0.4pl1/build/shtool install -c -m 755 $prog
> /usr/local/bin/$prog; \
> done
> make[2]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
> make[1]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
> 
> As you can see I get binaries for phpize, php-config and pear but not
> any PHP binary?
> 
> Configure used :
> 
> sh configure --enable-discard-path
> --with-apache=/opt/src/src/apache_1.3.19/ \
>  --with-mysql=/opt --with-gd=/opt --with-jpeg-dir=/opt
> 
> Help appreciated
> 
> 
> 
> Lasse
> Netcraft Scandinavia
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] RE: string search

2001-07-16 Thread scott [gts]

hehe... that's what regular expressions are for.
they're extrememly powerful... but that doesnt mean that
you should only use them for extremely complicated situations.
they work great everywhere... 

if you dont like "overdoing it", you might as well loop
thru the string character by character, C-style.  :-)

> -Original Message-
> From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] RE: string search
> 
> Couldn't he just do something like
> 
> if (strstr($text, "aol.com")) {
>MyFunction();
> } else {
>echo "Not Found";
> }
> 
> It just seems like using ereg for this is like killing a fly with a
> sledgehammer
> 
> Sheridan


-- 
PHP General Mailing List (http://www.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 replace using ereg

2001-07-16 Thread scott [gts]

what code are you trying to use?

i have exactly the following code, and it prints out:
Hello there, this is a test.
My name is BOB


$text = "Hello there, <>.
My name is <>";

$ASSIGN   = array(test => "this is a test",
'name'=> 'BOB', );
$OPENTAG  = "<<";
$CLOSETAG = ">>";

print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text );




> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 12:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] string replace using ereg
> 
> 
> Mmmm, thx , but I can't get it to work when I run your code,
> 
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in Eval code on
> line 1
> 
> Fatal error: Failed evaluating code: $ASSIGN[$1] in test2.php on line 9
> 
> ?
> can u please take another small look
> 
> thanks anyway
> 
> "Scott" <[EMAIL PROTECTED]> schreef in bericht
> news:<[EMAIL PROTECTED]>...
> > $text = "Hello there, <>.
> > My name is <>";
> >
> > $ASSIGN   = array(test => "this is a test", 'name'=> 'BOB', );
> > $OPENTAG  = "<<";
> > $CLOSETAG = ">>";
> >
> > print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text );
> >
> >
> > prints:
> > Hello there, this is a test.
> > My name is BOB
> >
> >
> > To do what you want, throw a loop statement around the preg_replace
> > to loop thru each line of a file... etc...  :)
> >
> > > -Original Message-
> > > From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, July 16, 2001 12:01 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] string replace using ereg
> > >
> > >
> > > hi,
> > >
> > > I want to replace strings in string using a key / value array as the
> > > replacemant contract
> > > basicly,
> > > I want to find a open en close tag, pick out the word in the middle and
> > > replace it by the value of the key that match the picked out word.
> > > example
> > >
> > > <> <>
> > >
> > > should result in
> > >
> > > this is a test this is a test
> > >
> > > well, The below code works for only one replacement cause when I add
> another
> > > on the same line. it will pick out
> > > test>> < > > als the key wordt and therefor isn't able to find this key in the array.
> > >
> > > how can I get the reg expression so it will not only get the first
> occurence
> > > of the open tag and the last of the close tag ??
> > >
> > > please help,
> > >
> > > kind regards
> > > Jeroen Olthof
> > >
> > > $ASSIGN = array(test => "this is a test" )
> > >
> > > $OPENTAG = "<<";
> > > $CLOSETAG = ">>";
> > >
> > > while ($line[$i]) {
> > > ereg($OPENTAG."([^*]*)".$CLOSETAG, $line[$i], $regs);
> > > $newString .= str_replace($this->OPENTAG.$regs[1].$this->CLOSETAG,
> > > $ASSIGN[$regs[1]], $line[$i]);
> > > }
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.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 replace using ereg

2001-07-16 Thread scott [gts]

$text = "Hello there, <>.
My name is <>";

$ASSIGN   = array(test => "this is a test", 'name'=> 'BOB', );
$OPENTAG  = "<<";
$CLOSETAG = ">>";

print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text );


prints:
Hello there, this is a test.
My name is BOB


To do what you want, throw a loop statement around the preg_replace
to loop thru each line of a file... etc...  :)

> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 12:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] string replace using ereg
> 
> 
> hi,
> 
> I want to replace strings in string using a key / value array as the
> replacemant contract
> basicly,
> I want to find a open en close tag, pick out the word in the middle and
> replace it by the value of the key that match the picked out word.
> example
> 
> <> <>
> 
> should result in
> 
> this is a test this is a test
> 
> well, The below code works for only one replacement cause when I add another
> on the same line. it will pick out
> test>> < als the key wordt and therefor isn't able to find this key in the array.
> 
> how can I get the reg expression so it will not only get the first occurence
> of the open tag and the last of the close tag ??
> 
> please help,
> 
> kind regards
> Jeroen Olthof
> 
> $ASSIGN = array(test => "this is a test" )
> 
> $OPENTAG = "<<";
> $CLOSETAG = ">>";
> 
> while ($line[$i]) {
> ereg($OPENTAG."([^*]*)".$CLOSETAG, $line[$i], $regs);
> $newString .= str_replace($this->OPENTAG.$regs[1].$this->CLOSETAG,
> $ASSIGN[$regs[1]], $line[$i]);
> }
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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 can I see if variable is a odd or an even number?

2001-07-16 Thread scott [gts]

even numbers are even becuase they're divisible by 2
w/o a remainder... use this property to your advantage:

if ( $num % 2 ) {
print "$num is odd";
}
else {
print "$num is even";
}

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 12:07 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How can I see if variable is a odd or an even number?
> 
> 
> Do you know if there is a function to find out if a variable contains a
> odd or an even number? I checked the manual but didn't see it.
> 
> Thanks!
> 
> Regards,
> Sumarlidi Einar Dadason
> 
> SED - Graphic Design
> 
> --
> Phone:   (+354) 4615501
> Mobile:  (+354) 8960376
> Fax: (+354) 4615503
> E-mail:  [EMAIL PROTECTED]
> Homepage:www.sed.is
> --
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] RE: string search

2001-07-16 Thread scott [gts]

read the docs for ereg... i hardly use it, so i dont know
for certain if it will match. (althouth the use of "^" at
beginning *and* end suggests that it wont do what you expect)

preg will match "aol.com" with this regexp:

preg_match('/aol.com/', $string )


> -Original Message-
> From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 11:49 AM
> To: PHP (E-mail)
> Subject: [PHP] RE: string search
> 
> 
> Will this work?
> 
> $string = "http://www.aol.com/";;
> 
> if (ereg ("^aol.com^", $string) {
> }
> else {
> }


-- 
PHP General Mailing List (http://www.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] echo vs printf

2001-07-16 Thread scott [gts]

from the manual:
[print is a language construct [EMAIL PROTECTED]]
The print() function returns a boolean indicating the status of the call. If the
write was successful, print() returns 1. If not, it returns 0. This can be used to
detect when the client has closed the connection, and appropriate measures taken. The
builtin echo does not provide this same service.


can anyone else think of any other difference between
print and echo ?

i use print, becuase that's what i'm used to...
but i'd be curious to find out if there really
is any significant differences between the way
echo and print both work.


> -Original Message-
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] echo vs printf
>
>
> i seem to remember reading somewhere that print acts like (is) a function,
> presumably returning false if  it cannot print to screen, whereas echo just
> dumps it.
>
> also you can drop vars in print like
>
> print "you have $points points";
>
> whereas to echo it you'd have to concatenate the string.
>
> Steve
>
>
> "Don Read" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On 16-Jul-01 brother wrote:
> > > Why should I use printf instead of echo and vice versa?
> > >
> >
> > printf print-formated
> >
> > $a=12.3456;
> >
> > echo $a, '';
> > printf('%1.2f', $a);
> >
> > 12.3456
> > 12.34
> >
> > > As for today I use printf mostly but I don't know why.
> >
> > You prolly mean print; There may be some minor differences from echo,
> > but i've never seen 'em.
> > (i think they threw print in PHP to keep JAPHs happy).
> >
> > Regards,
> > --
> > Don Read   [EMAIL PROTECTED]
> > -- It's always darkest before the dawn. So if you are going to
> >steal the neighbor's newspaper, that's the time to do it.
>
>
>
> --
> PHP General Mailing List (http://www.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 . . . .

2001-07-16 Thread scott [gts]

any number of things could happen to the $directory variable...
it could be out of scope, gotten overwritten or unset by another
function, or it might just never have been saved to the database...

but the real problem with that code is that there are no 
error checks on the file functions.  that is a bad thing.

you should *always* check file operations for errors.
$fp = fopen( ... ) or die("Cannot open");


> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 10:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] sessions . . . .
> 
> 
> i have  three pages all begin with session_start()  one fo the variables i 
> register on the first page si $directory which is used to create a unique 
> and temp directory for user files.  in the first this is some stuff saved 
> tot his directory.  in the second page there is information pulled fromt 
> this directory.  in the third when i try to save to it i get the following erros
> 
> 
> Warning: fopen("/body.html","a+") - Permission denied in 
> /home/www/hvacsites.com/SiteBuilder/control.php on line 35
> 
> Warning: Supplied argument is not a valid File-Handle resource in 
> /home/www/hvacsites.com/SiteBuilder/control.php on line 36
> 
> Warning: Supplied argument is not a valid File-Handle resource in 
> /home/www/hvacsites.com/SiteBuilder/control.php on line 37
> 
> from the code
> 
>  $pg_info .= "";
>  $file = "$directory/body.html";
>  $handle = fopen($file, "a+");
>  fputs($handle, $pg_info);
>  fclose($handle);
> 
> as you can see in the error $directory appears not to be there.  i didnt 
> unregister it.  i didnt change it.  where did it go?  and what might have 
> cause this??
> 
> 
> 
> Thank You,
>  
> Jon Yaggie
> www.design-monster.com
>  
> And they were singing . . . 
>  
> '100 little bugs in the code
> 100 bugs in the code
> fix one bug, compile it again
> 101 little bugs in the code
>  
> 101 little bugs in the code . . .'
>  
> And it continued until they reached 0
> 
> 
> 

-- 
PHP General Mailing List (http://www.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 name declarations?

2001-07-13 Thread scott [gts]



> -Original Message-
> From: Matthew Aznoe [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Variable name declarations?
> 
> However, I do have one complaint about PHP that seems to have a tendency to
> bite me far too often, and that is the lack of variable declaration.  While
> I do not think the type of the variable should be required, requiring the
> user to specify which variable names are going to be used I think would be
> useful.  The reason why I believe this is important is in debugging.  I have
> been caught many times misspelling a variable name slightly (ie -> ei), and
> since PHP does no variable name checking, sometimes it takes a while to
> discover the error.  If each variable name had to be declared prior to use,
> it would eliminate this problem by warning the user each time an undeclared
> name was used.

you are basically describing the "use strict;" pragma of perl.

if you declare "use strict;" at the beginning of a perl script,
you must then declare all variables before using them (among
other things that "use strict" prohibits, but variable declaration
is by far the most noticeable effect of "use strict")

my $num = 5;#good

$num = 5;   #error

but the great thing is, is that you can turn "strict" mode off
for specific code blocks if you find a need to get a little
loose with the rules.

no strict;
$x = 5; #no error


i wish PHP had an equivilent to perl's "use strict"... 
it would certainly save us all a lot of time, and probably
make us clean our code up a little bit :)

> I do not believe that this would sacrifice very much freedom in the
> language, and it would certainly make debugging and maintainence easier on
> the developer. 

if PHP make variable declaration an optional thing by use of
something similar to perl's "use strict" pragma, then it wouldnt
sacrifise anything... becuase only people who wanted it would
use it.

if PHP were to mandate variable declaration for all scripts all
the time, then it would certainly sacrifise a lot... 

>
> Does anyone else have any thoughts on this?> 
>

yes.  i love the idea... just as long as it's an optional feature
that can be turned on and off as the programmer needs.

-- 
PHP General Mailing List (http://www.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] peculiar behaviour of large integers with "<" and ">"

2001-07-13 Thread scott [gts]

i guess you've got a more recent version of PHP than i do...

For me, it prints out "This is printed" but not 
"This is not printed", which made my eyebrows touch the
ceiling when i first saw that... 


> -Original Message-
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 2:47 PM
> To: php
> Subject: RE: [PHP] peculiar behaviour of large integers with "<" and ">"
> 
> 
> I am running 4.0.6. Nothing prints to the screen using a cut and paste of
> the code below.
> 
> > -Original Message-
> > From: scott [gts] [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, July 13, 2001 12:25 PM
> > To: php
> > Subject: RE: [PHP] peculiar behaviour of large integers with 
> > "<" and ">"
> > 
> > 
> > after reading thru the PHP site some more, i found a little
> > note mentioning a problem with the way negative integers are
> > handled in v4.0.6...
> > 
> > what version are you using?
> > what do you see when you run this code?
> > 
> > if (5 < -2147483647) {
> > print "This is printed.";
> > }
> > 
> > if (5 < -214748364) {
> > print "This is not.";
> > }
> 
> -- 
> PHP General Mailing List (http://www.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] peculiar behaviour of large integers with "<" and ">"

2001-07-13 Thread scott [gts]

after reading thru the PHP site some more, i found a little
note mentioning a problem with the way negative integers are
handled in v4.0.6...

what version are you using?
what do you see when you run this code?

if (5 < -2147483647) {
print "This is printed.";
}

if (5 < -214748364) {
print "This is not.";
}

> -Original Message-
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 2:23 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] peculiar behaviour of large integers with "<" and ">"
> 
> 
>  // compare 5 to the max value of an integer
> if (5 < -2147483647) {
>   print "This is";
> } else {
>   print "Nothing ";
> }
> 
> // knock a digit off the max and compare again
> if (5 < -214748364) {
>   print "weird";
> } else {
>   print "unusual";
> }
> ?>
> 
> I get nothing unusual
> 
> Kirk
> 
> > -Original Message-
> > From: scott [gts] [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, July 13, 2001 12:08 PM
> > To: php
> > Subject: [PHP] peculiar behaviour of large integers with "<" and ">"
> > 
> > 
> > Has anyone come across this before?
> > 
> > // compare 5 to the max value of an integer
> > if (5 < -2147483647) {
> >   print "This is";
> > }
> > 
> > // knock a digit off the max and compare again
> > if (5 < -214748364) {
> >   print "weird";
> > }
> 
> -- 
> PHP General Mailing List (http://www.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] peculiar behaviour of large integers with "<" and ">"

2001-07-13 Thread scott [gts]

Has anyone come across this before?

// compare 5 to the max value of an integer
if (5 < -2147483647) {
  print "This is";
}

// knock a digit off the max and compare again
if (5 < -214748364) {
  print "weird";
}

-- 
PHP General Mailing List (http://www.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 problem using headers

2001-07-13 Thread scott [gts]

you're passing the PHPSESSID incorrectly, it seems

you must do something like this:
  
or
  header("Location: nextpage.php?$SID");

what you're doing now will go to page "input.php?=SID"
instead of "input.php?938sa9fa98f7daf987a9s" (or similar)


> -Original Message-
> From: David Allen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 6:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session problem using headers
> 
> 
> Hi,
> 
> I am having problems with sessions. With cookies turned on it works
> fine. Turn off cookies it fails.
> 
> I have tried both
> 
> header("Location: input.php?=SID");
> header("Location: input.php?PHPSESSID=".PHPSESSID);
> 
> to pass the session id to the programme input.php but neither works.
> 
> The first lines of input.php are
> 
>  session_register("userid");
> ?>
> 
> userid is the variable  I wish to pass. However, I have no other code
> related to sessions in this script. Do I need in some way "tell" the
> script to use this session id?
> 
> As a have said before, it works fine if cookies are turned on.
> 
> Thanks in advance for any help.
> 
> David
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

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




RE: [PHP] Re: How to convert a string into a mathematical expression?

2001-07-13 Thread scott [gts]

be *extremely* careful.  eval() is like spawning another PHP
interpreter... it'll execute *any* code that you give it.

people could type in unlink(); and such commands and really
trash your webserver.

> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Re: How to convert a string into a mathematical
> expression?
> 
> Take a look at the eval() function.
> 


-- 
PHP General Mailing List (http://www.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] forms and IP numbers

2001-07-13 Thread scott [gts]

stat()

> -Original Message-
> From: Randy Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 4:09 PM
> To: scott [gts]; php
> Subject: RE: [PHP] forms and IP numbers
> 
> 
> I would like to pull the date and time of the creation of a file via a php
> script and compare it to the current time.
> 
> How do I do this?
> 
> TIA
> 
> Randy
> 

-- 
PHP General Mailing List (http://www.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] forms and IP numbers

2001-07-13 Thread scott [gts]

no offense, but that's a bad kludge for the problem.

however, if you really want to do that, you could try
checking $SERVER_NAME and $HTTP_REFERER and other
enviornment variables like that... 

what would be easier (and better practise) to do is to 
verify that the incoming username is valid... 


> -Original Message-
> From: Marc van Duivenvoorde [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 6:10 AM
> To: Php general lijst
> Subject: [PHP] forms and IP numbers
> 
> 
> A friend of mine found a bug in my messageboard code, this way he can post 
> with other (than in my database) nicknames from a local form. Now I want to 
> have the formhandler do a check from where the form is sent. If it is not 
> sent from my own webserver it has to display an error message.
> 
> Thanks,
> 
> Marc van Duivenvoorde
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Alternative to phpMyAdmin

2001-07-13 Thread scott [gts]

like you said... as long as the database provider accepts
connections from outside, you can administer it from anywhere.

if the provider doesn't accept incoming connections, no amount
of tools and software will work for you.

> -Original Message-
> From: Alexander Skwar [mailto:[EMAIL PROTECTED]]On Behalf Of
> Subject: RE: [PHP] Alternative to phpMyAdmin
>
>
> > if you install mysql on a windoze machine then you can administer ANY >
> mysql database going through the socket.
>
> Okay, for a development this may be fine, but I still fail to see how a
> tool that runs on your own computer (no matter if it's a Windows tool, or
> a Linux tool) can help you administer databases which are not on the same
> computer (unless the mysql database on the providers server can be
> contacted from any machine and not just from "localhost").
>
> --
> Homepage:http://www.digitalprojects.com   |   http://www.iso-top.de
> iso-top.de - Die günstige Art an Linux Distributionen zu kommen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] Re: How to maintain a variable between PHP pages (sessions?).

2001-07-13 Thread scott [gts]

sessions or cookies is the way you probably want to go.

you could pass the variable around to each and every
form, but that is a pain in the ass, and extremely
prone to errors.

on the first page, where you check the user's ability to 
use attachments, you could simply set a cookie

setcookie('cookie_can_use_attachments', ... );

and on subsequent pages, check to see if the variable
$cookie_can_use_attachments is set

or, if you plan to carry arounc more information from
page to page than just the user's ability to use attachments,
sessions will make your life much easier 

best of luck.

> -Original Message-
> From: Santiago Romero [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 2:12 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: How to maintain a variable between PHP pages
> (sessions?).
> 
> 
>  Hi!
> 
>  How is possible to maintain a PHP variable defined on a PHP3 file
>  (IMP 2.2.5, mailbox.php3) so that is available for another PHP3
>  file (compose.php3) and for future reloads of mailbox.php3?
> 
>  I have a variable called can_use_attachs (can_use_attachs) that
>  is checked on an LDAP server on mailbox.php3 and used on compose.php3.
>  The idea is just to check the LDAP server just once (the first
>  time) and set that variable so that future reloads do not check the
>  ldap server another time.
> 
>  I'm using the following code, but I suspect that produces a segmen-
>  tation fault one time each about 4000 reloads (yes, I can reload
>  the page thousands of times automatically, and when I reach about
>  4000 it produces a segmentation fault on token_cache.c):
> 
> // the beginning of my mailbox.php3 file
> if( !isset( $can_use_attachs ) )
> {
>  $ds=ldap_connect("192.168.1.152");
> 
>  if ($ds)
>  {
>$r=ldap_bind($ds);
>$busca="uid=" . $imp->user;
>$sr=ldap_search($ds,"cn=Correo,o=sistemas.servicom2000",
>$busca);
>if( ldap_count_entries($ds,$sr) < 1 )
>  SetCookie( "can_use_attachs", 'n', time()+3600 );
>else
>{ 
>  $info = ldap_get_entries($ds, $sr);
>  if( $info[0]["roomnumber"][0] == "s" )
>SetCookie( "can_use_attachs", 's', time()+3600 );
>  else
>SetCookie( "can_use_attachs", 'n', time()+3600 );
>}
>ldap_close($ds);
>  }
> }
> 
>  And in compose.php3:
> 
> 
> 
>  
>  (etc...)
>  
> 
> 
>  
> 
>  Does anyone know a better way of doing the above? I don't know how
>  to use PHP sessions (as used on Horde/IMP) so that I don't need
>  cookies to set up that variable.
>  
> PS: and if someone can see in the above code what could be the 
> cause of the segmentation fault, please tell me.
> 
>  CU and thanks a lot.
> -- 
> Santiago Romero
> Departamento de Sistemas
> [EMAIL PROTECTED]
> 
> Av. Primado Reig 189, entlo
> 46020 Valencia - Spain
> Telf. (+34) 96 332 12 00
> Fax. (+34) 96 332 12 01
> http://www.servicom2000.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] Enabling short tags in PHP 4.0.6

2001-07-13 Thread scott [gts]

what do the tags look like?


or 
<% %>

the first is a short tag
the second is an asp style tag

maybe you're looking at the wrong option in the 'ini' file.

> -Original Message-
> From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 11:17 PM
> To: Coulee Web; [EMAIL PROTECTED]
> Subject: RE: [PHP] Enabling short tags in PHP 4.0.6
> 
> 
> Are you sure you have the php.ini file in the right directory? When looking
> at phpinfo() make sure php.ini is located where the "Configuration File
> (php.ini) Path" is set to.
> 
> -Original Message-
> From: Coulee Web [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 6:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Enabling short tags in PHP 4.0.6
> 
> I have just installed PHP 4.0.6 on my server and although the php.ini
> file shows that short open tags should be on, a look at phpinfo() shows
> they are off and of course the don't work. I have a huge site already
> developed using short tags and must turn them on. Does anyone know what
> is wrong? I even configured PHP with the --enable-short-tags option but
> still no luck.
> 
> --
> ---
> Shane Lambert, Owner
> Coulee Web
> http://www.couleeweb.net/
> 
> --
> PHP General Mailing List (http://www.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] The need for strong typing...

2001-07-13 Thread scott [gts]

you could easily write yourself a typing function to take
care of all that (as someone suggested previously) using the
same familiar syntax as you want to use in the function
definition.

function pay($fromaccount, $toaccount, $amount, $memo) {

  $good = checkInput($fromaccount, "int", $toaccount, "int", $memo, "varchar(1000)" )
or die("Invalid input!");

  // code...

}

> -Original Message-
> From: Dr. Evil [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 10:31 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] The need for strong typing...
>
>
> > The one problem with all your musings is that there is no such thing as an
> > integer when it comes to transferring data over http.  Everything comes as
> > a string.  What is done with these strings when they get to the
> > application is what matters.  It's not like there is an HTML form element
> > like  or .  All you have is  > type=text> when it comes to users entering data and passing it to you.  I
> > fail to see how strong typing helps you here at all.  You are going to
> > have to apply some sort of user-space rule once you receive the data.  And
> > that is quite easy to do with PHP.
>
> Right, obviously.  The only data type in http is the string.  However,
> there is obviously some value in being able to say:
>
> function pay(fromaccount int, toaccount int, amount int, memo
>varchar(100)) { // 
>
> instead of:
>
> function pay(fromaccount, toaccount, amount, memo) { // 
>
> In the former case, even if there was a mistake in checking user
> input, at least the script will die instead of trying to do some
> operation on some impossible data type.  That's a good thing.
>
> Obviously, all user input must be taken from string type to other
> types, but internal functions should be constrained.  It's just
> another level of checking.  It's exactly the same reason why databases
> allow you to put constraints into table definitions.  Sure, you should
> check that the value is positive when you do the INSERT, but you
> should also put a constraint into the table.  Lots of things go
> wrong.
>
> Also obviously, this capability isn't needed for most of what PHP is
> used for, and so maybe it doesn't belong in PHP, and maybe those of us
> who are writing more sensitive aps should look into other things.  Any
> sugestions?
>
> I don't want people to think that I'm bashing PHP.  I'm not.  I love
> it.  I could never go back to perl or anything else.  It's just that
> I'm working on this one particular financial application, and I'm
> paranoid that something will slip through somewhere, and I would feel
> more comfortable if I could define variables that have built-in
> constraints.  Can I use classes to do this?
>
> --
> PHP General Mailing List (http://www.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] Strong typing?

2001-07-13 Thread scott [gts]

and as far as i know, perl's 'strict mode' has absolutely
nothing to do with typing of variables...

use strict; will force you to define all variables
with "my $var;" or "local $var;" before you assign values
to them or try and use them... but it doesnt do anything
about enforcing typing... 

in perl 6, i think that plans are under way to add
extensions that will let people strongly-type
variables if they want (but it still wont be mandatory)

example: my integer $number = 5;

would stronlgy-type that variable as an integer, and
you wouldnt be able to assign any other type of value
to it without an error.  but i dont know how far the
developers will go towards realizing strongly-typed
extensions to perl... 

as rasmus said... it's incredibly hard to have it both
ways.  the freedom of perl and PHP largely comes from
*not* having to always worry about variable typing,
memory allocation/cleanup and all those other nitpicky
low-level things that BDSM ... errr C programmers
seem to love  :-)


> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 8:15 PM
> To: Dr. Evil
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Strong typing?
> 
> 
> > PHP is a great language.  It makes it fast and easy to create web
> > pages.  However, one feature which is critical for doing rock-solid
> > stable websites is strong typing.  The reason for this is that you're
> > dealing with untrusted user input.  Strong typing helps because if you
> > are expecting an INT, and the user gave you something else, and you
> > made a mistake in your input checking, the program will fail when you
> > attempt to assign the value to the strongly-type INT variable.  This
> > is a good thing when you are dealing with money, or other contexts
> > where you need very solid code.
> >
> > First, is there a plan to introduce a strong typing option, like
> > perl's strict mode?
> >
> > Second, is there a way to get something equivalent to strong typing
> > using the class system?
> 
> You can't really have it both ways.  And no, there is no plan to implement
> strong typing.
> 
> -Rasmus
> 
> 
> -- 
> PHP General Mailing List (http://www.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] Thumbnail Generation from DB Stored Images.

2001-07-13 Thread scott [gts]

Here is my code to turn a directory full of *files*
into thumbnail images.  im sure you can adapt it to
your own needs...  the code is a bit long-winded, but
it was my first attempt at writing thumbnail code,
so forgive me ;)



// example call to the function
make_thumbs('./pictures/cavern/', './pictures/cavern/thumbs', 200, 60 );

/*
Simple function to make thumbnail images for an
entire directory of .JPG images. (no GIF support
because the owners of the GIF patent are buttheads)

It will create square thumbnail images (height=width),
with the original image resized properly within the
thumbnail dimensions to preserve the height to width ratio

This code is free for use as long as you keep my
email and URL in here:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://furt.com/code/make_thumbs/

Syntax of function call
  make_thumbs(
$dir= where the original image files are located
$tdir   = where you want the thumbnails to be saved
$max= $max=width=height of the new thumbnail images
all thumbnails are square.
$quality = quality of thumbnail JPG worst(1..100)best
$border  = how many pixels of border to put around the image
);

*/
function make_thumbs($dir, $tdir, $max, $quality=75, $border=3) {
  // this is so the script won't time out
  set_time_limit(0);

  $files = opendir($dir) or die("Cannot opendir $dir");
  while ($file = readdir($files)) {

if ( preg_match("/[a-zA-Z0-9]\.(jpg|jpeg|JPG|JPEG)$/", $file) ) {
//if (!file_exists($tdir .'/'. $file .'_t.jpg')) {

// Information about the original image
$img_name = $dir .'/'. $file;
$img  = imagecreatefromjpeg($img_name) or die("Cannot read 
$img_name");
$img_x= $img_y = 0;
$img_w= imagesx($img);
$img_h= imagesy($img);

// Create a new empty container for the thumbnail image
$out = imagecreate($max, $max);

// Set background colour of the thumbnail container
$bg = ImageColorAllocate($out, 200,200,200);

// If image is more wide than tall
if ($img_w > $img_h) {
$mod   = ($img_w - $max) / $img_w;

$out_w = $max;
$out_h = $img_h * (1 - $mod);

$out_x = 0;
$out_y = ($max - $out_h) / 2;

$out_x += $border;
$out_w -= $border*2;
}

// If image is more tall than wide
else {
$mod   = ($img_h - $max) / $img_h;

$out_h = $max;
$out_w = $img_w * (1 - $mod);

$out_y = 0;
$out_x = ($max - $out_w) / 2;

$out_y += $border;
$out_h -= $border*2;
}

// for debugging purposes... so i can see what's going on
//print "out_x=$out_x, out_y=$out_y, img_x=$img_x, img_y=$img_y\n";
//print "out_w=$out_w, out_h=$out_h, img_w=$img_w, img_h=$img_h\n";

//Put some text into the image
//$fg = ImageColorAllocate($out, 0,0,0);
//imagestring ($out, '2', 3, $max-15, "Text", $fg);

// Copy and resize the original image into the new thumbnail container
imagecopyresized (
$out, $img,
$out_x, $out_y, $img_x, $img_y,
$out_w, $out_h, $img_w, $img_h);

// Save the image to disk (in the thumbnail directory)
imagejpeg($out, $tdir .'/'. $file .'_t.jpg', $quality);

//}
}#if
  }#while


}





> -Original Message-
> From: Jason Bell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 7:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Thumbnail Generation from DB Stored Images.
> 
> 
> Hello! I have images stored in a MySQL Database. I can retrieve the images 
> and display them without a problem, but I'd really like to be able to 
> create thumbnails. The code that I've written just doesn't seem to work. 
> Preferably, I'd like to pull the image from the database, and create the 
> thumbnail for display, without ever writing an image to the disk. If this 
> is not possible, I'd like to know alternate methods. I'm using 
> imagemagick's convert utility to create the thumbs. Here is my code:
> 
> getpic.php:
> 
>  if($id) {
> @MYSQL_CONNECT("localhost","username","mypassword");
> @mysql_select_db("daelic");
> $query = "select image,type from images where id=$id";
> $result = @MYSQL_QUERY($query);
> $data = @MYSQL_RESULT($result,0,"image");
> $type = @MYSQL_RESULT($result,0,"type");
> Header( "Content-type: $type");
>   

RE: [PHP] quotes

2001-07-12 Thread scott [gts]

also: mysql_escape_string()
will format data properly for use in MySQL queries

> -Original Message-
> From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] quotes
> 
> 
> Heidi Belal wrote:
> > I have a problem using apostrophes/single quotes.
> > I am using PHP and MySQL.  The user enters data into
> > the text field and everything goes ok, until an
> > apostrophy/single quote is added in the middle of the
> > text - then disaster occurs!
> 
> Use addslashes() on the text before inserting it into the database.
> 
> http://php.net/addslashes
> 
> regards
> Wagner
> 
> -- 
> Madness takes its toll. Please have exact change.
> 
> -- 
> PHP General Mailing List (http://www.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] installation

2001-07-12 Thread scott [gts]

the RPM is a binary.  if mysql support is not in the RPM,
there's no way to add it

if you want to install PHP the simplest way, get the
sources and compile it yourself as a stanalone binary
(NOT using --with-apache or --with-apxs)

then you can tweak it however you want, and compile
in support for whatever you need... 

Here's the quick way of doing it:

1) download mysql, unzip it.
2) download PHP ,unzip it
./compile --with-mysql=/path/to/mysql   and other options
make
make test
make install

3) edit apache httpd.conf
4) restart apache

done.   :)


> -Original Message-
> From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 26, 2001 1:19 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] installation
> 
> 
> Hi there,
> 
> Im just a new in PHP, please help me in installing PHP with mysql support 
> using the RPM's format. It is much easier to install packages in Redhat6.2 
> in RPM's but it does not automatically install PHP mysql support.
> 
> Please help me, i keep on trying installing this but it doesnt work.
> 
> Mike
> 

-- 
PHP General Mailing List (http://www.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 not handling 404 errors for .php pages

2001-07-12 Thread scott [gts]

thanks... cant believe i didnt think of capturing
500 errors myself...

must mean the coffee's wearing off  :)

> -Original Message-
> From: DAve Goodrich [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] apache not handling 404 errors for .php pages
> 
> ErrorDocument 500 /path/to/my_error_page.html
> 
> That should get you the result you want.
> 
> DAve


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




  1   2   3   >