[PHP] store pics on mysql db

2002-04-22 Thread mm fernandez


hi...is it possible to store pics (jpeg/gif) on the mysql database? if so, 
how and what type should that field be?

thanks.


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: From where was function called?

2002-04-22 Thread Adrian Ciutureanu

You can use the 'magic constants' __FILE__ and __LINE__
For example, if you have an editor that can replace the newline "\n"
character, you can replace all "\n" with
"\nerror_log(__FILE__ . '[' .  __LINE__ . ']');"

"Nico Van Der Dussen" <[EMAIL PROTECTED]> wrote in message
3CC45EB5.6064.19C3129@localhost">news:3CC45EB5.6064.19C3129@localhost...
> Hi,
>
> I'm having a real problem:
>
> In a codeset of more than 5000 lines of code, I have a rogue call to a
> function.
>
> Is there a way I can determine in a function from where the call was
> made?  (Filename, linenumber etc)
>
> Thanks
>
> Nico
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] TEST

2002-04-22 Thread kip

TEST



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Setting the name of a file in a download....

2002-04-22 Thread Brian White

I am using the following code to create a downloader. It works, except
that IE will just dump the contents to it's browser and Netscape 4
asks if I want to save it in a file called "blah.php".


 // File: blah.php

 if ( ! $fp = fsockopen ("www.steptwo.com.au", 80, $errno, $errstr, 30) )
 {
 echo "$errstr ($errno)\n";
 }
 else
 {
 $userpass = "user:password";
 fputs ($fp, "GET /files/file.zip HTTP/1.0\r\n" .
 "Host: www.steptwo.com.au\r\n" .
 "Authorization: Basic " . base64_encode( $userpass ) . 
"\r\n" .
 "\r\n");

 while ( $headerStr = trim( fgets( $fp , 3072 ) ) )
 {
 if ( strpos( $headerStr, ":" ) )
 header( $headerStr );
 }


 fpassthru( $fp );
 }

Is there any way to get it to save as a file called "file.zip"?
Is there any header I can set? The headers it currently returns
are:

Date: Tue, 23 Apr 2002 06:02:36 GMT
Server: Apache/1.3.12 (Unix) ApacheJServ/1.1.2 PHP/4.0.1pl2 
FrontPage/4.0.4.3 mod_ssl/2.6.6 OpenSSL/0.9.5a
Last-Modified: Tue, 23 Apr 2002 05:13:07 GMT
ETag: "61b3e-ba-3cc4ed63"
Accept-Ranges: bytes
Content-Length: 186
Connection: close
Content-Type: application/zip

regs

Brian White
-
Brian White
Step Two Designs Pty Ltd
Knowledge Management Consultancy, SGML & XML
Phone: +612-93197901
Web:   http://www.steptwo.com.au/
Email: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[2]: [PHP] Interesting Links, can be not PHP

2002-04-22 Thread Mantas Kriauciunas

Hey PHP General List,

Got your email on:Monday, April 22, 2002, 10:29:52 PM writing:

:
MT> it's a "bookmark"

MT> basically, it's telling the browser to scroll the page down until it finds
MT> the named bookmark

MT> eg
MT> Top of page
MT> blah...
MT> ...
MT> go to top

MT> clicking on that link will scrol the page to "top"

MT> in your case, it's a "no-name" bookmark, and most browsers treat this as
MT> either "don't move" or "top"

MT> it's useful when doing "onClicks", etc. when you don't want to user to go to
MT> a different page

MT> HTH


MT> -Original Message-
MT> From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
MT> Sent: Tuesday, April 23, 2002 5:17 PM
MT> To: PHP General List
MT> Subject: [PHP] Interesting Links, can be not PHP


MT> Hey PHP General List,

MT>   Well i have seen some strange links last few months earlyer i
MT>   didn't look at them because i didn't care... and now i am curious...
MT>   how to understand link like this Http://www.foo.com/# and thats
MT>   it... links ends and as it sayes for example it links to Our Works
MT>   page on that website... how to understand that # ? can anybody
MT>   expain? or give link to explanation ?


:

Thanks for your brief explanation. Now i understand little more. I got
confused before whyt it is only # no letters.. thanks again ;)

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Interesting Links, can be not PHP

2002-04-22 Thread Martin Towell

it's a "bookmark"

basically, it's telling the browser to scroll the page down until it finds
the named bookmark

eg
Top of page
blah...
...
go to top

clicking on that link will scrol the page to "top"

in your case, it's a "no-name" bookmark, and most browsers treat this as
either "don't move" or "top"

it's useful when doing "onClicks", etc. when you don't want to user to go to
a different page

HTH


-Original Message-
From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 5:17 PM
To: PHP General List
Subject: [PHP] Interesting Links, can be not PHP


Hey PHP General List,

  Well i have seen some strange links last few months earlyer i
  didn't look at them because i didn't care... and now i am curious...
  how to understand link like this Http://www.foo.com/# and thats
  it... links ends and as it sayes for example it links to Our Works
  page on that website... how to understand that # ? can anybody
  expain? or give link to explanation ?

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread Justin French

on 23/04/02 1:59 PM, Martin Towell ([EMAIL PROTECTED]) wrote:


> would become
> 
> =foo
> ="foo"
> = "foo"
> ='foo'
> ='foo'
> 
> which the browser would just ignore

In theory, yes.  I don't think I'd trust it here -- this is potentially
malicious content added by unknown people.  I'd be taking the approach keep
what you trust, throw out the rest, which is a more complex set of regexps
though.

hence  should be trimmed back to  this is easier on a
smaller subset of HTML, rather than "all HTML".

I personally would not give unknown contributors any more than you have to.


Justin

Creative Director
http://Indent.com.au



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Interesting Links, can be not PHP

2002-04-22 Thread Mantas Kriauciunas

Hey PHP General List,

  Well i have seen some strange links last few months earlyer i
  didn't look at them because i didn't care... and now i am curious...
  how to understand link like this Http://www.foo.com/# and thats
  it... links ends and as it sayes for example it links to Our Works
  page on that website... how to understand that # ? can anybody
  expain? or give link to explanation ?

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can php support ttf??

2002-04-22 Thread Richard Archer

At 11:29 AM +0800 23/4/02, zhaoxd wrote:

>When I compiled gd ,I used some libraries,such as
>libpng-1.2.0,zlib-1.1.4,freetype-2.1.0,I want my gd can support ttf
>besides png image,is it enough?
>
>Can php support ttf?I hava just compiled gd in php,but I found it can
>not use some functions like ImageTTFtext and ImageTTFBBox,why?

You be using ImageFtText and ImageFtBBox with freetype 2.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




FW: [PHP] remove last character in a string

2002-04-22 Thread Jarrad Kabral

its my understanding that you wish to strip the last character of the string
not return it. Putting -1 in the length parameter will just return the last
character, it wont get rid of it


$string = "This is the string,";
$str_length = strlen($string);

if (substr($string,0,-1) == ",") {
//Strip
$formatted_str = substr($string,0,str_length-1);
} else {
//Dont strip
//
}


That should work but I didnt test it  ;)


Regards
Jarrad Kabral



-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 23 April 2002 1:57 PM
To: Evan Nemerson; [EMAIL PROTECTED]
Subject: Re: [PHP] remove last character in a string


Because I'm kinda stupid.  :)

tyler

- Original Message -
From: "Evan Nemerson" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 10:53 PM
Subject: Re: [PHP] remove last character in a string


> Why get strlen involved???
>
> $string = substr("$string", 0, -1);
>
>
>
> --
> He is richest who is content with the least, for content is the wealth of
> nature.
>
> Socrates
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] remove last character in a string

2002-04-22 Thread Matthew Walker

Actually, if he uses a negative index in substr(), he doesn't need to
know the length of the string.

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 9:29 PM
To: Craig Westerman; php-general-list
Subject: Re: [PHP] remove last character in a string

First, you'll need to get the length of the str with the str_len()
function.
After you have that, use the substr() function like Rasmus mentioned.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: "Craig Westerman" <[EMAIL PROTECTED]>
To: "php-general-list" <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 10:26 PM
Subject: [PHP] remove last character in a string


> I have a string that ends in a comma. What is best method to remove
the
> comma?
>
> Craig ><>
> [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Can php support ttf??

2002-04-22 Thread Matthew Walker

Also, non-Unicode TTF fonts will /not/ work with PHP.

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-Original Message-
From: Rahul Bhide [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 9:45 PM
To: zhaoxd
Cc: php mailling list
Subject: Re: [PHP] Can php support ttf??

Hi,
You need freetype-1.* library . You can get it at www.freetype.org .
Then compile php --with-ttf=/usr/local assuming you have the library in
/usr/local/lib .

I struggled a lot getting the TTF fonts to work in my env . Now I
conclude that only specific combinations of versions of php/gd/freetype
work well
with each other . I am using

freetype-1.3.1
gd-1.8.4
php-4.0.4pl1

which works well for me .

hope this helps.

~Rahul

zhaoxd wrote:

> hello all:
> :)
> My version of gd is 1.8.4,my php is 4.1.2,which works on apache server
whose version is 1.3.24 and my OS is linux7.2.
>
> When I compiled gd ,I used some libraries,such as
libpng-1.2.0,zlib-1.1.4,freetype-2.1.0,I want my gd can support ttf
besides png image,is it enough?
>
> Can php support ttf?I hava just compiled gd in php,but I found it can
not use some functions like ImageTTFtext and ImageTTFBBox,why?
>
> Is that right that  gd-1.8.4 can't support functions about ttf ,just
as gd cannot support gif?
>
> Thank you
> zhaoxd


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren

Because I'm kinda stupid.  :)

tyler

- Original Message -
From: "Evan Nemerson" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 10:53 PM
Subject: Re: [PHP] remove last character in a string


> Why get strlen involved???
>
> $string = substr("$string", 0, -1);
>
>
>
> --
> He is richest who is content with the least, for content is the wealth of
> nature.
>
> Socrates
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren

Yeah, I thought about that and said to myself "That's not right".  But I had
already clicked the "Send" button and the message was no longer in my
outbox.  :)

tyler

- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>
Cc: "Craig Westerman" <[EMAIL PROTECTED]>; "php-general-list"
<[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 12:04 AM
Subject: Re: [PHP] remove last character in a string


> No you don't.  You should go read the substr() docs as well:
>
> substr($str,0,-1);
>
> -Rasmus
>
> On Mon, 22 Apr 2002, Tyler Longren wrote:
>
> > First, you'll need to get the length of the str with the str_len()
function.
> > After you have that, use the substr() function like Rasmus mentioned.
> >
> > Tyler Longren
> > Captain Jack Communications
> > www.captainjack.com
> > [EMAIL PROTECTED]
> >
> > - Original Message -
> > From: "Craig Westerman" <[EMAIL PROTECTED]>
> > To: "php-general-list" <[EMAIL PROTECTED]>
> > Sent: Monday, April 22, 2002 10:26 PM
> > Subject: [PHP] remove last character in a string
> >
> >
> > > I have a string that ends in a comma. What is best method to remove
the
> > > comma?
> > >
> > > Craig ><>
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remove last character in a string

2002-04-22 Thread Rasmus Lerdorf

No you don't.  You should go read the substr() docs as well:

substr($str,0,-1);

-Rasmus

On Mon, 22 Apr 2002, Tyler Longren wrote:

> First, you'll need to get the length of the str with the str_len() function.
> After you have that, use the substr() function like Rasmus mentioned.
> 
> Tyler Longren
> Captain Jack Communications
> www.captainjack.com
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Craig Westerman" <[EMAIL PROTECTED]>
> To: "php-general-list" <[EMAIL PROTECTED]>
> Sent: Monday, April 22, 2002 10:26 PM
> Subject: [PHP] remove last character in a string
> 
> 
> > I have a string that ends in a comma. What is best method to remove the
> > comma?
> >
> > Craig ><>
> > [EMAIL PROTECTED]
> >
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remove last character in a string

2002-04-22 Thread Evan Nemerson

Why get strlen involved???

$string = substr("$string", 0, -1);



-- 
He is richest who is content with the least, for content is the wealth of 
nature.

Socrates

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can php support ttf??

2002-04-22 Thread Rahul Bhide

Hi,
You need freetype-1.* library . You can get it at www.freetype.org . Then compile 
php --with-ttf=/usr/local assuming you have the library in
/usr/local/lib .

I struggled a lot getting the TTF fonts to work in my env . Now I conclude that 
only specific combinations of versions of php/gd/freetype work well
with each other . I am using

freetype-1.3.1
gd-1.8.4
php-4.0.4pl1

which works well for me .

hope this helps.

~Rahul

zhaoxd wrote:

> hello all:
> :)
> My version of gd is 1.8.4,my php is 4.1.2,which works on apache server whose version 
>is 1.3.24 and my OS is linux7.2.
>
> When I compiled gd ,I used some libraries,such as 
>libpng-1.2.0,zlib-1.1.4,freetype-2.1.0,I want my gd can support ttf besides png 
>image,is it enough?
>
> Can php support ttf?I hava just compiled gd in php,but I found it can not use some 
>functions like ImageTTFtext and ImageTTFBBox,why?
>
> Is that right that  gd-1.8.4 can't support functions about ttf ,just as gd cannot 
>support gif?
>
> Thank you
> zhaoxd


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] remove last character in a string

2002-04-22 Thread Craig Westerman

Wouldn't it be better to check to see if charicater is indeed a comma before
removing it?

I was guessing eregi_replace would be the way to go.

Am I thinking wrong?

Craig ><>
[EMAIL PROTECTED]


First, you'll need to get the length of the str with the str_len() function.
After you have that, use the substr() function like Rasmus mentioned.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Can php support ttf??

2002-04-22 Thread zhaoxd

hello all:
:)
My version of gd is 1.8.4,my php is 4.1.2,which works on apache server whose version 
is 1.3.24 and my OS is linux7.2.

When I compiled gd ,I used some libraries,such as 
libpng-1.2.0,zlib-1.1.4,freetype-2.1.0,I want my gd can support ttf besides png 
image,is it enough?

Can php support ttf?I hava just compiled gd in php,but I found it can not use some 
functions like ImageTTFtext and ImageTTFBBox,why?

Is that right that  gd-1.8.4 can't support functions about ttf ,just as gd cannot 
support gif?

Thank you
zhaoxd




Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren

First, you'll need to get the length of the str with the str_len() function.
After you have that, use the substr() function like Rasmus mentioned.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: "Craig Westerman" <[EMAIL PROTECTED]>
To: "php-general-list" <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 10:26 PM
Subject: [PHP] remove last character in a string


> I have a string that ends in a comma. What is best method to remove the
> comma?
>
> Craig ><>
> [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remove last character in a string

2002-04-22 Thread Rasmus Lerdorf

read php.net/substr

On Mon, 22 Apr 2002, Craig Westerman wrote:

> I have a string that ends in a comma. What is best method to remove the
> comma?
> 
> Craig ><>
> [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] remove last character in a string

2002-04-22 Thread Craig Westerman

I have a string that ends in a comma. What is best method to remove the
comma?

Craig ><>
[EMAIL PROTECTED]



Re: [PHP] Why isn't this working? :( - I found my solution!

2002-04-22 Thread Leif K-Brooks

Thanks for everyone's help.  I just figured out was wrong.  I wasn't
checking if a code was being returned.  So all he had to do was chenge the
codeid field to a non-existant code.  Lol. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Regex: catchall function to validate Last and First names

2002-04-22 Thread Carl E Shmidt

I have a guest book , and I want to make sure that those people who sign the
guest book can't impersonate a member of the web site.  the code below
checks the input string, which is the guestbook signer's name, against a
list of defined web site members.  Is there any way to circumvent the code
as I've written it?

  function validateGuestbookSigner($valToEval,&$errorArray){
echo "Value: $valToEval";
$valToEval=preg_replace("/[^A-Za-z0-9]/","",$valToEval);
echo "Value after stripping all nonessential debris: $valToEval";

//obtain the list of names to test against
$names=getGuestBookNames();

//iterate through each person in the list
foreach($names as $name){

  //explode to get first and last name
  $namePieces=explode(",",$name);


  //look for the last name,case insensitive
  if(preg_match("/" . $namePieces[0] . "/i", $valToEval)){
$errorArray[]="The last name that it matched is: $namePieces[0]";
$errorArray[]="Please consult the Guestbook Rules for a list of
names of those people in the band or are affilliated with the web site
";
$errorArray[]="Part of the guestbook signer's name matches a last
name that cannot be used";
return false;
  }

  //look for the first name,case insensitive
  //(the name might just be Webmaster, so make sure
  // to check if first name exists at all)
  if(count($namePieces)>1){
 if(preg_match("/" . $namePieces[1]  . "/i", $valToEval)){
   $errorArray[]="The first name that it matched is:
$namePieces[1]";
   $errorArray[]="Please consult the Guestbook rules for a list of
names of those people in the band or are affilliated with the web s
ite";
   $errorArray[]="Part of the guestbook signer's name matches a last
name that cannot be used";
   return false;
 }
  }
}
return true;
  }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Why isn't this working? :(

2002-04-22 Thread Richard Archer

At 9:11 PM -0400 22/4/02, Leif K-Brooks wrote:


At 9:11 PM -0400 22/4/02, Leif K-Brooks wrote:

>I have a site where users can sign up.  I have had huge problems with people
>using auto-signups, so I tried to stop them with an authentication image.
>Someone has since gotten around that.  I highly doubt he is using OCR.  Can
>someone try to figure out what's wrong with my code?

I can't see anything wrong with it. Maybe the hacker is smarter than
you give him credit for.


>$authimage = ImageCreate(40,15);

Try randomising the size of the image. That'll stuff up any hash tables
he's built.


>imagestring($authimage,5,0,0,$getcode[code],$black);

and try varying the offset of the string in the image.


>$code = mt_rand(1000,);

Only 8999 possible codes? Is he brute-forcing it?
Check the server logs for thousands of verification attempts.


>if($code != $getcode[code]){
>die("Error: wrong code");

And consider deleting the code after 3 incorrect attempts.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: ereg size limit???

2002-04-22 Thread SP

Hey James, yeah you're right that was a typo, ereg was what I meant.  Thanks
your suggestion worked and plus I think preg is much faster then ereg so
that's cool.


-Original Message-
From: liljim [mailto:[EMAIL PROTECTED]]
Sent: April 22, 2002 4:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: ereg size limit???


Hi,


"Sp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to validate my input with ereg but I get the error "Warning:
> REG_BADBR" when I try over 255 characters.  Is there anyway around this?
>
> Works
> =
> if(eregi('^[A-Za-z]{1,255}$', "test sentence"))
>   echo "valid input";
>
> Doesn't Work
> 
> if(eregi('^[A-Za-z]{1,256}$', "test sentence"))
>   echo "valid input";


First off, you're using eregi (case insensitive), but defining a-zA-Z (a
through z, case insensitive) in your characters class. You could just use
ereg and leave the character class as it is, or drop the A-Z from the eregi
version.

Secondly, I'd amend your code to:
^[a-z]+$

And thirdly, I'd just use a combination of ereg / preg_* functions and
strlen.

if(preg_match("/^[a-z]+$/i", $string) && strlen($string) < 255)
{
echo "Whatever.";
}

I'm not sure why you're getting that error, but then again, I haven't
bothered reading up about it :)

James



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Why isn't this working? :(

2002-04-22 Thread Martin Towell

> Can someone try to figure out what's wrong with my code?
What are you expecting, and what are you seeing?


-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Why isn't this working? :(


I have a site where users can sign up.  I have had huge problems with people
using auto-signups, so I tried to stop them with an authentication image.
Someone has since gotten around that.  I highly doubt he is using OCR.  Can
someone try to figure out what's wrong with my code?  Here it is:
Contents of auth_image.php:


Some code from signup.php:
//I do seed the random number in the header
$code = mt_rand(1000,);
mysql_query("insert into signupcodes(code) values('$code')");
$codeid = mysql_insert_id();

Code from above: 

