Re: [PHP] How can I change the timezone?

2003-05-29 Thread Erick
How to do this?

-- 

Jay Blanchard [EMAIL PROTECTED]
???:[EMAIL PROTECTED]
[snip]
I am in Hong Kong and the server is in US.
I can't change the server setting.
[/snip]

How about getting the server time and then adding or subtracting from
that to get the appropriate time?

http://us2.php.net/manual/en/function.time.php

HTH!

Jay



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



RE: [PHP] How can I change the timezone?

2003-05-29 Thread Jay Blanchard
[snip]
How to do this?

[snip]
I am in Hong Kong and the server is in US.
I can't change the server setting.
[/snip]

How about getting the server time and then adding or subtracting from
that to get the appropriate time?

http://us2.php.net/manual/en/function.time.php
[/snip]

Use mktime http://us2.php.net/manual/en/function.mktime.php

HTH!

Jay

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



[PHP] Re: secure code

2003-05-29 Thread Anil Kumar K.

Here is exactly what you are looking for:

The Open Web Application Security Project http://www.owasp.org/

best.
   Anil


On Wed, 28 May 2003, Tim Burgan wrote:

 Hello,
 
 I'm wondering if you can recommend any resources that discuss writing secure
 code and how to put the best methods in place to prevent hackers.
 
 I'm particularly looking at resources from the web coding perspective, not
 securing a server.
 
 Or, what things to you do to 'block' hackers.
 
 Thanks
 Tim Burgan
 
 

-- 
Linuxense Information Systems Pvt. Ltd., Trivandrum, India
http://www.linuxense.com


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



Re: [PHP] How can I change the timezone?

2003-05-29 Thread Erick
Thank you.

I added 43200 then slove this problem.

-- 

Jay Blanchard [EMAIL PROTECTED]
???:[EMAIL PROTECTED]
[snip]
How to do this?

[snip]
I am in Hong Kong and the server is in US.
I can't change the server setting.
[/snip]

How about getting the server time and then adding or subtracting from
that to get the appropriate time?

http://us2.php.net/manual/en/function.time.php
[/snip]

Use mktime http://us2.php.net/manual/en/function.mktime.php

HTH!

Jay



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



RE: [PHP] sessions and domains

2003-05-29 Thread Steven Kallstrom
Bk,

You would have to somehow pass all session variables onto the
new host since session variables are stored server-side.  You would have
to have a function that took all session variables and passed them to
the new domain including session id...  then you would need a function
that would take those variables and make them session variables in the
new domain...

SJK

 -Original Message-
 From: bk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 28, 2003 5:35 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] sessions and domains
 
 Hi
 
 I've to set up a shared shopping cart to buy items
 from four different sites and pay them at once
 passing trough a single checkout.
 
 
 Provided that these sites are hosted on the same
 server (actually in the same directory), but have
 different names, is it possible to share php
 sessions across multiple domains? How?
 
 
 
 
 
 
 
 --
 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] Variables don't pass... *sniff*

2003-05-29 Thread Wendell Brown
On Wed, 28 May 2003 12:46:50 +0100, David Grant wrote:

I would've thought that $HTTP_*_VARS will be deprecated sometime in the 
future.  It might be an idea to write your own accessor methods, e.g.

function RetrieveGetParameter($parameterValue)

Egads!  Wouldn't the following be a little simpler?

At the top of the file put.

if( is_array($_POST) ) 
  $pArray = $_POST;
else
  $pArray = $HTTP_POST_VARS;

Then access $pArray[fred] where ever you want to?  And yes, I know
this creates a second copy of the post array in local memory (wouldn't
pointers be nice right about now), but if the post array is going to be
accessed a lot, it would seem to be faster to copy it once than to call
the function over and over.  :)


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



Re: [PHP] About Guest Book\'s messages....

2003-05-29 Thread Lew Mark-Andrews
I used wordwrap($word,40,\n,1) to prevent it,
but my system is BIG5 ,two bytes,
Sometimes this method would  destroy the structure
of the two-bytes word.

Hi,

Have you looked into the multi-byte string functions in the manual?
Search on php.net for mb_str .
Also, have you tried just forcing the guestbook display (tables?) to a
fixed width with HTML or CSS.
If you're still stuck, you might ask about this on the PHP
Internationalization [PHP-I18N] Mailing List which focuses on multi-byte
issues.

HTH,
Lew



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



Re: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread daniel
I did this:

if (!empty($_POST)) {
 extract($_POST);
} else {
 extract($HTTP_POST_VARS);
}

And have it in an include file, extract_post.php.
This way I can just include it and all variables are available, just like if
register_globals had been on.

Daniel.

- Original Message - 
From: Wendell Brown
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 4:01 PM
Subject: Re: [PHP] Variables don't pass... *sniff*


On Wed, 28 May 2003 12:46:50 +0100, David Grant wrote:

I would've thought that $HTTP_*_VARS will be deprecated sometime in the
future.  It might be an idea to write your own accessor methods, e.g.

function RetrieveGetParameter($parameterValue)

Egads!  Wouldn't the following be a little simpler?

At the top of the file put.

if( is_array($_POST) )
  $pArray = $_POST;
else
  $pArray = $HTTP_POST_VARS;

Then access $pArray[fred] where ever you want to?  And yes, I know
this creates a second copy of the post array in local memory (wouldn't
pointers be nice right about now), but if the post array is going to be
accessed a lot, it would seem to be faster to copy it once than to call
the function over and over.  :)


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

2003-05-29 Thread Dan Joseph
Tim,

Make sure you handle all exceptions, exit() after each redirect, make sure
you are validating all form fields before it goes into the database, things
like that.  Might want to grab webproxy from www.atstake.com and use it to
test your app.  Its kind of complex to use at first, but there should be
some docs online.

-Dan Joseph

 -Original Message-
 From: Tim Burgan [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 27, 2003 7:52 PM
 To: PHP Lists
 Subject: [PHP] secure code


 Hello,

 I'm wondering if you can recommend any resources that discuss
 writing secure
 code and how to put the best methods in place to prevent hackers.

 I'm particularly looking at resources from the web coding perspective, not
 securing a server.

 Or, what things to you do to 'block' hackers.

 Thanks
 Tim Burgan


 --
 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] Variables don't pass... *sniff*

2003-05-29 Thread Wendell Brown
On Wed, 28 May 2003 16:13:22 +0200, [EMAIL PROTECTED] wrote:

if (!empty($_POST)) {
 extract($_POST);
} else {
 extract($HTTP_POST_VARS);
}

And have it in an include file, extract_post.php.
This way I can just include it and all variables are available, just like if
register_globals had been on.

Yup!  You could even add that php to the auto_prepend_file variable in
your php.ini or add this to your .htaccess file (assuming you are
running Apache and have overwrite turned on) and the prepend will
happen automagically on every php program:

php_value  auto_prepend_file  /www/extract_post.php

However, both of these solutions create the same security issue that
turning RegisterGlobals on took care of in the first place.  :)




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



Re: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread daniel
 However, both of these solutions create the same security issue that
 turning RegisterGlobals on took care of in the first place.  :)

Howcome? I don't think I understand that... Is the security issue not with
the fact that you're POSTing og GETing variables rather than the way you do
it? Would extract()'ing them with an include script not have the exact same
(lack of) security as doing $_POST[myVar] in the script?



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



[PHP] Re: About Guest Book\'s messages....

2003-05-29 Thread hui
do it in your html code,
you use a table for the message text?
add this:

table width=460 style=TABLE-LAYOUT:fixed


style=TABLE-LAYOUT:fixed

it works.
:)



Fongming [EMAIL PROTECTED] дÈëÓʼþ
news:[EMAIL PROTECTED]
 Hi, Sir:

 There may be someone  leave a message like
 following:




U

 and it expand the width of the table on  my web page and make  pages
ugly

 I used wordwrap($word,40,\n,1) to prevent it,
 but my system is BIG5 ,two bytes,
 Sometimes this method would  destroy the structure
 of the two-bytes word.

 Any one has good ideas and could help me with that ?
 Thanks


 ---
 Fongming from Taiwan.


 --
 ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
 http://fonn.fongming.idv.tw
 [EMAIL PROTECTED]



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



RE: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread Jay Blanchard
[snip]
Yup!  You could even add that php to the auto_prepend_file variable in
your php.ini or add this to your .htaccess file (assuming you are
running Apache and have overwrite turned on) and the prepend will happen
automagically on every php program:

php_value  auto_prepend_file  /www/extract_post.php

However, both of these solutions create the same security issue that
turning RegisterGlobals on took care of in the first place.  :)
[/snip]

But you could address any security issues in the included code and
exit the app as needed, no? I wouldn't go as far as using the
auto_prepend_file.

Jay

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



Re: [PHP] Re: About Guest Book\'s messages....

2003-05-29 Thread Awlad Hussain
using style=TABLE-LAYOUT:fixed does not wrap the text

- Original Message - 
From: hui [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 3:13 PM
Subject: [PHP] Re: About Guest Book\'s messages


 do it in your html code,
 you use a table for the message text?
 add this:

 table width=460 style=TABLE-LAYOUT:fixed


 style=TABLE-LAYOUT:fixed

 it works.
 :)



 Fongming [EMAIL PROTECTED] дÈëÓʼþ
 news:[EMAIL PROTECTED]
  Hi, Sir:
 
  There may be someone  leave a message like
  following:
 
 




 U
 
  and it expand the width of the table on  my web page and make  pages
 ugly
 
  I used wordwrap($word,40,\n,1) to prevent it,
  but my system is BIG5 ,two bytes,
  Sometimes this method would  destroy the structure
  of the two-bytes word.
 
  Any one has good ideas and could help me with that ?
  Thanks
 
 
  ---
  Fongming from Taiwan.
 
 
  --
  ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
  http://fonn.fongming.idv.tw
  [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] strtr question

2003-05-29 Thread ed

I want to remove unwanted characters from filenames of files uploaded to
our server. I am currently using strtr to do this. I have a few characters
that are being removed but I would also like a single quote to be removed
if it is in the filename. I think it has to be escaped in the command
though. How do I do this?

TIA,

Ed



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



Re: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread Wendell Brown
On Wed, 28 May 2003 16:30:17 +0200, [EMAIL PROTECTED] wrote:

Howcome? I don't think I understand that...

Check this out.

http://us4.php.net/registerglobals



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



RE: [PHP] strtr question

2003-05-29 Thread Joe Stump
You could do this a number of ways:

eregi(), ereg() or str_replace() ...

?

  $string = What's up?;
  $string = str_replace(','',$string);
  echo $string.\n;

?

That will output Whats up?

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] strtr question



I want to remove unwanted characters from filenames of files uploaded to
our server. I am currently using strtr to do this. I have a few characters
that are being removed but I would also like a single quote to be removed
if it is in the filename. I think it has to be escaped in the command
though. How do I do this?

TIA,

Ed



-- 
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] Variables don't pass... *sniff*

2003-05-29 Thread David Grant
Wendell Brown wrote:
Egads!  Wouldn't the following be a little simpler?

At the top of the file put.

if( is_array($_POST) ) 
  $pArray = $_POST;
else
  $pArray = $HTTP_POST_VARS;
Absolutely!  I've been getting a little carried away with moving a lot 
of PHP functions to OO classes recently...  Damn it!  I must learn to 
simplify a bit more.. :P

Regards,

David

--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**

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


Re: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread daniel
Okay, that makes sense, but I would never write a script like that in the
first place ;)

Not unless I'm really tired or something, in which case it's good to have
this thing turned off by default =)

Cheers


