Re: [PHP] Passing variables

2007-03-22 Thread Tijnema !

On 3/22/07, Jeff [EMAIL PROTECTED] wrote:

I want to thank you all for clearing me up on setting the register_globals
to ON issue!! I have refrained from doing so and my code is running great
with the $_GET.

I am having NO trouble passing my single variable to the next page using..

echo A href=\char_edit_form.php?charid=$charid\Edit/A;

as when the next page that load actually shows the character info, so
basically you can see you are dealing with the correct record.

NOW.

I want to pass two variables to a delete page. The charid and the char name.
Here is what I have but it will only pass the 1st variable ?charid

echo A href=\delete_char.php?charid=$charid
?char=.$myrow[char_name].\Delete/A;

I get the 1st variable using the $charid = (int)$_GET['charid']; (on the
next page)

I do however NOT get

$charname = $_GET[char] to pull the name out. (on the next page)

I've tried putting a comma, a , a % between the variables ie..

echo A href=\delete_char.php?charid=$charid 
?char=.$myrow[char_name].\Delete/A;

but it just won't let me pull the $_GET[char]

I have even tried $_GET['char'] but am under the impression '_' are for
integers and _ are for text?

This is bullshit, ' and  do the same.


Anyway, can someone please let me know the
PROPER way to pass the two or more variables?


script.php?var1=value1var2=value2var3=value3




Thanks WAY in advance!!

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




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



Re: [PHP] Question before upgrading to 5

2007-03-22 Thread Tijnema !

On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:

Hi everyone,

I just got done going through all my configure options for php5, and finally
configure finished successfully... I didn't install it yet, have a question.
Can I have both 4 and 5 installed temporarily until I'm sure all my scripts
work ok? They should, I've been careful, but I want to be sure since this is
the only server I currently have. I was going to install a virtual copy of
fedora and do testing, but I don't have time, hopefully someone can answer.
I think I just have to change the prefix to something other than default and
load the new module in httpd. If I had more time I would do this the right
way, but we all know how that goes...

If this will work, I can then just uninstall 4.. Hopefully it won't break
anything.

I'll post my configure options if anyone would like to double check

Thanks,
Jake


If you use make install on the second one, it will add the libphp5
library to your httpd.conf, and then you would have libphp4 and
libphp5 in your httpd.conf. That is guaranteed to give problems. So if
you comment out one of the 2, then it works fine.

Tijnema


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.16/729 - Release Date: 3/21/2007
7:52 AM


--
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] What API does PHP need?

2007-03-22 Thread Roman Neuhauser
# markw@mohawksoft.com / 2007-03-20 23:44:48 -0400:
 I want to write another PHP extension, for no real reason, I've written a
 few and just want to keep up to date.
 
 What sort of API would you like to see?

dup(2)

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Re: Random Unique ID

2007-03-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
 Mark wrote:
 [EMAIL PROTECTED] wrote:
 
 Hello,
 
 I want to add a random unique ID to a Mysql table.  Collisions
 are unlikely but possible so to handle those cases I'd like to
 regenerate the random ID until there is no collision and only
 then add my row.  Any suggestions for a newbie as to the right
 way to go about doing this?
 
 Best,
 
 Craig
 .
 
 I suggest looking into a GUID sort of thing, it is all coded for you and it
 works just like you want.
 
 If you are running Linux, you can get this using:
$GUID =  exec(uuidgen);

http://www.ossp.org/pkg/lib/uuid

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Re: Random Unique ID

2007-03-22 Thread Tijnema !

On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:

# [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
 Mark wrote:
 [EMAIL PROTECTED] wrote:
 
 Hello,
 
 I want to add a random unique ID to a Mysql table.  Collisions
 are unlikely but possible so to handle those cases I'd like to
 regenerate the random ID until there is no collision and only
 then add my row.  Any suggestions for a newbie as to the right
 way to go about doing this?
 
 Best,
 
 Craig
 .
 
 I suggest looking into a GUID sort of thing, it is all coded for you and it
 works just like you want.

 If you are running Linux, you can get this using:
$GUID =  exec(uuidgen);

http://www.ossp.org/pkg/lib/uuid


Note that this doesn't gonna work when safe mode is on..!


--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

--
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] Question before upgrading to 5

2007-03-22 Thread Jochem Maas
alternatively you can search for 'Rasmus' and 'ProxyPass' in the list
archive and use Rasmus' rather cool ProxyPass solution to running both
php4 and php5 ... his explanation should give you enough info to set it up.

Tijnema ! wrote:
 On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
 Hi everyone,

 I just got done going through all my configure options for php5, and
 finally
 configure finished successfully... I didn't install it yet, have a
 question.
 Can I have both 4 and 5 installed temporarily until I'm sure all my
 scripts
 work ok? They should, I've been careful, but I want to be sure since
 this is
 the only server I currently have. I was going to install a virtual
 copy of
 fedora and do testing, but I don't have time, hopefully someone can
 answer.
 I think I just have to change the prefix to something other than
 default and
 load the new module in httpd. If I had more time I would do this the
 right
 way, but we all know how that goes...

 If this will work, I can then just uninstall 4.. Hopefully it won't break
 anything.

 I'll post my configure options if anyone would like to double check

 Thanks,
 Jake
 
 If you use make install on the second one, it will add the libphp5
 library to your httpd.conf, and then you would have libphp4 and
 libphp5 in your httpd.conf. That is guaranteed to give problems. So if
 you comment out one of the 2, then it works fine.
 
 Tijnema

 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.16/729 - Release Date:
 3/21/2007
 7:52 AM


 -- 
 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] image uploading/resizing best practices in PHP

2007-03-22 Thread Dwayne Heronimo
Dear All,

I would like to make a script to upload a jpg filewith php to a server; then 
make a thumb; save if for later use. And store the path to the image in a 
database to display it later. But what is the best practice to do this on a 
relatively low traffic website?

I dont know where to begin but I have 2 appoaches:

1. To make a script to upload the image and resize this on the fly and store 
only the thumb image somewhere for later use. While also to store the image 
path in de database for later retrieval.

2. to make a script to only upload the image as is and then insert the image 
path in the database for later use. And upon displaying the image to use 
like a nondistructive img scr=resizer.php?imgfile=image.jpgwidth=250 
border=0 resizer to display the image in the desired dimentions.

Which one would be the best practice now a days for a relative low traffic 
site?
I really have no idean how to build this but I have a good approach I maybe 
could start searching for something more specific.

Thanks for your help,

Dwayne 

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



Re: [PHP] image uploading/resizing best practices in PHP

2007-03-22 Thread Tijnema !

On 3/22/07, Dwayne Heronimo [EMAIL PROTECTED] wrote:

Dear All,

I would like to make a script to upload a jpg filewith php to a server; then
make a thumb; save if for later use. And store the path to the image in a
database to display it later. But what is the best practice to do this on a
relatively low traffic website?

I dont know where to begin but I have 2 appoaches:

1. To make a script to upload the image and resize this on the fly and store
only the thumb image somewhere for later use. While also to store the image
path in de database for later retrieval.


The best way i think if you have enough space on the server to store the thumb.



2. to make a script to only upload the image as is and then insert the image
path in the database for later use. And upon displaying the image to use
like a nondistructive img scr=resizer.php?imgfile=image.jpgwidth=250
border=0 resizer to display the image in the desired dimentions.

This one is worser then the first one, because everytime you request
the thumb would cost some CPU power. This isn't a lot, but if you are
gonna process 1000s thumbs a time, it will really make difference in
performance.



Which one would be the best practice now a days for a relative low traffic
site?
I really have no idean how to build this but I have a good approach I maybe
could start searching for something more specific.

Thanks for your help,

Dwayne


You should have a look at the image functions of
PHP(www.php.net/image). Creating the thumbs is the hardest part. The
upload part should be no problem with a little bit of google :)
Or you might want to google for a full working scripts, i saw them around.

Tijnema



--
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] image uploading/resizing best practices in PHP

2007-03-22 Thread Shafiq Rehman

Option one is much better.

--
Shafiq Rehman (ZCE)
http://phpgurru.com | http://shafiq.pk

On 3/22/07, Tijnema ! [EMAIL PROTECTED] wrote:


On 3/22/07, Dwayne Heronimo [EMAIL PROTECTED] wrote:
 Dear All,

 I would like to make a script to upload a jpg filewith php to a server;
then
 make a thumb; save if for later use. And store the path to the image in
a
 database to display it later. But what is the best practice to do this
on a
 relatively low traffic website?

 I dont know where to begin but I have 2 appoaches:

 1. To make a script to upload the image and resize this on the fly and
store
 only the thumb image somewhere for later use. While also to store the
image
 path in de database for later retrieval.

The best way i think if you have enough space on the server to store the
thumb.


 2. to make a script to only upload the image as is and then insert the
image
 path in the database for later use. And upon displaying the image to use
 like a nondistructive img scr=resizer.php?imgfile=image.jpgwidth=250
 border=0 resizer to display the image in the desired dimentions.
This one is worser then the first one, because everytime you request
the thumb would cost some CPU power. This isn't a lot, but if you are
gonna process 1000s thumbs a time, it will really make difference in
performance.


 Which one would be the best practice now a days for a relative low
traffic
 site?
 I really have no idean how to build this but I have a good approach I
maybe
 could start searching for something more specific.

 Thanks for your help,

 Dwayne

You should have a look at the image functions of
PHP(www.php.net/image). Creating the thumbs is the hardest part. The
upload part should be no problem with a little bit of google :)
Or you might want to google for a full working scripts, i saw them around.

Tijnema


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

2007-03-22 Thread itoctopus
Since you're new to this, always be sure to clean up the output you get from
$_GET or $_POST to avoid sql injection.

Fore example: $search_value = htmlentities($_GET['search_value'],
ENT_QUOTES);
If you're casting to something other than a string (such as int) than you're
safe and you don't have to use htmlentities.

--
itoctopus - http://www.itoctopus.com
Jeff [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thank you Chris!

 Chris [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Jeff wrote:
  I want to thank you all for clearing me up on setting the
  register_globals to ON issue!! I have refrained from doing so and my
code
  is running great with the $_GET.
 
  I am having NO trouble passing my single variable to the next page
  using..
 
  echo A href=\char_edit_form.php?charid=$charid\Edit/A;
 
  as when the next page that load actually shows the character info, so
  basically you can see you are dealing with the correct record.
 
  NOW.
 
  I want to pass two variables to a delete page. The charid and the char
  name. Here is what I have but it will only pass the 1st variable
?charid
 
  echo A href=\delete_char.php?charid=$charid
  ?char=.$myrow[char_name].\Delete/A;
 
  The first one is preceded by a ?
 
  Subsequent ones are with an ''.
 
  See http://en.wikipedia.org/wiki/Query_string
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/

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



Re: [PHP] image uploading/resizing best practices in PHP

2007-03-22 Thread Dwayne Heronimo
thx for the input. I was afraid that it would be option 1 because it is more 
complex.
I will start googling. ;)

Thx

Shafiq Rehman [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Option one is much better.

 -- 
 Shafiq Rehman (ZCE)
 http://phpgurru.com | http://shafiq.pk

 On 3/22/07, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Dwayne Heronimo [EMAIL PROTECTED] wrote:
  Dear All,
 
  I would like to make a script to upload a jpg filewith php to a server;
 then
  make a thumb; save if for later use. And store the path to the image in
 a
  database to display it later. But what is the best practice to do this
 on a
  relatively low traffic website?
 
  I dont know where to begin but I have 2 appoaches:
 
  1. To make a script to upload the image and resize this on the fly and
 store
  only the thumb image somewhere for later use. While also to store the
 image
  path in de database for later retrieval.

 The best way i think if you have enough space on the server to store the
 thumb.

 
  2. to make a script to only upload the image as is and then insert the
 image
  path in the database for later use. And upon displaying the image to 
  use
  like a nondistructive img 
  scr=resizer.php?imgfile=image.jpgwidth=250
  border=0 resizer to display the image in the desired dimentions.
 This one is worser then the first one, because everytime you request
 the thumb would cost some CPU power. This isn't a lot, but if you are
 gonna process 1000s thumbs a time, it will really make difference in
 performance.

 
  Which one would be the best practice now a days for a relative low
 traffic
  site?
  I really have no idean how to build this but I have a good approach I
 maybe
  could start searching for something more specific.
 
  Thanks for your help,
 
  Dwayne
 
 You should have a look at the image functions of
 PHP(www.php.net/image). Creating the thumbs is the hardest part. The
 upload part should be no problem with a little bit of google :)
 Or you might want to google for a full working scripts, i saw them 
 around.

 Tijnema


  --
  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] trans id problem

2007-03-22 Thread Luciano Tolomei

I must configure a site to not use cookie at all.

so i have made a directive in the .htaccess file
to disable cookie and use only trans id:

php_flag  session.use_cookies 0
php_flag  session.use_trans_sid 1


i have a big problem with form with method post.
the php correclty add the hidden session variables
but it seem that it does not arrive to the page.

if i put method= get in the form it works, but i cannot do it, and i 
really need post method.


There is some known problem about that ?

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



Re: [PHP] image uploading/resizing best practices in PHP

2007-03-22 Thread Németh Zoltán
2007. 03. 22, csütörtök keltezéssel 12.48-kor Dwayne Heronimo ezt írta:
 thx for the input. I was afraid that it would be option 1 because it is more 
 complex.

why would resizing and then storing it be more complex than resizing and
then displaying it?