At top of proccess_signup.php:
$getcode = mysql_fetch_array(mysql_query("select * from signupcodes where id
= '$codeid'"));
if($code != $getcode[code]){
die("Error: wrong code");
}

In the middle of process_signup.php, after I've done checks of a few other
things:
 echo "You're a member! :DBack to homepage";
mysql_query("delete from signupcodes where id='$codeid'") or print 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Why isn't this working? :(

2002-04-22 Thread Leif K-Brooks

I have a site where users can sign up.  I have had huge problems with people
using auto-signups, so I tried to stop them with an authentication image.
Someone has since gotten around that.  I highly doubt he is using OCR.  Can
someone try to figure out what's wrong with my code?  Here it is:
Contents of auth_image.php:


Some code from signup.php:
//I do seed the random number in the header
$code = mt_rand(1000,);
mysql_query("insert into signupcodes(code) values('$code')");
$codeid = mysql_insert_id();

Code from above: 

At top of proccess_signup.php:
$getcode = mysql_fetch_array(mysql_query("select * from signupcodes where id
= '$codeid'"));
if($code != $getcode[code]){
die("Error: wrong code");
}

In the middle of process_signup.php, after I've done checks of a few other
things:
 echo "You're a member! :DBack to homepage";
mysql_query("delete from signupcodes where id='$codeid'") or print 




Re: [PHP] Unsubscribe?

2002-04-22 Thread Miguel Cruz

On Mon, 22 Apr 2002, Josiah Wallingford wrote:
> How do you unsubscribe to this mailing list?

Instructions are provided in the header of each list message.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Unsubscribe?

2002-04-22 Thread Martin Towell

[snip from bottom of msgs]
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[end snip]

-Original Message-
From: Josiah Wallingford [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 10:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Unsubscribe?


How do you unsubscribe to this mailing list?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Unsubscribe?

2002-04-22 Thread Josiah Wallingford

How do you unsubscribe to this mailing list?



Re: [PHP] LogiCreate: looking for resellers

2002-04-22 Thread Michael Kimsal

Richard Archer wrote:
> At 7:57 PM -0400 22/4/02, Michael Kimsal wrote:
> 
> 
>>you won't find a stronger combination of a solid development
>>framework and professional support anywhere else.
> 
> 
> In a word: Bollocks.
> 
> This obviously an untrue claim for all but one company in the world.
> And I find it very hard to believe that you could be that company.
> 
> I would never purchase (or possibly even use) a product from someone
> who lies and misleads in their promotional material.
> 
> Thanks for the spam.
> 
>  ...R.

Perhaps I should have clarified (and I thought it was evident)
that we were referring to the PHP market, not the
software development market in general.  We still don't know
anyone else who provides guaranteed PHP development support
service or professional training courses for PHP.  If you
know of others in the US, please let me know.

I apologize to you if you've felt misled - it was not the
intention at all.


Michael Kimsal
http://www.logicreate.com
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] LogiCreate: looking for resellers

2002-04-22 Thread Richard Archer

At 7:57 PM -0400 22/4/02, Michael Kimsal wrote:

> you won't find a stronger combination of a solid development
>framework and professional support anywhere else.

In a word: Bollocks.

This obviously an untrue claim for all but one company in the world.
And I find it very hard to believe that you could be that company.

I would never purchase (or possibly even use) a product from someone
who lies and misleads in their promotional material.

Thanks for the spam.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] LogiCreate: looking for resellers

2002-04-22 Thread Michael Kimsal

Hello all!

My company, Tap Internet, has launched the latest
version of our development platform - LogiCreate.  The basic
info can be found at http://www.logicreate.com, but I'm writing
here specifically to solicit product resellers from
the PHP developer community.

The product itself has been tested in numerous deployments
over the past 2 years, including ecommerce, extranet, intranet and
CMS-oriented installations.

Although there are numerous open source projects and toolkits
you can base your development work on, we'd like to appeal to
your commercial instincts.  By becoming a LogiCreate
reseller, you'll be getting much more than code and updates,
including

* Deployment experience and support.  Our engineers
have deployed large scale ecommerce sites (processing
tens of millions of dollars per day) as well as handled
migration from ColdFusion and ASP-based sites.

* Sales support - if you need help developing proposals
to go up against competitors, we can help.  Whether it's
the validity of PHP itself, or questions about open source
security, we'll lend our support to your sales efforts.

* Training - we offer the only professional PHP training course
in the US, and as a reseller you get preferred rates on
training courses (as well as at least one free class per year).

While there's nothing wrong with the mailing lists and
support forums on various free sites, you won't find a stronger 
combination of a solid development framework and professional support
anywhere else. If you're ready to step up your development
efforts with PHP, give us a call.


-
Michael Kimsal
734-480-9961
http://www.logicreate.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread Martin Towell

What about:
1. getting rid of anything between ""
2. get rid of any attributes that start with " on" and end with a
quotes or space
Maybe I'm forgetting about some valid attributes that start
with "on", you might have to cater for them

Does this work?

HTH
Martin


-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 6:49 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: AW: [PHP] Re: Second opinion needed - javascript blocker


Thynks, but I don't want to block html, I want to block javascript!  And
since onmouseover and similar events can be put in any tag, I'm trying to
block them.
on 4/22/02 4:44 PM, J Smith at [EMAIL PROTECTED] wrote:


Then I'd suggest using the strip_tags() function and define which tags you'd
like to leave untouched.

J


Red Wingate wrote:

> He might want to use this function but doing so no links or bold underline
> Tags will be destroyed as well.
> 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] From where was function called?

2002-04-22 Thread Martin Towell

um - (unix) grep   (windows) find files
That's something that I've been wanting for a while - a function call stack
that the php script can look at.

-Original Message-
From: Nico van der Dussen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 3:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] From where was function called?


Hi,

I'm having a real problem:

In a codeset of more than 5000 lines of code, I have a rogue call to a
function.

Is there a way I can determine in a function from where the call was
made?  (Filename, linenumber etc)

Thanks

Nico


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Miguel Cruz

On Mon, 22 Apr 2002, Leif K-Brooks wrote:
> I use $formvar for form processing, I don't use the arrays.  This is how I
> was taught to do it.  If my host upgrades to 4.2.0, my website is as good as
> gone!  What am I supposed to do?!

Fix them! This direction was first announced in 4Q1999; 2.5 years ought to 
be enough preparation time.

This change improves your security, so it'd be rational to be happy about 
it.

In any case, you can probably override it for your web space with a 
.htaccess directive, should you want to persist in your resistance to 
positive change.

Also, if you were taught to do it the $formvar way in the past year or so, 
you should find the person who taught you and tweak their nose.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Why does this not work??

2002-04-22 Thread Richard Archer

At 10:28 PM + 22/4/02, Jeffrey Means wrote:
>In using the setcookie function I can not set a cookie if I specify a time
>period.  ie. setcookie("Cookie_Name", "Cookie_Value", time()+30); will not
>set a cookie, but setcookie("Cookie_Name", "Cookie_Value"); does work.  What
>am I dooing wrong??

30 seconds is a mighty short cookie age.

Are the clocks on the workstation and server in synch?
I suggest your server clock is more than 30 seconds faster than your
workstation clock, and the cookie is being set in the past.

Cookie expiry times less than an hour can cause problems in time
zones which have daylight savings. I always use 2 hours as a minimum.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Why does this not work??

2002-04-22 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jeffrey Means) wrote:

> In using the setcookie function I can not set a cookie if I specify a time 
> period.  ie. setcookie("Cookie_Name", "Cookie_Value", time()+30); will not 
> set a cookie, but setcookie("Cookie_Name", "Cookie_Value"); does work.  What 
> am I dooing wrong??

You need to read the docs more carefully, because time() returns a value in 
seconds, not minutes.  Your time period is too short: the cookie expires 30 
seconds after having been set.  Whereas when you set no expiration, the 
cookie remains set until the window closes.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 4.1.2 problem with IE

2002-04-22 Thread Richard Archer

At 5:30 PM -0400 22/4/02, Dave Sugar wrote:

>The forward page is using the HTTP meta tag, as follows:
> 
>I don't see any errors in the Apache logs regarding this (in error.log).  I
>also don't see the page sent to the client (in server.log).

Hi Dave,

This implies Explorer is failing to interpret the meta refresh properly,
and is not contacting the server to request the correct page.

It seems to be working fine on the limited versions of IE I have here.

Try using the full URL in that tag:
http://gdpim.glencoe.com/login/login.php";>


Another option (and this is how I always set these redirections up)
is to set up an index.php file containing:

http://gdpim.glencoe.com/login/login.php";);
?>

You will also need to add "index.php" to the DirectoryIndex line
in httpd.conf:
DirectoryIndex index.cgi index.pl index.html index.htm index.php


>I have posted the entire Apache Config file, but I think this overkill:

Too much information is better than not enough :)

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-22 Thread Jason Soza

I actually was using other scripts I'd found, written by different 
authors. I did this to try to save time, but this hasn't been the case.

All I was looking to do was have someone fill out a form, hit submit, 
and I would have the contents of the form e-mailed to me, and any 
attachments would be sent as well.

I think that since that last upload script works and the two scripts 
that sent the attachments via e-mail didn't work, I'm just going to try 
my hand at writing my own script using the mail() function. I'll just 
have the script e-mail me the form contents and upload the files to an 
incoming directory with a timestamp prefix, so I can match the e-mails 
with the uploads. This should be a fairly straightforward task, correct?

Jason Soza

- Original Message -
From: Jason Wong <[EMAIL PROTECTED]>
Date: Monday, April 22, 2002 0:54 am
Subject: Re: [PHP] Attachments


> 1) Did *you* write both the php & perl scripts? Just checking, if 
> you wrote 
> both, then you might have made the same mistake in both ;-) If 
> they're by 
> independent authors then the chances of the same mistake are 
> slightly lower.
> 
> 2) Just to really confirm that the upload process is not the 
> problem can you 
> try sending a local existing file using your scripts?
> 
> 3) In your scripts I can't see where the attachments (ie the 
> files) gets 
> encoded to base64. Have I missed something?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications 
> Development *
> 
> /*
> Who are you?
> */



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Why does this not work??

2002-04-22 Thread Jeffrey Means

In using the setcookie function I can not set a cookie if I specify a time 
period.  ie. setcookie("Cookie_Name", "Cookie_Value", time()+30); will not 
set a cookie, but setcookie("Cookie_Name", "Cookie_Value"); does work.  What 
am I dooing wrong??



Jeffrey D. Means
CIO for PicoTech
Fort Collins, Colorado


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Empty $_SESSION and $_POST ??

2002-04-22 Thread Andre Dubuc