- Original Message - 
From: Wendell Brown
To: [EMAIL PROTECTED] ; [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 4:42 PM
Subject: Re: [PHP] Variables don't pass... *sniff*


On Wed, 28 May 2003 16:30:17 +0200, [EMAIL PROTECTED] wrote:

Howcome? I don't think I understand that...

Check this out.

http://us4.php.net/registerglobals


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



RE: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread Joe Stump
While I wholey support the concept of using appropriate globals ($_POST,
$_GET, $_COOKIE, etc.) I'd like to make one point abundantly clear:

While it doesn't guarantee that data has not been forged, it does require
an attacker to guess the right kind of forging.

-- http://us4.php.net/registerglobals

Thus a brute force attack (forging all variables types: post, cookie, and
get) could break a system (unless you were doing an amazing amount of
checking). Basically, I wanted everyone who uses this feature to be aware it
does not make them ammune to the type of attack it is used to prevent.

To prevent a brute force as I describe (but not prevent forged cookies by
any means) you could do:

?php

  if($_COOKIE['userID']  !$_GET['userID']  !$_POST['userID'])
  {
echo Valid userID cookie, but still could be forged.\n;
  }

?

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: Wendell Brown [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:43 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Variables don't pass... *sniff*


On Wed, 28 May 2003 16:30:17 +0200, [EMAIL PROTECTED] wrote:

Howcome? I don't think I understand that...

Check this out.

http://us4.php.net/registerglobals



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

2003-05-29 Thread Joe Stump
Have you read up on regular expressions? They'll do just what you're looking
for:

?php

  ereg_replace('[ab\.\,\ ]','',$string); // remove 'a', 'b', '.', ','

?

http://www.php.net/ereg_replace

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:49 AM
To: Joe Stump
Subject: RE: [PHP] strtr question



 Yes this would be great only I'm not substituting a single character
found in a filename but a host of characters found in filenames.

Ed

On Wed, 28 May 2003, Joe Stump wrote:

 You could do this a number of ways:

 eregi(), ereg() or str_replace() ...

 ?

   $string = What's up?;
   $string = str_replace(','',$string);
   echo $string.\n;

 ?

 That will output Whats up?

 --Joe

 --
 Joe Stump [EMAIL PROTECTED]
 http://www.joestump.net
 Label makers are proof God wants Sys Admins to be happy.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 28, 2003 7:42 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] strtr question



 I want to remove unwanted characters from filenames of files uploaded to
 our server. I am currently using strtr to do this. I have a few characters
 that are being removed but I would also like a single quote to be removed
 if it is in the filename. I think it has to be escaped in the command
 though. How do I do this?

 TIA,

 Ed



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



[PHP] Form Generators

2003-05-29 Thread Clint
Does anyone know of a form generator that will look at a MySQL table and
generate an add/edit form off of that table?

Thanks,
Clint


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



Re: [PHP] Form Generators

2003-05-29 Thread Cal Evans
check www.freshmeat.net. There are several.

=C=
* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: Clint [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 9:59 AM
Subject: [PHP] Form Generators


 Does anyone know of a form generator that will look at a MySQL table and
 generate an add/edit form off of that table?

 Thanks,
 Clint


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

2003-05-29 Thread Edward Peloke
Ok,

I know thumbnails have been discussed and I have looked at the archives, I
am just looking for opinions.  I am doing a small website for a used vehicle
dealer.  I need to make it as easy as possible for him to add new vehicles.
I plan to just give him a form for the information, and a place to upload a
picture.  The main page will have the thumbnails of all the vehicles and as
you click on each one, you will see the normal sized photo.

Should I:

1.  Allow him to upload one picture and then somehow generate a thumbnail
from that?
   If so, should I generate the thumbnail when the picture is uploaded and
keep the original picture and the thumbnail on the
server or
   generate the thumbnail on the fly when the page is loaded...and only
store the original picture?

2.  Should I have him generate thumbnails and upload both pictures to the
server?


Thanks,
Eddie


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



RE: [PHP] thumbnails

2003-05-29 Thread Joe Stump
I'd definitely generate them on the fly for him. I personally use the *NIX
program convert which comes with imagemagick. It works great and is easy
to use.

General Steps:

1.) Copy big image to location
2.) Use convert to make a thumbnail and name it 't_'.$image_name
3.) Put image name in a db someplace
4.) Just prefix $image_name with 't_' to get the thumbnail

I'm sure there are ways to do this within GD, but I've found Convert to be
more flexible. I have a class you can download at:

http://www.joestump.net/files/software/convert/

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:54 AM
To: [EMAIL PROTECTED] Php. Net
Subject: [PHP] thumbnails


Ok,

I know thumbnails have been discussed and I have looked at the archives, I
am just looking for opinions.  I am doing a small website for a used vehicle
dealer.  I need to make it as easy as possible for him to add new vehicles.
I plan to just give him a form for the information, and a place to upload a
picture.  The main page will have the thumbnails of all the vehicles and as
you click on each one, you will see the normal sized photo.

Should I:

1.  Allow him to upload one picture and then somehow generate a thumbnail
from that?
   If so, should I generate the thumbnail when the picture is uploaded and
keep the original picture and the thumbnail on the
server or
   generate the thumbnail on the fly when the page is loaded...and only
store the original picture?

2.  Should I have him generate thumbnails and upload both pictures to the
server?


Thanks,
Eddie


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

2003-05-29 Thread CPT John W. Holmes
 I know thumbnails have been discussed and I have looked at the archives, I
 am just looking for opinions.  I am doing a small website for a used
vehicle
 dealer.  I need to make it as easy as possible for him to add new
vehicles.
 I plan to just give him a form for the information, and a place to upload
a
 picture.  The main page will have the thumbnails of all the vehicles and
as
 you click on each one, you will see the normal sized photo.

 Should I:

 1.  Allow him to upload one picture and then somehow generate a thumbnail
 from that?

Yes.

If so, should I generate the thumbnail when the picture is uploaded and
 keep the original picture and the thumbnail on the
 server or

Yes.

generate the thumbnail on the fly when the page is loaded...and only
 store the original picture?

No. No need to make the server work that much.

 2.  Should I have him generate thumbnails and upload both pictures to the
 server?

No. No need to make the user work that much. Although, if you have a
competent user who understands how to make pictures for the web, you could
actually use method two and save yourself a lot of work messing around with
image functions... The ideal system would offer the ability to do both.

---John Holmes...


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



Re: [PHP] strtr question

2003-05-29 Thread Mike Morton
Ed:

Better yet, because not all browsers pass through the original file name
that was was uploaded, have the user input the name - and validate that
instead. You can then restrict them to numbers letters:

$filename=ereg_replace([^0-9a-zA-Z.],,$filename)

Or something like that.


On 5/28/03 10:42 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 
 I want to remove unwanted characters from filenames of files uploaded to
 our server. I am currently using strtr to do this. I have a few characters
 that are being removed but I would also like a single quote to be removed
 if it is in the filename. I think it has to be escaped in the command
 though. How do I do this?
 
 TIA,
 
 Ed
 
 

--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple.
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


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



Re: [PHP] thumbnails

2003-05-29 Thread bbonkosk
Hello,

I did a family photo gallery, and from my experiences it would be best if you 
handle the thumbnail generation during the upload process.  Just make sure you 
have a naming convention or link the thumnail into your repository/DB so you 
don't loose that space when you delete the record.  It really does not consume 
too much space, pretty easy to do, and a lot easier to manage if you do it in 
your control environment.
-Brad

 Ok,
 
 I know thumbnails have been discussed and I have looked at the archives, I
 am just looking for opinions.  I am doing a small website for a used vehicle
 dealer.  I need to make it as easy as possible for him to add new vehicles.
 I plan to just give him a form for the information, and a place to upload a
 picture.  The main page will have the thumbnails of all the vehicles and as
 you click on each one, you will see the normal sized photo.
 
 Should I:
 
 1.  Allow him to upload one picture and then somehow generate a thumbnail
 from that?
If so, should I generate the thumbnail when the picture is uploaded and
 keep the original picture and the thumbnail on the
 server or
generate the thumbnail on the fly when the page is loaded...and only
 store the original picture?
 
 2.  Should I have him generate thumbnails and upload both pictures to the
 server?
 
 
 Thanks,
 Eddie
 
 
 -- 
 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] sessions and domains

2003-05-29 Thread CPT John W. Holmes
You'd really only have to pass the session ID to the other domains, since
all of the session files are located in the same directory. So, when linking
to one of the other domains, just include SID in the URL or form. Should be
painless.

echo 'a href=http://www.otherdomain.php/page.php?'.SID.'Link to other
domain/a';

SID is a constant.

---John Holmes...

- Original Message -
From: Steven Kallstrom [EMAIL PROTECTED]
To: 'bk' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 9:47 AM
Subject: RE: [PHP] sessions and domains


 Bk,

 You would have to somehow pass all session variables onto the
 new host since session variables are stored server-side.  You would have
 to have a function that took all session variables and passed them to
 the new domain including session id...  then you would need a function
 that would take those variables and make them session variables in the
 new domain...

 SJK

  -Original Message-
  From: bk [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, May 28, 2003 5:35 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] sessions and domains
 
  Hi
 
  I've to set up a shared shopping cart to buy items
  from four different sites and pay them at once
  passing trough a single checkout.
 
 
  Provided that these sites are hosted on the same
  server (actually in the same directory), but have
  different names, is it possible to share php
  sessions across multiple domains? How?
 
 
 
 
 
 
 
  --
  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



[PHP] Re: [otro] [PHP] Re: Error with directories

2003-05-29 Thread j0rd1 adame
On Wednesday 28 May 2003 03:07, Catalin Trifu wrote:
 Hi,

 It seems to me that a script from
 /var/www/wahtever/  includes a script called algo.php
 which can not be found by PHP, because, probably it
 is in the /var/www/ dir.
 Either you add /var/www/ to the php.ini include_path,
 or when you include files you give the full path.