greets
Zoltán Németh

 I will start googling. ;)
 
 Thx
 
 Shafiq Rehman [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
  Option one is much better.
 
  -- 
  Shafiq Rehman (ZCE)
  http://phpgurru.com | http://shafiq.pk
 
  On 3/22/07, Tijnema ! [EMAIL PROTECTED] wrote:
 
  On 3/22/07, Dwayne Heronimo [EMAIL PROTECTED] wrote:
   Dear All,
  
   I would like to make a script to upload a jpg filewith php to a server;
  then
   make a thumb; save if for later use. And store the path to the image in
  a
   database to display it later. But what is the best practice to do this
  on a
   relatively low traffic website?
  
   I dont know where to begin but I have 2 appoaches:
  
   1. To make a script to upload the image and resize this on the fly and
  store
   only the thumb image somewhere for later use. While also to store the
  image
   path in de database for later retrieval.
 
  The best way i think if you have enough space on the server to store the
  thumb.
 
  
   2. to make a script to only upload the image as is and then insert the
  image
   path in the database for later use. And upon displaying the image to 
   use
   like a nondistructive img 
   scr=resizer.php?imgfile=image.jpgwidth=250
   border=0 resizer to display the image in the desired dimentions.
  This one is worser then the first one, because everytime you request
  the thumb would cost some CPU power. This isn't a lot, but if you are
  gonna process 1000s thumbs a time, it will really make difference in
  performance.
 
  
   Which one would be the best practice now a days for a relative low
  traffic
   site?
   I really have no idean how to build this but I have a good approach I
  maybe
   could start searching for something more specific.
  
   Thanks for your help,
  
   Dwayne
  
  You should have a look at the image functions of
  PHP(www.php.net/image). Creating the thumbs is the hardest part. The
  upload part should be no problem with a little bit of google :)
  Or you might want to google for a full working scripts, i saw them 
  around.
 
  Tijnema
 
 
   --
   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] Re: Random Unique ID

2007-03-22 Thread Mark
Tijnema ! wrote:

 On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
 # [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
  Mark wrote:
  [EMAIL PROTECTED] wrote:
  
  Hello,
  
  I want to add a random unique ID to a Mysql table.  Collisions
  are unlikely but possible so to handle those cases I'd like to
  regenerate the random ID until there is no collision and only
  then add my row.  Any suggestions for a newbie as to the right
  way to go about doing this?
  
  Best,
  
  Craig
  .
  
  I suggest looking into a GUID sort of thing, it is all coded for you
  and it works just like you want.
 
  If you are running Linux, you can get this using:
 $GUID =  exec(uuidgen);

 http://www.ossp.org/pkg/lib/uuid
 
 Note that this doesn't gonna work when safe mode is on..!

Generating a psudo-random unique key doesn't seem to be something PHP does
well. I can post an extension this afternoon if anyone wants to use it.

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



RE: [PHP] Question before upgrading to 5

2007-03-22 Thread Jake McHenry

Sorry about the delivery and read requests.. I was tired and forgot to turn
them off for the list..

 alternatively you can search for 'Rasmus' and 'ProxyPass' in the list
 archive and use Rasmus' rather cool ProxyPass solution to running both
 php4 and php5 ... his explanation should give you enough info 
 to set it up.
 

I don't need them running parallel, only both installed

 Tijnema ! wrote:
  On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I just got done going through all my configure options for 
 php5, and
  finally
  configure finished successfully... I didn't install it yet, have a
  question.
  Can I have both 4 and 5 installed temporarily until I'm sure all my
  scripts
  work ok? They should, I've been careful, but I want to be 
 sure since
  this is
  the only server I currently have. I was going to install a virtual
  copy of
  fedora and do testing, but I don't have time, hopefully someone can
  answer.
  I think I just have to change the prefix to something other than
  default and
  load the new module in httpd. If I had more time I would 
 do this the
  right
  way, but we all know how that goes...
 
  If this will work, I can then just uninstall 4.. Hopefully 
 it won't break
  anything.
 
  I'll post my configure options if anyone would like to 
 double check
 
  Thanks,
  Jake
  
  If you use make install on the second one, it will add the libphp5
  library to your httpd.conf, and then you would have libphp4 and
  libphp5 in your httpd.conf. That is guaranteed to give 
 problems. So if
  you comment out one of the 2, then it works fine.


Yes, I just wanted to make sure I only needed to change the prefix to get
them both installed

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.16/729 - Release Date: 3/21/2007
7:52 AM
 

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



Re: [PHP] Question before upgrading to 5

2007-03-22 Thread Jochem Maas
Jake McHenry wrote:
 Sorry about the delivery and read requests.. I was tired and forgot to turn
 them off for the list..
 
 alternatively you can search for 'Rasmus' and 'ProxyPass' in the list
 archive and use Rasmus' rather cool ProxyPass solution to running both
 php4 and php5 ... his explanation should give you enough info 
 to set it up.

 
 I don't need them running parallel, only both installed

I think you missed the point. you would have 2 apaches running, that is correct
but the trick is to set it up so that they use the same document roots
for each site that you are trying to convert.

the beauty of this is that you can literally run the same site in php5 and php4
simulaneously with urls something *like*:

php4.mydevsite.com
php5.mydevsite.com  (ProxyPassed to 'inner' apache)


were HOSTS file contains:

127.0.0.1 php4.mydevsite.com php5.mydevsite.com

and both outer and inner apache's use the same docroot for the given site.

obviously it's just one way of setting up a comfortable dev environment - as 
long
as you have something that allows you to doo your tihng without to much pain 
then thats
the main thing :-)



 
 Tijnema ! wrote:
 On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
 Hi everyone,

 I just got done going through all my configure options for 
 php5, and
 finally
 configure finished successfully... I didn't install it yet, have a
 question.
 Can I have both 4 and 5 installed temporarily until I'm sure all my
 scripts
 work ok? They should, I've been careful, but I want to be 
 sure since
 this is
 the only server I currently have. I was going to install a virtual
 copy of
 fedora and do testing, but I don't have time, hopefully someone can
 answer.
 I think I just have to change the prefix to something other than
 default and
 load the new module in httpd. If I had more time I would 
 do this the
 right
 way, but we all know how that goes...

 If this will work, I can then just uninstall 4.. Hopefully 
 it won't break
 anything.

 I'll post my configure options if anyone would like to 
 double check
 Thanks,
 Jake
 If you use make install on the second one, it will add the libphp5
 library to your httpd.conf, and then you would have libphp4 and
 libphp5 in your httpd.conf. That is guaranteed to give 
 problems. So if
 you comment out one of the 2, then it works fine.
 
 
 Yes, I just wanted to make sure I only needed to change the prefix to get
 them both installed
 

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



Re: [PHP] Re: Keep the PHP list ON TOPIC!

2007-03-22 Thread Jochem Maas
Myron Turner wrote:
 Jochem Maas wrote:
 I would have made a similar comment - but I have soap stuck between my
 teeth atm :-P
   
 Just use a little of that saliva that you've been wasting on spitballs. ;-)

ok - I'm all soaped up now - I'll try a be nicer in future.

the general point stands but the manner in which it was brought did leave
plenty of room for improvement, have a bad day is no excuse really! anyway
I do my best to be more diplomatic when I try to tackle a misplaced 
post/person/wotsit
in future.

apologies to the OP is question for the tone.

 

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



RE: [PHP] Question before upgrading to 5

2007-03-22 Thread Jake McHenry
I don't want 2 instances of apache running,  your over thinking this... I
only asked if I need to change only the prefix, or if there is anything
else, to get both php versions installed. Once I see my scripts are working
ok, or not, I'll be getting rid of php4. I'm not running a dev machine, this
is production, and the only one I have currently, my backup died last week
and I haven't gotten the parts for it yet. Is prefix the only option I need
to change? Or do I need to change these too?

--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-exec-dir=/usr/bin \


Thanks,
Jake

 Jake McHenry wrote:
  Sorry about the delivery and read requests.. I was tired 
 and forgot to turn
  them off for the list..
  
  alternatively you can search for 'Rasmus' and 'ProxyPass' 
 in the list
  archive and use Rasmus' rather cool ProxyPass solution to 
 running both
  php4 and php5 ... his explanation should give you enough info 
  to set it up.
 
  
  I don't need them running parallel, only both installed
 
 I think you missed the point. you would have 2 apaches 
 running, that is correct
 but the trick is to set it up so that they use the same document roots
 for each site that you are trying to convert.
 
 the beauty of this is that you can literally run the same 
 site in php5 and php4
 simulaneously with urls something *like*:
 
 php4.mydevsite.com
 php5.mydevsite.com(ProxyPassed to 'inner' apache)
 
 
 were HOSTS file contains:
 
 127.0.0.1 php4.mydevsite.com php5.mydevsite.com
 
 and both outer and inner apache's use the same docroot for 
 the given site.
 
 obviously it's just one way of setting up a comfortable dev 
 environment - as long
 as you have something that allows you to doo your tihng 
 without to much pain then thats
 the main thing :-)
 
 
 
  
  Tijnema ! wrote:
  On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I just got done going through all my configure options for 
  php5, and
  finally
  configure finished successfully... I didn't install it 
 yet, have a
  question.
  Can I have both 4 and 5 installed temporarily until I'm 
 sure all my
  scripts
  work ok? They should, I've been careful, but I want to be 
  sure since
  this is
  the only server I currently have. I was going to install 
 a virtual
  copy of
  fedora and do testing, but I don't have time, hopefully 
 someone can
  answer.
  I think I just have to change the prefix to something other than
  default and
  load the new module in httpd. If I had more time I would 
  do this the
  right
  way, but we all know how that goes...
 
  If this will work, I can then just uninstall 4.. Hopefully 
  it won't break
  anything.
 
  I'll post my configure options if anyone would like to 
  double check
  Thanks,
  Jake
  If you use make install on the second one, it will add the libphp5
  library to your httpd.conf, and then you would have libphp4 and
  libphp5 in your httpd.conf. That is guaranteed to give 
  problems. So if
  you comment out one of the 2, then it works fine.
  
  
  Yes, I just wanted to make sure I only needed to change the 
 prefix to get
  them both installed
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



Re: [PHP] Re: Random Unique ID

2007-03-22 Thread Roman Neuhauser
# markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
 Tijnema ! wrote:
 
  On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
 
  http://www.ossp.org/pkg/lib/uuid
  
  Note that this doesn't gonna work when safe mode is on..!
 
Ralf S. Engelschall's OSSP UUID library wrapped in a PHP extension
(shipped with the library) won't work in safe mode? How's that?

 Generating a psudo-random unique key doesn't seem to be something PHP does
 well. I can post an extension this afternoon if anyone wants to use it.

I'm curious.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Question before upgrading to 5

2007-03-22 Thread Tijnema !

On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:

I don't want 2 instances of apache running,  your over thinking this... I
only asked if I need to change only the prefix, or if there is anything
else, to get both php versions installed. Once I see my scripts are working
ok, or not, I'll be getting rid of php4. I'm not running a dev machine, this
is production, and the only one I have currently, my backup died last week
and I haven't gotten the parts for it yet. Is prefix the only option I need
to change? Or do I need to change these too?

--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-exec-dir=/usr/bin \


Thanks,
Jake


AFAIK are these settings all relative to prefix. So if your prefix is
/opt/php5, datadir would become /opt/php5/share, includedir would
become /opt/php5/include etc.

Tijnema


 Jake McHenry wrote:
  Sorry about the delivery and read requests.. I was tired
 and forgot to turn
  them off for the list..
 
  alternatively you can search for 'Rasmus' and 'ProxyPass'
 in the list
  archive and use Rasmus' rather cool ProxyPass solution to
 running both
  php4 and php5 ... his explanation should give you enough info
  to set it up.
 
 
  I don't need them running parallel, only both installed

 I think you missed the point. you would have 2 apaches
 running, that is correct
 but the trick is to set it up so that they use the same document roots
 for each site that you are trying to convert.

 the beauty of this is that you can literally run the same
 site in php5 and php4
 simulaneously with urls something *like*:

 php4.mydevsite.com
 php5.mydevsite.com(ProxyPassed to 'inner' apache)


 were HOSTS file contains:

 127.0.0.1 php4.mydevsite.com php5.mydevsite.com

 and both outer and inner apache's use the same docroot for
 the given site.

 obviously it's just one way of setting up a comfortable dev
 environment - as long
 as you have something that allows you to doo your tihng
 without to much pain then thats
 the main thing :-)



 
  Tijnema ! wrote:
  On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I just got done going through all my configure options for
  php5, and
  finally
  configure finished successfully... I didn't install it
 yet, have a
  question.
  Can I have both 4 and 5 installed temporarily until I'm
 sure all my
  scripts
  work ok? They should, I've been careful, but I want to be
  sure since
  this is
  the only server I currently have. I was going to install
 a virtual
  copy of
  fedora and do testing, but I don't have time, hopefully
 someone can
  answer.
  I think I just have to change the prefix to something other than
  default and
  load the new module in httpd. If I had more time I would
  do this the
  right
  way, but we all know how that goes...
 
  If this will work, I can then just uninstall 4.. Hopefully
  it won't break
  anything.
 
  I'll post my configure options if anyone would like to
  double check
  Thanks,
  Jake
  If you use make install on the second one, it will add the libphp5
  library to your httpd.conf, and then you would have libphp4 and
  libphp5 in your httpd.conf. That is guaranteed to give
  problems. So if
  you comment out one of the 2, then it works fine.
 
 
  Yes, I just wanted to make sure I only needed to change the
 prefix to get
  them both installed
 

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

 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
 Date: 3/22/2007 7:44 AM



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM


--
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] Re: Random Unique ID

2007-03-22 Thread Tijnema !

On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:

# markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
 Tijnema ! wrote:

  On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
 
  http://www.ossp.org/pkg/lib/uuid
 
  Note that this doesn't gonna work when safe mode is on..!

Ralf S. Engelschall's OSSP UUID library wrapped in a PHP extension
(shipped with the library) won't work in safe mode? How's that?


I quote the wrong guy i think, i meant to quote this

If you are running Linux, you can get this using:
   $GUID =  exec(uuidgen);

As this is using the exec function, which doesn't work with safe mode on.




 Generating a psudo-random unique key doesn't seem to be something PHP does
 well. I can post an extension this afternoon if anyone wants to use it.

I'm curious.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

--
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] Re: _Construct question

2007-03-22 Thread Erik Jones

On Mar 21, 2007, at 7:14 PM, Chris wrote:


Erik Jones wrote:

That's not true, running with v. 5.2.1:
?php
class A
{
function A() {
echo works\n;
}
}
$a = new A();
?
Outputs:
works
On Mar 21, 2007, at 8:06 AM, itoctopus wrote:
They're basically the same thing, however, you can only use  
__construct in

PHP5.


He meant that __construct() doesn't work in php4.

It's only available in php5.

php5 does this:

Is the function __construct available?
- Yes? Use it.
- No? Look for a function with the same name as the class. If  
that's available, use it.


So it's backwards compatible.


Ah, yes, looking back I can see how his statement was ambiguous.