On Monday 22 April 2002 05:34 pm, you wrote:
> On Monday, April 22, 2002, at 03:47  PM, Andre Dubuc wrote:
> > I tried what you suggested, and indeed globals are off. Perhaps my
> > problem
> > stems from my use of the $_GET[] with $vars. I guess I don't really
> > understand what I'm doing. If you would take a peek at this code [I
> > think
> > I've introduced a security hole, and I'm mixing up things]:
>
> I think the problem you're having is basically understanding what
> register_globals does, and why some people might want to turn it off.
>
> register_globals takes a variable (doesn't matter if it's a server
> variable, a cookie variable, a post variable, or a get variable) and
> registers it as global throughout the script.  This means that if
> someone types
>
> http://www.domain.com/index.php?firstname=andre&lastname=dubuc
>
> into the "Address" bar of her browser, she has just requested the
> "index.php" resource from the server at "www.domain.com" using the HTTP
> protocol and sent two variables to the server using the GET method:
>
> $firstname = 'andre'
> $lastname = 'dubuc'
>
> If you have register_globals turned on, then your script can look like
> this:
>
> if ($firstname == 'andre' && $lastname == 'dubuc') {
>// do something
> }
>
> and it still works.  However, if you have register_globals turned off,
> then the above 'if test' won't work.  This is because these variables
> are not $firstname and $lastname, they are $_GET['firstname'] and
> $_GET['lastname'].  To do an 'if test' with register_globals off, you
> should do:
>
> if ($_GET['firstname'] == 'andre' && $_GET['lastname'] == 'dubuc') {
>// do something
> }
>
> There's really not much of a difference.  The thing is that instead of
> being a global variable, the data that you passed is now an element of
> the $_GET array.  So you use the standard element notation, using the
> associative index of the variable name.
>
> If you do this:
>
> $firstname = $_GET['firstname'];
> $lastname = $_GET['lastname'];
>
> ...you make your code simpler to understand, but be careful that you
> don't do something in the same script like
>
> $lastname = $row['last_name'];
>
> (which could happen if you were trying to simplify your MySQL result
> data.)
>
> I'll take a look at what you've got
>
> > On page 1:
> >
> > 
> > // ob_start(); so I can have html headers on this page & redirect later
> > // some other code
> > 
> >  > // The following line is where I think I've caused myself grief.
> >
> > 
> >
> > 
> > ?>
>
> Yeah, I'd say you've caused yourself some grief.  This isn't even
> related to register_globals -- you've got two HTML input tags in the
> middle of your PHP block.  You need to print() or echo these, not just
> type them in directly.
>
> print("");
> print("");
>
> > $bozo = $_GET['bozo'];
> >
> > /* Now is this correct? Am I exposing 'bozo'  to a security hole? For
> > the
> > rest of the script, with each $_GET['var'] from the previous page I do
> > the
> > same. Somehow, I don't think I've grasped what to do with $vars. From my
> > reading elsewhere, should I, for example, in page 1 use something like
> >
> > 
>
> I prefer to do it the way that you have read elsewhere, but it really
> doesn't matter.  Either way, you have a variable in your script that
> points to some user-specified data.  What you've done is simplified the
> results, similar to what some people do when they pull data out of a
> result set with mysql_fetch_array().  The only security hole is if you
> have written your script to do something unsafe with the $bozo variable.
>
> HOWEVER... bear in mind that now that you are referring to this variable
> in this fashion, you could end up inadvertently overwriting this
> variable with a new variable, by doing something like
>
> $bozo = $row['bozo'];
>
>   -- something that is far less likely to occur when referring to it as
> $_GET['bozo'].
>
> It really depends on how organized your code is.  If I were you, I would
> probably get into the habit of calling it $_GET['bozo'], since that just
> saves you time and stress in the long run.  The only security hole would
> be this:
>
> $_SESSION['admin'] = 'yes'; // indicates that user is an administrator
> $admin = $_SESSION['admin']; // simplify our variable name
>
> if ($admin == 'yes') { // if user is an administrator
>// display some sensitive data
> }
>
> // for some stupid reason we do this
> $admin = $_GET['admin']; // obviously you wouldn't do something like this
>
> if ($admin == 'yes') {
>// display some sensitive data
> }
>
> Essentially, in the above code, you've given the value of a GET variable
> called "admin" the same power as a session variable called "admin".
> This is bad practice in general, and I'm sure you wouldn't make this
> mistake.
>
> Simply making $admin = $_SESSION['admin'] does NOT mean that someone can
> type "admin=yes" into the querystring and automatically become the
> admin, because register_globals is OFF -- this me

[PHP] Re: Not A PHP question but I need help in a big way...

2002-04-22 Thread Michael Kimsal

Chuck Pup Payne wrote:
> Hi,
> 
> I just got finish will a meeting from HELL, I need to ask can some one tell
> me is there an Apache Mailing List like this. I have to ask if I can do ASP
> page on Apache, I know I know please don't flame me, I kept trying to get
> them to switch to PHP, but I been told to shut my mouth and just find out
> this information. So I am sorry that I am asking but I not sure where to
> start.
> 
> Chuck Payne
> 

You don't need a mailing list so much as just going to google first -
it'll point you to mailing lists or groups if they exist (hit 'groups' 
at the top too).

I can give you the answer(s):

Chilisoft makes an ASP interpreter which works with Apache,
but it doesn't run everything.

By ASP I'm assuming you mean VBScript.  You will see reference to an ASP 
module for Apache - don't bother.  It uses Perl and emulates some of the 
core ASP system objects.  Unless your people are inclined to rewrite 
everything in Perl, don't bother even clicking those weblinks.

So the short answer is pretty much 'no', with the exception of 
Chilisoft.  If your ASP pages are extremely simple Hello World type 
stuff that don't use any external COM stuff, it'll work.  Otherwise skip 
it.  If you're on Windows, just stick with ASP/VBScript.

Michael Kimsal
http://www.phphelpdesk.com
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Not A PHP question but I need help in a big way...

2002-04-22 Thread Weston Houghton


Check out ChiliSoft:
http://www.chilisoft.com/

Wes


> Hi,
> 
> I just got finish will a meeting from HELL, I need to ask can some one tell
> me is there an Apache Mailing List like this. I have to ask if I can do ASP
> page on Apache, I know I know please don't flame me, I kept trying to get
> them to switch to PHP, but I been told to shut my mouth and just find out
> this information. So I am sorry that I am asking but I not sure where to
> start.
> 
> Chuck Payne
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] header redirection

2002-04-22 Thread Norman Zhang

Hi,

My codes are as follows,

login.php


// This is my default header that I want to include on every page.
  
  
Support Center


  

  


  
  SupportCenter
    


   upload   download
  Logout 


// End of my default header that I want to include on every page.

Support Center


  
User Name

  
  
Password

  
  
 

  



  
  
 0)
{
  $_SESSION['userid']=$row[0];
  $_SESSION['userlevel']=$row[1];
  $_SESSION['usersec']=mt_rand(100, 999);

  $updatesql="update auth set seckey='$_SESSION[usersec]'
where usrid='$_SESSION[userid]'";

  if (!mysql_query($updatesql))
die ("Cannot update database.");

  header("Location: down.php");
  die ();
}
else
{
  echo "Go Away!";
  echo "You are not authorized to view this resource.";
  die();
}
  }
?>

down.php

 0)
{
?>

// I want to include the default header in here again. But it does not work.



Thanks,
Norman

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
On Saturday 20 April 2002 05:07, Norman Zhang wrote:
> Hi,
>
> I use header(location: ...) for redirection to another page. But I also
> want to include ,  and  tags in the other page. Is
there
> a way to this? Because php complains that the header already been sent.

Show us your code.

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Spiritual leadership should remain spiritual leadership and the temporal
power should not become too important in any church.
- Eleanor Roosevelt
*/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Empty $_SESSION and $_POST ??

2002-04-22 Thread Erik Price


On Monday, April 22, 2002, at 03:47  PM, Andre Dubuc wrote:

> I tried what you suggested, and indeed globals are off. Perhaps my 
> problem
> stems from my use of the $_GET[] with $vars. I guess I don't really
> understand what I'm doing. If you would take a peek at this code [I 
> think
> I've introduced a security hole, and I'm mixing up things]:

I think the problem you're having is basically understanding what 
register_globals does, and why some people might want to turn it off.

register_globals takes a variable (doesn't matter if it's a server 
variable, a cookie variable, a post variable, or a get variable) and 
registers it as global throughout the script.  This means that if 
someone types

http://www.domain.com/index.php?firstname=andre&lastname=dubuc

into the "Address" bar of her browser, she has just requested the 
"index.php" resource from the server at "www.domain.com" using the HTTP 
protocol and sent two variables to the server using the GET method:

$firstname = 'andre'
$lastname = 'dubuc'

If you have register_globals turned on, then your script can look like 
this:

if ($firstname == 'andre' && $lastname == 'dubuc') {
   // do something
}

and it still works.  However, if you have register_globals turned off, 
then the above 'if test' won't work.  This is because these variables 
are not $firstname and $lastname, they are $_GET['firstname'] and 
$_GET['lastname'].  To do an 'if test' with register_globals off, you 
should do:

if ($_GET['firstname'] == 'andre' && $_GET['lastname'] == 'dubuc') {
   // do something
}

There's really not much of a difference.  The thing is that instead of 
being a global variable, the data that you passed is now an element of 
the $_GET array.  So you use the standard element notation, using the 
associative index of the variable name.

If you do this:

$firstname = $_GET['firstname'];
$lastname = $_GET['lastname'];

...you make your code simpler to understand, but be careful that you 
don't do something in the same script like

$lastname = $row['last_name'];

(which could happen if you were trying to simplify your MySQL result 
data.)

I'll take a look at what you've got

> On page 1:
>
> 
> // ob_start(); so I can have html headers on this page & redirect later
> // some other code
> 
>  // The following line is where I think I've caused myself grief.
>
> 
>
> 
> ?>

Yeah, I'd say you've caused yourself some grief.  This isn't even 
related to register_globals -- you've got two HTML input tags in the 
middle of your PHP block.  You need to print() or echo these, not just 
type them in directly.

print("");
print("");