It was a permission issue ... :(


thanx
j0rd1

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



[PHP] Search Engines and Last-Modified Header (was: Variables don't pass...)

2003-05-29 Thread Wendell Brown
On Wed, 28 May 2003 09:31:11 -0500, Jay Blanchard wrote:

I wouldn't go as far as using the auto_prepend_file.

Neither would I in this case Jay.It was simply an example of what
could be done, not necessarily what SHOULD be done.  I did however, use
auto_prepend_file in a .htaccess file for a somewhat similar case.  

I have a site with about 90 pseudo-static pages (the page is static but
I use PHP to include the header and footer) and a handful of fully
dynamic pages.  I REALLY want this site to be regularly updated in the
search engines but, unfortunately, many search engines only spider
pages that are newer than what they have in their database.  Since
PHP is dynamic, it doesn't report a Last-Modified header so the
search engine doesn't think anything has been updated.  Hence stale
search engine results.

To force all of the pages (both pseudo-static and dynamic) to generate
a Last-Modified header, I set up prepend.php script which is
configured as a directory level (.htaccess) parm to auto_prepend_file.

Here is the content of prepend.php.


?php 

  header( Last-Modified:  . 
gmdate( D, d M Y H:i:s, 
   filemtime( $_SERVER['SCRIPT_FILENAME'] ) ) . 
 GMT ); 

?

For my truly dynamic pages, I figured out that only the last call to
header actually shows up in the real header that makes it to the
browser (or search engine), so I can create a more unique
Last-Modified header as part of the dynamic pages (like when the
database is updated or whatever makes sense) and it will overwrite the
automatically generated one.

Now for those of you still reading this and going what the heck is he
talking about -- what Last-Modified header, I would like to recommend
that you grab a copy of Sam Spade for windows (it's free and an
absolute must have) and look at the returned headers on a static html
page and the headers returned from a php page.

http://www.samspade.org/ssw/

You might also be interested in the following article about search
engine placement:

http://www.searchenginewatch.com/webmasters/


Standard disclaimer - no association with the above mentioned
product(s) except as a happy customer.  :)


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



Re: [PHP] strtr question

2003-05-29 Thread CPT John W. Holmes
 I want to remove unwanted characters from filenames of files uploaded to
 our server. I am currently using strtr to do this. I have a few characters
 that are being removed but I would also like a single quote to be removed
 if it is in the filename. I think it has to be escaped in the command
 though. How do I do this?

You shouldn't remove unwanted characters you should only allow the
characters you want. There's a difference. You should say that only
alphanumeric characters are allowed and all others should be removed, rather
than saying remove spaces and quotes, for example. The reason being is that
there may be other characters out there that cause problems in your script,
but you don't know about them right now. If you only _allow_ a certain set
of characters, you eliminate everything else so it can't do any harm.

$safe_name = preg_replace('/[^a-zA-Z0-9]/','',$unsafe_name);

That will only allow a-Z and 0-9 characters (alphanumeric) for example.
Everything else will be removed.

---John Holmes...


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



RE: [PHP] thumbnails

2003-05-29 Thread Edward Peloke

thanks for all the info, I am doing this project this week (hopefully) so I
am sure I will have more questions!

Eddie
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:14 AM
To: Edward Peloke; [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] thumbnails


Hello,

I did a family photo gallery, and from my experiences it would be best if
you
handle the thumbnail generation during the upload process.  Just make sure
you
have a naming convention or link the thumnail into your repository/DB so you
don't loose that space when you delete the record.  It really does not
consume
too much space, pretty easy to do, and a lot easier to manage if you do it
in
your control environment.
-Brad

 Ok,

 I know thumbnails have been discussed and I have looked at the archives, I
 am just looking for opinions.  I am doing a small website for a used
vehicle
 dealer.  I need to make it as easy as possible for him to add new
vehicles.
 I plan to just give him a form for the information, and a place to upload
a
 picture.  The main page will have the thumbnails of all the vehicles and
as
 you click on each one, you will see the normal sized photo.

 Should I:

 1.  Allow him to upload one picture and then somehow generate a thumbnail
 from that?
If so, should I generate the thumbnail when the picture is uploaded and
 keep the original picture and the thumbnail on the
 server or
generate the thumbnail on the fly when the page is loaded...and only
 store the original picture?

 2.  Should I have him generate thumbnails and upload both pictures to the
 server?


 Thanks,
 Eddie


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



[PHP] session_registered issue

2003-05-29 Thread César Aracena
Hi all,

I have no problem with registering a session. As a matter of fact, I
making a site where I register 3 different levels of sessions with no
problem. The thing is when, in my header.inc (which includes
session_start(); for all the site) I tell through PHP only to show the
login form ONLY when:

!session_is_registered(user) OR !session_is_registered(admin) etc.

but it keeps showing it when registered or not... Any ideas?

Here's my code:

!-- SNIP --

if (!session_is_registered(user) OR !session_is_registered(admin) OR
!session_is_registered(full_admin))
{
echo CENTERFORM ACTION=\.$CFG-wwwroot./zonaclientes/login.php\
METHOD=POST;
echo CENTERSPAN class=\copy\ZONA DE CLIENTESBR;
echo Usuario:BR;
echo INPUT TYPE=text NAME=user VALUE=\\ SIZE=15BR;
echo Contrasentilde;a:/SPANBR;
echo INPUT TYPE=password NAME=pass VALUE=\\ SIZE=15BR;
echo INPUT TYPE=submit NAME=Submit VALUE=\Ingresar\/CENTER;
echo /FORM;
echo HR;
}

-- SNIP --

Thanks in advanced,

---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel/Fax: +54.299.477-4532
Cipolletti, Rio Negro
R8324BEG
Argentina




---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar



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



Re: [PHP] thumbnails

2003-05-29 Thread Dallas Goldswain
Hi ,

I have mailed you some code i use to make thumbnails etc.
It only manipulates the image once, then stores a thumb and streams it to
the page when requested

Regards
Dallas Goldswain
Technical Director
Web|Genetics / www.development.co.za

Regards
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,

 I did a family photo gallery, and from my experiences it would be best if
you
 handle the thumbnail generation during the upload process.  Just make sure
you
 have a naming convention or link the thumnail into your repository/DB so
you
 don't loose that space when you delete the record.  It really does not
consume
 too much space, pretty easy to do, and a lot easier to manage if you do it
in
 your control environment.
 -Brad

  Ok,
 
  I know thumbnails have been discussed and I have looked at the archives,
I
  am just looking for opinions.  I am doing a small website for a used
vehicle
  dealer.  I need to make it as easy as possible for him to add new
vehicles.
  I plan to just give him a form for the information, and a place to
upload a
  picture.  The main page will have the thumbnails of all the vehicles and
as
  you click on each one, you will see the normal sized photo.
 
  Should I:
 
  1.  Allow him to upload one picture and then somehow generate a
thumbnail
  from that?
 If so, should I generate the thumbnail when the picture is uploaded
and
  keep the original picture and the thumbnail on the
  server or
 generate the thumbnail on the fly when the page is loaded...and only
  store the original picture?
 
  2.  Should I have him generate thumbnails and upload both pictures to
the
  server?
 
 
  Thanks,
  Eddie
 
 
  -- 
  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] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Jason Wong
On Wednesday 28 May 2003 20:11, Adnan wrote:

 i have been having trouble working out how to upload an image, the most
 progress ive made is putting a blank file on the server, but thats it, any
 suggestions anyone??

If you're wanting to do HTTP uploads then manual  Handling file uploads tells 
you all you need to know. Note that the FTP stuff are completely unrelated.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--


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



Re: [PHP] Session Question

2003-05-29 Thread Pushpinder Singh Garcha
Hello Ernest,

SInce register_globals() is ON on my server, I need to be able to 
figure out a way to ensure session security.
Another question I had was that,  with register_globals() ON can I 
still use the $_SESSION to set my variables ? I want to avoid recoding 
the entire application, so I want to see what can be done to enhance 
security with the current setup.

Does the super-global array approach i.e. $_SESSION work, irrespective 
of the fact that REGISTER_GLOBALS is ON / OFF ?
If I start setting session variables in the $_SESSION array from now 
on, will it improve the security of the session.  I am a newbie in PHP 
session handling and am sorry if any of the above questions sound 
extremely lame.

Thanks in advance,
--Pushpinder


On Wednesday, May 21, 2003, at 04:34 PM, Ernest E Vogelsinger wrote:

At 21:51 21.05.2003, Pushpinder Singh Garcha said:
[snip]
register_globals is ON on my site.
You should really rethink this - have a look at
http://www.php.net/manual/en/security.registerglobals.php
http://www.php.net/manual/en/ref.session.php section Sessions and
Security
register_globals=on simply enables anyone injecting globals to your 
site:
http://www.yoursite.com/myscript.php?valid_user=sam+spade

To keep sessions secure, one might consider these steps:

(1) Filesystem security:
session.save_path points to a directoy owned and readable by the 
webserver
user only:
session.save_path=/tmp/php
chown apache:apache /tmp/php
chmod 700 /tmp/php

(2) If security issues are high you may attempt to make sure that the
session identifier - be it via cookie or via URL parameter - gets
additional confirmation. I once used this approach: I am transmitting a
random cookie (random name, random value) to the browser, making a 
note (in
$_SESSION) of the cookie name and its value. When the session gets
revisited check for the existence and the value of this cookie. If the
values match construct another random cookie, having another name and
another value (also sending header information to delete the old 
cookie).
If the cookie doesn't match don't discard the session but merely 
redirect
the browser to another URL (usually a login page), clearing the 
session ID
if it was received it as cookie.
This has a drawback - clients are forced to accept cookies, or the 
system
wouldn't work at all. Thus you can only implement it where security is 
at
risk, and where acceptance of the additional cookie can be enforced
(extranet applications, for example).

(3) As a last resort one can remember the client IP that must match 
for the
same session. This is not secure at all, and it doesn't work with some 
AOL
connections where client IPs change at will (by AOL using random 
proxies
for every INet connection). You can however automatically rule out that
method if the client IP stems from the AOL-assigned range.

Keeping a very good eye on session security, sessions are the only 
thing
where you can keep login data and access rights, just like you're 
doing it.
I would only urge you NOT to use session_register() and
session_is_registered(), but to use the $_SESSION[] superglobal to be
absolutely sure you're using only data you yourself have put there, 
and not
injected data.

--
O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/


--
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] Resending POST Variables

2003-05-29 Thread Shaun
Hi,

I have a page which uses POST variables sent from a form. If a user clicks
on a link on this page is it possible to send those POST variables to the
next page aswell?

Thanks for your help



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



Re: [PHP] Resending POST Variables

2003-05-29 Thread David Grant
Shaun wrote:

Hi,

I have a page which uses POST variables sent from a form. If a user clicks
on a link on this page is it possible to send those POST variables to the
next page aswell?
You can send them by tagging them to the end of the link, or saving them 
into a session, but you can't (for obvious reasons) access POST 
variables after a GET request.

Just loop through the POST superglobal (i.e. using foreach) and create a 
appending string for your hyperlink.

Regards,

David

--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**

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


Re: [PHP] Resending POST Variables

2003-05-29 Thread Adam Voigt
form name=form1 method=post action=nextpage.php
?php

foreach($_POST AS $key = $value)
echo input type=\hidden\ name=\$key\ value=\$value\;

?
/form

a href=javascript:document.form1.submit();Submit Again/a


Like that?


On Wed, 2003-05-28 at 12:22, Shaun wrote:
 Hi,
 
 I have a page which uses POST variables sent from a form. If a user clicks
 on a link on this page is it possible to send those POST variables to the
 next page aswell?
 
 Thanks for your help
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



RE: [PHP] Resending POST Variables

2003-05-29 Thread Wim Paulussen
You can do this either by sending 'hidden' input and store the POST value in
the 'hidden' input or by storing the variables in a session. At least , that
is what I do and it works for me.

-Oorspronkelijk bericht-
Van: Shaun [mailto:[EMAIL PROTECTED]
Verzonden: Wednesday, May 28, 2003 6:23 PM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Resending POST Variables


Hi,

I have a page which uses POST variables sent from a form. If a user clicks
on a link on this page is it possible to send those POST variables to the
next page aswell?

Thanks for your help



--
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] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Jason Wong wrote:

 On Wednesday 28 May 2003 20:11, Adnan wrote:
 
 i have been having trouble working out how to upload an image, the most
 progress ive made is putting a blank file on the server, but thats it,
 any suggestions anyone??
 
 If you're wanting to do HTTP uploads then manual  Handling file uploads
 tells you all you need to know. Note that the FTP stuff are completely
 unrelated.
 

Basically, im trying to upload a file to the server it isnt a big issue on
how its done, i have tried all sorts of different ways, i havent had any
luck, when i tried to upload with http i got something like cant create
/tmp/php/php... 

any ideas?

thanks for your help :)

adnan

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



RE: [PHP] Session Question

2003-05-29 Thread Wim Paulussen
You should be able to use $_SESSION with register_globals on.

citation from manual

If you want your script to work regardless of register_globals, you need to
use the $_SESSION array. All $_SESSION entries are automatically registered.
If your script uses session_register(), it will not work in environments
where register_globals is disabled.

-Oorspronkelijk bericht-
Van: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Verzonden: Wednesday, May 28, 2003 6:18 PM
Aan: Ernest E Vogelsinger
CC: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Session Question