erik jones [EMAIL PROTECTED]
software developer
615-296-0838
emma(r)





Re: [PHP] Random Unique ID

2007-03-22 Thread tedd

At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:

Hello,
I want to add a random unique ID to a Mysql table.  Collisions
are unlikely but possible so to handle those cases I'd like to
regenerate the random ID until there is no collision and only
then add my row.  Any suggestions for a newbie as to the right
way to go about doing this?
Best,
Craig


Craig:

Simple.

Generate a random unique ID via whatever method you want. However, 
before using, search your dB to see if it's already in use. If it is, 
then generate another one and repeat.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Random Unique ID

2007-03-22 Thread Németh Zoltán
2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:
 At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
 Hello,
 I want to add a random unique ID to a Mysql table.  Collisions
 are unlikely but possible so to handle those cases I'd like to
 regenerate the random ID until there is no collision and only
 then add my row.  Any suggestions for a newbie as to the right
 way to go about doing this?
 Best,
 Craig
 
 Craig:
 
 Simple.
 
 Generate a random unique ID via whatever method you want. However, 
 before using, search your dB to see if it's already in use. If it is, 
 then generate another one and repeat.

it's probably more efficient to try to insert with the generated ID at
once, and repeat only if it fails.
if the ID generation method is good enough, repeat will be needed only
extremely rarely

greets
Zoltán Németh

 
 Cheers,
 
 tedd
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 

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



[PHP] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari

Ave,

I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
permissions snag.
I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
//[EMAIL PROTECTED]/ShareName Share².
The ³user² has full read-write permission and physically I¹m able to do
anything I want sitting on my Mac OS X in this share, like create, delete or
modify files. 

The problem is, I don¹t think Apache Web Server (or PHP) has write access on
this share. In PHP, I¹m able to read data from files on this share, but I¹m
not able to write  data to any file on that share. I get access is denied.

Is there anyway through PHP to give Apache or PHP write access to the files
on this share? 
I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
Access through the Windows System that has the original folder. Windows is
only able to provide the Mac User with Permissions, not Apache.

Any help would be appreciated.

Thanks


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:


Ave,

I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
permissions snag.
I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
//[EMAIL PROTECTED]/ShareName Share².
The ³user² has full read-write permission and physically I¹m able to do
anything I want sitting on my Mac OS X in this share, like create, delete or
modify files.

The problem is, I don¹t think Apache Web Server (or PHP) has write access on
this share. In PHP, I¹m able to read data from files on this share, but I¹m
not able to write  data to any file on that share. I get access is denied.

Is there anyway through PHP to give Apache or PHP write access to the files
on this share?
I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
Access through the Windows System that has the original folder. Windows is
only able to provide the Mac User with Permissions, not Apache.

Any help would be appreciated.

Thanks


You could chmod the whole share to 777 but that might give problems!
Or make sure the user apache runs on has write access to the share.
But normal each file is set with permission 755, means that only the
owner can write to it.

I'm not able to give a real fix right now, but it is quite complicated :(

Tijnema



~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²




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



Re: [PHP] Random Unique ID

2007-03-22 Thread tedd

At 4:28 PM +0100 3/22/07, Németh Zoltán wrote:

2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:

 At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
 Hello,
 I want to add a random unique ID to a Mysql table.  Collisions
 are unlikely but possible so to handle those cases I'd like to
 regenerate the random ID until there is no collision and only
 then add my row.  Any suggestions for a newbie as to the right
 way to go about doing this?
 Best,
 Craig

 Craig:

 Simple.

 Generate a random unique ID via whatever method you want. However,
 before using, search your dB to see if it's already in use. If it is,
 then generate another one and repeat.


it's probably more efficient to try to insert with the generated ID at
once, and repeat only if it fails.
if the ID generation method is good enough, repeat will be needed only
extremely rarely

greets
Zoltán Németh



I like to write code that avoids failure if 
possible rather than writing something that I 
know can fail and then dealing with resultant 
errors. Just differences in perspectives.


As for efficiency, that's probably not even worth mentioning in this case.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Random Unique ID

2007-03-22 Thread Németh Zoltán
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
 At 4:28 PM +0100 3/22/07, Németh Zoltán wrote:
 2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:
   At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
   Hello,
   I want to add a random unique ID to a Mysql table.  Collisions
   are unlikely but possible so to handle those cases I'd like to
   regenerate the random ID until there is no collision and only
   then add my row.  Any suggestions for a newbie as to the right
   way to go about doing this?
   Best,
   Craig
 
   Craig:
 
   Simple.
 
   Generate a random unique ID via whatever method you want. However,
   before using, search your dB to see if it's already in use. If it is,
   then generate another one and repeat.
 
 it's probably more efficient to try to insert with the generated ID at
 once, and repeat only if it fails.
 if the ID generation method is good enough, repeat will be needed only
 extremely rarely
 
 greets
 Zoltán Németh
 
 
 I like to write code that avoids failure if 
 possible rather than writing something that I 
 know can fail and then dealing with resultant 
 errors. Just differences in perspectives.

that's a matter of taste, which can not be argued ;)

 
 As for efficiency, that's probably not even worth mentioning in this case.

why not? you would use 2 sql queries while I would use one most of the
time and 2 in case of already reserved ID - that is almost twice as much
processor time
that may count much if the routine is used frequently

greets
Zoltán Németh

 
 Cheers,
 
 tedd
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari
rahul:~/Documents/XFER rjohari$ ls -la osm
total 26548
drwxr-xr-x  1 rjohari  rjohari16384 31 Dec  1969 .
drwxr-xr-x  5 rjohari  rjohari  170 22 Mar 12:08 ..
-rwxr-xr-x  1 rjohari  rjohari21508 13 Sep  2006 .DS_Store
-rwxr-xr-x  1 rjohari  rjohari   82 14 Sep  2006 ._Temporary Items
-rwxr-xr-x  1 rjohari  rjohari   945181 22 Mar 09:44 ALL.dbf
drwxr-xr-x  1 rjohari  rjohari16384 22 Mar 13:27 DISPO
-rwxr-xr-x  1 rjohari  rjohari 4608 28 Feb 14:04 HFGLEND.CDX
-rwxr-xr-x  1 rjohari  rjohari 6172 28 Feb 14:04 HFGLEND.DBF
-rwxr-xr-x  1 rjohari  rjohari 4608 28 Feb 14:04 HFMESA.CDX
-rwxr-xr-x  1 rjohari  rjohari 6172 28 Feb 14:04 HFMESA.DBF
-rwxr-xr-x  1 rjohari  rjohari 4608 28 Feb 14:04 HFPHENX.CDX
-rwxr-xr-x  1 rjohari  rjohari 6172 28 Feb 14:04 HFPHENX.DBF
-rwxr-xr-x  1 rjohari  rjohari 6435  7 Nov 15:15 HFUND.DBF
-rwxr-xr-x  1 rjohari  rjohari   642844  7 Nov 15:15 OSM.DBF
-rwxr-xr-x  1 rjohari  rjohari   142848 21 Mar 19:57 OSMH.CDX
-rwxr-xr-x  1 rjohari  rjohari  1820024 21 Mar 19:58 OSMH.DBF
-rwxr-xr-x  1 rjohari  rjohari12288 21 Mar 19:42 OSMT.CDX
-rwxr-xr-x  1 rjohari  rjohari 3072 16 Nov 14:03 TEST.CDX
-rwxr-xr-x  1 rjohari  rjohari12804 16 Nov 14:51 TEST.DBF
-rwxr-xr-x  1 rjohari  rjohari 7116 21 Sep 17:02 TEST_RUN.DBF
-rwxr-xr-x  1 rjohari  rjohari 4608  2 Mar 13:44 TRANSBX.CDX
-rwxr-xr-x  1 rjohari  rjohari  714 21 Mar 17:13 TRANSBX.DBF
-rwxr-xr-x  1 rjohari  rjohari  191 31 Oct 17:53 TRANSDIR.DBF
drwxr-xr-x  1 rjohari  rjohari16384 14 Sep  2006 Temporary Items
-rwxr-xr-x  1 rjohari  rjohari 4608 21 Feb 21:00 dmam.CDX
-rwxr-xr-x  1 rjohari  rjohari22752 21 Feb 21:01 dmam.DBF
-rwxr-xr-x  1 rjohari  rjohari54784 22 Mar 08:25 novastar.CDX
-rwxr-xr-x  1 rjohari  rjohari  6490610 22 Mar 08:25 novastar.DBF
-rwxr-xr-x  1 rjohari  rjohari44032  3 Nov 13:53 osm.CDX
-rwxr-xr-x  1 rjohari  rjohari  573 20 Sep  2006 osm_move.FXP
-rwxr-xr-x  1 rjohari  rjohari  407 20 Sep  2006 osm_move.prg
-rwxr-xr-x  1 rjohari  rjohari40448 29 Dec 15:41 osma.CDX
-rwxr-xr-x  1 rjohari  rjohari   486992 29 Dec 15:41 osma.DBF
-rwxr-xr-x  1 rjohari  rjohari 4608 21 Mar 16:05 osmf.CDX
-rwxr-xr-x  1 rjohari  rjohari   132180 21 Mar 16:05 osmf.DBF
-rwxr-xr-x  1 rjohari  rjohari89088 28 Feb 18:57 osmj.CDX
-rwxr-xr-x  1 rjohari  rjohari  1098794 28 Feb 18:57 osmj.DBF
-rwxr-xr-x  1 rjohari  rjohari31232 21 Mar 19:43 osmn.CDX
-rwxr-xr-x  1 rjohari  rjohari   319534 21 Mar 19:43 osmn.DBF
-rwxr-xr-x  1 rjohari  rjohari31744 21 Mar 19:22 osmp.CDX
-rwxr-xr-x  1 rjohari  rjohari   372590 21 Mar 19:22 osmp.DBF
-rwxr-xr-x  1 rjohari  rjohari   659424 21 Mar 19:42 osmt.dbf
-rwxr-xr-x  1 rjohari  rjohari  314  7 Nov 11:02 transbr2.DBF
-rwxr-xr-x  1 rjohari  rjohari  314  7 Nov 17:19 transbranch.DBF
-rwxr-xr-x  1 rjohari  rjohari11264 21 Sep 16:47 warm092106.xls



On 3/22/07 12:31 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Well chmod is certainly not doing anything. I tried that to begin with. I
 don't get an error, but it doesn't change any permissions. Just doesn't do
 anything to the permissions of the file/folder. Like it's just ignored.
 
 I did it as root using sudo.
 
 Can you post the log of the ls -la Share command here?
 
 Tijnema
 
 
 On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 Or make sure the user apache runs on has write access to the share.
 
 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.
 
 Yes, it is quite complicated :(
 
 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.
 
 Tijnema
 
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run
 into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete
 or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access
 on
 this share. In PHP, I¹m able to read data from files on this share, but
 I¹m
 not able to write  data to any file on that share. I get 

Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

rahul:~/Documents/XFER rjohari$ ls -la osm
total 26548
drwxr-xr-x  1 rjohari  rjohari16384 31 Dec  1969 .
drwxr-xr-x  5 rjohari  rjohari  170 22 Mar 12:08 ..
-rwxr-xr-x  1 rjohari  rjohari21508 13 Sep  2006 .DS_Store

[snip]

-rwxr-xr-x  1 rjohari  rjohari11264 21 Sep 16:47 warm092106.xls


I was guessing that, all files and folders have the 755 permission...,
meaning that the owner can edit, but the group and all other can't.
I did some googling for you, and you should mount your share with
-o fmask=777,dmask=777
so your example mount command becomes:
mount ­t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share
that should do it :)

Tijnema



On 3/22/07 12:31 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Well chmod is certainly not doing anything. I tried that to begin with. I
 don't get an error, but it doesn't change any permissions. Just doesn't do
 anything to the permissions of the file/folder. Like it's just ignored.

 I did it as root using sudo.

 Can you post the log of the ls -la Share command here?

 Tijnema


 On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 Or make sure the user apache runs on has write access to the share.

 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.

 Yes, it is quite complicated :(

 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.

 Tijnema


 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run
 into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete
 or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access
 on
 this share. In PHP, I¹m able to read data from files on this share, but
 I¹m
 not able to write  data to any file on that share. I get access is
 denied.

 Is there anyway through PHP to give Apache or PHP write access to the
 files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac)
 Write
 Access through the Windows System that has the original folder. Windows
 is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks

 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.

 I'm not able to give a real fix right now, but it is quite complicated :(

 Tijnema


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²






 --
 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] Re: Random Unique ID

2007-03-22 Thread markw
 On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
 # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
  Tijnema ! wrote:
 
   On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
  
   http://www.ossp.org/pkg/lib/uuid
  
   Note that this doesn't gonna work when safe mode is on..!

 Ralf S. Engelschall's OSSP UUID library wrapped in a PHP extension
 (shipped with the library) won't work in safe mode? How's that?

 I quote the wrong guy i think, i meant to quote this
 If you are running Linux, you can get this using:
$GUID =  exec(uuidgen);
 As this is using the exec function, which doesn't work with safe mode on.



  Generating a psudo-random unique key doesn't seem to be something PHP
 does
  well. I can post an extension this afternoon if anyone wants to use
 it.

 I'm curious.


Take a hop over to www.mohawksoft.org, and check out download, download
MUniqID and tell me what you think.

It should build as a module.

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



Re: [PHP] Re: Random Unique ID

2007-03-22 Thread Tijnema !

On 3/22/07, markw@mohawksoft.com markw@mohawksoft.com wrote:

 On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
 # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
  Tijnema ! wrote:
 
   On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
  
   http://www.ossp.org/pkg/lib/uuid
  
   Note that this doesn't gonna work when safe mode is on..!

 Ralf S. Engelschall's OSSP UUID library wrapped in a PHP extension
 (shipped with the library) won't work in safe mode? How's that?

 I quote the wrong guy i think, i meant to quote this
 If you are running Linux, you can get this using:
$GUID =  exec(uuidgen);
 As this is using the exec function, which doesn't work with safe mode on.



  Generating a psudo-random unique key doesn't seem to be something PHP
 does
  well. I can post an extension this afternoon if anyone wants to use
 it.

 I'm curious.


Take a hop over to www.mohawksoft.org, and check out download, download
MUniqID and tell me what you think.