> $bozo = $_GET['bozo'];
>
> /* Now is this correct? Am I exposing 'bozo'  to a security hole? For 
> the
> rest of the script, with each $_GET['var'] from the previous page I do 
> the
> same. Somehow, I don't think I've grasped what to do with $vars. From my
> reading elsewhere, should I, for example, in page 1 use something like
> :
> 

I prefer to do it the way that you have read elsewhere, but it really 
doesn't matter.  Either way, you have a variable in your script that 
points to some user-specified data.  What you've done is simplified the 
results, similar to what some people do when they pull data out of a 
result set with mysql_fetch_array().  The only security hole is if you 
have written your script to do something unsafe with the $bozo variable.

HOWEVER... bear in mind that now that you are referring to this variable 
in this fashion, you could end up inadvertently overwriting this 
variable with a new variable, by doing something like

$bozo = $row['bozo'];

  -- something that is far less likely to occur when referring to it as 
$_GET['bozo'].

It really depends on how organized your code is.  If I were you, I would 
probably get into the habit of calling it $_GET['bozo'], since that just 
saves you time and stress in the long run.  The only security hole would 
be this:

$_SESSION['admin'] = 'yes'; // indicates that user is an administrator
$admin = $_SESSION['admin']; // simplify our variable name

if ($admin == 'yes') { // if user is an administrator
   // display some sensitive data
}

// for some stupid reason we do this
$admin = $_GET['admin']; // obviously you wouldn't do something like this

if ($admin == 'yes') {
   // display some sensitive data
}

Essentially, in the above code, you've given the value of a GET variable 
called "admin" the same power as a session variable called "admin".  
This is bad practice in general, and I'm sure you wouldn't make this 
mistake.

Simply making $admin = $_SESSION['admin'] does NOT mean that someone can 
type "admin=yes" into the querystring and automatically become the 
admin, because register_globals is OFF -- this means that

$admin != $_GET['admin']

unless you set it so.

> Once I figure out how I'm supposed to write the variables in the 
> scripts,
> I'll be OK. But I'm so CONFUSED!  */
>
> if  ($bozo == "") die ("Please enter your 'First Name'.  Click
> 

Re: [PHP] PHP 4.1.2 problem with IE

2002-04-22 Thread Dave Sugar

The error page being shown is IE's 'Page Nout Found' error, not an error 404
returned from the server.  The error sounds very similar to an error posted
to bugs.php.net here (http://bugs.php.net/bug.php?id=15794).  It also has
the feel of this error, but the same solution does not seem to make a
difference (http://bugs.php.net/bug.php?id=9433)

The forward page is using the HTTP meta tag, as follows:




 Glencoe Instructor Management
 





I don't see any errors in the Apache logs regarding this (in error.log).  I
also don't see the page sent to the client (in server.log).

I'm not sure I understand you final question about "What's in the file
system where the file is supposed to be?"  There is the file login.php which
is where the index.html is forwarding to but it shows the 'Page not found'
error in IE.

Just to note, I am unable to reproduce the problem running in Netscape 6.2
(havn't tried other browsers).  I also

This site is virtual hosted (as you will see in the Apache Config below).
But one of the items posted to bugs.php.net made refernece to this as the
problem.  But I also see it on a NON-virtual hosted site.

Once again, thanks for the help.
Dave Sugar
[EMAIL PROTECTED]

I have posted the entire Apache Config file, but I think this overkill:

#
### Main Server Common Config ###
#
###
###
###
### Variable Secion
###
User gdpim.glencoe.com
Group gdpim.glencoe.com
Listen 198.45.24.71:80
Listen 198.45.24.71:9000

ServerAdmin [EMAIL PROTECTED]
ServerRoot /web/sites/gdpim.glencoe.com
###
### Core System Config
###
# LoadModule env_module /usr/local/apache_1.3.14/libexec/mod_env.so
# LoadModule config_log_module
/usr/local/apache_1.3.14/libexec/mod_log_config.so
# LoadModule mime_module/usr/local/apache_1.3.14/libexec/mod_mime.so
# LoadModule negotiation_module
/usr/local/apache_1.3.14/libexec/mod_negotiation.so
# LoadModule status_module
/usr/local/apache_1.3.14/libexec/mod_status.so
# LoadModule includes_module
/usr/local/apache_1.3.14/libexec/mod_include.so
# LoadModule autoindex_module
/usr/local/apache_1.3.14/libexec/mod_autoindex.so
# LoadModule dir_module /usr/local/apache_1.3.14/libexec/mod_dir.so
# LoadModule cgi_module /usr/local/apache_1.3.14/libexec/mod_cgi.so
# LoadModule asis_module/usr/local/apache_1.3.14/libexec/mod_asis.so
# LoadModule imap_module/usr/local/apache_1.3.14/libexec/mod_imap.so
# LoadModule action_module
/usr/local/apache_1.3.14/libexec/mod_actions.so
# LoadModule userdir_module
/usr/local/apache_1.3.14/libexec/mod_userdir.so
# LoadModule alias_module
/usr/local/apache_1.3.14/libexec/mod_alias.so
# LoadModule access_module
/usr/local/apache_1.3.14/libexec/mod_access.so
# LoadModule auth_module/usr/local/apache_1.3.14/libexec/mod_auth.so
# LoadModule setenvif_module
/usr/local/apache_1.3.14/libexec/mod_setenvif.so
LoadModule rewrite_module
/usr/local/apache_1.3.14/libexec/mod_rewrite.so
LoadModule dbm_auth_module
/usr/local/apache_1.3.14/libexec/mod_auth_dbm.so
# LoadModule php3_module
/usr/local/apache_1.3.9/libexec/libphp3-oracle.so
# Old PHP module -- insecure
# LoadModule php4_module
/usr/local/apache_1.3.9/libexec/libphp4-gd-jpeg.so
# New PHP module
LoadModule php4_module
/web/sites/gdpim.glencoe.com/conf/libphp4-S-gdpim.so

#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_rewrite.c
# AddModule mod_auth_msql.c
AddModule mod_auth_dbm.c
AddModule mod_perl.c
# AddModule mod_php3.c
AddModule mod_php4.c

SetEnv PERL5LIB /web/sites/gdpim.glencoe.com/site_perl
SetEnv PERLLIB /web/sites/gdpim.glencoe.com/site_perl
Include conf/mod_perl.conf


 php_value include_path ".:/web/sites/gdpim.glencoe.com/conf"


###
### Server Config
###
ServerType standalone
HostnameLookups off
ErrorLog logs/error.log
CustomLog logs/server.log "%h %l %u %t \"%r\" %s %b \"%{Referer}i\"
\"%{User-agent}i\""
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_status
Timeout 600
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 30
MinSpareServers 1
MaxSpareServers 20
StartServers 2
MaxClients 100
MaxRequestsPerChild 800
###
### Document Config
###
TypesConfig /etc/mime.types
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType

[PHP] Re: ImageCreate v. ImageCreateTrueColor

2002-04-22 Thread pt8455568-14

ImageCreate() creates a palette based image. The numbers of colors is thus
limited to 256. Where as the function name suggests ImageCreateTrueColor()
creates a true color image.

You will have to test out the functions you want to use with these two.
There is no better solution.

good luck

Paradox.

"Natalie Leotta" <[EMAIL PROTECTED]> wrote in message
7546CB15C0A1D311BF0D0004AC4C4B0C024ABF8D@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABF8D@SSIMSEXCHNG...
> Hello,
>
> I'm making an Image and I was wondering what the difference is between
these
> two Image constructors.  I need to find a way to make dotted and dashed
> lines (according to different patterns I've been given) and I want the
> sections between the dots to be transparent.  I'm planning on using the
> ImageSetStyle function.  From what I read on PHP.net, some things cannot
be
> used with ImageCreateTrueColor, but it looks like some can only be used
that
> one.
>
> One thing I'm interested in is the constant IMG_COLOR_TRANSPARENT - can
this
> be used with ImageCreate?
>
> Is there a reason I should use one of the constructors over the other?
>
> Thanks!
>
> -Natalie
>
>
> Natalie S. Leotta
> Information Management Services, Inc.
> (301) 680-9770
> [EMAIL PROTECTED]
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Rodolfo Gonzalez

On Mon, 22 Apr 2002, Leif K-Brooks wrote:
> The only problem with that is that I have at least 50 scripts that are using
> the old thing!

You could auto_prepend the file which has the code for "backwards 
compatibility" of the variables.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Rasmus Lerdorf

Also see extract() and import_request_variables()

Although, an upgrade to PHP 4.2.0 is not going to automatically disable
register_globals.  Upgrading PHP does not overwrite the existing php.ini
file, so unless you ISP specifically changes this php.ini setting, nothing
will change.

-Rasmus

On Mon, 22 Apr 2002, Alok K. Dhir wrote:

> Change your scripts.  It's relatively easy to cause variables in the
> superglobal arrays to be set in the global namespace.  Code samples for
> this appear in various places in the the user contributed notes in the
> PHP documentation.
>
> A quick and dirty working example:
>
> foreach (array_merge($_POST,$_GET) as $key=>$val) {
>   global $$key;
>   $$key=$val;
> }
>
> If you include the above at the top of all your existing scripts, they
> should continue to function.
>
> As always, caveat emptor...
>
> Alok
>
> > -Original Message-
> > From:
> > [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED].
> > net] On Behalf Of Leif K-Brooks
> > Sent: Monday, April 22, 2002 5:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] The so-called improvment in PHP 4.2.0
> >
> >
> > I use $formvar for form processing, I don't use the arrays.
> > This is how I was taught to do it.  If my host upgrades to
> > 4.2.0, my website is as good as gone!  What am I supposed to do?!
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Leif K-Brooks

The only problem with that is that I have at least 50 scripts that are using
the old thing!
on 4/22/02 5:14 PM, Adam Voigt at [EMAIL PROTECTED] wrote:

Umm, use $_POST or $_GET or $_REQUEST from now on.

Adam Voigt
[EMAIL PROTECTED]




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Eugene Lee

On Mon, Apr 22, 2002 at 05:10:34PM -0400, Leif K-Brooks wrote:
: 
: I use $formvar for form processing, I don't use the arrays.  This is how I
: was taught to do it.  If my host upgrades to 4.2.0, my website is as good as
: gone!  What am I supposed to do?!

Learn the new method.  Or RTFM.

http://www.php.net/manual/en/html/language.variables.predefined.html


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Alok K. Dhir

Change your scripts.  It's relatively easy to cause variables in the
superglobal arrays to be set in the global namespace.  Code samples for
this appear in various places in the the user contributed notes in the
PHP documentation.

A quick and dirty working example:

foreach (array_merge($_POST,$_GET) as $key=>$val) {
global $$key;
$$key=$val;
}

If you include the above at the top of all your existing scripts, they
should continue to function.

As always, caveat emptor...

Alok

> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED].
> net] On Behalf Of Leif K-Brooks
> Sent: Monday, April 22, 2002 5:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] The so-called improvment in PHP 4.2.0
> 
> 
> I use $formvar for form processing, I don't use the arrays.  
> This is how I was taught to do it.  If my host upgrades to 
> 4.2.0, my website is as good as gone!  What am I supposed to do?!
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Adam Voigt

Umm, use $_POST or $_GET or $_REQUEST from now on.

Adam Voigt
[EMAIL PROTECTED]

On Mon, 22 Apr 2002 17:10:34 -0400, Leif K-Brooks <[EMAIL PROTECTED]> wrote:
> I use $formvar for form processing, I don't use the arrays.  This is how I
> was taught to do it.  If my host upgrades to 4.2.0, my website is as good as
> gone!  What am I supposed to do?!
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] The so-called improvment in PHP 4.2.0

2002-04-22 Thread Leif K-Brooks

I use $formvar for form processing, I don't use the arrays.  This is how I
was taught to do it.  If my host upgrades to 4.2.0, my website is as good as
gone!  What am I supposed to do?!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Not A PHP question but I need help in a big way...

2002-04-22 Thread Chuck PUP Payne

Hi,

I just got finish will a meeting from HELL, I need to ask can some one tell
me is there an Apache Mailing List like this. I have to ask if I can do ASP
page on Apache, I know I know please don't flame me, I kept trying to get
them to switch to PHP, but I been told to shut my mouth and just find out
this information. So I am sorry that I am asking but I not sure where to
start.

Chuck Payne


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PHP 4.2.0 Release Announcement

2002-04-22 Thread Manuzhai

You need to post to php.announce... :D