Hello Ernest,

SInce register_globals() is ON on my server, I need to be able to
figure out a way to ensure session security.
Another question I had was that,  with register_globals() ON can I
still use the $_SESSION to set my variables ? I want to avoid recoding
the entire application, so I want to see what can be done to enhance
security with the current setup.

Does the super-global array approach i.e. $_SESSION work, irrespective
of the fact that REGISTER_GLOBALS is ON / OFF ?
If I start setting session variables in the $_SESSION array from now
on, will it improve the security of the session.  I am a newbie in PHP
session handling and am sorry if any of the above questions sound
extremely lame.

Thanks in advance,
--Pushpinder



On Wednesday, May 21, 2003, at 04:34 PM, Ernest E Vogelsinger wrote:

 At 21:51 21.05.2003, Pushpinder Singh Garcha said:
 [snip]
 register_globals is ON on my site.

 You should really rethink this - have a look at
 http://www.php.net/manual/en/security.registerglobals.php
 http://www.php.net/manual/en/ref.session.php section Sessions and
 Security

 register_globals=on simply enables anyone injecting globals to your
 site:
 http://www.yoursite.com/myscript.php?valid_user=sam+spade

 To keep sessions secure, one might consider these steps:

 (1) Filesystem security:
 session.save_path points to a directoy owned and readable by the
 webserver
 user only:
 session.save_path=/tmp/php
 chown apache:apache /tmp/php
 chmod 700 /tmp/php

 (2) If security issues are high you may attempt to make sure that the
 session identifier - be it via cookie or via URL parameter - gets
 additional confirmation. I once used this approach: I am transmitting a
 random cookie (random name, random value) to the browser, making a
 note (in
 $_SESSION) of the cookie name and its value. When the session gets
 revisited check for the existence and the value of this cookie. If the
 values match construct another random cookie, having another name and
 another value (also sending header information to delete the old
 cookie).
 If the cookie doesn't match don't discard the session but merely
 redirect
 the browser to another URL (usually a login page), clearing the
 session ID
 if it was received it as cookie.
 This has a drawback - clients are forced to accept cookies, or the
 system
 wouldn't work at all. Thus you can only implement it where security is
 at
 risk, and where acceptance of the additional cookie can be enforced
 (extranet applications, for example).

 (3) As a last resort one can remember the client IP that must match
 for the
 same session. This is not secure at all, and it doesn't work with some
 AOL
 connections where client IPs change at will (by AOL using random
 proxies
 for every INet connection). You can however automatically rule out that
 method if the client IP stems from the AOL-assigned range.

 Keeping a very good eye on session security, sessions are the only
 thing
 where you can keep login data and access rights, just like you're
 doing it.
 I would only urge you NOT to use session_register() and
 session_is_registered(), but to use the $_SESSION[] superglobal to be
 absolutely sure you're using only data you yourself have put there,
 and not
 injected data.


 --
 O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/



 --
 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] Resending POST Variables

2003-05-29 Thread Shaun
ok,

basically this is so I can implement page numbering on my search results,
the user submits the form and I want to be able to send the form results
back to the same page when the user clicks 'next' or 'previous'.

I have tried putting this at the top of the page:

$_SESSION['post'] = $_POST;
$_POST = $_SESSION['post'];

but this doesn't work, any ideas?

Thanks for your help

Adam Voigt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 form name=form1 method=post action=nextpage.php
 ?php

 foreach($_POST AS $key = $value)
 echo input type=\hidden\ name=\$key\ value=\$value\;

 ?
 /form

 a href=javascript:document.form1.submit();Submit Again/a


 Like that?


 On Wed, 2003-05-28 at 12:22, Shaun wrote:
  Hi,
 
  I have a page which uses POST variables sent from a form. If a user
clicks
  on a link on this page is it possible to send those POST variables to
the
  next page aswell?
 
  Thanks for your help
 -- 
 Adam Voigt ([EMAIL PROTECTED])
 Linux/Unix Network Administrator
 The Cryptocomm Group




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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adam Voigt
If your running under linux/unix, do:

chown webuser:webuser /tmp/php

Supplement /tmp/php with whatever upload path you have
set in your php.ini, and webuser with whatever user your
webserver runs as.



On Wed, 2003-05-28 at 12:33, Adnan wrote:
 Jason Wong wrote:
 
  On Wednesday 28 May 2003 20:11, Adnan wrote:
  
  i have been having trouble working out how to upload an image, the most
  progress ive made is putting a blank file on the server, but thats it,
  any suggestions anyone??
  
  If you're wanting to do HTTP uploads then manual  Handling file uploads
  tells you all you need to know. Note that the FTP stuff are completely
  unrelated.
  
 
 Basically, im trying to upload a file to the server it isnt a big issue on
 how its done, i have tried all sorts of different ways, i havent had any
 luck, when i tried to upload with http i got something like cant create
 /tmp/php/php... 
 
 any ideas?
 
 thanks for your help :)
 
 adnan
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Adam Voigt wrote:

 If your running under linux/unix, do:
 
 chown webuser:webuser /tmp/php
 
 Supplement /tmp/php with whatever upload path you have
 set in your php.ini, and webuser with whatever user your
 webserver runs as.
 
 
 
 On Wed, 2003-05-28 at 12:33, Adnan wrote:
 Jason Wong wrote:
 
  On Wednesday 28 May 2003 20:11, Adnan wrote:
  
  i have been having trouble working out how to upload an image, the
  most progress ive made is putting a blank file on the server, but
  thats it, any suggestions anyone??
  
  If you're wanting to do HTTP uploads then manual  Handling file
  uploads tells you all you need to know. Note that the FTP stuff are
  completely unrelated.
  
 
 Basically, im trying to upload a file to the server it isnt a big issue
 on how its done, i have tried all sorts of different ways, i havent had
 any luck, when i tried to upload with http i got something like cant
 create /tmp/php/php...
 
 any ideas?
 
 thanks for your help :)
 
 adnan

just did that, and did a

print_r($_FILES);
and this is what i got
Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
[tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )

thanks for your help :)

adnan

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



Re: [PHP] Resending POST Variables

2003-05-29 Thread Tom Woody
On Wed, 2003-05-28 at 11:38, Shaun wrote:
 ok,
 
 basically this is so I can implement page numbering on my search results,
 the user submits the form and I want to be able to send the form results
 back to the same page when the user clicks 'next' or 'previous'.
 
I do the very same thing as you, but I link to the same page.  I have my
search results show a count, and the user can choose a specific page, or
they can use next and previous links.  But I never leave the first page.

And my page uses both GET and POST...Also its an internally accessed 
page only so I don't have as many security aspect to deal with.

I check from the presence of on of the $_POST variables that will always
be present.  If its there, I perform actions assuming a $_POST
occurred.  Otherwise I assume $_GET, as there will never be a case where
both a POST and a GET happen at the same time.  The search results are
done as links to the $_SERVER['PHP_SELF'] with get variables appended on
the URL.  This sets the page I'm looking at, then I use the offset and
limit on the mysql query to build the next page.  If you are interested
I can send more specific code example...
-- 
Tom 

In a world without boundaries why
do we need Gates and Windows?


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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adam Voigt
Hmm, what's the exact error message you get?


On Wed, 2003-05-28 at 12:43, Adnan wrote:
 Adam Voigt wrote:
 
  If your running under linux/unix, do:
  
  chown webuser:webuser /tmp/php
  
  Supplement /tmp/php with whatever upload path you have
  set in your php.ini, and webuser with whatever user your
  webserver runs as.
 
 just did that, and did a
 
 print_r($_FILES);
 and this is what i got
 Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
 [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
 
 thanks for your help :)
 
 adnan
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Adam Voigt wrote:

 Hmm, what's the exact error message you get?
 
 
 On Wed, 2003-05-28 at 12:43, Adnan wrote:
 Adam Voigt wrote:
 
  If your running under linux/unix, do:
  
  chown webuser:webuser /tmp/php
  
  Supplement /tmp/php with whatever upload path you have
  set in your php.ini, and webuser with whatever user your
  webserver runs as.
 
 just did that, and did a
 
 print_r($_FILES);
 and this is what i got
 Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
 [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
 
 thanks for your help :)
 
 adnan

when i browse for the image then press submit i dont get any error or
anything, if i dont put print_r($_FILES); i dont get anything

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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adam Voigt
Call me an optimist but if you don't get any error's, that
usually means it worked. You do know that the uploaded file
is erased when the page ends right?

You have to use a call to move_uploaded_file to actually
put it somewhere on the file system.


On Wed, 2003-05-28 at 12:53, Adnan wrote:
 Adam Voigt wrote:
 
  Hmm, what's the exact error message you get?
  
  
  On Wed, 2003-05-28 at 12:43, Adnan wrote:
  Adam Voigt wrote:
  
   If your running under linux/unix, do:
   
   chown webuser:webuser /tmp/php
   
   Supplement /tmp/php with whatever upload path you have
   set in your php.ini, and webuser with whatever user your
   webserver runs as.
  
  just did that, and did a
  
  print_r($_FILES);
  and this is what i got
  Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
  [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
  
  thanks for your help :)
  
  adnan
 
 when i browse for the image then press submit i dont get any error or
 anything, if i dont put print_r($_FILES); i dont get anything
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Adam Voigt wrote:

 Hmm, what's the exact error message you get?
 
 
 On Wed, 2003-05-28 at 12:43, Adnan wrote:
 Adam Voigt wrote:
 
  If your running under linux/unix, do:
  
  chown webuser:webuser /tmp/php
  
  Supplement /tmp/php with whatever upload path you have
  set in your php.ini, and webuser with whatever user your
  webserver runs as.
 
 just did that, and did a
 
 print_r($_FILES);
 and this is what i got
 Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
 [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
 
 thanks for your help :)
 
 adnan

i get this when i put:

$destination_file=$ftp_dir.$_FILES['imagefile'];

Warning: ftp_site() [function.ftp-site]: /Array: No such file or directory
in /srv/virtual/test_barakat/en/inc/photoposted.inc.php on line 26
 
but if i change it to 

$destination_file=$ftp_dir.'image.jpg';

i get what i said earlier 

thanks

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



[PHP] skipping occurance in regex

2003-05-29 Thread Brian V Bonini
how can you skip the first occurance and stop at the second in a regex?

table id=xxx
tr
td
table
tr
tdcontent1/td
/tr
/table
/td
/tr
tr
tdcontent2/td
/tr
/table

If I wanted to grab all that from within a document I know I can start
at table id= because it's unique but how do I skip the first /table
and stop at the second?




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



[PHP] Checking Client's Cipher Strength with IIS

2003-05-29 Thread Ed Gorski
Hello, 

I have a question who's answer has been bugging me for a while.  What I need
to do is write a script that detects if a browser is using 128-bit
encryption when connecting to our website.  While this is easy for most (I
have the script working for them), a real problem for me has come up with
clients that run IE on Windows 2K without 128-bit support (ie 40-bit or 56
instead).  Do any of you fine ladies and gentlemen know how to detect a
browser's cipher strength using PHP (or any other web language)?  I am
running PHP 4.3.1 on IIS 5.0 on a Windows 2000 server.  I have tried using
some server vars (namely HTTPS_KEYSIZE) but that reports incorrect data with
the win2k/IE/56-bit configuration I mentioned above.

Any help is appreciated and thanks in advance,

Ed  


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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adam Voigt
I think what you want is:

move_uploaded_file($_FILES['imagefile']['tmp_name'],$ftpdir .
$_FILES['imagefile']['name']);

(Apologies if it wraps, that should be all one line.)



On Wed, 2003-05-28 at 12:58, Adnan wrote:
 Adam Voigt wrote:
 
  Hmm, what's the exact error message you get?
  
  
  On Wed, 2003-05-28 at 12:43, Adnan wrote:
  Adam Voigt wrote:
  
   If your running under linux/unix, do:
   
   chown webuser:webuser /tmp/php
   
   Supplement /tmp/php with whatever upload path you have
   set in your php.ini, and webuser with whatever user your
   webserver runs as.
  
  just did that, and did a
  
  print_r($_FILES);
  and this is what i got
  Array ( [imagefile] = Array ( [name] = photo.jpg [type] = image/jpeg
  [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
  
  thanks for your help :)
  
  adnan
 
 i get this when i put:
 
 $destination_file=$ftp_dir.$_FILES['imagefile'];
 
 Warning: ftp_site() [function.ftp-site]: /Array: No such file or directory
 in /srv/virtual/test_barakat/en/inc/photoposted.inc.php on line 26
  
 but if i change it to 
 
 $destination_file=$ftp_dir.'image.jpg';
 
 i get what i said earlier 
 
 thanks
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



[PHP] Create Links on the fly?

2003-05-29 Thread Chase
Salutations!

I am trying to do something fairly simple, but I can't seem to make it
work...  I want to have a form field on a page that the user will put in a 3
to 5 digit number and when they click on Submit that number will become
part of an URL that they are forwarded to.

For example, if the user put in the number 123, then when they click on
Submit they would be pushed to http://www.mypage.com/123.

Can anyone offer help??



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



Re: [PHP] Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Adam Voigt wrote:

 I think what you want is:
 
 move_uploaded_file($_FILES['imagefile']['tmp_name'],$ftpdir .
 $_FILES['imagefile']['name']);
 
 (Apologies if it wraps, that should be all one line.)
 
 
 
 On Wed, 2003-05-28 at 12:58, Adnan wrote:
 Adam Voigt wrote:
 
  Hmm, what's the exact error message you get?
  
  
  On Wed, 2003-05-28 at 12:43, Adnan wrote:
  Adam Voigt wrote:
  
   If your running under linux/unix, do:
   
   chown webuser:webuser /tmp/php
   
   Supplement /tmp/php with whatever upload path you have
   set in your php.ini, and webuser with whatever user your
   webserver runs as.
  
  just did that, and did a
  
  print_r($_FILES);
  and this is what i got
  Array ( [imagefile] = Array ( [name] = photo.jpg [type] =
  image/jpeg
  [tmp_name] = /tmp/php/ phpBEzrql [error] = 0 [size] = 35532 ) )
  
  thanks for your help :)
  
  adnan
 
 i get this when i put:
 
 $destination_file=$ftp_dir.$_FILES['imagefile'];
 
 Warning: ftp_site() [function.ftp-site]: /Array: No such file or
 directory in /srv/virtual/test_barakat/en/inc/photoposted.inc.php on line
 26
  
 but if i change it to
 
 $destination_file=$ftp_dir.'image.jpg';
 
 i get what i said earlier
 
 thanks

im getting

Warning: move_uploaded_file(/image.jpg) [function.move-uploaded-file]:
failed to create stream: Permission denied in
/srv/virtual/website/en/inc/photoposted.inc.php on line 26
 
 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'/tmp/php/php2RUYd7' to '/image.jpg' in
/srv/virtual/website/en/inc/photoposted.inc.php on line 26
 
i suppose at least it narrows down the problem a little. is this down to
doing chown ?? coz i did it



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



[PHP] Re:[PHP] Re: About Guest Book's messages....

2003-05-29 Thread fongming
Thanks ,hui:

style=TABLE-LAYOUT:fixed
^

it won't work 
It just disappeared and hide the text,
it didn't cut the line to suitable for 
the table ,and it didn't force the texts
down to the next line.
It didn't.

but thanks again




do it in your html code,
you use a table for the message text?
add this:

table width=460 style=TABLE-LAYOUT:fixed


style=TABLE-LAYOUT:fixed

it works.
:)



Fongming [EMAIL PROTECTED] дÈëÓʼþ
news:[EMAIL PROTECTED]
 Hi, Sir:

 There may be someone  leave a message like
 following:




U

 and it expand the width of the table on  my web page and make  pages
ugly

 I used wordwrap($word,40,\n,1) to prevent it,
 but my system is BIG5 ,two bytes,
 Sometimes this method would  destroy the structure
 of the two-bytes word.

 Any one has good ideas and could help me with that ?
 Thanks


 ---
 Fongming from Taiwan.


 --
 ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
 http://fonn.fongming.idv.tw
 [EMAIL PROTECTED]



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



--
¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
http://fonn.fongming.idv.tw
[EMAIL PROTECTED]

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



[PHP] Re: ANY POSTNUKER? Security problem!

2003-05-29 Thread Shawn McKenzie

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It is also a simple drop-down box setting in the admin / settings.

- -Shawn

Nabil [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 i have problem with session in postnuke.

 the problem is that while i m logged in as a user, if i closed the
 browser, then i logged into it again , i still logged in, and that
 make a security hale, as any one can use my account on my pc...
 (ofcourse i don't want to log out)

 Any solution to make my login depending on a PHP session? so if the
 user closed the browser , then back in , he has to put his usernme
 and password.

 Best Rergards


-BEGIN PGP SIGNATURE-
Version: PGP 8.0.2

iQA/AwUBPtTxkbiya2JGK6NREQKzyQCeOoxmfH6pNJrnhLt2dNg4lxXfLlEAoJJd
VVx84SqQI119yQDinvkgD0V7
=ildx
-END PGP SIGNATURE-



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



Re: [PHP] My Sincere Request!![Scanned]

2003-05-29 Thread bob parker
I have three points in response to this thread.

1. This is the an example of the Nigeria 419 scam. I have no idea how it got 
the 419 in the name.  What they want from your is you bank account details so 
that they can remit the money out of the country and you supposedly get to 
keep your share. What actually happens is SURPRISE SURPRISE your bank account 
gets emptied.

2. Please don't repeat the entire spam with your response. Most people 
reading this list do have an attention span greater than your average 
labrador.

3.
Answer:  No!
Question:Should I post my response above the topic?

Cheers
Bob Parker

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



[PHP] Re: Create Links on the fly?

2003-05-29 Thread Bobby Patel
###HTML snippet
form action = redirect.php
Enter Number : input type=text name=number
/form


###PHP

?php
$number = $HTTP_POST_VARS['number']; # or $_POST['number']; depnding on PHP
version
header (Location: http://www.mypage.com/.$number);
exit();
?

### NOTE: I just wrote this on the fly so there is no error checking or
sytnax checking
 Hopefully this makes sense and doesn;t need explanations, but if so
just post the list and me and I'll get back to you.


Bobby
Chase [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Salutations!

 I am trying to do something fairly simple, but I can't seem to make it
 work...  I want to have a form field on a page that the user will put in a
3
 to 5 digit number and when they click on Submit that number will become
 part of an URL that they are forwarded to.

 For example, if the user put in the number 123, then when they click on
 Submit they would be pushed to http://www.mypage.com/123.

 Can anyone offer help??





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



RE: [PHP] Session Question

2003-05-29 Thread Johnson, Kirk

 SInce register_globals() is ON on my server, I need to be able to 
 figure out a way to ensure session security.

The single most important thing to do is initialize all your variables. The
way to ensure that you have done that is to set the error reporting level to
E_ALL (which is max). The server will then report it if you use a variable
that hasn't yet been assigned a value.

Kirk

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



[PHP] Re: Trouble With FTP_PUT Please Help!

2003-05-29 Thread Adnan
Hi, just to let you know i've sussed it out, i didnt realise that the
destination directory had to be on the system, rather than on the site

thank you very much for ur help and time

adnan

Adnan wrote:

 Hi,
 
 i have been having trouble working out how to upload an image, the most
 progress ive made is putting a blank file on the server, but thats it, any
 suggestions anyone??
 
 Im using PHP 4.3.2, Apache 1.3.27
 
 here is the code im using!
 
 photoposted.php
 
 ?
 
 $ftp_user_name='username';
 $ftp_user_pass='';
 $ftp_server='xxx.xxx.xxx.xxx';
 $ftp_dir='/'.$_FILES['imagefile'];
 $destination_file=$ftp_dir.'';
 
 $conn_id = ftp_connect($ftp_server);
 $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
 $upload =

ftp_put($conn_id,$destination_file,$_FILES['imagefile']['name'],FTP_IMAGE);
 
 ?
 
 postphoto.php
 
 ?
 
 echo form action=\/en/index.php?action=membersmp=photoposted\
method=\post\ enctype=\multipart/form-data\;
 echo Click the Browse button to find the file you wish to upload;
 echo input type=hidden name=\MAX_FILE_SIZE\ value=20;
 echo input type=\file\ name=\imagefile\;
 echo INPUT TYPE=\submit\ name=\upload\ value=\upload\;
 echo /form;
 
 ?
 
 i am quite new to php, any suggestions would be highly appreciated!
 
 thanks :)
 
 adnan


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



[PHP] Jpgraph troubles

2003-05-29 Thread Jordan Elver
Hi,
I've been creating some graphs using jpgraph and they work really well when I 
view them directly i.e. directly through the script. My problem comes as soon 
as I try to display them using the img tag within another page. When I do:

img src=graph.php /

I can't get it to display. It just shows the broken image icon.

Any ideas whaty may be causing that?

TIA,
Jord
-- 
Jordan Elver
The office is like an army, and I'm the field general. You're my footsoldiers 
and customer quality is the WAR!!! -- David Brent (The Office)


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



[PHP] PHP Rocks! ..OT..

2003-05-29 Thread Wendell Brown
I had completely forgotten how much more hassel CGI / Perl is when
compared to PHP.  I just got done doing a MINOR mod to a Perl script
(it took me about 4 hours compared to what would have taken me about 10
minutes in PHP) and I just want to say THANK YOU to all the PHP
developers!  :)


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



Re: [PHP] Jpgraph troubles

2003-05-29 Thread Wendell Brown
On Wed, 28 May 2003 19:00:20 +0100, Jordan Elver wrote:

I can't get it to display. It just shows the broken image icon.

I assume you are sending something similar to the following before the
actual pic?

header(content-type: image/png);

I have a script set up on my page that demonstrates using GD directly
(at least I think jpgraph uses GD):

http://www.arkie.net/~scripts/thermometer/


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



[PHP] Dealing with spam on the list - please read

2003-05-29 Thread Rasmus Lerdorf
Folks, occasionally the odd spam message is going to slip through our
various safeguards and spam will go out on the PHP lists.  We are working
on improving things on our end to reduce the amount that slip through, but
we also need your help with the following:

 1. Do not respond to the list complaining about the spam.  That just
makes things worse.

 2. Do not report the spam to the upstream providers of the PHP mailing
list server.  People tend to report the spam to the abuse address
at Pair Networks which only serves to get our provider upset at us
and does nothing to combat the original spam.  

 3. Please just hit your delete key and move on if you see a spam.  
Local spam filters such as SpamAssassin or Bogofilter are quite
effective at catching the ones that slip through our net.  If
you really feel the need to yell at someone over the spam, please
yell at us.  Send your gripes to [EMAIL PROTECTED] and we will try
to address your problem.

-Rasmus


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



[PHP] rand() function not working right

2003-05-29 Thread ldg
I'm using the latest php and the rand() function isn't working properly when
giving it any min and max arguments.
It does work without anything between the () but if I put a min and max,
then only the min value always gets chosen.

Is that a bug? Is that new?

I'm not using an old php version, and it makes no difference to seed or not.
I've switched to mt_rand() and it seems to work fine with min/max so far..

-- 
Didier Godefroy
mailto:[EMAIL PROTECTED]


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



[PHP] detect proxy

2003-05-29 Thread Miguel Angelo
Hi Sonjaya,

   Here is how i detect a proxy / user external ip and internal ip

   I use the global variable catched by PHP from the web server,
   the web server that i use is Apache i don't know about your's but it might
   work.
   There are tonns of available information here is some that i have debugged 
If you get a 

   User Browser :$GLOBALS[HTTP_USER_AGENT]
   External IP : $GLOBALS[REMOTE_ADDR]
   Internal IP : $GLOBALS[HTTP_X_FORWARDED_FOR]

   Proxy :   $GLOBALS[HTTP_VIA]

Please notice that you might get all, same or partial information from the user
i think the only one that you can trust 100% is the External IP since this is
basic TCP/IP all the rest might be empty or with invalid values. Microsoft ISA
proxy at my job for example does not foward the internal user IP.


try something  print_r($GLOBALS)to check out all the avaliable
informations

you could do something like this

if ( $GLOBALS[HTTP_VIA] ==  ) {
  echo User Proxy is Not Available br;
}
else {
  echo User Proxy: $GLOBALS[HTTP_VIA] br;
}

Hope this help you !

Stay happy
Miguel Angelo


From: sonjaya  [EMAIL PROTECTED]
To: php-general  [EMAIL PROTECTED]
Date: Wed, 28 May 2003 18:02:26 +0700
Subject: detect proxy
dear milist
any body now script to detect browser also ip  event using proxy public or
high anonymous .thank's



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



[PHP] CleanUp!!

2003-05-29 Thread Erich Kolb
How can I clean this up?
$in_file = http://somedomain.com/somefile.php;

$out_file = ereg_replace(http://;, , $in_file);
$out_file = ereg_replace(/,-, $out_file);
$out_file = /www/dev/.$out_file;



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



Re: [PHP] Jpgraph troubles

2003-05-29 Thread Jordan Elver
 I assume you are sending something similar to the following before the
 actual pic?

 header(content-type: image/png);

Jpgraph does that for you I think. As I said before, the script works when you 
access it directly, but not when it's through an img tag.
-- 
Jordan Elver
There may be no 'I' in team, but there's a 'ME' if you look hard enough. -- 
David Brent (The Office)


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



Re: [PHP] CleanUp!!

2003-05-29 Thread Matt Grimm
First, make sure to use str_replace whenever possible instead of
ereg_replace.  It's faster:

$out_file = str_replace(http://;, , $in_file);

etc...

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

- Original Message - 
From: Erich Kolb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 11:11 AM
Subject: [PHP] CleanUp!!


 How can I clean this up?
 $in_file = http://somedomain.com/somefile.php;

 $out_file = ereg_replace(http://;, , $in_file);
 $out_file = ereg_replace(/,-, $out_file);
 $out_file = /www/dev/.$out_file;



 -- 
 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] Help with fread

2003-05-29 Thread Erich Kolb
How can I get statistics from a remote file?

I am trying to get info on:
FileSize
Date Created
Date Modified

when:
fopen (http://somedomain.com/somefile.ext;, r)

Also, I am unable to use filesize function where $fp =
fopen(http://somedomain.com/somefile.ext;, r).


Is it possible to do this, or is it a limitation of php/linux filesystem?



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



[PHP] Re: Help with fread

2003-05-29 Thread Catalin Trifu
Hi,

As the PHP manual states you CAN NOT use filesystem functions,
such as filesize, filectime, etc...
on remote files, such as those opened opened through HTTP.
You can however rely on the FTP functions, if you can use FTP to
open the files.


Cheers,
Catalin

Erich Kolb [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 How can I get statistics from a remote file?

 I am trying to get info on:
 FileSize
 Date Created
 Date Modified

 when:
 fopen (http://somedomain.com/somefile.ext;, r)

 Also, I am unable to use filesize function where $fp =
 fopen(http://somedomain.com/somefile.ext;, r).


 Is it possible to do this, or is it a limitation of php/linux filesystem?





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



[PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
Let's say I have a table with links in the headers for sorting each column.  I want to 
carry the sort variable along in the $_GET array, and I need to be able to pass other 
variables to this same page, also using the GET method.  My trouble is when I need to 
append a new variable to the REQUEST_URI -- I need to detect whether a QUERY_STRING 
has already been passed, so I won't use ? when I need  in the URI.  Here's my 
clunky attempt:

a href=?php
echo $_SERVER['REQUEST_URI'];
if ($_SERVER['QUERY_STRING']  !$_GET['newVar']) {
echo newVar=1;
}
else if (!$_SERVER['QUERY_STRING']) {
echo ?newVar=1;
}
?
link description text/a

Please tell me there is some way to just append to the query string without checking 
it first...

--
Matt Grimm 
Web Developer 
The Health TV Channel, Inc. 
(a non - profit organization) 
3820 Lake Otis Parkway 
Anchorage, AK 99508 
907.770.6200 ext. 686 
907.336.6205 (fax) 
E-mail: [EMAIL PROTECTED] 
Web: www.healthtvchannel.org

[PHP] Checking if an array key exists

2003-05-29 Thread James Kaufman
I have a multi-dimensional array. Looks like this:

$work_order_hdr = array ('whdr_id'='record_no',
 'whdr_order_no'='request_no',
 'whdr_site_id'='site_id',
 'whdr_user_id'='user_id',
 'whdr_location'='location',
 'whdr_date_submitted'='date_submitted',
 'whdr_date_acknowledged'='date_acknowledged',
 'whdr_date_approved'='date_approved',
 'whdr_date_rejected'='date_rejected',
 'whdr_date_cancelled'='date_cancelled',
 'whdr_date_closed'='date_closed',
 'whdr_status'='status');

$work_order_hdr['links']['whdr_site_id']='site_master[site_id]';
$work_order_hdr['links']['whdr_user_id']='user_master[user_id]';

I use the a part of the array to display the field names from the db in a more
user-friendly manner.  The 'links' part is new and is intended to link certain
fields to fields in other tables.

I have a variable called '$tbl' that contains a table name, in this case
$tbl='work_order_hdr'. I can reference 'whdr_id' like this:

echo $$tbl['whdr_id']

That gives the expected 'record_no'

I can't seem to access the links correctly. I've tried various combinations of
'isset' and 'array_key_exists' but can't find the correct syntax.

The system in question is running php 4.1.2. Suggestions?

-- 
Jim Kaufman mailto:[EMAIL PROTECTED]
Linux Evangelistcell: 612-481-9778  
public key 0x6D802619   fax:  952-937-9832
http://www.linuxforbusiness.net

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



Re: [PHP] Checking if an array key exists

2003-05-29 Thread CPT John W. Holmes
 I have a multi-dimensional array. Looks like this:

 $work_order_hdr = array ('whdr_id'='record_no',
  'whdr_order_no'='request_no',
  'whdr_site_id'='site_id',
  'whdr_user_id'='user_id',
  'whdr_location'='location',
  'whdr_date_submitted'='date_submitted',
  'whdr_date_acknowledged'='date_acknowledged',
  'whdr_date_approved'='date_approved',
  'whdr_date_rejected'='date_rejected',
  'whdr_date_cancelled'='date_cancelled',
  'whdr_date_closed'='date_closed',
  'whdr_status'='status');

 $work_order_hdr['links']['whdr_site_id']='site_master[site_id]';
 $work_order_hdr['links']['whdr_user_id']='user_master[user_id]';

 I use the a part of the array to display the field names from the db in a
more
 user-friendly manner.  The 'links' part is new and is intended to link
certain
 fields to fields in other tables.

 I have a variable called '$tbl' that contains a table name, in this case
 $tbl='work_order_hdr'. I can reference 'whdr_id' like this:

 echo $$tbl['whdr_id']

 That gives the expected 'record_no'

 I can't seem to access the links correctly. I've tried various
combinations of
 'isset' and 'array_key_exists' but can't find the correct syntax.

Wouldn't it be:

echo ${$tbl['links']['whdr_site_id']};
echo ${$tbl['links']['whdr_user_id']};

You know you could move your array down one more dimension and do away with
the variable variables...

$ar = array('work_order_hdr' =
   array ('whdr_id'='record_no',
 'whdr_order_no'='request_no',
 'whdr_site_id'='site_id',
 'whdr_user_id'='user_id',
 'whdr_location'='location',
 'whdr_date_submitted'='date_submitted',
 'whdr_date_acknowledged'='date_acknowledged',
 'whdr_date_approved'='date_approved',
 'whdr_date_rejected'='date_rejected',
 'whdr_date_cancelled'='date_cancelled',
 'whdr_date_closed'='date_closed',
 'whdr_status'='status'));

$ar['work_order_hdr']['links']['whdr_site_id']='site_master[site_id]';
$ar['work_order_hdr']['links']['whdr_user_id']='user_master[user_id]';

Then, if you have $tbl = 'work_order_hdr', you use

echo $ar[$tbl]['wdhr_id'];

echo $ar[$tbl]['links']['whdr_site_id'];

etc... Pretty much any implementation of variable variables is just a work
around to using arrays.

---John Holmes...


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



Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread CPT John W. Holmes
You have to check for it, regardless. See if this works for you.

$url = $_SERVER['REQUEST_URI'] . '?' . ((isset($_SERVER['QUERY_STRING'])) ?
$_SERVER['QUERY_STRING'] . '' : '' ) . 'newVar=1';

The middle part basically sees if the QUERY_STRING is empty. If it is, it
includes a question mark otherwise it includes an apersand. Actually, to be
fully compliant, replace the  with amp; in your URLs.

$url = $_SERVER['REQUEST_URI'] . '?' . ((isset($_SERVER['QUERY_STRING'])) ?
$_SERVER['QUERY_STRING'] . 'amp;' : '' ) . 'newVar=1';

It'll work, trust me. :)

---John Holmes...

- Original Message -
From: Matt Grimm [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 4:12 PM
Subject: [PHP] Appending to the REQUEST_URI


Let's say I have a table with links in the headers for sorting each column.
I want to carry the sort variable along in the $_GET array, and I need to be
able to pass other variables to this same page, also using the GET method.
My trouble is when I need to append a new variable to the REQUEST_URI -- I
need to detect whether a QUERY_STRING has already been passed, so I won't
use ? when I need  in the URI.  Here's my clunky attempt:

a href=?php
echo $_SERVER['REQUEST_URI'];
if ($_SERVER['QUERY_STRING']  !$_GET['newVar']) {
echo newVar=1;
}
else if (!$_SERVER['QUERY_STRING']) {
echo ?newVar=1;
}
?
link description text/a

Please tell me there is some way to just append to the query string without
checking it first...

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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



[PHP] PHP Fusebox - Circuit within another Circuit

2003-05-29 Thread Christopher Ditty
We are using PHP Fusebox to develop one of our applications where I
work.
 I have a descent-grasp on the whole fusebox concept, but I am having
problems getting my head around how sub-circuits work. Can anyone
offer
any advice?  When I go to the main fuseaction, all works fine.  When I
try to go to main.admin, I just get a blank screen.  Even if there is
nothing in the admin directory.

I have copied my switch and circuits file below.

Chris

fbx_Switch.php
switch($Fusebox[fuseaction]){
case main:
case Fusebox.defaultFuseaction:
dsp_page_header($config, $_GET);
dsp_page_main($config, $_GET);
dsp_page_footer($config, $_GET);
break;

case admin:
$XFA[admin] = admin.main;
break;

default:
print I received a fuseaction called b' .
$Fusebox[fuseaction] . '/b that circuit b' .
$Fusebox[circuit]
. '/b does not have a handler for.;
break;
}

fbx_Circuits.php
$Fusebox[circuits][home] = home;
$Fusebox[circuits][admin] = home/admin;
$Fusebox[circuits][account] = home/account;
$Fusebox[circuits][electric] = home/electric;
$Fusebox[circuits][gas] = home/gas;
$Fusebox[circuits][registration] = home/registration;

--
05/28/2003, 03:51:02 PM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas  Water Division, and no such 
inference should be made.

==


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



[PHP] Netbilling Connect Script or Class...

2003-05-29 Thread Ralph
I have to setup credit card verification/processing with Netbilling.com,
does anybody know of a PHP based Netbilling connect script or class?

Your help is appreciated.



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



Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread CPT John W. Holmes
Replying to myself... :)

 You have to check for it, regardless. See if this works for you.

 $url = $_SERVER['REQUEST_URI'] . '?' . ((isset($_SERVER['QUERY_STRING']))
?
 $_SERVER['QUERY_STRING'] . '' : '' ) . 'newVar=1';

 The middle part basically sees if the QUERY_STRING is empty. If it is, it
 includes a question mark otherwise it includes an apersand. Actually, to
be
 fully compliant, replace the  with amp; in your URLs.

I changed the code and forgot to fix the above paragraph. The middle part
sees if QUERY_STRING is set, if it is, it includes it's value and appends an
ampersand to the end, then includes the new var. The question mark has to be
included no matter what, since it's not a part of the query string variable.

Actually, the easiest way would just be to use:

$url = $_SERVER['REQUEST_URI'] . '?' . @$_SERVER['QUERY_STRING'] .
'newVar=1';

The @ will suppress any warnings about undefined index. You may end up with
www.domain.com?newVar=1, but it'll still work. Don't know if it's
compliant or what... but :)

---John Holmes...


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



Re: [PHP] Jpgraph troubles

2003-05-29 Thread John S. Huggins
On Wed, 28 May 2003, Jordan Elver wrote:

-Hi,
-I've been creating some graphs using jpgraph and they work really well when I 
-view them directly i.e. directly through the script. My problem comes as soon 
-as I try to display them using the DEFANGED_IMG tag within another page. When I do:
-
-DEFANGED_IMG src=graph.php /
-
-I can't get it to display. It just shows the broken image icon.
-
-Any ideas whaty may be causing that?

Some mail filters strip all IMG tags from HTML style emails to prevent
unwanted trickery of loading images so see if an email address works.

Some just change the IMG tag to DEFANGED_IMG effectively breaking the
link.

I only see this in email filters so I do not know why this is showing up
on your PHP generated web page.


-
-TIA,
-Jord
--- 
-Jordan Elver
-The office is like an army, and I'm the field general. You're my footsoldiers 
-and customer quality is the WAR!!! -- David Brent (The Office)
-
-
--- 
-PHP General Mailing List (http://www.php.net/)
-To unsubscribe, visit: http://www.php.net/unsub.php
-

**

John Huggins

[EMAIL PROTECTED]
http://www.phphosts.com/

**


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



RE: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread Evan Nemerson
Deprecated means that it has fallen out of favor, and is
_in_the_process_of_being_phased_out_ You should not rely on this code in
new applications. Go look it up in a dictionary.

If you have to be backward compatible with  4.1.0 (which was released
on 10-Dec-2001!) I suggest something like this:

?

function get($v) {
$_GLOBALS[$v] = (version_compare(phpversion(), '4.1.0', '=')) ?
$_GET[$v] : $HTTP_GET_VARS[$v];
}

get('desired_var');
echo $desired_var;

?

However, I don't think it's at all unreasonable to request that they use
a version of PHP less than 2 years old (i think 4.0.6, the last version
before 4.1.0, was released 27-Jun-2001). At that point, I would be more
concerned with compatibility with _future_ releases than 'absolute
compatibility' with past releases.





On Wed, 2003-05-28 at 04:46, Jay Blanchard wrote:
 [snip]
 To maintain absolute compatibility, just use $HTTP_GET_VARS.  It's 
 availalable in all PHP versions, just deprectaed in versions here $_GET 
 is available.
 [/snip]
 
 Just to be perfectly clear on this. Let's say that I am writing an
 application that I am going to release to the public (for free of
 course!). In order that the application be as compatible with the many
 installed versions of PHP as possible I should always use $HTTP_GET_VARS
 or $HTTP_POST_VARS ? Or is there a point at which the formation of the
 variable call changes (like the $_GET and $_POST in the latest
 versions)? If there is a point at which it changes how can I account for
 that in code, other than telling the potential use that you must be
 running PHP 4.x.x?
 
 Thanks!
 
 Jay
 


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



Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
Yes, thanks John, with a little tweaking this does just what I needed.  I
keep forgetting to use that compact conditional syntax, it's sexy.

I had to use PHP_SELF instead of REQUEST_URI first, since the latter
contains the path, the script, and the query string.

$url = $_SERVER['PHP_SELF'] . '?' . @$_SERVER['QUERY_STRING'] .
'amp;newVar=1';

Now I can just throw in a conditional like below to make sure I'm not
duplicating the newVar in my query string.  Thanks!

--
Matt Grimm

- Original Message - 
From: CPT John W. Holmes [EMAIL PROTECTED]
To: Matt Grimm [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 1:06 PM
Subject: Re: [PHP] Appending to the REQUEST_URI


 Replying to myself... :)

  You have to check for it, regardless. See if this works for you.
 
  $url = $_SERVER['REQUEST_URI'] . '?' .
((isset($_SERVER['QUERY_STRING']))
 ?
  $_SERVER['QUERY_STRING'] . '' : '' ) . 'newVar=1';
 
  The middle part basically sees if the QUERY_STRING is empty. If it is,
it
  includes a question mark otherwise it includes an apersand. Actually, to
 be
  fully compliant, replace the  with amp; in your URLs.

 I changed the code and forgot to fix the above paragraph. The middle part
 sees if QUERY_STRING is set, if it is, it includes it's value and appends
an
 ampersand to the end, then includes the new var. The question mark has to
be
 included no matter what, since it's not a part of the query string
variable.

 Actually, the easiest way would just be to use:

 $url = $_SERVER['REQUEST_URI'] . '?' . @$_SERVER['QUERY_STRING'] .
 'newVar=1';

 The @ will suppress any warnings about undefined index. You may end up
with
 www.domain.com?newVar=1, but it'll still work. Don't know if it's
 compliant or what... but :)

 ---John Holmes...


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

2003-05-29 Thread Jordan Elver
 I can see what headers are sent.  What is the url of the image?

I checked using curl -I and found that the correct headers are being sent. I 
found out it was because I didn't have a certain library I needed included 
within the graph script.

Thanks for your help anyway,
Cheers,
Jord
-- 
Jordan Elver
If work was so good, the rich would have kept more of it for themselves. -- 
David Brent (The Office)


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



[PHP] Does array_rand need to be seeded?

2003-05-29 Thread Matt Grimm
The manual entry for array_rand states:

Don't forget to call srand() to seed the random number generator.

However, the srand page states this:

Note: Since PHP 4.2.0 it's no longer necessary to seed the random number generator 
before using it.

Is the 'random number generator' identical for all PHP random functions?  So I'm *not* 
required to seed any of them?

Thanks,
--
Matt Grimm 


[PHP] replacing register_shutdown_function

2003-05-29 Thread Brian Moon
Hi all,

Ever since register_shutdown_function was changed to no longer happen after
the connection was closed, several things on our site have started to suck.
Not the main, public site, but our internal pages where cache is regenerated
and such.

I have tried using the pcntl functions in an exec'd script (both perl and
PHP) to fork and hopefully return to the web app to allow it to continue
(and not wait forever).  This works great with CLI and the command line, but
does not work at all if I exec() from mod_php.

All I do is call:

exec(/dealnews/myscript.php);

in the PHP app.  myscript.php then forks.  Unfortunately, exec() waits for
the damn forked process to finish before he returns.

Am I just not seeing something in PHP pcntl support here or am I on a wild
goose chase?

Thanks,

Brian Moon
dealnews.com


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



[PHP] re: quantifiers not working in ereg.*

2003-05-29 Thread matze
 On Sunday 25 May 2003 20:42, matze wrote:
  on a redhat 8.0 box with php 4.1.2 rpm (from rh v7.2) installed
  the ereg.* functions don't work as i expect. in some cases -
  especially when \r\n sequences are involved - the ereg functions
  don't match a string, although they should. i tested with the same
  code on several machines, it works fine on all, only the above
  mentioned redhat box causes problems:
 
  $foo =barB\r\nfoo\r\n;
  if(ereg(.+\r\nfo, $foo))
  {
print('matched');
  }
  else
  {
print('not matched');
  }
 
  i expect the output 'matched', and actually i get it on all machines
  but the redhat box.
 
 FWIW using RH7.2, PHP 4.3.0 compiled from source the above matches.
 
  any idea what could be the reason for this behaviour?
 
 Stab in the darK: as of RH8 the locale settings were changed, not sure
 whether 
 this has any bearing on your problem. Best ask on the RH list.

will have a look at this point

 Another thing, when you installed php didn't it complain? RH7.2 used
 Apache 
 1.3.X and RH8 uses Apache 2.X.

i installed also apache 1.3.27 from the rh 7.2 rpm ;-)
 
 BTW you're probably better off using the preg*() functions anyway.

prob is that the critical part of code is in a standard peace of
software (xmlrpc) that i'd like avoid to modify.

thx

/matze

-- 
   ( ( ( i ) ) )  http://barcelona.indymedia.org  ( ( ( i ) ) )

 *  using free software / Debian GNU/Linux | http://debian.org  *

gpg --keyserver keys.indymedia.org --recv-keys B9A88F6F

La guerra es un acto abominable en el que se matan personas que no
 se conocen, dirigidas por personas que se conocen y no se matan


pgp0.pgp
Description: PGP signature


[PHP] Decrypting data with GnuPG

2003-05-29 Thread Pierre-Luc Soucy
Hi,

I would like to decrypt data encoded with GnuPG without including the 
private key passphrase in the command to prevent people from viewing it 
with ps.

Here is the code I wrote:


$command = /usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning 
--always-trust --yes --output /path/to/output.txt --decrypt 
/path/to/testtext.asc;
$passphrase = '***';

$fp = popen($command, 'w+');
fputs($fp, $passphrase);
pclose($fp);
print Done;
exit;
==
I assumed that the fputs() function would write the passphrase at the 
prompt, but that doesn't seem to be the case - the command does not 
create the output.txt file when ran by the PHP program (which is running 
as a CGI under my user BTW) while it works when ran from the shell.

Any idea why?

Thanks!

Pierre-Luc Soucy

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


[PHP] Biding Arrays from Oracle Stored Procedure to PHP Variables

2003-05-29 Thread Gregory Watson
Hi guys...

I'm very new to using Oracle and stored procedures.

I'm using a stored procedure to return 12 variables, 8 of which are arrays.

?php

   $EventID = 41403;
   $BufferSize = 3000;
   $connection_oracle = OCILogon(,**, **);
   $statement_oracle = OCIParse($connection_oracle, BEGIN
   CFADMIN.getRewardUserList(:in_eventid, :out_status,
   :out_record_count, :in_buffersize, :out_memberid, :out_firstname,
   :out_lastname, :out_city, :out_state, :out_loginid, :out_email,
   :out_redeemstatus); END;);
   OCIBindByName($statement_oracle, :in_eventid, $EventID, -1);
   OCIBindByName($statement_oracle, :out_status, $Status, -1);
   OCIBindByName($statement_oracle, :out_record_count, $RecordCount, -1);
   OCIBindByName($statement_oracle, :in_buffersize, $BufferSize, -1);
   OCIBindByName($statement_oracle, :out_memberid, $MemberID, -1,
   OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_firstname, $FirstName, -1,
   OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_lastname, $LastName, -1,
   OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_city, $City, -1, OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_state, $State, -1, OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_loginid, $LoginID, -1,
   OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_email, $Email, -1, OCI_ASSOC);
   OCIBindByName($statement_oracle, :out_redeemstatus, $RedeemStatus,
   -1, OCI_ASSOC);
   OCIExecute($statement_oracle, OCI_DEFAULT);
   OCIFreeStatement($statement_oracle);
   OCILogOff($connection_oracle);
?

I keep getting the following error:

   Warning: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00306:
   wrong number or types of arguments in call to 'GETREWARDUSERLIST'
   ORA-06550: line 1, column 7: PL/SQL: Statement ignored in
   C:\ftp_dir\boards\winners.php on line 22
I know I'm not binding them correctly, but I've looked all over the PHP 
site and I can't seem to find anything that makes any sense in what to 
do! Can anyone help?

Thanks in advance!

Greg



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


[PHP] Parsing html to extract images

2003-05-29 Thread Hidrahyl
Hi,

anyone can help me parsing html files in order to get all the images
containing a file?

Thanks, Simon.

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



Re: [PHP] session_registered issue

2003-05-29 Thread César Aracena
Hi Jim,

To solve the problem about caching I use two methods: In design stage, I
simply turn off the Automatic Refresh Page in my Explorer options and,
in working stage I use once a jscript to prevent the hole site from
caching and the visitor´s brwsers think that it´s allways refreshing...
use it with concience.

About te problem I posted, regarding the session_registered issue, it´s
solved. I found out that the concatenator I should use for this case was
AND not OR, as it tells PHP to ALSO look for the other(s) variable(s) and
not one by one for separate.

Cheers,

---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel/Fax: +54.299.477-4532
Cipolletti, Rio Negro
R8324BEG
Argentina

quote=Jim McNeely
 I am having a similar issue, and I'm thinking that the browser is
 holding a cache of the page, and if it shows it hasn't been modified
 since last visited it uses the cache and bypasses all the dynamic stuff
 you are trying to do. I'm not exactly sure about that but it's my
 current working theory. It holds up that if you modify a file or empty
 the cache it displays properly, and if you don't it uses an older
 version of the page, ignoring database changes (and auth scripts) that
 would have changed the page's contents.

 So the question is, is there a way to format a link so that it forces a
 page to refresh, ignoring the browser's cache?

 Jim McNeely
 Envision Data
 Custom, intuitive, practical software for your business.
 [EMAIL PROTECTED]
 http://www.envisiondata.com

 On Wednesday, May 28, 2003, at 09:37  AM, César Aracena wrote:

 Hi all,

 I have no problem with registering a session. As a matter of fact, I
 making a site where I register 3 different levels of sessions with no
 problem. The thing is when, in my header.inc (which includes
 session_start(); for all the site) I tell through PHP only to show the
 login form ONLY when:

 !session_is_registered(user) OR !session_is_registered(admin) etc.

 but it keeps showing it when registered or not... Any ideas?

 Here's my code:

 !-- SNIP --

 if (!session_is_registered(user) OR !session_is_registered(admin)
 OR
 !session_is_registered(full_admin))
 {
 echo CENTERFORM
 ACTION=\.$CFG-wwwroot./zonaclientes/login.php\ METHOD=POST;
 echo CENTERSPAN class=\copy\ZONA DE CLIENTESBR;
 echo Usuario:BR;
 echo INPUT TYPE=text NAME=user VALUE=\\ SIZE=15BR;
 echo Contrasentilde;a:/SPANBR;
 echo INPUT TYPE=password NAME=pass VALUE=\\ SIZE=15BR;
 echo INPUT TYPE=submit NAME=Submit VALUE=\Ingresar\/CENTER;
 echo /FORM;
 echo HR;
 }

 -- SNIP --

 Thanks in advanced,

 ---
 Cesar Aracena
 [EMAIL PROTECTED]
 http://www.icaam.com.ar
 Cel: +54.299.635-6688
 Tel/Fax: +54.299.477-4532
 Cipolletti, Rio Negro
 R8324BEG
 Argentina




 ---
 Soluciones profesionales en
  Internet y Comunicaciones
   http://www.icaam.com.ar



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



---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar



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



[PHP] Help with eval()

2003-05-29 Thread zavaboy
Hey,

I'm having problems with the eval() function...

if ($Sort == Up) {
$do==;
} else {
$do==;
}
for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
//So.. the above line acts like:
//for ($i = $aNum; $i = $bNum; )
//...or...
//for ($i = $aNum; $i = $bNum; )
{
i
if ($Sort == Up) {
$i++;
} else {
$i--
}

Any idea how to make it work right?



- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com



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



Re: [PHP] detect proxy

2003-05-29 Thread sonjaya
dear sir
 sorry if my english bad, my question is , any body now script to detect ip(internet 
protocol)  to 
web us . exsample : your  ip is  192.168.1.1 , i get this $ip(REMOTE_ADDRES) , but 
this script just 
for main ip i want client ip because i use proxy , how we can detect, i want like this 
 . You are 
connected through proxy : 1.0 cleint.yahi.com:8080 (Squid/2.4.STABLE1), 1.0 
cache2.yahi.com:8080 
(Squid/2.4.STABLE7), 1.0 sfc-cache- main.cache.yahi.com:8080 (squid/2.5.STABLE2) at 
216.149.15.26
Your IP : 192.168.0.153, 216.125.24.6, 216.125.22.105 
User Online: 45
like that 

Understandable english please!

On Wed, 28 May 2003 18:02:26 +0700
  sonjaya [EMAIL PROTECTED] wrote:
 dear milist 
 any body now script to detect browser also ip  event 
 using proxy public or high anonymous .thank's
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


António Rafael C. Paiva
Electronics and Telecommunications Dep.
Aveiro University





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



Re: [PHP] Create Links on the fly?

2003-05-29 Thread Justin French
if you wish to have this work purely with PHP, and not rely on client-side
stuff like javascript, then your only option (that i can see) is to create a
middle man script which translates their wishes.

startpage.html
---
html
...
form action='redirect.php' method='post'
input type='text' name='yourNumber' size='5' maxlength='5' /
input type='submit' name='submit' value='show' /
/form
...
/html
---

redirect.php
---
?
if($_POST['yourNumber'])
{
header(Location: http://mysite.com/dir/{$_POST['yourNumber']});
}
else
{
header(Location: startpage.html);
}
?
---


It can be done client side, IF you're willing to take on the risks and
uncertainties of relying on javascript, which i try to avoid wherever
possible.

You'll have to ask a JS list about that though :)


Justin French

on 29/05/03 4:20 AM, Chase ([EMAIL PROTECTED]) wrote:

 Salutations!
 
 I am trying to do something fairly simple, but I can't seem to make it
 work...  I want to have a form field on a page that the user will put in a 3
 to 5 digit number and when they click on Submit that number will become
 part of an URL that they are forwarded to.
 
 For example, if the user put in the number 123, then when they click on
 Submit they would be pushed to http://www.mypage.com/123.
 
 Can anyone offer help??
 
 


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



Re: [PHP] How can I change the timezone?

2003-05-29 Thread Justin French
on 28/05/03 11:49 PM, Jay Blanchard ([EMAIL PROTECTED])
wrote:

 [snip]
 I am in Hong Kong and the server is in US.
 I can't change the server setting.
 [/snip]
 
 How about getting the server time and then adding or subtracting from
 that to get the appropriate time?
 
 http://us2.php.net/manual/en/function.time.php

That doesn't really account for daylight savings, etc etc.

Justin


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



[PHP] PHP OOP x Procedural Performance

2003-05-29 Thread William N. Zanatta

  It is a known issue that function calls are expensive for the processor.

  The OOP let us better organize the code but, thinking in function (or
method) calls it may be more expensive than in the procedural form.

  My question is, has anyone made any tests regarding the performance of
OOP versus procedural language? Is it a good choice to code in OOP with
PHP ?


-=[ William N. Zanatta ]==[ [EMAIL PROTECTED] ]=-


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



Re: [PHP] Session Question

2003-05-29 Thread Justin French
Register globals essentially takes the value of $_SESSION['foo'] and creates
$foo.  It does the same thing for GET, POST, COOKIES, etc.

The problem here is that you have no way of telling if $foo was a POST
variable, GET, SESSION, or whatever.  So, I can choose to append ?admin=1 to
one of your URLs, and if you do not do any checking or variable
initialising, it might be possible for me to fake myself as a user with
admin clearance, or anything else that would be considered a risk.

The super global arrays like $_SESSION exist, and can be used, regardless of
whether register globals is on or off.  If you start relying on
$_SESSION['foo'] rather than $foo, $_POST['bah'] instead of $bah and
$_GET['xyz'] instead of $xyz, you've made a great start.

You should be able to use $_SESSION right now, but be aware that the manual
says if you choose to use $_SESSION, then you should stop using functions
such as session_register().


The next logical step would be to manually turn off register globals for
your site, using a directory-level .htaccess file in your document root.  An
example of this file would be:

---
IfModule mod_php4.c
php_flag register_globals off
/IfModule
---

Do a whole bunch of testing on your LAN, make any changes you need to make
to your code, perhaps turn the error reporting to the highest level (E_ALL)
to see what warnings you get, then try the same on your live server.


Justin




on 29/05/03 3:18 AM, Pushpinder Singh Garcha ([EMAIL PROTECTED]) wrote:

 SInce register_globals() is ON on my server, I need to be able to
 figure out a way to ensure session security.
 Another question I had was that,  with register_globals() ON can I
 still use the $_SESSION to set my variables ? I want to avoid recoding
 the entire application, so I want to see what can be done to enhance
 security with the current setup.
 
 Does the super-global array approach i.e. $_SESSION work, irrespective
 of the fact that REGISTER_GLOBALS is ON / OFF ?
 If I start setting session variables in the $_SESSION array from now
 on, will it improve the security of the session.  I am a newbie in PHP
 session handling and am sorry if any of the above questions sound
 extremely lame.
 


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



[PHP] Notice: Undefined variable: PHP_SELF

2003-05-29 Thread Dandie
Hi,
I am having problem with a PHP page on our web site.
I've installed the latest version of PHP on a Windows 2000 server.

The error we're getting is:
Notice: Undefined variable: PHP_SELF

Where do I start to fix this problem?

Thanks



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



[PHP] creating thumbnails from .BMP files

2003-05-29 Thread Artoo Smith
Hey,

How do you create thumbnails from .BMP files?  Is there a function like
there is for JPG (ImageJPEG)?

Thanks



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



Re: [PHP] PHP OOP x Procedural Performance

2003-05-29 Thread Ray Hunter
yes, the bottom line is code reuse...that is why there is oop. So that a
developer can always reuse code saving money on development and thus if
speed is an issue then adding more hardware.


--
Ray

On Wed, 2003-05-28 at 20:05, William N. Zanatta wrote:
   It is a known issue that function calls are expensive for the processor.
 
   The OOP let us better organize the code but, thinking in function (or
 method) calls it may be more expensive than in the procedural form.
 
   My question is, has anyone made any tests regarding the performance of
 OOP versus procedural language? Is it a good choice to code in OOP with
 PHP ?
 
 
 -=[ William N. Zanatta ]==[ [EMAIL PROTECTED] ]=-
 


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



  1   2   >