It should build as a module.



I'm not sure where you want to use it for, but keep in mind that if
you are gonna use external modules/applications it will probably work
only on your development server. Not everyone (nearly nobody) has such
modules installed, so if you are planning to distribute, you need to
keep in mind that everyone that want's to use the script, will need to
install the used module/app.

Tijnema





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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:


Ave,

Or make sure the user apache runs on has write access to the share.

That's the problem I'm facing. I'm not sure how to do that. If I'm not
mistaken, Apache runs as user nobody on my Mac, but I don't know how to
give that user write access on the Windows Machine.

Yes, it is quite complicated :(


I believe this has nothing to do with your windows machine, but with
the mount on your Mac. I'm not very familiar with Mac OS X (Although i
have installed it) I know it's based on a linux kernel, and uses same
mount tools. I think a simple chmod 777 to the mount folder would do
the job.
so if you have it mounted at /Share
chmod 777 /Share
I believe that windows mounts everything with chmod value 777, so that
shouldn't be a problem.

Tijnema



 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks

 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.

 I'm not able to give a real fix right now, but it is quite complicated :(

 Tijnema


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²







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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari

Ave,

Or make sure the user apache runs on has write access to the share.

That's the problem I'm facing. I'm not sure how to do that. If I'm not
mistaken, Apache runs as user nobody on my Mac, but I don't know how to
give that user write access on the Windows Machine.

Yes, it is quite complicated :(


 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.
 
 I'm not able to give a real fix right now, but it is quite complicated :(
 
 Tijnema
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:


Well chmod is certainly not doing anything. I tried that to begin with. I
don't get an error, but it doesn't change any permissions. Just doesn't do
anything to the permissions of the file/folder. Like it's just ignored.

I did it as root using sudo.


Can you post the log of the ls -la Share command here?

Tijnema



On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 Or make sure the user apache runs on has write access to the share.

 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.

 Yes, it is quite complicated :(

 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.

 Tijnema


 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete
 or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access
 on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks

 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.

 I'm not able to give a real fix right now, but it is quite complicated :(

 Tijnema


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²






 --
 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] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari
Ave, 

Certainly looks very promising, but is giving me:
mount_smbfs: -o fmask=: option not supported

Let me google it too, see what I can come up with. Appreciate it a lot mate.


On 3/22/07 12:48 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 rahul:~/Documents/XFER rjohari$ ls -la osm
 total 26548
 drwxr-xr-x  1 rjohari  rjohari16384 31 Dec  1969 .
 drwxr-xr-x  5 rjohari  rjohari  170 22 Mar 12:08 ..
 -rwxr-xr-x  1 rjohari  rjohari21508 13 Sep  2006 .DS_Store
 [snip]
 -rwxr-xr-x  1 rjohari  rjohari11264 21 Sep 16:47 warm092106.xls
 
 I was guessing that, all files and folders have the 755 permission...,
 meaning that the owner can edit, but the group and all other can't.
 I did some googling for you, and you should mount your share with
 -o fmask=777,dmask=777
 so your example mount command becomes:
 mount ­t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share
 that should do it :)
 
 Tijnema
 
 
 On 3/22/07 12:31 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Well chmod is certainly not doing anything. I tried that to begin with. I
 don't get an error, but it doesn't change any permissions. Just doesn't do
 anything to the permissions of the file/folder. Like it's just ignored.
 
 I did it as root using sudo.
 
 Can you post the log of the ls -la Share command here?
 
 Tijnema
 
 
 On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 Or make sure the user apache runs on has write access to the share.
 
 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.
 
 Yes, it is quite complicated :(
 
 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.
 
 Tijnema
 
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run
 into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder
 on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create,
 delete
 or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write
 access
 on
 this share. In PHP, I¹m able to read data from files on this share, but
 I¹m
 not able to write  data to any file on that share. I get access is
 denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the
 files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac)
 Write
 Access through the Windows System that has the original folder. Windows
 is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.
 
 I'm not able to give a real fix right now, but it is quite complicated
 :(
 
 Tijnema
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 
 
 
 
 --
 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] Random Unique ID

2007-03-22 Thread tedd

At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:

2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:

  As for efficiency, that's probably not even worth mentioning in this case.

why not? you would use 2 sql queries while I would use one most of the
time and 2 in case of already reserved ID - that is almost twice as much
processor time
that may count much if the routine is used frequently


Go ahead, try it, and tell me how much time it cost.

From experience, there are things one can spend 
their time optimizing and there are other things 
that one should be able to see that aren't worth 
pursing.


I've been wrong before, but you're open to prove me wrong again, if you like.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] Integer question

2007-03-22 Thread Matt Carlson
When dealing with large numbers inside of php, I know at the int limit, a 
variable is recast into float.



1).  How do you return the true number of the float when it reaches the upper 
limits of mysql's bigint (9223372036854775807).

2).  How do you handle numbers that large, while maintaining precision.
3).  Is there a php equivalent of unsigned?

Thanks all





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



[PHP] Integer question

2007-03-22 Thread Matt Carlson
When dealing with large numbers inside of php, I know at the int limit, a 
variable is recast into float.



1).  How do you return the true number of the float when it reaches the upper 
limits of mysql's bigint (9223372036854775807).

2).  How do you handle numbers that large, while maintaining precision.
3).  Is there a php equivalent of unsigned?

Thanks all





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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari

Well chmod is certainly not doing anything. I tried that to begin with. I
don't get an error, but it doesn't change any permissions. Just doesn't do
anything to the permissions of the file/folder. Like it's just ignored.

I did it as root using sudo.


On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 Or make sure the user apache runs on has write access to the share.
 
 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.
 
 Yes, it is quite complicated :(
 
 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.
 
 Tijnema
 
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete
 or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access
 on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.
 
 I'm not able to give a real fix right now, but it is quite complicated :(
 
 Tijnema
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 
 
 
 
 --
 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] Re: Random Unique ID

2007-03-22 Thread Mark
Tijnema ! wrote:

 On 3/22/07, markw@mohawksoft.com markw@mohawksoft.com wrote:
  On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
  # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
   Tijnema ! wrote:
  
On 3/22/07, Roman Neuhauser [EMAIL PROTECTED] wrote:
   
http://www.ossp.org/pkg/lib/uuid
   
Note that this doesn't gonna work when safe mode is on..!
 
  Ralf S. Engelschall's OSSP UUID library wrapped in a PHP extension
  (shipped with the library) won't work in safe mode? How's that?
 
  I quote the wrong guy i think, i meant to quote this
  If you are running Linux, you can get this using:
 $GUID =  exec(uuidgen);
  As this is using the exec function, which doesn't work with safe mode
  on.
 
 
 
   Generating a psudo-random unique key doesn't seem to be something
   PHP
  does
   well. I can post an extension this afternoon if anyone wants to use
  it.
 
  I'm curious.
 

 Take a hop over to www.mohawksoft.org, and check out download, download
 MUniqID and tell me what you think.

 It should build as a module.


 I'm not sure where you want to use it for, but keep in mind that if
 you are gonna use external modules/applications it will probably work
 only on your development server. Not everyone (nearly nobody) has such
 modules installed, so if you are planning to distribute, you need to
 keep in mind that everyone that want's to use the script, will need to
 install the used module/app.


Well, it can build as part of PHP if you do a buildconf as well

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

Ave,

Certainly looks very promising, but is giving me:
mount_smbfs: -o fmask=: option not supported

Let me google it too, see what I can come up with. Appreciate it a lot mate.


Hmm, i googled a little bit, and i found a norwegian site with some
kind of same problem, and from what i understand they say it is that
the Mac OS X implementation of Samba doesn't accept any configuration
options.

But they don't tell how to fix (or i don't understand.. LOL)

Maybe updating to latest samba will do the job, but this is totally
not PHP related.
You are better off going to the samba list. so have a look here:
https://lists.samba.org/mailman/

Tijnema




On 3/22/07 12:48 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 rahul:~/Documents/XFER rjohari$ ls -la osm
 total 26548
 drwxr-xr-x  1 rjohari  rjohari16384 31 Dec  1969 .
 drwxr-xr-x  5 rjohari  rjohari  170 22 Mar 12:08 ..
 -rwxr-xr-x  1 rjohari  rjohari21508 13 Sep  2006 .DS_Store
 [snip]
 -rwxr-xr-x  1 rjohari  rjohari11264 21 Sep 16:47 warm092106.xls

 I was guessing that, all files and folders have the 755 permission...,
 meaning that the owner can edit, but the group and all other can't.
 I did some googling for you, and you should mount your share with
 -o fmask=777,dmask=777
 so your example mount command becomes:
 mount ­t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share
 that should do it :)

 Tijnema


 On 3/22/07 12:31 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Well chmod is certainly not doing anything. I tried that to begin with. I
 don't get an error, but it doesn't change any permissions. Just doesn't do
 anything to the permissions of the file/folder. Like it's just ignored.

 I did it as root using sudo.

 Can you post the log of the ls -la Share command here?

 Tijnema


 On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 Or make sure the user apache runs on has write access to the share.

 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how to
 give that user write access on the Windows Machine.

 Yes, it is quite complicated :(

 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.

 Tijnema


 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run
 into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder
 on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create,
 delete
 or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write
 access
 on
 this share. In PHP, I¹m able to read data from files on this share, but
 I¹m
 not able to write  data to any file on that share. I get access is
 denied.

 Is there anyway through PHP to give Apache or PHP write access to the
 files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac)
 Write
 Access through the Windows System that has the original folder. Windows
 is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks

 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.

 I'm not able to give a real fix right now, but it is quite complicated
 :(

 Tijnema


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²






 --
 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] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari

Yes, it does appear that samba on mac os x is not taking any configuration
options. I tried different options for the mount_smbfs command which does
have very specific user/owner/group related permissions options - but all
give me the same operation not supported error.

Let me take a closer look at Samba and also the list you linked to.

Thanks again - appreciate your help!


On 3/22/07 2:21 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 Ave,
 
 Certainly looks very promising, but is giving me:
 mount_smbfs: -o fmask=: option not supported
 
 Let me google it too, see what I can come up with. Appreciate it a lot mate.
 
 Hmm, i googled a little bit, and i found a norwegian site with some
 kind of same problem, and from what i understand they say it is that
 the Mac OS X implementation of Samba doesn't accept any configuration
 options.
 
 But they don't tell how to fix (or i don't understand.. LOL)
 
 Maybe updating to latest samba will do the job, but this is totally
 not PHP related.
 You are better off going to the samba list. so have a look here:
 https://lists.samba.org/mailman/
 
 Tijnema
 
 
 
 On 3/22/07 12:48 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 rahul:~/Documents/XFER rjohari$ ls -la osm
 total 26548
 drwxr-xr-x  1 rjohari  rjohari16384 31 Dec  1969 .
 drwxr-xr-x  5 rjohari  rjohari  170 22 Mar 12:08 ..
 -rwxr-xr-x  1 rjohari  rjohari21508 13 Sep  2006 .DS_Store
 [snip]
 -rwxr-xr-x  1 rjohari  rjohari11264 21 Sep 16:47 warm092106.xls
 
 I was guessing that, all files and folders have the 755 permission...,
 meaning that the owner can edit, but the group and all other can't.
 I did some googling for you, and you should mount your share with
 -o fmask=777,dmask=777
 so your example mount command becomes:
 mount ­t smbfs -o fmask=777,dmask=777 //[EMAIL PROTECTED]/ShareName Share
 that should do it :)
 
 Tijnema
 
 
 On 3/22/07 12:31 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Well chmod is certainly not doing anything. I tried that to begin with. I
 don't get an error, but it doesn't change any permissions. Just doesn't
 do
 anything to the permissions of the file/folder. Like it's just ignored.
 
 I did it as root using sudo.
 
 Can you post the log of the ls -la Share command here?
 
 Tijnema
 
 
 On 3/22/07 12:18 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 Or make sure the user apache runs on has write access to the share.
 
 That's the problem I'm facing. I'm not sure how to do that. If I'm not
 mistaken, Apache runs as user nobody on my Mac, but I don't know how
 to
 give that user write access on the Windows Machine.
 
 Yes, it is quite complicated :(
 
 I believe this has nothing to do with your windows machine, but with
 the mount on your Mac. I'm not very familiar with Mac OS X (Although i
 have installed it) I know it's based on a linux kernel, and uses same
 mount tools. I think a simple chmod 777 to the mount folder would do
 the job.
 so if you have it mounted at /Share
 chmod 777 /Share
 I believe that windows mounts everything with chmod value 777, so that
 shouldn't be a problem.
 
 Tijnema
 
 
 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run
 into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a
 folder
 on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to
 do
 anything I want sitting on my Mac OS X in this share, like create,
 delete
 or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write
 access
 on
 this share. In PHP, I¹m able to read data from files on this share,
 but
 I¹m
 not able to write  data to any file on that share. I get access is
 denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the
 files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac)
 Write
 Access through the Windows System that has the original folder.
 Windows
 is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 You could chmod the whole share to 777 but that might give problems!
 Or make sure the user apache runs on has write access to the share.
 But normal each file is set with permission 755, means that only the
 owner can write to it.
 
 I'm not able to give a real fix right now, but it is quite complicated
 :(
 
 Tijnema
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no 

Re: [PHP] Integer question

2007-03-22 Thread Tijnema !

On 3/22/07, Matt Carlson [EMAIL PROTECTED] wrote:

When dealing with large numbers inside of php, I know at the int limit, a 
variable is recast into float.



1).  How do you return the true number of the float when it reaches the upper 
limits of mysql's bigint (9223372036854775807).

2).  How do you handle numbers that large, while maintaining precision.
3).  Is there a php equivalent of unsigned?

Thanks all



Hmm, better have a look at the gmp functions : www.php.net/gmp
if you don't have the gmp math library installed, you might want to
look at the worses alternative bcmath, which is automatically build
into php: www.php.net/bc

Tijnema





--
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] Book Suggestion for ZCE

2007-03-22 Thread Danial Rahmanzadeh

hey dudes,
i want to know that which books are good to read  before ZCE exam.
I have read php 5 and php 4 study guides and php 4 practice tests. I have
also read php|architect's guide to php security and bought a 10 slot sample
exam. What else do you suggest?
cheers,
Danial


Re: [PHP] Permissions issue on share

2007-03-22 Thread Al
Get a copy of WinSCP3 or FileZilla ftp utilities, both are free.  They will show 
you who the owner is for the dirs and files.  You can also use a SSH shell 
command; but, unless you are already familiar with Unix commands, using the 
utilities will be a lot easier and quicker.


To change a file or dir when you do not own or have the proper permissions:
Copy the files and dirs to your local HD
Delete them on the server.
Upload them from your HD to the server. Now the owner will be the ID of ftp 
login, that's you.
Fix the permissions as needed. The files and dirs must have the others, also 
called world, W bit set to write and maybe the X bit also.


Rahul Sitaram Johari wrote:


Rahul Sitaram Johari wrote:

Ave,

I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
permissions snag.
I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
//[EMAIL PROTECTED]/ShareName Share².
The ³user² has full read-write permission and physically I¹m able to do
anything I want sitting on my Mac OS X in this share, like create, delete or
modify files. 


The problem is, I don¹t think Apache Web Server (or PHP) has write access on
this share. In PHP, I¹m able to read data from files on this share, but I¹m
not able to write  data to any file on that share. I get access is denied.

Is there anyway through PHP to give Apache or PHP write access to the files
on this share? 
I don¹t see how I can provide Apache Web Server (installed on my Mac) Write

Access through the Windows System that has the original folder. Windows is
only able to provide the Mac User with Permissions, not Apache.

Any help would be appreciated.

Thanks


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²


Ave,

I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
permissions snag.
I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
//[EMAIL PROTECTED]/ShareName Share².
The ³user² has full read-write permission and physically I¹m able to do
anything I want sitting on my Mac OS X in this share, like create, delete or
modify files. 


The problem is, I don¹t think Apache Web Server (or PHP) has write access on
this share. In PHP, I¹m able to read data from files on this share, but I¹m
not able to write  data to any file on that share. I get access is denied.

Is there anyway through PHP to give Apache or PHP write access to the files
on this share? 
I don¹t see how I can provide Apache Web Server (installed on my Mac) Write

Access through the Windows System that has the original folder. Windows is
only able to provide the Mac User with Permissions, not Apache.

Any help would be appreciated.

Thanks


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²




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



Re: [PHP] Question before upgrading to 5

2007-03-22 Thread Jochem Maas
Jake McHenry wrote:
 I don't want 2 instances of apache running,  your over thinking this... I

whatever, I guess we have different opinions about trying to do things 
'properly'.



 only asked if I need to change only the prefix, or if there is anything
 else, to get both php versions installed. 

so you have 2 versions of php installed. you can't run the apache module of both
version simultaneously. so your going to shut down apache on a production box
and then fiddle the config to run with the php5 module and bring it back up.

then what? you hope that all your sites/code runs okay with php5? if it doesn't
you can only fix it if you keep running with the broken sites on php5 otherwise 
you
can only unfiddle the config and stick with php4. no?

 Once I see my scripts are working
 ok, or not, I'll be getting rid of php4. I'm not running a dev machine, this
 is production, and the only one I have currently, 

you might consider that the machine whose screen your looking at whilst reading 
this
is a perfectly good dev machine - you seem to on a windows PC, which of itself 
is not
a problem in terms of setting up a dev environment that suitably mirrors the 
apache/php/DB
configuration of your production server but you may have issues with 'your' php 
code itself
depending the [OS] portability of the code.

given that the server in question is a production server there is even more 
reason to
not disrupt service whilst testing your code on php5 - which is exactly what a 
second
[temporary, custom] install of apache would allow you to do. sure it's a bit 
more work
but it's also more professional - it means you can update the 'real' apache to 
run php5
in the safe knowledge that it will *work* with only a few seconds of down time 
whilst
you restart the webserver process.

 my backup died last week
 and I haven't gotten the parts for it yet. Is prefix the only option I need
 to change? Or do I need to change these too?

no just change prefix. (although I'm not 100% sure about localstatedir - I have 
never touched myself
and I do run various machines that have php4 and php5 installed [compiled by 
hand as you are doing])

btw - installing a second apache is rather the same as installing a second copy 
of
php in so far as you can also specify a custom prefix to have it install (and 
read it's config)
from some other place - so as not to interfere with the production apache.

 
 --datadir=/usr/share \
 --includedir=/usr/include \
 --libdir=/usr/lib \
 --libexecdir=/usr/libexec \
 --localstatedir=/var \
 --mandir=/usr/share/man \
 --infodir=/usr/share/info \
 --with-exec-dir=/usr/bin \
 
 
 Thanks,
 Jake
 
 Jake McHenry wrote:
 Sorry about the delivery and read requests.. I was tired 
 and forgot to turn
 them off for the list..

 alternatively you can search for 'Rasmus' and 'ProxyPass' 
 in the list
 archive and use Rasmus' rather cool ProxyPass solution to 
 running both
 php4 and php5 ... his explanation should give you enough info 
 to set it up.

 I don't need them running parallel, only both installed
 I think you missed the point. you would have 2 apaches 
 running, that is correct
 but the trick is to set it up so that they use the same document roots
 for each site that you are trying to convert.

 the beauty of this is that you can literally run the same 
 site in php5 and php4
 simulaneously with urls something *like*:

 php4.mydevsite.com
 php5.mydevsite.com   (ProxyPassed to 'inner' apache)


 were HOSTS file contains:

 127.0.0.1 php4.mydevsite.com php5.mydevsite.com

 and both outer and inner apache's use the same docroot for 
 the given site.

 obviously it's just one way of setting up a comfortable dev 
 environment - as long
 as you have something that allows you to doo your tihng 
 without to much pain then thats
 the main thing :-)



 Tijnema ! wrote:
 On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
 Hi everyone,

 I just got done going through all my configure options for 
 php5, and
 finally
 configure finished successfully... I didn't install it 
 yet, have a
 question.
 Can I have both 4 and 5 installed temporarily until I'm 
 sure all my
 scripts
 work ok? They should, I've been careful, but I want to be 
 sure since
 this is
 the only server I currently have. I was going to install 
 a virtual
 copy of
 fedora and do testing, but I don't have time, hopefully 
 someone can
 answer.
 I think I just have to change the prefix to something other than
 default and
 load the new module in httpd. If I had more time I would 
 do this the
 right
 way, but we all know how that goes...

 If this will work, I can then just uninstall 4.. Hopefully 
 it won't break
 anything.

 I'll post my configure options if anyone would like to 
 double check
 Thanks,
 Jake
 If you use make install on the second one, it will add the libphp5
 library to your httpd.conf, and then you would have libphp4 and
 libphp5 in your httpd.conf. That is guaranteed to give 
 problems. So if
 you comment out one of 

Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Al [EMAIL PROTECTED] wrote:

Get a copy of WinSCP3 or FileZilla ftp utilities, both are free.  They will show
you who the owner is for the dirs and files.  You can also use a SSH shell
command; but, unless you are already familiar with Unix commands, using the
utilities will be a lot easier and quicker.

To change a file or dir when you do not own or have the proper permissions:
Copy the files and dirs to your local HD
Delete them on the server.
Upload them from your HD to the server. Now the owner will be the ID of ftp
login, that's you.
Fix the permissions as needed. The files and dirs must have the others, also
called world, W bit set to write and maybe the X bit also.


So you would recommend a recursive chmod?
as long as there's no OS installed it wouldn't do a lot, but of course
this would remove a little bit security. (Not that there's a lot of
security with windows...:P)
But i think that when remounting the partitition, the permissions are
reset too. That's why there are options like fmask and dmask :) but
somehow they don't work on Mac OS X.

Tijnema



Rahul Sitaram Johari wrote:


Rahul Sitaram Johari wrote:
 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²


 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²



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

2007-03-22 Thread Jochem Maas
Matt Carlson wrote:
 When dealing with large numbers inside of php, I know at the int limit, a 
 variable is recast into float.
 
 
 
 1).  How do you return the true number of the float when it reaches the upper 
 limits of mysql's bigint (9223372036854775807).

I can't see how that is possible, once its 'floated' the precise int is gone.
although you might consider returning the given mysql bigint field as a
string 'CAST() AS STRING' (or whatever the syntax is) and then using the string 
inconjunction with
the bc or gmp extensions.

 2).  How do you handle numbers that large, while maintaining precision.

keep them as strings - and/or use a 64bit machine?

 3).  Is there a php equivalent of unsigned?

no

 
 Thanks all
 
 
 
 
 

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Rahul Sitaram Johari
Ave,

 But i think that when remounting the partitition, the permissions are reset
too.

Unfortunately you're absolutely right! The share is re-mounted on a daily
basis (along with a reboot), and thus, even if the 'copy, delete from
server, copy to server' process were to work, with every unmount  remount,
it would go back to original permissions  ownership.

Fmask, dmask and for that matter some other mount_smbfs options I found are
an accurate solution to this problem - but unfortunately they don't work on
Mac OS X, or the Samba that comes with mac os x, one or the other.

I know this is gone completely out of PHP context, but I do appreciate you
guys helping out. I'm just not finding any solution for this. I think I've
gone through 100 websites googling different combinations.



On 3/22/07 3:14 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Al [EMAIL PROTECTED] wrote:
 Get a copy of WinSCP3 or FileZilla ftp utilities, both are free.  They will
 show
 you who the owner is for the dirs and files.  You can also use a SSH shell
 command; but, unless you are already familiar with Unix commands, using the
 utilities will be a lot easier and quicker.
 
 To change a file or dir when you do not own or have the proper permissions:
 Copy the files and dirs to your local HD
 Delete them on the server.
 Upload them from your HD to the server. Now the owner will be the ID of ftp
 login, that's you.
 Fix the permissions as needed. The files and dirs must have the others,
 also
 called world, W bit set to write and maybe the X bit also.
 
 So you would recommend a recursive chmod?
 as long as there's no OS installed it wouldn't do a lot, but of course
 this would remove a little bit security. (Not that there's a lot of
 security with windows...:P)
 But i think that when remounting the partitition, the permissions are
 reset too. That's why there are options like fmask and dmask :) but
 somehow they don't work on Mac OS X.
 
 Tijnema
 
 
 Rahul Sitaram Johari wrote:
 
 
 Rahul Sitaram Johari wrote:
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.
 
 Any help would be appreciated.
 
 Thanks
 
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 
 --
 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] Passing variables

2007-03-22 Thread Travis Doherty
itoctopus wrote:

Since you're new to this, always be sure to clean up the output you get from
$_GET or $_POST to avoid sql injection.

Fore example: $search_value = htmlentities($_GET['search_value'],
ENT_QUOTES);
If you're casting to something other than a string (such as int) than you're
safe and you don't have to use htmlentities.

  

Good call. One better is prepared statements.  Avoid the problem all
together.

Travis Doherty

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Tijnema !

On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

Ave,

 But i think that when remounting the partitition, the permissions are reset
too.

Unfortunately you're absolutely right! The share is re-mounted on a daily
basis (along with a reboot), and thus, even if the 'copy, delete from
server, copy to server' process were to work, with every unmount  remount,
it would go back to original permissions  ownership.

Fmask, dmask and for that matter some other mount_smbfs options I found are
an accurate solution to this problem - but unfortunately they don't work on
Mac OS X, or the Samba that comes with mac os x, one or the other.

I know this is gone completely out of PHP context, but I do appreciate you
guys helping out. I'm just not finding any solution for this. I think I've
gone through 100 websites googling different combinations.


You could try to update to the latest version (maybe even from CVS),
i'm not sure if it helps, but if it is fixed, it is done in a later
version :)

And if it doesn't, you could submit a bug ticket at samba.

Tijnema




On 3/22/07 3:14 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Al [EMAIL PROTECTED] wrote:
 Get a copy of WinSCP3 or FileZilla ftp utilities, both are free.  They will
 show
 you who the owner is for the dirs and files.  You can also use a SSH shell
 command; but, unless you are already familiar with Unix commands, using the
 utilities will be a lot easier and quicker.

 To change a file or dir when you do not own or have the proper permissions:
 Copy the files and dirs to your local HD
 Delete them on the server.
 Upload them from your HD to the server. Now the owner will be the ID of ftp
 login, that's you.
 Fix the permissions as needed. The files and dirs must have the others,
 also
 called world, W bit set to write and maybe the X bit also.

 So you would recommend a recursive chmod?
 as long as there's no OS installed it wouldn't do a lot, but of course
 this would remove a little bit security. (Not that there's a lot of
 security with windows...:P)
 But i think that when remounting the partitition, the permissions are
 reset too. That's why there are options like fmask and dmask :) but
 somehow they don't work on Mac OS X.

 Tijnema


 Rahul Sitaram Johari wrote:


 Rahul Sitaram Johari wrote:
 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²


 Ave,

 I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete or
 modify files.

 The problem is, I don¹t think Apache Web Server (or PHP) has write access on
 this share. In PHP, I¹m able to read data from files on this share, but I¹m
 not able to write  data to any file on that share. I get access is denied.

 Is there anyway through PHP to give Apache or PHP write access to the files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac) Write
 Access through the Windows System that has the original folder. Windows is
 only able to provide the Mac User with Permissions, not Apache.

 Any help would be appreciated.

 Thanks


 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²



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



 --
 PHP General Mailing List 

Re: [PHP] Integer question

2007-03-22 Thread Tijnema !

On 3/22/07, Jochem Maas [EMAIL PROTECTED] wrote:

Matt Carlson wrote:
 When dealing with large numbers inside of php, I know at the int limit, a 
variable is recast into float.



 1).  How do you return the true number of the float when it reaches the upper 
limits of mysql's bigint (9223372036854775807).

I can't see how that is possible, once its 'floated' the precise int is gone.
although you might consider returning the given mysql bigint field as a
string 'CAST() AS STRING' (or whatever the syntax is) and then using the string 
inconjunction with
the bc or gmp extensions.

 2).  How do you handle numbers that large, while maintaining precision.

keep them as strings - and/or use a 64bit machine?


a 64bit machine would make the number larger, not unlimited :)



 3).  Is there a php equivalent of unsigned?

no


 Thanks all






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

2007-03-22 Thread Jochem Maas
although you should be filtering input in order to
avoid sql injection cross-site-scripting and other related nasties
you shouldn't be using htmlentities() in order to protect
against sql injection.

filter the incoming data, e.g.:

$a = intval($_GET['a']); // you want only integers
$a = floatval($_GET['a']); // you want only floats
$a = strip_text($_GET['a']); // you do want html

especially go read this page and use the filter extension if you can:
http://nl2.php.net/filter

and then escape your data properly according to the context it
is being used, e.g.:


mysql_real_escape_string(); // for using data in a mysql query
htmlentities(); // for using data in a webpage



itoctopus wrote:
 Since you're new to this, always be sure to clean up the output you get from
 $_GET or $_POST to avoid sql injection.
 
 Fore example: $search_value = htmlentities($_GET['search_value'],
 ENT_QUOTES);
 If you're casting to something other than a string (such as int) than you're
 safe and you don't have to use htmlentities.
 
 --
 itoctopus - http://www.itoctopus.com
 Jeff [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Thank you Chris!

 Chris [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Jeff wrote:
 I want to thank you all for clearing me up on setting the
 register_globals to ON issue!! I have refrained from doing so and my
 code
 is running great with the $_GET.

 I am having NO trouble passing my single variable to the next page
 using..

 echo A href=\char_edit_form.php?charid=$charid\Edit/A;

 as when the next page that load actually shows the character info, so
 basically you can see you are dealing with the correct record.

 NOW.

 I want to pass two variables to a delete page. The charid and the char
 name. Here is what I have but it will only pass the 1st variable
 ?charid
 echo A href=\delete_char.php?charid=$charid
 ?char=.$myrow[char_name].\Delete/A;
 The first one is preceded by a ?

 Subsequent ones are with an ''.

 See http://en.wikipedia.org/wiki/Query_string

 --
 Postgresql  php tutorials
 http://www.designmagick.com/
 

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



Re: [PHP] Integer question

2007-03-22 Thread Jochem Maas
Tijnema ! wrote:
 On 3/22/07, Jochem Maas [EMAIL PROTECTED] wrote:
 Matt Carlson wrote:
  When dealing with large numbers inside of php, I know at the int
 limit, a variable is recast into float.
 
 
 
  1).  How do you return the true number of the float when it reaches
 the upper limits of mysql's bigint (9223372036854775807).

 I can't see how that is possible, once its 'floated' the precise int
 is gone.
 although you might consider returning the given mysql bigint field as a
 string 'CAST() AS STRING' (or whatever the syntax is) and then using
 the string inconjunction with
 the bc or gmp extensions.

  2).  How do you handle numbers that large, while maintaining precision.

 keep them as strings - and/or use a 64bit machine?
 
 a 64bit machine would make the number larger, not unlimited :)

this I understand, 64bits may give him enough precision
for his needs though.


 

  3).  Is there a php equivalent of unsigned?

 no

 
  Thanks all
 
 
 
 
 

 -- 
 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] Download tracker/counter

2007-03-22 Thread Robert Wolfe
Hi all!  This is my first posting to the PHP-General mailing list so please
bear with me J

 

I have a couple of files that I would like to allow folks to download via a
php script that acts as a download tracker and counter.  Basically I want
to:

 

1)  Allow the downloads of said files.

2)  Count the number of time a file has been downloaded.

3)  Record the IP addresses of the machines that download the files.

 

Could anyone point me in the right direction to get an example of this type
of code snippet or even maybe an existing PHP script that will do this very
thing?

 

TIA for any assistance!

Robert


-- 
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.448 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 


Re: [PHP] Message threading (was Job Opportunity)

2007-03-22 Thread Jochem Maas

...

 If I don't agree with murder being illegal does that make it right that
 I do it? Of course not, because people smarter than me decided that it
 should be. (Please note that this does not represent my opinion and is
 only being used as an extreme example).
 
 -Stut
 
 Jochem: I think I'm over it now!

glad that your back to normal ;-)

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



Re: [PHP] Random Unique ID

2007-03-22 Thread Németh Zoltán
2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
 At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
 2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
 
As for efficiency, that's probably not even worth mentioning in this 
  case.
 
 why not? you would use 2 sql queries while I would use one most of the
 time and 2 in case of already reserved ID - that is almost twice as much
 processor time
 that may count much if the routine is used frequently
 
 Go ahead, try it, and tell me how much time it cost.

it would be an interesting benchmark, timing it on some 10 runs or
like that, if I'll have some time I promise I'll do it :)

 
 From experience, there are things one can spend 
 their time optimizing and there are other things 
 that one should be able to see that aren't worth 
 pursing.

yes, it's true. as for the current thing, I do not have experience or
benchmarks, so you may be right that it does not worth the energy. I
said what I said out of logic, which says that 2 queries are slower than
1 query ;)

 
 I've been wrong before, but you're open to prove me wrong again, if you like.

when I'll have some free time (probably not in the next couple of
weeks...) I think I'll try to benchmark it - and we'll see whether the
difference is worth mentioning or not :)

but if anyone has (or you have) existing benchmarks please show me, I'm
interested in it

greets
Zoltán Németh

 
 Cheers,
 
 tedd
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 

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



[PHP] Performance: While or For loop

2007-03-22 Thread Tijnema !

Hi,

Does somebody has benchmarks of what is faster, while or for loop?

Thanks,

Tijnema

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



[PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Paul Nowosielski
Dear All,

I was wondering if there are any major date function changes between php4 and 
5.

When I say date function I mean mktime() , date() ,strtotime() etc.

Here is my dilemma, I've upgraded from php4 to php5. there is some very old 
legacy code that is not working correctly. 

Specifically on our sales calendar.  Some task show up but most don't.
I have the old site and the new upgraded site on the same db.
When entering a new task on the calendar, tasks enter w/ the new system show 
up on the new system and not on the old. Most old tasks don't show up on the 
new.

The code is a pretty bad hack (why use the echo statement once when you can 
use it 207 times).

www:/srv/www/htdocs/admin # grep -ic echo calendar/calendar.html
207



Any knowledge of this would be greatly appreciated.

Thank you, 
-- 
Paul Nowosielski
Webmaster 

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



Re: [PHP] Permissions issue on share - SOLVED!!

2007-03-22 Thread Rahul Sitaram Johari

Ave,

I can't believe I'm saying this, but SOLVED it!
Took me about 6 hours, and this one website, with this one little snippet in
one corner of a black  white page on the ENTIRE Internet gave me a solution
with this guy who had the same problem - and he wrote fixed it for me, hope
it helps someone else - Well, if he ever came to town, beer would be on the
house :)

Believe it or not, two simple little parameters to the mount_smbfs command
did the trick. 

mount_smbfs -u 70 -g 70 //[EMAIL PROTECTED]/ShareName SharePoint

Explanation:
First  foremost, this does not work with the mount command (mount -t
smbfs) which is what I was using. It only works with the mount_smbfs
command. 

Basically you have to specify the uid  gid, that is, the UserID and the
GroupID that you want to specify as Owner  Group of the mounted share. In
my case, 70 is the uid  gid of Apache Web Server on Mac OS X.
With the -u 70 -g 70 specifying Apache Web Server, of the mounted share,
Apache got read/write permissions to anything on the mounted share.

Suddenly I was able to write to files using PHP/Apache on that share!

Actually it's a useful command because once you determine UID  GID of a
User/Group that you want to specify for a mounted share, you can tighten
security and really take control of permission sets for a mounted share.

snip: I used NetInfo Manager to find out uid  gid of Apache Web Server on
my Mac OS X.

Hope this helps someone else ;)

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



On 3/22/07 3:32 PM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/22/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 Ave,
 
 But i think that when remounting the partitition, the permissions are reset
 too.
 
 Unfortunately you're absolutely right! The share is re-mounted on a daily
 basis (along with a reboot), and thus, even if the 'copy, delete from
 server, copy to server' process were to work, with every unmount  remount,
 it would go back to original permissions  ownership.
 
 Fmask, dmask and for that matter some other mount_smbfs options I found are
 an accurate solution to this problem - but unfortunately they don't work on
 Mac OS X, or the Samba that comes with mac os x, one or the other.
 
 I know this is gone completely out of PHP context, but I do appreciate you
 guys helping out. I'm just not finding any solution for this. I think I've
 gone through 100 websites googling different combinations.
 
 You could try to update to the latest version (maybe even from CVS),
 i'm not sure if it helps, but if it is fixed, it is done in a later
 version :)
 
 And if it doesn't, you could submit a bug ticket at samba.
 
 Tijnema
 
 
 
 On 3/22/07 3:14 PM, Tijnema ! [EMAIL PROTECTED] wrote:
 
 On 3/22/07, Al [EMAIL PROTECTED] wrote:
 Get a copy of WinSCP3 or FileZilla ftp utilities, both are free.  They will
 show
 you who the owner is for the dirs and files.  You can also use a SSH shell
 command; but, unless you are already familiar with Unix commands, using the
 utilities will be a lot easier and quicker.
 
 To change a file or dir when you do not own or have the proper permissions:
 Copy the files and dirs to your local HD
 Delete them on the server.
 Upload them from your HD to the server. Now the owner will be the ID of ftp
 login, that's you.
 Fix the permissions as needed. The files and dirs must have the others,
 also
 called world, W bit set to write and maybe the X bit also.
 
 So you would recommend a recursive chmod?
 as long as there's no OS installed it wouldn't do a lot, but of course
 this would remove a little bit security. (Not that there's a lot of
 security with windows...:P)
 But i think that when remounting the partitition, the permissions are
 reset too. That's why there are options like fmask and dmask :) but
 somehow they don't work on Mac OS X.
 
 Tijnema
 
 
 Rahul Sitaram Johari wrote:
 
 
 Rahul Sitaram Johari wrote:
 Ave,
 
 I¹m not sure if anyone here is going to be able to help, but I¹ve run into
 a
 permissions snag.
 I have Apache Web Server running on Mac OS X with PHP. I have a folder on
 a
 windows machine mounted on my Mac OS X as a share using the ³mount ­t
 smbfs
 //[EMAIL PROTECTED]/ShareName Share².
 The ³user² has full read-write permission and physically I¹m able to do
 anything I want sitting on my Mac OS X in this share, like create, delete
 or
 modify files.
 
 The problem is, I don¹t think Apache Web Server (or PHP) has write access
 on
 this share. In PHP, I¹m able to read data from files on this share, but
 I¹m
 not able to write  data to any file on that share. I get access is denied.
 
 Is there anyway through PHP to give Apache or PHP write access to the
 files
 on this share?
 I don¹t see how I can provide Apache Web Server (installed on my Mac)
 Write
 Access through the Windows System that has the original folder. 

RE: [PHP] Performance: While or For loop

2007-03-22 Thread Jake McHenry
 does this help?

http://www.php.lt/benchmark/phpbench.php

Jake



 -Original Message-
 From: Tijnema ! [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 22, 2007 4:38 PM
 To: PHP
 Subject: [PHP] Performance: While or For loop
 
 Hi,
 
 Does somebody has benchmarks of what is faster, while or for loop?
 
 Thanks,
 
 Tijnema
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



Re: [PHP] Performance: While or For loop

2007-03-22 Thread Tijnema !

On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:

 does this help?

http://www.php.lt/benchmark/phpbench.php

Jake


Well, there wasn't a test between For and While, so i did it myself,
and i'm quite confused about the result.
I let PHP count from 0 to 1 on my 1ghz AMD Athlon.
While did it in a average time of 55 seconds.
For did it in a average time of 59 seconds.
It's not a big difference, if you see what number it needs to go to,
but there is a difference.

code used:
?php
set_time_limit(10);
echo date(H:i:s);
for($i = 0; $i  1;$i++)
{
}
echo date(H:i:s);
$x = 0;
while($x  1)
{
$x++;
}
echo date(H:i:s);
?

So, use while loops instead of for loops ;)

Tijnema

ps. I also did the while loop before the for loop, doesn't matter.





 -Original Message-
 From: Tijnema ! [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 22, 2007 4:38 PM
 To: PHP
 Subject: [PHP] Performance: While or For loop

 Hi,

 Does somebody has benchmarks of what is faster, while or for loop?

 Thanks,

 Tijnema

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

 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
 Date: 3/22/2007 7:44 AM



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM


--
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] Performance: While or For loop

2007-03-22 Thread Tijnema !

On 3/22/07, Jon Anderson [EMAIL PROTECTED] wrote:

Your test isn't exactly fair. The for loop has no statements in it, and
the while loop has one. Your tests show while as approx 7% faster, while
a modified test shows an approximate 30% speed improvement:

Do this:

for ($i=0;$i1000;$i++) {}

v.s.:

$i = 0;
while ($i++  1000) {}

The above while loop is 30% faster than the for. A little teaking on the
for loop, it's faster still:


I was comparing the way people normal use while and for. But this does
confirms what i said, while is faster.


for ($i=1000;$i--;) {}

A little tweaking on the while, and it's faster yet:

$i = 1000;
while ($i--) {}

The last while loop is around 60% faster on my hardware than the first
for loop.

jon

Tijnema ! wrote:
 On 3/22/07, Jake McHenry [EMAIL PROTECTED] wrote:
  does this help?

 http://www.php.lt/benchmark/phpbench.php

 Jake

 Well, there wasn't a test between For and While, so i did it myself,
 and i'm quite confused about the result.
 I let PHP count from 0 to 1 on my 1ghz AMD Athlon.
 While did it in a average time of 55 seconds.
 For did it in a average time of 59 seconds.
 It's not a big difference, if you see what number it needs to go to,
 but there is a difference.

 code used:
 ?php
 set_time_limit(10);
 echo date(H:i:s);
 for($i = 0; $i  1;$i++)
 {
 }
 echo date(H:i:s);
 $x = 0;
 while($x  1)
 {
 $x++;
 }
 echo date(H:i:s);
 ?

 So, use while loops instead of for loops ;)

 Tijnema

 ps. I also did the while loop before the for loop, doesn't matter.




  -Original Message-
  From: Tijnema ! [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 22, 2007 4:38 PM
  To: PHP
  Subject: [PHP] Performance: While or For loop
 
  Hi,
 
  Does somebody has benchmarks of what is faster, while or for loop?
 
  Thanks,
 
  Tijnema
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
  --
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
  Date: 3/22/2007 7:44 AM
 
 

 --
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date:
 3/22/2007
 7:44 AM


 --
 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] Creating an FTP account on the fly from PHP

2007-03-22 Thread PHP Fusebox

I built a CMS that lets a super user create and manage basic users
(among lots of other things). I want basic users to get an FTP account
that is automatically associated with their website user account, and
managed from my add/edit user form. For example if I create a user
named [EMAIL PROTECTED] for him to login to my web app, I want my
users to be able to use their same login name and password to access
their web folder via FTP.

I am running on LAMP on a CPanel server with ProFTP as the FTP server
software, but I have no clue how to get PHP to be able to create,
edit, or delete an FTP account. Can someone point me in the right
direction?

I can see the Form field names and URLs in the CPanel forms where this
is set up, but is it safe to CURL these same URLs from my app? That
seems like a big security risk.


Thanks,
Geoff

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



Re: [PHP] Creating an FTP account on the fly from PHP

2007-03-22 Thread Tijnema !

On 3/22/07, PHP Fusebox [EMAIL PROTECTED] wrote:

I built a CMS that lets a super user create and manage basic users
(among lots of other things). I want basic users to get an FTP account
that is automatically associated with their website user account, and
managed from my add/edit user form. For example if I create a user
named [EMAIL PROTECTED] for him to login to my web app, I want my
users to be able to use their same login name and password to access
their web folder via FTP.

I am running on LAMP on a CPanel server with ProFTP as the FTP server
software, but I have no clue how to get PHP to be able to create,
edit, or delete an FTP account. Can someone point me in the right
direction?

I can see the Form field names and URLs in the CPanel forms where this
is set up, but is it safe to CURL these same URLs from my app? That
seems like a big security risk.


Thanks,
Geoff


Let's start with the end, it is a big security hole, as you would need
to enter your reseller account info in the curl options. Which might
be traced somewhere.

I'm not sure how ProFTP is set up, but might it be that it is working
for every local user? So that if you create a new user on your system,
that it can also login through FTP. That's quite common for such
things as CPanel. I never used CPanel or such on my own development
server so i don't know, but i think it works like above, and you
should just create a new user with useradd from within PHP with the
exec function.

Tijnema


--
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: Random Unique ID

2007-03-22 Thread Mark
[EMAIL PROTECTED] wrote:

 Hello,
 
 I want to add a random unique ID to a Mysql table.  Collisions
 are unlikely but possible so to handle those cases I'd like to
 regenerate the random ID until there is no collision and only
 then add my row.  Any suggestions for a newbie as to the right
 way to go about doing this?
 
 Best,
 
 Craig
 
I just wrote up a quick PHP extension that will do what you want. It is on
my website, it is called muniqid, you can get it from the download area.
You can build it as part of PHP or used phpize, configure, make, make
install and create a module.

get it at http://ww.mohawksoft.org

It provides two functions:

muniqid_time(), and muniqid_rand().

muniqid_time() creates a GUID looking string that incorporates, time in
seconds, timer ticks, pid, ip address, and system stats to create an almost
certainly unique key with enough random data to make it impossible to
guess.

A duplicate is only possible within your web site (I guess it could happen
somewhere in the world), if you are using SMP motherboards and both
processors are processing a create ID, at *exactly* the same time (within
resolution of clock ticks) and are running in two threads within the same
process and rand() is isolated between threads and both threads have
processed the same number of IDs. Short of that, pretty impossible.

muniqid_rand() creates a GUID looking string that incorporates a lot of
random data from your machine. It may be less unique than muniqid_time, but
is far more random.

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



RE: [PHP] Creating an FTP account on the fly from PHP

2007-03-22 Thread Jake McHenry
 
 On 3/22/07, PHP Fusebox [EMAIL PROTECTED] wrote:
  I built a CMS that lets a super user create and manage basic users
  (among lots of other things). I want basic users to get an 
 FTP account
  that is automatically associated with their website user 
 account, and
  managed from my add/edit user form. For example if I create a user
  named [EMAIL PROTECTED] for him to login to my web app, I want my
  users to be able to use their same login name and password to access
  their web folder via FTP.
 
  I am running on LAMP on a CPanel server with ProFTP as the 
 FTP server
  software, but I have no clue how to get PHP to be able to create,
  edit, or delete an FTP account. Can someone point me in the right
  direction?
 
  I can see the Form field names and URLs in the CPanel forms 
 where this
  is set up, but is it safe to CURL these same URLs from my app? That
  seems like a big security risk.
 
 
  Thanks,
  Geoff
 
 Let's start with the end, it is a big security hole, as you would need
 to enter your reseller account info in the curl options. Which might
 be traced somewhere.
 
 I'm not sure how ProFTP is set up, but might it be that it is working
 for every local user? So that if you create a new user on your system,
 that it can also login through FTP. That's quite common for such
 things as CPanel. I never used CPanel or such on my own development
 server so i don't know, but i think it works like above, and you
 should just create a new user with useradd from within PHP with the
 exec function.
 
 Tijnema
 

Make sure your system is secure, users created are in their own group and
can't get to anything... Can't run anything, etc. I made that mistake a long
time ago when I was first starting out.. Ended up with a root kit installed
 Yippe

Jake

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



RE: [PHP] Question before upgrading to 5

2007-03-22 Thread Jake McHenry
 I'll think about it.. We only use php for intranet applications I create,
so the server is basically dead at nights, which is when I do most of my
work.



 
 Jake McHenry wrote:
  I don't want 2 instances of apache running,  your over 
 thinking this... I
 
 whatever, I guess we have different opinions about trying to 
 do things 'properly'.
 
 
 
  only asked if I need to change only the prefix, or if there 
 is anything
  else, to get both php versions installed. 
 
 so you have 2 versions of php installed. you can't run the 
 apache module of both
 version simultaneously. so your going to shut down apache on 
 a production box
 and then fiddle the config to run with the php5 module and 
 bring it back up.



The original config is from OS installation, so who knows what I could mess
up by doing this, this is why I'm asking, cause I don't want to screw up
php, apache would be just more to add on to it



 
 then what? you hope that all your sites/code runs okay with 
 php5? if it doesn't
 you can only fix it if you keep running with the broken sites 
 on php5 otherwise you
 can only unfiddle the config and stick with php4. no?
 



Its only 1 line in httpd.conf, just change from php4 module to php5
module. Not that big of a deal



  Once I see my scripts are working
  ok, or not, I'll be getting rid of php4. I'm not running a 
 dev machine, this
  is production, and the only one I have currently, 
 
 you might consider that the machine whose screen your looking 
 at whilst reading this
 is a perfectly good dev machine - you seem to on a windows 
 PC, which of itself is not
 a problem in terms of setting up a dev environment that 
 suitably mirrors the apache/php/DB
 configuration of your production server but you may have 
 issues with 'your' php code itself
 depending the [OS] portability of the code.



Most of my stuff works on windows too, but some of the earlier scripts
accessing files don't work,, I've already considered moving the site to my
desktop while I upgrade the server.. But no



 
 given that the server in question is a production server 
 there is even more reason to
 not disrupt service whilst testing your code on php5 - which 
 is exactly what a second
 [temporary, custom] install of apache would allow you to do. 
 sure it's a bit more work
 but it's also more professional - it means you can update the 
 'real' apache to run php5
 in the safe knowledge that it will *work* with only a few 
 seconds of down time whilst
 you restart the webserver process.
 
  my backup died last week
  and I haven't gotten the parts for it yet. Is prefix the 
 only option I need
  to change? Or do I need to change these too?
 
 no just change prefix. (although I'm not 100% sure about 
 localstatedir - I have never touched myself
 and I do run various machines that have php4 and php5 
 installed [compiled by hand as you are doing])
 
 btw - installing a second apache is rather the same as 
 installing a second copy of
 php in so far as you can also specify a custom prefix to have 
 it install (and read it's config)
 from some other place - so as not to interfere with the 
 production apache.
 



As long as I use prefix, all of these options point to
/prefix/otheroptiondirectories correct? Making prefix the root? So in
the OS installation of PHP and httpd, that's why it left prefix blank, and
put in the values below. So with the config the way it is now... It
would overwrite php4 and I would really be screwed...



  
  --datadir=/usr/share \
  --includedir=/usr/include \
  --libdir=/usr/lib \
  --libexecdir=/usr/libexec \
  --localstatedir=/var \
  --mandir=/usr/share/man \
  --infodir=/usr/share/info \
  --with-exec-dir=/usr/bin \
  
  
  Thanks,
  Jake
  
  Jake McHenry wrote:
  Sorry about the delivery and read requests.. I was tired 
  and forgot to turn
  them off for the list..
 
  alternatively you can search for 'Rasmus' and 'ProxyPass' 
  in the list
  archive and use Rasmus' rather cool ProxyPass solution to 
  running both
  php4 and php5 ... his explanation should give you enough info 
  to set it up.
 
  I don't need them running parallel, only both installed
  I think you missed the point. you would have 2 apaches 
  running, that is correct
  but the trick is to set it up so that they use the same 
 document roots
  for each site that you are trying to convert.
 
  the beauty of this is that you can literally run the same 
  site in php5 and php4
  simulaneously with urls something *like*:
 
  php4.mydevsite.com
  php5.mydevsite.com (ProxyPassed to 'inner' apache)
 
 
  were HOSTS file contains:
 
  127.0.0.1 php4.mydevsite.com php5.mydevsite.com
 
  and both outer and inner apache's use the same docroot for 
  the given site.
 
  obviously it's just one way of setting up a comfortable dev 
  environment - as long
  as you have something that allows you to doo your tihng 
  without to much pain then thats
  the main thing :-)
 
 
 
  Tijnema ! wrote:
 

Re: [PHP] Passing variables

2007-03-22 Thread Chris

Tijnema ! wrote:

On 3/22/07, Jeff [EMAIL PROTECTED] wrote:
I want to thank you all for clearing me up on setting the 
register_globals

to ON issue!! I have refrained from doing so and my code is running great
with the $_GET.

I am having NO trouble passing my single variable to the next page 
using..


echo A href=\char_edit_form.php?charid=$charid\Edit/A;

as when the next page that load actually shows the character info, so
basically you can see you are dealing with the correct record.

NOW.

I want to pass two variables to a delete page. The charid and the char 
name.

Here is what I have but it will only pass the 1st variable ?charid

echo A href=\delete_char.php?charid=$charid
?char=.$myrow[char_name].\Delete/A;

I get the 1st variable using the $charid = (int)$_GET['charid']; (on the
next page)

I do however NOT get

$charname = $_GET[char] to pull the name out. (on the next page)

I've tried putting a comma, a , a % between the variables ie..

echo A href=\delete_char.php?charid=$charid 
?char=.$myrow[char_name].\Delete/A;

but it just won't let me pull the $_GET[char]

I have even tried $_GET['char'] but am under the impression '_' are for
integers and _ are for text?

This is bullshit, ' and  do the same.


There's no need to swear at someone for asking a question.

And there is a difference between ' and :

?php
$animal = 'dog';
echo 'I have a $animal as a petbr/\n';
echo I have a $animal as a petbr/\n;
?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Question before upgrading to 5

2007-03-22 Thread Myron Turner

Jochem Maas wrote:

Jake McHenry wrote:
  

I don't need them running parallel, only both installed



I think you missed the point. you would have 2 apaches running, that is correct
but the trick is to set it up so that they use the same document roots
for each site that you are trying to convert.

the beauty of this is that you can literally run the same site in php5 and php4
simulaneously with urls something *like*:

php4.mydevsite.com
php5.mydevsite.com  (ProxyPassed to 'inner' apache)


were HOSTS file contains:

127.0.0.1 php4.mydevsite.com php5.mydevsite.com

and both outer and inner apache's use the same docroot for the given site.

obviously it's just one way of setting up a comfortable dev environment - as 
long
as you have something that allows you to doo your tihng without to much pain 
then thats
the main thing :-)

  
I've handled this by having the second installation of Apache listen on 
a different port.  The default is of course 80, so the directive reads:

  Listen 80
But the second install can listen on, for instance, 8080
 Listen 8080

Then you can access the site, using the same urls, but with the 8080 port:
http://www.example.com:8080/somepage.html

--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



Re: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Chris

Paul Nowosielski wrote:

Dear All,

I was wondering if there are any major date function changes between php4 and 
5.


I don't think so but check the docs: 
http://www.php.net/manual/en/faq.migration5.php



When I say date function I mean mktime() , date() ,strtotime() etc.

Here is my dilemma, I've upgraded from php4 to php5. there is some very old 
legacy code that is not working correctly. 


Specifically on our sales calendar.  Some task show up but most don't.
I have the old site and the new upgraded site on the same db.
When entering a new task on the calendar, tasks enter w/ the new system show 
up on the new system and not on the old. Most old tasks don't show up on the 
new.


That could be a register_globals issue - there's no way for us to know 
what's going on without seeing the code.


Time to start digging.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



RE: [PHP] Passing variables

2007-03-22 Thread Jake McHenry
I was going to say the same thing, but was too busy to worry about it



 -Original Message-
 From: Chris [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 22, 2007 7:14 PM
 To: Tijnema !
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Passing variables
 
 Tijnema ! wrote:
  On 3/22/07, Jeff [EMAIL PROTECTED] wrote:
  I want to thank you all for clearing me up on setting the 
  register_globals
  to ON issue!! I have refrained from doing so and my code 
 is running great
  with the $_GET.
 
  I am having NO trouble passing my single variable to the 
 next page 
  using..
 
  echo A href=\char_edit_form.php?charid=$charid\Edit/A;
 
  as when the next page that load actually shows the 
 character info, so
  basically you can see you are dealing with the correct record.
 
  NOW.
 
  I want to pass two variables to a delete page. The charid 
 and the char 
  name.
  Here is what I have but it will only pass the 1st variable ?charid
 
  echo A href=\delete_char.php?charid=$charid
  ?char=.$myrow[char_name].\Delete/A;
 
  I get the 1st variable using the $charid = 
 (int)$_GET['charid']; (on the
  next page)
 
  I do however NOT get
 
  $charname = $_GET[char] to pull the name out. (on the next page)
 
  I've tried putting a comma, a , a % between the variables ie..
 
  echo A href=\delete_char.php?charid=$charid 
  ?char=.$myrow[char_name].\Delete/A;
 
  but it just won't let me pull the $_GET[char]
 
  I have even tried $_GET['char'] but am under the 
 impression '_' are for
  integers and _ are for text?
  This is bullshit, ' and  do the same.
 
 There's no need to swear at someone for asking a question.
 
 And there is a difference between ' and :
 
 ?php
 $animal = 'dog';
 echo 'I have a $animal as a petbr/\n';
 echo I have a $animal as a petbr/\n;
 ?
 
 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



RE: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Jake McHenry

I just asked this a bit ago. Time and Date seem to be the same, but
strtotime is definitly different, as that was what broke in my script in
php4, and I was told it worked as expected in php5.
 

 -Original Message-
 From: Chris [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 22, 2007 7:18 PM
 To: Paul Nowosielski
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Date functions differences between php 4 and 5
 
 Paul Nowosielski wrote:
  Dear All,
  
  I was wondering if there are any major date function 
 changes between php4 and 
  5.
 
 I don't think so but check the docs: 
 http://www.php.net/manual/en/faq.migration5.php
 
  When I say date function I mean mktime() , date() ,strtotime() etc.
  
  Here is my dilemma, I've upgraded from php4 to php5. there 
 is some very old 
  legacy code that is not working correctly. 
  
  Specifically on our sales calendar.  Some task show up but 
 most don't.
  I have the old site and the new upgraded site on the same db.
  When entering a new task on the calendar, tasks enter w/ 
 the new system show 
  up on the new system and not on the old. Most old tasks 
 don't show up on the 
  new.
 
 That could be a register_globals issue - there's no way for 
 us to know 
 what's going on without seeing the code.
 
 Time to start digging.
 
 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



Re: [PHP] close session when browser is closed

2007-03-22 Thread Juergen Wind

Travis Doherty wrote:
 By default the session cookie expires when the browseris closed.
this is not always true: f.e. FF requires *all* open windows to be closed to
forget that session.

If the browser refuses the cookie, sessions won't work anyway.  
again: this is not always true. Only if  session.use_only_cookies = 1
otherwise the session id can alternatively propagate using the query string
or hidden input fields.
(if session.use_trans_sid = 1)

just my 2 cent

-- 
View this message in context: 
http://www.nabble.com/close-session-when-browser-is-closed-tf3443138.html#a9627180
Sent from the PHP - General mailing list archive at Nabble.com.

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



RE: [PHP] close session when browser is closed

2007-03-22 Thread Jake McHenry
Also, on a daily basis last week after a windows update glitch... I had to
kill rogue IE processes after it was closed, which I found kept some of my
users logged in, which was fun...

 
 Travis Doherty wrote:
  By default the session cookie expires when the browseris closed.
 this is not always true: f.e. FF requires *all* open windows 
 to be closed to
 forget that session.
 
 If the browser refuses the cookie, sessions won't work anyway.  
 again: this is not always true. Only if  
 session.use_only_cookies = 1
 otherwise the session id can alternatively propagate using 
 the query string
 or hidden input fields.
 (if session.use_trans_sid = 1)
 
 just my 2 cent
 
 -- 
 View this message in context: 
 http://www.nabble.com/close-session-when-browser-is-closed-tf3
 443138.html#a9627180
 Sent from the PHP - General mailing list archive at Nabble.com.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



Re: [PHP] Permissions issue on share

2007-03-22 Thread Jim Lucas

Rahul Sitaram Johari wrote:

Ave,

I¹m not sure if anyone here is going to be able to help, but I¹ve run into a
permissions snag.
I have Apache Web Server running on Mac OS X with PHP. I have a folder on a
windows machine mounted on my Mac OS X as a share using the ³mount ­t smbfs
//[EMAIL PROTECTED]/ShareName Share².
The ³user² has full read-write permission and physically I¹m able to do
anything I want sitting on my Mac OS X in this share, like create, delete or
modify files. 


The problem is, I don¹t think Apache Web Server (or PHP) has write access on
this share. In PHP, I¹m able to read data from files on this share, but I¹m
not able to write  data to any file on that share. I get access is denied.

Is there anyway through PHP to give Apache or PHP write access to the files
on this share? 
I don¹t see how I can provide Apache Web Server (installed on my Mac) Write

Access through the Windows System that has the original folder. Windows is
only able to provide the Mac User with Permissions, not Apache.

Any help would be appreciated.

Thanks


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²


you could always change apache to run as the user/group that the mount 
is set to.


Sorry you had to spend 6 hours hunting down a 2 second fix.  Not sure 
why no one else suggested this.  If it is a local copy of Apache and not 
used by anybody else, who cares about what permissions it runs as.


Jim

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



[PHP] Question after php5

2007-03-22 Thread Jake McHenry
Hi everyone,

I decided I would spend the extra time and install separate copies of apache
and php5. All went successfully, I thought. Apache starts and runs on 8080,
I get pages. But not php pages. I added a php.conf file which is included in
httpd.conf, I just copied the layout of the rest of the include statements
and below is my php.conf file in the conf/extra directory What did I
miss? I'm just trying to echo out hello world, and I get a blank page. In
the logs, I'm getting a 304..?



#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_modulemodules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php



Thanks,
Jake

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



RE: [PHP] Question after php5

2007-03-22 Thread Jake McHenry
In my index.php file, I have this:


?php
echo PHP hello world;
?

HTML Hello World


I get the HTML Hello World output, but not the php? So the
conf/extra/php.conf file is somewhat being included, but I'm not getting any
output  And now there is a 200 entry in the log file. So with just php,
I get a 304, with html I get a 200, with both I get a 200 but no php
output. What did I miss???

Thanks,
Jake



 
 Hi everyone,
 
 I decided I would spend the extra time and install separate 
 copies of apache
 and php5. All went successfully, I thought. Apache starts and 
 runs on 8080,
 I get pages. But not php pages. I added a php.conf file which 
 is included in
 httpd.conf, I just copied the layout of the rest of the 
 include statements
 and below is my php.conf file in the conf/extra directory 
 What did I
 miss? I'm just trying to echo out hello world, and I get a 
 blank page. In
 the logs, I'm getting a 304..?
 
 
 
 #
 # PHP is an HTML-embedded scripting language which attempts to make it
 # easy for developers to write dynamically generated webpages.
 #
 
 LoadModule php5_modulemodules/libphp5.so
 
 #
 # Cause the PHP interpreter to handle files with a .php extension.
 #
 AddType application/x-httpd-php .php
 # AddType application/x-httpd-php-source .phps
 
 #
 # Add index.php to the list of files that will be served as directory
 # indexes.
 #
 DirectoryIndex index.php
 
 
 
 Thanks,
 Jake
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007
 7:44 AM
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



RE: [PHP] Question after php5 SOLVED... For now

2007-03-22 Thread Jake McHenry
I got it working...  During the php install, it modified httpd.conf with
this: LoadModule php5_modulemodules/libphp5.so .. And I moved
that to my php.conf as it was in apache2 with php4, but it doesn't work in
the newest version of apache that I downloaded.. They must have changed it
so that the module must be loaded before something else in httpd.conf
instead of calling it from an external config file..

Ok.. Now off to testing my scripts to see if they'll work under php5..


Jake





 -Original Message-
 From: Jake McHenry [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 22, 2007 10:43 PM
 To: php-general@lists.php.net
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Question after php5
 
 In my index.php file, I have this:
 
 
 ?php
 echo PHP hello world;
 ?
 
 HTML Hello World
 
 
 I get the HTML Hello World output, but not the php? So the
 conf/extra/php.conf file is somewhat being included, but I'm 
 not getting any
 output  And now there is a 200 entry in the log file. So 
 with just php,
 I get a 304, with html I get a 200, with both I get a 200 but no php
 output. What did I miss???
 
 Thanks,
 Jake
 
 
 
  
  Hi everyone,
  
  I decided I would spend the extra time and install separate 
  copies of apache
  and php5. All went successfully, I thought. Apache starts and 
  runs on 8080,
  I get pages. But not php pages. I added a php.conf file which 
  is included in
  httpd.conf, I just copied the layout of the rest of the 
  include statements
  and below is my php.conf file in the conf/extra directory 
  What did I
  miss? I'm just trying to echo out hello world, and I get a 
  blank page. In
  the logs, I'm getting a 304..?
  
  
  
  #
  # PHP is an HTML-embedded scripting language which attempts 
 to make it
  # easy for developers to write dynamically generated webpages.
  #
  
  LoadModule php5_modulemodules/libphp5.so
  
  #
  # Cause the PHP interpreter to handle files with a .php extension.
  #
  AddType application/x-httpd-php .php
  # AddType application/x-httpd-php-source .phps
  
  #
  # Add index.php to the list of files that will be served as 
 directory
  # indexes.
  #
  DirectoryIndex index.php
  
  
  
  Thanks,
  Jake
  
  -- 
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
  Date: 3/22/2007
  7:44 AM
   
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  -- 
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
  Date: 3/22/2007 7:44 AM
   
  
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007
 7:44 AM
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/730 - Release 
 Date: 3/22/2007 7:44 AM
  
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
 

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



Re: [PHP] Integer question

2007-03-22 Thread Richard Lynch
On Thu, March 22, 2007 2:33 pm, Tijnema ! wrote:
  2).  How do you handle numbers that large, while maintaining
 precision.

 keep them as strings - and/or use a 64bit machine?

 a 64bit machine would make the number larger, not unlimited :)

Even GMP (or BC) isn't unlimited...

It's just limited to the number of bytes you have in RAM/swap. :-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] close session when browser is closed

2007-03-22 Thread Travis Doherty
Juergen Wind wrote:

Travis Doherty wrote:
  

By default the session cookie expires when the browseris closed.


this is not always true: f.e. FF requires *all* open windows to be closed to
forget that session.
  

Personally I think this does make sense.  I fully expect the browser to
maintain cookies Until it is closed -- If I have closed one tab that
had set a cookie, re-opening that URL in a new window/tab should still
cause the browser to send in my cookie.

  

If the browser refuses the cookie, sessions won't work anyway.  


again: this is not always true. Only if  session.use_only_cookies = 1
otherwise the session id can alternatively propagate using the query string
or hidden input fields.
(if session.use_trans_sid = 1)
  

That is correct - as I mentioned (unless its in the URL...) ... It's
kind of weird to pass sessions through URLs though, I prefer clean,
simple URLs such as www.example.com/resource/topic.html, instead of
something like
www.example.com/?x=resourcey=1113this=44PHPSESSID=123124124124124bookmarkable=not_really

Travis

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



Re: [PHP] Performance: While or For loop

2007-03-22 Thread Travis Doherty
Tijnema ! wrote:

 On 3/22/07, Jon Anderson [EMAIL PROTECTED] wrote:

 Your test isn't exactly fair. The for loop has no statements in it, and
 the while loop has one. Your tests show while as approx 7% faster, while
 a modified test shows an approximate 30% speed improvement:

 Do this:

 for ($i=0;$i1000;$i++) {}

 v.s.:

 $i = 0;
 while ($i++  1000) {}


This has been asked many times, probably likewise for every language. 
Search for the same question on the C programming language for a more in
depth discussion of this and to find out why one way is faster than the
other...

Major factor: Don't forget the difference between pre and post increment
operators.  $i++ and ++$i.

For reference this is my PHP test script and results:

{{{
[EMAIL PROTECTED] tdoherty $ cat ./forwhile.php
?
$i=0; $start = microtime(TRUE);
for ($i=0; $i10; ++$i) {}
echo sprintf(For pre-increment ($i): %0.3f\n,microtime(TRUE) - $start);

$i=0; $start = microtime(TRUE);
for ($i=0; $i10; $i++) {}
echo sprintf(For post-increment ($i): %0.3f\n,microtime(TRUE) - $start);

$i=0; $start = microtime(TRUE);
while (++$i  10) {}
echo sprintf(While pre-increment ($i): %0.3f\n,microtime(TRUE) - $start);

$i=0; $start = microtime(TRUE);
while ($i++  10) {}
echo sprintf(While post-increment ($i): %0.3f\n,microtime(TRUE) - $start);
?
[EMAIL PROTECTED] tdoherty $ php ./forwhile.php
For pre-increment (10): 0.035
For post-increment (10): 0.060
While pre-increment (10): 0.029
While post-increment (11): 0.056
}}}

After multiple runs I see that the for pre-increment loop is fastest. 
Note that the while loop with a post-increment runs once more than with
a pre-increment.

Everytime I run, the results are *very* different, though still fall
within similar comparitive domains.

Travis Doherty

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



Re: [PHP] Creating an FTP account on the fly from PHP

2007-03-22 Thread Travis Doherty
PHP Fusebox wrote:

 I built a CMS that lets a super user create and manage basic users
 (among lots of other things). I want basic users to get an FTP account
 that is automatically associated with their website user account, and
 managed from my add/edit user form. For example if I create a user
 named [EMAIL PROTECTED] for him to login to my web app, I want my
 users to be able to use their same login name and password to access
 their web folder via FTP.

 I am running on LAMP on a CPanel server with ProFTP as the FTP server
 software, but I have no clue how to get PHP to be able to create,
 edit, or delete an FTP account. Can someone point me in the right
 direction?

ProFTPd?  It can authenticate against MySQL tables...  It gets
authentication from your database.  We used to do this many many years
ago... It worked fine and was probably choke full of security problems.

Setting up ProFTPd for MySQL authentication was a pain, I'm sure its
easier today.  Once you have that setup, its just a simple matter of
CRUD SQL queries.

Travis Doherty

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



Re: [PHP] Performance: While or For loop

2007-03-22 Thread Mario Guenterberg
On Fri, Mar 23, 2007 at 12:24:45AM -0500, Travis Doherty wrote:
 After multiple runs I see that the for pre-increment loop is fastest. 
 Note that the while loop with a post-increment runs once more than with
 a pre-increment.
 
 Everytime I run, the results are *very* different, though still fall
 within similar comparitive domains.

Hi...

I used your script and my results are different from yours.
The post-while increment is generally the fastest result on my
machine (Core 2 Duo, php 5.2.1 and apache 2.2.4).

I ran the script multiple times:

[schnipp ]

For pre-increment (10): 0.066
For post-increment (10): 0.066
While pre-increment (10): 0.028
While post-increment (11): 0.025

[schnipp ]

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -

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