"Derick Rethans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> The PHP Group is happy to announce the immediate
> availability of PHP 4.2.0, the latest version of the widely-used,
> general-purpose scripting language that is especially well-suited for Web
> development.
>
> This latest release contains over one hundred changes, bug fixes and
> improvements over the previous release, PHP 4.1.2. Among the highlights
> are experimental support for Apache 2, cleanups in variable handling and
> overhauls of various PHP components, including the domxml, posix, sockets
> and iconv extensions. For more information, see below:
>
>
> -
>
>
> External variables
>
> The biggest change in PHP 4.2.0 concerns variable handling. External
> variables (from the environment, the HTTP request, cookies or the web
> server) are no longer registered in the global scope by default. The
> preferred method of accessing these external variables is by using the new
> Superglobal arrays, introduced in PHP 4.1.0. More information about this
> change:
>
> * PHP Manual: Predefined variables
>   http://www.php.net/manual/en/html/language.variables.predefined.html
>
> * The PHP 4.1.0 release announcement
>   http://www.php.net/release_4_1_0.php
>
> * Thomas Oertli's article on secure programming in PHP
>   http://www.zend.com/zend/art/art-oertli.php
>
> Compatibility
>
> The Apache Software Foundation recently released their first General
> Availability version of Apache 2. PHP 4.2.0 will have EXPERIMENTAL support
> for this version. You can build a DSO module for Apache 2 with
> --with-apxs2. We do not recommend that you use this in a production
> environment.
>
> PHP 4.2.0 still lacks certain key features on Mac OS X and Darwin, and
> isn't officially supported by the PHP Group on these platforms.
> Specifically, building PHP as a dynamically loaded Apache module isn't
> supported at this time. PHP 4.3.0, due to be released in August, 2002,
> will be the first PHP release to officially support Mac OS X. It, along
> with future Mac OS X and Apache releases, will enable full feature parity
> with other PHP platforms.
> Improvements
>
> PHP 4.2.0 includes several improvements:
>
> * External variables (from the environment, the HTTP request, cookies
>   or the web server) are no longer registered as global variables
> * Overhaul of the sockets extension
> * Highly improved performance with file uploads
> * The satellite and mailparse extensions were moved to PECL and are no
>   longer bundled with the official PHP release
> * The posix extension has been cleaned up
> * iconv handling has been improved
> * Output buffering support, which was introduced in PHP 4.1.0 has been
>   stabilized
> * Improved performance and stability of the domxml extension
> * New multibyte regular expression support
> * LOTS of fixes and new functions
>
> For a full list of changes in PHP 4.2.0, see the NEWS file
> (http://www.php.net/ChangeLog-4.php).
>
>
>
>
> regards,
>
> Derick Rethans
> [EMAIL PROTECTED]
>
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Base class for objects with get/set w/o overload

2002-04-22 Thread Barry Hoggard

I'm implementing a web site at an ISP (like many it seems) that has
not enabled overload().

I'm accustomed to the Perl world, where I use a base class to do
get/set methods by inserting them into the symbol table.  From what
I've read, the way to do this in PHP is to use overload().

My other alternative is to have something like get('varname'),
set('varname', 'value') in a base class for my object.  Is that they
way to do this, or can you point me to a better way?  I don't wish to
manually implement methods for every variable in every class I have.


-- 
Barry Hoggard
Tristan Media LLC
e: [EMAIL PROTECTED]
p: 212-627-1596
aim: hoggardb 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP 4.2.0 Release Announcement

2002-04-22 Thread Derick Rethans


The PHP Group is happy to announce the immediate 
availability of PHP 4.2.0, the latest version of the widely-used, 
general-purpose scripting language that is especially well-suited for Web 
development.

This latest release contains over one hundred changes, bug fixes and 
improvements over the previous release, PHP 4.1.2. Among the highlights 
are experimental support for Apache 2, cleanups in variable handling and 
overhauls of various PHP components, including the domxml, posix, sockets 
and iconv extensions. For more information, see below:


-


External variables

The biggest change in PHP 4.2.0 concerns variable handling. External 
variables (from the environment, the HTTP request, cookies or the web 
server) are no longer registered in the global scope by default. The 
preferred method of accessing these external variables is by using the new 
Superglobal arrays, introduced in PHP 4.1.0. More information about this 
change:

* PHP Manual: Predefined variables
  http://www.php.net/manual/en/html/language.variables.predefined.html

* The PHP 4.1.0 release announcement
  http://www.php.net/release_4_1_0.php

* Thomas Oertli's article on secure programming in PHP
  http://www.zend.com/zend/art/art-oertli.php

Compatibility

The Apache Software Foundation recently released their first General 
Availability version of Apache 2. PHP 4.2.0 will have EXPERIMENTAL support 
for this version. You can build a DSO module for Apache 2 with 
--with-apxs2. We do not recommend that you use this in a production 
environment.

PHP 4.2.0 still lacks certain key features on Mac OS X and Darwin, and 
isn't officially supported by the PHP Group on these platforms. 
Specifically, building PHP as a dynamically loaded Apache module isn't 
supported at this time. PHP 4.3.0, due to be released in August, 2002, 
will be the first PHP release to officially support Mac OS X. It, along 
with future Mac OS X and Apache releases, will enable full feature parity 
with other PHP platforms.
Improvements

PHP 4.2.0 includes several improvements:

* External variables (from the environment, the HTTP request, cookies 
  or the web server) are no longer registered as global variables
* Overhaul of the sockets extension
* Highly improved performance with file uploads
* The satellite and mailparse extensions were moved to PECL and are no 
  longer bundled with the official PHP release
* The posix extension has been cleaned up
* iconv handling has been improved
* Output buffering support, which was introduced in PHP 4.1.0 has been 
  stabilized
* Improved performance and stability of the domxml extension
* New multibyte regular expression support
* LOTS of fixes and new functions

For a full list of changes in PHP 4.2.0, see the NEWS file 
(http://www.php.net/ChangeLog-4.php).




regards,

Derick Rethans
[EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 4.1.2 problem with IE

2002-04-22 Thread Richard Archer

At 3:35 PM -0400 22/4/02, Dave Sugar wrote:

>  A client of ours has recently upgraded from PHP 4.0.6 to PHP 4.1.2 and now
>they are receiving complaints from users of their website that they
>frequently are getting 'Page Not found' errors when going to the website.

Can you post a complete error page. The exact working on it may shed
light on the problem.


>  The Website was developed under PHP 4.0.6.  And the index.html file is
>just a forward to the main PHP page.

How does the forward take place? Not a buggy old Javascript I hope!


>http://bugs.php.net about seemingly similar problems and the answer is 'It
>is an Apache Configuration Problem'.

Hmm... so what does your Apache config look like?

What is logged in the Apache logs?

What's in the file system where the file is supposed to be?

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread Leif K-Brooks

Thynks, but I don't want to block html, I want to block javascript!  And
since onmouseover and similar events can be put in any tag, I'm trying to
block them.
on 4/22/02 4:44 PM, J Smith at [EMAIL PROTECTED] wrote:


Then I'd suggest using the strip_tags() function and define which tags you'd
like to leave untouched.

J


Red Wingate wrote:

> He might want to use this function but doing so no links or bold underline
> Tags will be destroyed as well.
> 







Re: AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread J Smith


Then I'd suggest using the strip_tags() function and define which tags you'd 
like to leave untouched.

J


Red Wingate wrote:

> He might want to use this function but doing so no links or bold underline
> Tags will be destroyed as well.
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: AW: [PHP] Regex

2002-04-22 Thread Miguel Cruz

On Mon, 22 Apr 2002, Red Wingate wrote:
> ([[-a-zA-Z0-0_]*)\.([a-zA-Z]{2,4}$

Underscores are not permitted in domain names...

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Regex

2002-04-22 Thread Miguel Cruz

On Mon, 22 Apr 2002, James Taylor wrote:
> I'm trying to come up with a regular expression that will match the TL 
> and Second Level domain names in someone's email address ONLY.

Whatever you're planning on doing with that, I hope you're ready for 
addresses that end with .ac.uk and so on; trying to guess an organization 
based on the last two terms of the domain name doesn't always work.

> So, say someone's address is "[EMAIL PROTECTED]", I 
> need to match ONLY pacbell.net.   It shouldn't matter what the address 
> looks like, I'm looking for any number of digits, a dot, any number of 
> digits, and the end of the line.  The closest thing I can come up with 
> is  /\@.+?(.+\..+)?$/, but, as you can guess, that matches everything 
> except the very first character.

  /.*[^a-z0-9\-]([a-z0-9\-]+\.[a-z0-9\-]+)$/i

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 4.2.0?

2002-04-22 Thread Tyler Longren

Give em a few minutes.  They probably just put the "PHP 4.2.0 has been
released" announcement up on the index page.  They may not have put the
files up yet.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: "Sebastian A." <[EMAIL PROTECTED]>
To: "PHP General List (PHP.NET)" <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 3:14 PM
Subject: [PHP] PHP 4.2.0?


> On PHP.net it says that version 4.2.0 of PHP is out, yet on the downloads
> page, I can only find 4.1.2. If anyone has PHP 4.2.0 can you please
provide
> me the URL?
>
> Thanks in advance.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Regex

2002-04-22 Thread Darren Gamble

Good day,

Just off the top of my head, try:

/.+\@.*([^\.]*\.[^\.]*)$/ 

Might not have the exact syntax, but, you get the idea.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 2:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Regex
> 
> 
> I'm trying to come up with a regular expression that will 
> match the TL 
> and Second Level domain names in someone's email address ONLY.
> 
> So, say someone's address is 
> "[EMAIL PROTECTED]", I 
> need to match ONLY pacbell.net.   It shouldn't matter what 
> the address 
> looks like, I'm looking for any number of digits, a dot, any 
> number of 
> digits, and the end of the line.  The closest thing I can 
> come up with 
> is  /\@.+?(.+\..+)?$/, but, as you can guess, that matches everything 
> except the very first character.  Can anyone help me with this? Thanks
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




AW: [PHP] Regex

2002-04-22 Thread Red Wingate

([[-a-zA-Z0-0_]*)\.([a-zA-Z]{2,4}$

should fit ur needs :P

-Ursprungliche Nachricht-
Von: James Taylor [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 22. April 2002 10:17 PM
An: [EMAIL PROTECTED]
Betreff: [PHP] Regex

I'm trying to come up with a regular expression that will match the TL
and Second Level domain names in someone's email address ONLY.

So, say someone's address is "[EMAIL PROTECTED]", I
need to match ONLY pacbell.net.   It shouldn't matter what the address
looks like, I'm looking for any number of digits, a dot, any number of
digits, and the end of the line.  The closest thing I can come up with
is  /\@.+?(.+\..+)?$/, but, as you can guess, that matches everything
except the very first character.  Can anyone help me with this? Thanks


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL query

2002-04-22 Thread Tyler Longren

I'm not sure how PHP would handle this, but have you tried this:
mysql_query("UPDATE sampcomp SET fg='N', pctd='69', maxpctd='69.1' WHERE
sampcompid='3';UPDATE sampcomp SET fg='N', pctd='69.2', maxpctd='69.3'
WHERE sampcompid='2'");
??

I doubt you can put multiple queries in one execution of mysql_query().
It's worth a shot though.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]


- Original Message -
From: "Lee P Reilly" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 3:07 PM
Subject: [PHP] MySQL query


> Hi,
>
> Can someone tell me if there is a way to execute multiple MySQL
> statements by passing *one* query containing a number of individual
> statements to MySQL e.g.
>
> UPDATE sampcomp SET fg="N", pctd="69", maxpctd="69.1" WHERE
> sampcompid="3";UPDATE sampcomp SET fg="N", pctd="69.2", maxpctd="69.3"
> WHERE sampcompid="2";
>
> And just return FALSE if one of the queries cannot be executed? Just
> curious...
>
> Cheers,
> Lee
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread Red Wingate

He might want to use this function but doing so no links or bold underline
Tags will be destroyed as well.

-Ursprungliche Nachricht-
Von: J Smith [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 22. April 2002 10:08 PM
An: [EMAIL PROTECTED]
Betreff: [PHP] Re: Second opinion needed - javascript blocker


Try looking at htmlspecialchars() and htmlentities() instead. They'll
convert things like < and > to > and < and ampersands to &.

J


Leif K-Brooks wrote:

> I am trying to block javascript from ares of my site that  users can
> change.
> I am going to use the following code.  Can someone give me a second
> opinion on whether it will work?
>
> function stopjavascript($text){
> //Stop people from using &whatever;  tags, in case they can smuggle
> javascript in with that
> $text = str_replace("&","&",$text);
> //Stop the onmouseover, etc. parameters
> $text = eregi_replace("on","o-n",$text);
> //Stop script tags, as well as links to javascript:
> $text = eregi_replace("script","sc-ript",$text);
> //Return the edited string
> return $text;
> }


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP 4.2.0?

2002-04-22 Thread Sebastian A.

On PHP.net it says that version 4.2.0 of PHP is out, yet on the downloads
page, I can only find 4.1.2. If anyone has PHP 4.2.0 can you please provide
me the URL?

Thanks in advance.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Regex

2002-04-22 Thread James Taylor

I'm trying to come up with a regular expression that will match the TL 
and Second Level domain names in someone's email address ONLY.

So, say someone's address is "[EMAIL PROTECTED]", I 
need to match ONLY pacbell.net.   It shouldn't matter what the address 
looks like, I'm looking for any number of digits, a dot, any number of 
digits, and the end of the line.  The closest thing I can come up with 
is  /\@.+?(.+\..+)?$/, but, as you can guess, that matches everything 
except the very first character.  Can anyone help me with this? Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread J Smith


Try looking at htmlspecialchars() and htmlentities() instead. They'll 
convert things like < and > to > and < and ampersands to &.

J


Leif K-Brooks wrote:

> I am trying to block javascript from ares of my site that  users can
> change.
> I am going to use the following code.  Can someone give me a second
> opinion on whether it will work?
> 
> function stopjavascript($text){
> //Stop people from using &whatever;  tags, in case they can smuggle
> javascript in with that
> $text = str_replace("&","&",$text);
> //Stop the onmouseover, etc. parameters
> $text = eregi_replace("on","o-n",$text);
> //Stop script tags, as well as links to javascript:
> $text = eregi_replace("script","sc-ript",$text);
> //Return the edited string
> return $text;
> }


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MySQL query

2002-04-22 Thread Lee P Reilly

Hi,

Can someone tell me if there is a way to execute multiple MySQL
statements by passing *one* query containing a number of individual
statements to MySQL e.g.

UPDATE sampcomp SET fg="N", pctd="69", maxpctd="69.1" WHERE
sampcompid="3";UPDATE sampcomp SET fg="N", pctd="69.2", maxpctd="69.3"
WHERE sampcompid="2";

And just return FALSE if one of the queries cannot be executed? Just
curious...

Cheers,
Lee


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP 4.1.2 problem with IE

2002-04-22 Thread Dave Sugar

  A client of ours has recently upgraded from PHP 4.0.6 to PHP 4.1.2 and now
they are receiving complaints from users of their website that they
frequently are getting 'Page Not found' errors when going to the website.

  The Website was developed under PHP 4.0.6.  And the index.html file is
just a forward to the main PHP page.  But going straight to the main page
does not seem to make any difference.  I have seen some error reports at
http://bugs.php.net about seemingly similar problems and the answer is 'It
is an Apache Configuration Problem'.  But I have not seen any real answer
and to what the problem is or how to solve this problem.  I can't believe
that no one else is having similar problems.

  Any help in to how to solve this problem would be greatly appreciated.  I
have already spent a whole lot of time looking into this and don't know what
else to try to solve the problem (besides going back to version 4.0.6 of
PHP).

  The live website is running on Solaris version 8 on a Sparc processor.  I
don't know all the details of the hardware.  But it is PHP 4.1.2, Apache
1.3.14.

  Options to configure when compiling PHP are as follows:
--with-apxs --with-mysql=/web/tech/mysql --with-gd --with-jpeg-dir=/usr/loca
l/lib --enable-debug=no  --enable-track-vars=yes  --with-oracle=/oracle/prod
uct/8.0.5 --enable-trans-sid --enable-magic-quotes


  Thanks for the help
  Dave Sugar
  [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Empty $_SESSION and $_POST ??

2002-04-22 Thread Andre Dubuc

On Monday 22 April 2002 09:50 am, you wrote:
> On Friday, April 19, 2002, at 09:41  PM, Andre Dubuc wrote:
> > Is there a way I can verify that (a) globals are off and (b) $_SESSION
> > or
> > $_POST are on? This probably what's happening -- I can't access the
> > arrays at
> > all -- so, I think that might be where the problem lies. The $vars
> > still work
> > though throughout all scripts.
>
> $_SESSION and $_POST and other superglobals are already on all the time
> if you use PHP 4.1.x or later.
>
> Verify that globals are off by writing a script that checks the for the
> presence or the value of $variable and then pass "variable=1" or
> something on the querystring in your browser.
>
>
> Erik
>>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]


Thanks Eric,

Sorry about the delay in replying. I was at a funeral today.

I tried what you suggested, and indeed globals are off. Perhaps my problem 
stems from my use of the $_GET[] with $vars. I guess I don't really 
understand what I'm doing. If you would take a peek at this code [I think 
I've introduced a security hole, and I'm mixing up things]:

On page 1:


// ob_start(); so I can have html headers on this page & redirect later
// some other code



// many other lines of code


?>


On page 2: 


// ob_start(); so I can have html headers on this page & redirect later
// some other code

">

Once I figure out how I'm supposed to write the variables in the scripts, 
I'll be OK. But I'm so CONFUSED!  */

if  ($bozo == "") die ("Please enter your 'First Name'.  Click 
'Back" in your browser to enter this information.");

// new input variable unique to page 2


// other code: including an "if $level"  statement that checks for level of 
registration and redirects, using header("location . . .")

session_write_close(); // to allow the header through
header("location:page 3.php");
?>


On page 3:




{Btw, I've used "bozo" and "dodo" since it's easier to spot the diffference 
than what I actually use for the field :>]

Tia,
Andre
-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




AW: [PHP] Second opinion needed - javascript blocker

2002-04-22 Thread Red Wingate

Maybe u should just strip all the javascript tags out
Of the user-input (output page) with a script like this:

$text = eregi_replace("< *script[^>]*>([^<]*)<[^>]*>","//1",$test);

this should stip all the script-tags out of the text, but
will keep the text between the tags.

(the code was NOT tested :))

HF
red
-Ursprungliche Nachricht-
Von: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 22. April 2002 9:18 PM
An: [EMAIL PROTECTED]
Betreff: [PHP] Second opinion needed - javascript blocker

I am trying to block javascript from ares of my site that  users can change.
I am going to use the following code.  Can someone give me a second opinion
on whether it will work?

function stopjavascript($text){
//Stop people from using &whatever;  tags, in case they can smuggle
javascript in with that
$text = str_replace("&","&",$text);
//Stop the onmouseover, etc. parameters
$text = eregi_replace("on","o-n",$text);
//Stop script tags, as well as links to javascript:
$text = eregi_replace("script","sc-ript",$text);
//Return the edited string
return $text;
}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Second opinion needed - javascript blocker

2002-04-22 Thread Leif K-Brooks

I am trying to block javascript from ares of my site that  users can change.
I am going to use the following code.  Can someone give me a second opinion
on whether it will work?

function stopjavascript($text){
//Stop people from using &whatever;  tags, in case they can smuggle
javascript in with that
$text = str_replace("&","&",$text);
//Stop the onmouseover, etc. parameters
$text = eregi_replace("on","o-n",$text);
//Stop script tags, as well as links to javascript:
$text = eregi_replace("script","sc-ript",$text);
//Return the edited string
return $text;
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How do remove WARNING message

2002-04-22 Thread Dennis Moore

I am not a LDAP expert, however I assume you can place a condition on your
bind command to kill the script or go to your error reporting...



- Original Message -
From: "Jean-Rene Cormier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 1:03 PM
Subject: [PHP] How do remove WARNING message


> Ok I'm trying to create a script that would allow users to bind to an
> LDAP server and we all know there's gonna be some people mistyping their
> password but when I try to bind and put the wrong password I always get
> a warning message like this:
>
> Warning: LDAP: Unable to bind to server: Invalid credentials in
> /whatever/dir/script.php on line 53
>
> Is there a way I don't get this message and I'd put my own error
> message?
>
> Thanks
>
> Jean-Rene Cormier
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: mod_rewrite

2002-04-22 Thread Philip Hallstrom

You could also do something like this:

Configure Apache so that *every* request on a virtual
host would be handled by a single PHP script.


 ServerName myserver.mydomain.org
 DocumentRoot /usr/local/www/myserver
 Action php-parse /path-to/script.php

 Action php-parse /path-to/script.php
 SetHandler php-parse

 
   SetHandler "application/x-httpd-php"
 


Every request (whether the file exists or not) is handled by
/path-to/script.php.

Note that this means that gifs/jpgs also get run through this...


On Wed, 17 Apr 2002, [ rswfire ] wrote:

> I could really use your help with this.  The examples I have received from
> everyone thus far have not worked, including the last one that you posted.
> This is the situation:
>
> I have multiple domains, each with multiple subdomains, all of which
> automatically point to the root of my web environment.  I have only one file
> that does all of the work for all of these websites/webpages, and that is
> the index.php file in the root.  This file is smart enough to parse the url
> being accessed and create an appropriate page based on a very complex set of
> rules.
>
> Originally, I was using the ErrorDocument 404 to make it access the
> index.php file, but this has some inherent flaws.  The biggest problem was
> that forms that were being posted to a page that doesn't really exist never
> maintained the posted variables (due to the 404 redirect.)  Another
> limitation was that it just created a bunch of unnecessary error messages in
> my error log since there are no "real pages" on my network, even though it
> pretends there is.
>
> So, I need to use mod_rewrite.  That is apparent now.  The problem is I know
> nothing about creating regular expressions.  I simply need it to rewrite the
> url for any file that does not exist (it should not try to do so for a file
> that really does exist, say an image file) and it needs to have the
> following rule:
>
> A*.B*.C*/D*.E*
>
> Where A is a subdomain; B is the domain name; C is the top level domain; D/E
> are a file or directory.
>
> Some examples would be:
>
> http://www.swifte.net/
> http://www.cao.swifte.net/petition-sign.html
> http://hsdnetwork.swifte.net/technicians.html
> http://www.hsdnetwork.swifte.net/technicians.html
> http://www.caofund.org/
> http://www.hsdnetwork.com/
>
> Can you tell me how to do this?  I would appreciate your help so much!!
>
> -Samuel
>
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Re: [PHP] PHP editor for windows

2002-04-22 Thread DL Neil

> > "etc" (TM) is able to follow up the syntax coloring operation by
making
> > changes to the code to correct syntax errors, puts brackets in
exactly
> > the right place to indicate block structure within the code, imposes
> > data type prefixes in strict convention, chooses better variable
names
> > than any caffeine-driven prog, and alerts designers to most logic
errors
> > (the paid-support version guarantees a higher rate of success at the
> > last).

Only the M$ version enforces rules.
All other OpSys users can/will do what they like.

> How about enforcing/auto-correcting to the One True Brace Style
(version
> 42.0)?

It works with parentheses, brackets, braces, etc.

=dn


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ImageCreate v. ImageCreateTrueColor

2002-04-22 Thread Leotta, Natalie (NCI/IMS)

Hello,
 
I'm making an Image and I was wondering what the difference is between these
two Image constructors.  I need to find a way to make dotted and dashed
lines (according to different patterns I've been given) and I want the
sections between the dots to be transparent.  I'm planning on using the
ImageSetStyle function.  From what I read on PHP.net, some things cannot be
used with ImageCreateTrueColor, but it looks like some can only be used that
one. 
 
One thing I'm interested in is the constant IMG_COLOR_TRANSPARENT - can this
be used with ImageCreate?  
 
Is there a reason I should use one of the constructors over the other?
 
Thanks!
 
-Natalie
 

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

 



[PHP] From where was function called?

2002-04-22 Thread Nico van der Dussen

Hi,

I'm having a real problem:

In a codeset of more than 5000 lines of code, I have a rogue call to a
function.

Is there a way I can determine in a function from where the call was
made?  (Filename, linenumber etc)

Thanks

Nico


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How do remove WARNING message

2002-04-22 Thread Rasmus Lerdorf

Read the error handling chapter in the documentation.

-Rasmus

On Mon, 22 Apr 2002, Jean-Rene Cormier wrote:

> Ok I'm trying to create a script that would allow users to bind to an
> LDAP server and we all know there's gonna be some people mistyping their
> password but when I try to bind and put the wrong password I always get
> a warning message like this:
>
> Warning: LDAP: Unable to bind to server: Invalid credentials in
> /whatever/dir/script.php on line 53
>
> Is there a way I don't get this message and I'd put my own error
> message?
>
> Thanks
>
> Jean-Rene Cormier
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP editor for windows

2002-04-22 Thread .ben

> > >>> Other than notepad, interdev, ultraedit, etc (which i currently
> use
> > >>> for
> > >>> editing), does anyone know of a good editor for PHP for Windows,
> > >>> ideally
> > >>> with syntax colouring, etc?
>
> > >> You use etc for editing?  Sounds pretty cool.
>
> This is a new product Erik, only released at the beginning of this
> month, so it's no surprise that you haven't seen it in use yet. "etc"
> (TM) is able to follow up the syntax coloring operation by making
> changes to the code to correct syntax errors, puts brackets in exactly
> the right place to indicate block structure within the code, imposes
> data type prefixes in strict convention, chooses better variable names
> than any caffeine-driven prog, and alerts designers to most logic errors
> (the paid-support version guarantees a higher rate of success at the
> last).
>
> =dn

Actually, I think you'll find that those features are actually only
available in Etc Plus! 2002 (Gold), Enterprise version.

No i do not have a copy.

 .b


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_POST_VARS vs _POST

2002-04-22 Thread Erik Price


On Monday, April 22, 2002, at 12:19  PM, [EMAIL PROTECTED] wrote:

> HI ML
>
> Only one little question :
> I know that _POST doesn't exists on php 4.0.6 but does $HTTP_POST_VARS
> exist on php 4.1.2 ?

Yes, but you would have had an answer to this question 45 minutes ago if 
you had just tried it.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How do remove WARNING message

2002-04-22 Thread Jean-Rene Cormier

Ok I'm trying to create a script that would allow users to bind to an
LDAP server and we all know there's gonna be some people mistyping their
password but when I try to bind and put the wrong password I always get
a warning message like this:

Warning: LDAP: Unable to bind to server: Invalid credentials in
/whatever/dir/script.php on line 53

Is there a way I don't get this message and I'd put my own error
message?

Thanks

Jean-Rene Cormier




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] script executeion problem - executes twice for no reason- help

2002-04-22 Thread Miguel Cruz

On Mon, 22 Apr 2002, Edward Bailey wrote:
> if()
> {$filename = "../includes/news.html";

This condition will always return true.

What you are doing here is first executing the assignment:

   $filename = "../includes/news.html";

and then testing the outcome of that assignment (which is 
"../includes/news.html"). 

If you want to test whether or not $filename contains 
"../includes/news.html", then you should use == instead of =

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] adding numbers to a file

2002-04-22 Thread Rasmus Lerdorf

$lines = file('filename');
foreach($lines as line) {
list($var,$val) = explode('=>',$line);
if(trim($var)=="'total'") $val = trim($val);
}
$val = $new_value;
$fp = fopen('filename','w');
fputs($fp,"{\n'total' => $new_value\n}");
fclose($fp);

-Rasmus

On Mon, 22 Apr 2002, Craig Westerman wrote:

> I have a simple count file named count_db that contains ONLY the following:
>
> {
> 'total' => 3954
> }
>
> How do I open file, find numbers in the file, add $newnumbers to existing
> numbers. Then write these new numbers over the original numbers and close
> the file. I'm just needing to do this once a day to correct a poor count.
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: adding numbers to a file

2002-04-22 Thread Adrian Ciutureanu



"Craig Westerman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a simple count file named count_db that contains ONLY the
following:
>
> {
> 'total' => 3954
> }
>
> How do I open file, find numbers in the file, add $newnumbers to existing
> numbers. Then write these new numbers over the original numbers and close
> the file. I'm just needing to do this once a day to correct a poor count.
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] adding numbers to a file

2002-04-22 Thread Craig Westerman

I have a simple count file named count_db that contains ONLY the following:

{
'total' => 3954
}

How do I open file, find numbers in the file, add $newnumbers to existing
numbers. Then write these new numbers over the original numbers and close
the file. I'm just needing to do this once a day to correct a poor count.

Thanks

Craig ><>
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: deleting lines in a textfield

2002-04-22 Thread Adrian Ciutureanu



"Kris Vose" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
How would you go about deleting a specific line in a textfield via PHP?  For
example, I want to delete line 2 only and save the changes.  How would I go
about doing this using fopen and fwrite?

Kris




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session Tutorial

2002-04-22 Thread Ornella Fasolo

Hi,

I got a good start-tutorial from www.onlamp.com
the complete URL is 
http://www.onlamp.com/pub/a/php/excerpt/webdbapps_8/index.html?page=2
if you had some problem, you can write me, so I could send you it as an
attached file

i found it very good

regards
Ornella


>Recently I have been trying to work with sessions however I must admit that
>I am not sure I completely understand them. Does anyone know of a good
>tutorial that thoroughly explains sessions?
>
>Thanks in advance
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $HTTP_POST_VARS vs _POST

2002-04-22 Thread DrouetL

HI ML

Only one little question :
I know that _POST doesn't exists on php 4.0.6 but does $HTTP_POST_VARS
exist on php 4.1.2 ?


Regards

Laurent



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP editor for windows

2002-04-22 Thread DL Neil

> I really hate to do this, but it's one of my pet peives.

is that like a pet rock?

BTW if we're exercising peevishness, at the same time as indulging in
anally non-retentive breakfast habits, check out
http://www.onelook.com/cgi-bin/cgiwrap/bware/afen.cgi?type=word_all&word
=peeve

> >>> Other than notepad, interdev, ultraedit, etc (which i currently
use
> >>> for
> >>> editing), does anyone know of a good editor for PHP for Windows,
> >>> ideally
> >>> with syntax colouring, etc?

> >> You use etc for editing?  Sounds pretty cool.

This is a new product Erik, only released at the beginning of this
month, so it's no surprise that you haven't seen it in use yet. "etc"
(TM) is able to follow up the syntax coloring operation by making
changes to the code to correct syntax errors, puts brackets in exactly
the right place to indicate block structure within the code, imposes
data type prefixes in strict convention, chooses better variable names
than any caffeine-driven prog, and alerts designers to most logic errors
(the paid-support version guarantees a higher rate of success at the
last).

=dn


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] deleting lines in a textfield

2002-04-22 Thread Christoph Starkmann

AFAIK, there are no lines in a textfield; Text is simply displayed 
as needed to fit in the area of the textfield.

As soon as you can do anything with it in PHP, it is no longer in
a textfield but simply one string; This string you may search with
regular expressions or using PHP string functions.

If there were (are?) several lines, just crop everything from the
first newline to (not including) the second one.

HTH,

Kiko


> -Original Message-
> From: Kris Vose [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 5:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] deleting lines in a textfield
> 
> 
> How would you go about deleting a specific line in a 
> textfield via PHP?  For example, I want to delete line 2 only 
> and save the changes.  How would I go about doing this using 
> fopen and fwrite?
> š
> Kris
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: PHP editor for windows

2002-04-22 Thread Kunal Jhunjhunwala

I have been using html-kit @ http://www.chami.com/html-kit/
works great.. and the only stable inbuilt FTP proggy i have seen to date..
does anyone have alternatives to this? :)
Regards,
Kunal Jhunjhunwala

"Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought." - Clifford Stoll
- Original Message -
From: "dengach" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 9:16 PM
Subject: [PHP] Re: PHP editor for windows


> Have you tried Maguma Studio Light for PHP With Help version 1.0.0
released
> 2002-04-05  formerly PHPide, get it from http://www.maguma.com . The
version
> with help comes with php and mysql help.
>
> ".Ben" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Other than notepad, interdev, ultraedit, etc (which i currently use for
> > editing), does anyone know of a good editor for PHP for Windows, ideally
> > with syntax colouring, etc?
> >
> > Cheers,
> >
> >  .ben
> >
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] script executeion problem - executes twice for no reason - help

2002-04-22 Thread R'twick Niceorgaw

remove the To:$email  from $headers. You have it already in the $to
parameter.


- Original Message -
From: "Edward Bailey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 11:48 AM
Subject: [PHP] script executeion problem - executes twice for no reason -
help


> Please excuse my ignorance, this is probably a simple
> problem but I have no idea what to do next.
>
> I wrote the following to send an automated response to
> users that fill out a form, select submit and that
> triggers the conditional "if" statement and then the
> script sends an HTML based newsletter to the user. The
> script does work, but it sends out TWO newsletters
> instead of one and I have no idea why. I have used the
> code below in several different forms and it does the
> same thing each time so I would assume the code is the
> problem.
>
>
> if()
> {$filename = "../includes/news.html";
> $to = "$email";
> $subject = "Newsletter";
> $fd = fopen ($filename, 'r');
> $message = fread ($fd,
> fileSize("../includes/news.html"));
> fclose ($fd);
> $headers = "To: $email\nFrom: $from\nReply-To:
> $reply_address\nMIME-Version: 1.0\nContent-type:
> text/html; charset=iso-8859-1\n";
> mail($to, $subject, $message, $headers);
> }
>
> Can anyone help me or point me in the right direction?
>
> Thanks
>
> Ed
>
>
> __
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] deleting lines in a textfield

2002-04-22 Thread Kris Vose

How would you go about deleting a specific line in a textfield via PHP?  For example, 
I want to delete line 2 only and save the changes.  How would I go about doing this 
using fopen and fwrite?
š
Kris



[PHP] Re: PHP + Microsoft Access

2002-04-22 Thread J Smith


AFAIK, there is no unix app for using Access databases. You could try WINE 
or some sort of virtual desktop running Windows and use Access through 
that, but that would probably be even less stable than Windows itself. 

Running Windows 2000 with service pack 2 for the db server should probably 
be stable enough, anyways. I've been using it for a few months and although 
I'm no Windows fan, at least it hasn't died on me yet.

J


Tom Mikulecky wrote:

> Hello
> 
> I have to interface an MSAccess database and Apache server on a linux
> box thru PHP. The only way I found to do that is to use ODBC with some
> specific drivers (I tried Openlink). This solution needs sort of server
> running on a Windows station, it serves requests to the Access database
> file.
> 
> The problem is that I would like to do this WITHOUT any Windows station,
> to achieve good reliability (we can't have a Windows station running
> just for that). Also the database can't be ported to any other format
> because there are some programs written in VB-Access that need it as is.
> 
> So what I need is sort of sql driver for accessing mdb files on a
> unix/linux box. Does-it exist? I searched a lot on the web but with no
> succes.
> 
> Any suggestions are welcome
> Thanx in advance
> 
> Some details:
> - The Access database file (mdb) is located on a Unix box in a shared
> folder
> 
> Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >