php-general Digest 9 Oct 2005 09:35:00 -0000 Issue 3727

2005-10-09 Thread php-general-digest-help

php-general Digest 9 Oct 2005 09:35:00 - Issue 3727

Topics (messages 223777 through 223780):

Re: per user php.ini
223777 by: Rory Browne

Freetype and JPEG disabled
223778 by: Feris Thia C.
223780 by: cc

Re: Dynamic sub directory listing without redirect
223779 by: Philip Hallstrom

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---
why not upload a phpinfo() file and see?

I'm personally not quite sure how this would work, and I'm interested
in finding out.

On 10/8/05, James Benson [EMAIL PROTECTED] wrote:
 Hey everyone, probably missed the bit in the manual but my current
 webhost allows uploading of my own php.ini to my home dir, my question
 is how to do this?

 My guess would be to set the ./configure line to something like
 --with-config-file-path=/home/*/public_html

 but I dont wanna re-compile if im wrong, can anyone tell me?

 Using apache-1.3.33, php-4.4.0

 Many thanks,
 James Benson.

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


---End Message---
---BeginMessage---
Hi All,

I've tried to compile and install PHP with gd and freetype library enabled,
and all PNG and GIF library are loaded. But somehow, JPEG and Freetype still
not recognized. I installed Freetype 2.0.

Anyone facing these problems before ??? How can I resolved these ?

Regards,

Feris
---End Message---
---BeginMessage---
did you configured php with these option?
  --with-freetype-dir=/path/to/freetype
  --with-jpeg-dir=/path/to/jpeg


On 10/9/05, Feris Thia C. [EMAIL PROTECTED] wrote:
 Hi All,

 I've tried to compile and install PHP with gd and freetype library enabled,
 and all PNG and GIF library are loaded. But somehow, JPEG and Freetype
 still
 not recognized. I installed Freetype 2.0.

 Anyone facing these problems before ??? How can I resolved these ?

 Regards,

 Feris


---End Message---
---BeginMessage---

Hi List,

I am trying to allow dynamic URL's for my users to remember
similiar to:

www.mysite.com/joesoap

So I want to use joesoap in a PHP script to pick up the
user's details
from a MySQL database. If the joesoap does not exist in the table
I will handle that.

So basically I have one file www.mysite.com/index.php which should do
all the processing.

I have tried with the apache .htaccess mod_rewrite, however
when I echo
$_SERVER['PHP_SELF'] I can't detect the joesoap. It returns
/index.php.

Of course the easiest way is to do something like
www.mysite.com/index.php?username=joesoap
but that is too long and complicated for our users. As we
have thousands
of users, I don't want to create actual directories.

Furthermore can this be done too (without a joesoap file):
www.mysite.com/joesoap?show_extra_details=yes

Any advice/links would be much appreciated. If I am barking
up the wrong
tree throw me a bone please.

Thanks alot
Terence


Hi Terence,

I would handle this in a custom 404 error script.  Essentially, just have
the 404 page parse out the joesoap, check the database to see if its
valid, and act accordingly.


The only drawback to this is that the request won't appear in the access 
log.  At least under apache it won't.


Now if that matter to you or not is another issue...

-philip
---End Message---


[PHP] Re: Freetype and JPEG disabled

2005-10-09 Thread cc
did you configured php with these option?
  --with-freetype-dir=/path/to/freetype
  --with-jpeg-dir=/path/to/jpeg


On 10/9/05, Feris Thia C. [EMAIL PROTECTED] wrote:
 Hi All,

 I've tried to compile and install PHP with gd and freetype library enabled,
 and all PNG and GIF library are loaded. But somehow, JPEG and Freetype
 still
 not recognized. I installed Freetype 2.0.

 Anyone facing these problems before ??? How can I resolved these ?

 Regards,

 Feris



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



Re: [PHP] per user php.ini

2005-10-09 Thread James Benson

Nothing special on my configure line and the setting:-
Configuration File (php.ini) Path looks like /home/USERNAME/public_html

Only just noticed it's been switched over to CGI recently, It's also 
possible to have one php.ini per directory and the above mentioned 
setting always reflects the php.ini setting for that directory so must 
be something concerning httpd.




JB






Rory Browne wrote:

why not upload a phpinfo() file and see?

I'm personally not quite sure how this would work, and I'm interested
in finding out.

On 10/8/05, James Benson [EMAIL PROTECTED] wrote:


Hey everyone, probably missed the bit in the manual but my current
webhost allows uploading of my own php.ini to my home dir, my question
is how to do this?

My guess would be to set the ./configure line to something like
--with-config-file-path=/home/*/public_html

but I dont wanna re-compile if im wrong, can anyone tell me?

Using apache-1.3.33, php-4.4.0

Many thanks,
James Benson.

--
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] per user php.ini

2005-10-09 Thread Rory Browne
they probably use something along the lines of mapping PHP to php -c
$HOME/php.ini

In Linux this would generally be done using binfmt_misc.

On 10/9/05, James Benson [EMAIL PROTECTED] wrote:
 Nothing special on my configure line and the setting:-
 Configuration File (php.ini) Path looks like /home/USERNAME/public_html

 Only just noticed it's been switched over to CGI recently, It's also
 possible to have one php.ini per directory and the above mentioned
 setting always reflects the php.ini setting for that directory so must
 be something concerning httpd.



 JB






 Rory Browne wrote:
  why not upload a phpinfo() file and see?
 
  I'm personally not quite sure how this would work, and I'm interested
  in finding out.
 
  On 10/8/05, James Benson [EMAIL PROTECTED] wrote:
 
 Hey everyone, probably missed the bit in the manual but my current
 webhost allows uploading of my own php.ini to my home dir, my question
 is how to do this?
 
 My guess would be to set the ./configure line to something like
 --with-config-file-path=/home/*/public_html
 
 but I dont wanna re-compile if im wrong, can anyone tell me?
 
 Using apache-1.3.33, php-4.4.0
 
 Many thanks,
 James Benson.
 
 --
 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] Get Mac Address

2005-10-09 Thread Ben Sagal
I have a local intranet server, running apache1.3+php4.  Is it
possible to get the mac address of computes which access on of my php
pages?

Ben

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



[PHP] ID from lines?

2005-10-09 Thread Gustav Wiberg

Hi there!

How do I get ID number from these lines? Do I have to use regular 
expressions?


Line #3 : NH01LiteOn DVD±RW 
16725http://www.varupiraten.se/web/spec_product.php?ID=1711PC-CD-DVD-LDW-1653S-09C1
Line #4 : NH01LITEON 
8x725http://www.varupiraten.se/web/spec_product.php?ID=2250CD-DVD-LDW-811S1


/G
http://www.varupiraten.se/

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



Re: [PHP] ID from lines?

2005-10-09 Thread Gustav Wiberg
- Original Message - 
From: Al Hafoudh [EMAIL PROTECTED]

To: Gustav Wiberg [EMAIL PROTECTED]
Sent: Sunday, October 09, 2005 4:38 PM
Subject: Re: [PHP] ID from lines?



/ID=([0-9]*)\/


Thanx!

/G
@varupiraten.se



Gustav Wiberg wrote:


Hi there!

How do I get ID number from these lines? Do I have to use regular 
expressions?


Line #3 : NH01LiteOn DVD±RW 
16725http://www.varupiraten.se/web/spec_product.php?ID=1711PC-CD-DVD-LDW-1653S-09C1
Line #4 : NH01LITEON 
8x725http://www.varupiraten.se/web/spec_product.php?ID=2250CD-DVD-LDW-811S1


/G
http://www.varupiraten.se/





--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 
2005-10-07





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



Re: [PHP] ID from lines?

2005-10-09 Thread Gustav Wiberg

Hi

Yes, it would work in these cases... But if there would be two or three =, 
then you couldn't generalize it in that matter...


/G
@varupiraten.se


- Original Message - 
From: Kevin Waterson [EMAIL PROTECTED]

To: Gustav Wiberg [EMAIL PROTECTED]
Sent: Sunday, October 09, 2005 4:37 PM
Subject: Re: [PHP] ID from lines?


This one time, at band camp, Gustav Wiberg [EMAIL PROTECTED] wrote:



Line #3 : NH01LiteOn DVD±RW
16725http://www.varupiraten.se/web/spec_product.php?ID=1711PC-CD-DVD-LDW-1653S-09C1
Line #4 : NH01LITEON
8x725http://www.varupiraten.se/web/spec_product.php?ID=2250CD-DVD-LDW-811S1


explode on =

Kevin
--
Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote.


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005-10-07

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



[PHP] Regular expressions

2005-10-09 Thread Gustav Wiberg

Hi there!

I'm no good at reg exp... Yes, I confess..

Here's my code


?php
$lines = file('export/nhExportVarupiraten.txt');

// Loop through our array, show HTML source as HTML source; and line numbers 
too.

foreach ($lines as $line_num = $line) {

echo Line #b{$line_num}/b :  . htmlspecialchars($line) . br /\n;

if ($line_num  0 ) {
 $getName = explode('', $line);
 $pattern = /ID=([0-9]*)\/;
 $subject = $line;
 $idNumber = preg_split($pattern, $subject);

 echo NAME =  . $getName[2] .  has ID number=$idNumber[0]br;
}
//require(phpfunctions/opendb.php);
//$sql = UPDATE beskrivandeVarunamn= . safeQuote($bNamn) .  WHERER
//mysql_close();

}

?

Output of this code is something like this:
Line #0 : Varupiratenhttp://www.varupiraten.se/ NH01Liteon 
DVD±RW1225http://www.varupiraten.se/web/spec_product.php?ID=2252PC-CD-DVD-LDW-SOHW-852SX0
Line #1 : NH01LiteOn DVD±RW 16 
x655http://www.varupiraten.se/web/spec_product.php?ID=2251PC-CD-DVD-LDW-1653S-01C1
NAME = LiteOn DVD±RW 16 x has ID number=NH01LiteOn DVD±RW 16 
x655http://www.varupiraten.se/web/spec_product.php?
Line #2 : NH01LiteOn DVD±RW 
8x599http://www.varupiraten.se/web/spec_product.php?ID=1708PC-CD-DVD-LDW-832S-11C1
NAME = LiteOn DVD±RW 8x has ID number=NH01LiteOn DVD±RW 
8x599http://www.varupiraten.se/web/spec_product.php?
Line #3 : NH01LiteOn DVD±RW 
16725http://www.varupiraten.se/web/spec_product.php?ID=1711PC-CD-DVD-LDW-1653S-09C1
NAME = LiteOn DVD±RW 16 has ID number=NH01LiteOn DVD±RW 
16725http://www.varupiraten.se/web/spec_product.php?
Line #4 : NH01LITEON 
8x725http://www.varupiraten.se/web/spec_product.php?ID=2250CD-DVD-LDW-811S1
NAME = LITEON 8x has ID number=NH01LITEON 
8x725http://www.varupiraten.se/web/spec_product.php?



Just focus on $idNumber[0] in the code above... In the last row I get an 
output of LITEON 8x725http://www.varupiraten.se/web/spec_product.php?


I want to get an output of 2250. I do I achieve that?

/G
http://www.varupiraten.se/

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



Re: [PHP] per user php.ini

2005-10-09 Thread James Benson

Thanks for the replies.







Rory Browne wrote:

they probably use something along the lines of mapping PHP to php -c
$HOME/php.ini

In Linux this would generally be done using binfmt_misc.

On 10/9/05, James Benson [EMAIL PROTECTED] wrote:


Nothing special on my configure line and the setting:-
Configuration File (php.ini) Path looks like /home/USERNAME/public_html

Only just noticed it's been switched over to CGI recently, It's also
possible to have one php.ini per directory and the above mentioned
setting always reflects the php.ini setting for that directory so must
be something concerning httpd.



JB






Rory Browne wrote:


why not upload a phpinfo() file and see?

I'm personally not quite sure how this would work, and I'm interested
in finding out.

On 10/8/05, James Benson [EMAIL PROTECTED] wrote:



Hey everyone, probably missed the bit in the manual but my current
webhost allows uploading of my own php.ini to my home dir, my question
is how to do this?

My guess would be to set the ./configure line to something like
--with-config-file-path=/home/*/public_html

but I dont wanna re-compile if im wrong, can anyone tell me?

Using apache-1.3.33, php-4.4.0

Many thanks,
James Benson.

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

2005-10-09 Thread Jasper Bryant-Greene

Gustav Wiberg wrote:

?php
$lines = file('export/nhExportVarupiraten.txt');

// Loop through our array, show HTML source as HTML source; and line 
numbers too.

foreach ($lines as $line_num = $line) {

echo Line #b{$line_num}/b :  . htmlspecialchars($line) . br /\n;

if ($line_num  0 ) {
 $getName = explode('', $line);
 $pattern = /ID=([0-9]*)\/;
 $subject = $line;
 $idNumber = preg_split($pattern, $subject);


// instead of preg_split, use preg_match

$idNumber = preg_match($pattern, $subject, $matches);

// your ID number is now in $matches[1]



 echo NAME =  . $getName[2] .  has ID number=$idNumber[0]br;
}
//require(phpfunctions/opendb.php);
//$sql = UPDATE beskrivandeVarunamn= . safeQuote($bNamn) .  WHERER
//mysql_close();

}

?


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



[PHP] Mystery about chmod and permissions

2005-10-09 Thread Al

I've got a script that checks a directory's permissions for 757 and if they are 
not correct, chmods them with a cgi script.

That part works just fine.  Can alternately switch the permissions from 755 to 757 and back. I can use a ftp utility to 
check the permissions and they are correct.


The mystery is that I have a permissions check following the chmod and it reports the permissions that existed before 
the change.


snippets:

include http://$server/cgi-bin/chg_perms.cgi?name=$fp_nameperms=$fperms;;  
//e.g., $fperms= 0757;

[I've tried sleep(10) here; doesn't help]

echo Directory permissions for $dirname:  . substr(sprintf('%o', 
fileperms($dirname)), -3).   //reports 0755;

If I run the script again with the same permissions, the report shows the 
correct permissions.

It's as if permissions check code is executed before the chmod; but it isn't.  I've tried echoed the times for the chmod 
code and the permissions check and the chmod code is definitely before the permissions check.


Anyone have an explanation.?

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



RE: [PHP] Mystery about chmod and permissions

2005-10-09 Thread Jeffrey Santos
To save on computing time, the results of the fileperms command are
cached... I assume when you run a new instance of the program, it uses a new
cache / old one is deleted when the first instance ends.  Either way, you
should clear the cache first:

clearstatcache();

echo Directory permissions for $dirname:  . substr(sprintf('%o',
fileperms($dirname)), -3).   //reports 0755;

Give that a try

- Jeff
-Original Message-
From: Al [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 09, 2005 3:50 PM
To: php-general@lists.php.net
Subject: [PHP] Mystery about chmod and permissions

I've got a script that checks a directory's permissions for 757 and if they
are not correct, chmods them with a cgi script.

That part works just fine.  Can alternately switch the permissions from 755
to 757 and back. I can use a ftp utility to 
check the permissions and they are correct.

The mystery is that I have a permissions check following the chmod and it
reports the permissions that existed before 
the change.

snippets:

include http://$server/cgi-bin/chg_perms.cgi?name=$fp_nameperms=$fperms;;
//e.g., $fperms= 0757;

[I've tried sleep(10) here; doesn't help]

echo Directory permissions for $dirname:  . substr(sprintf('%o',
fileperms($dirname)), -3).   //reports 0755;

If I run the script again with the same permissions, the report shows the
correct permissions.

It's as if permissions check code is executed before the chmod; but it
isn't.  I've tried echoed the times for the chmod 
code and the permissions check and the chmod code is definitely before the
permissions check.

Anyone have an explanation.?

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

2005-10-09 Thread Gustav Wiberg
- Original Message - 
From: Jasper Bryant-Greene [EMAIL PROTECTED]

To: PHP General php-general@lists.php.net
Sent: Sunday, October 09, 2005 8:06 PM
Subject: Re: [PHP] Regular expressions



Gustav Wiberg wrote:

?php
$lines = file('export/nhExportVarupiraten.txt');

// Loop through our array, show HTML source as HTML source; and line 
numbers too.

foreach ($lines as $line_num = $line) {

echo Line #b{$line_num}/b :  . htmlspecialchars($line) . br 
/\n;


if ($line_num  0 ) {
 $getName = explode('', $line);
 $pattern = /ID=([0-9]*)\/;
 $subject = $line;
 $idNumber = preg_split($pattern, $subject);


// instead of preg_split, use preg_match

$idNumber = preg_match($pattern, $subject, $matches);

// your ID number is now in $matches[1]



 echo NAME =  . $getName[2] .  has ID number=$idNumber[0]br;
}
//require(phpfunctions/opendb.php);
//$sql = UPDATE beskrivandeVarunamn= . safeQuote($bNamn) .  WHERER
//mysql_close();

}

?


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
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 Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 
2005-10-07




Hi there!

Thanx, I'll try that! :-)

/G
http://www.varupiraten.se/

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



Re: [PHP] Get Mac Address

2005-10-09 Thread Rory Browne
On unix
man arp

on windows
arp/h
arp/help
arp/?

sorry for short and sweet resp, but I'm falling asleep.

On 10/9/05, Ben Sagal [EMAIL PROTECTED] wrote:
 I have a local intranet server, running apache1.3+php4.  Is it
 possible to get the mac address of computes which access on of my php
 pages?

 Ben

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



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



Re: [PHP] Get Mac Address

2005-10-09 Thread M. Sokolewicz
That will give you the *local* mac address, not that of the user 
visiting your page. The problem is the fact that the mac address is not 
sent as part of the REQUEST. As such it's not possible for PHP to find 
out what it is. So, unfortunately, no. (Though it's a very common 
question on this list)


- tul

Rory Browne wrote:

On unix
man arp

on windows
arp/h
arp/help
arp/?

sorry for short and sweet resp, but I'm falling asleep.

On 10/9/05, Ben Sagal [EMAIL PROTECTED] wrote:


I have a local intranet server, running apache1.3+php4.  Is it
possible to get the mac address of computes which access on of my php
pages?

Ben

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







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



Re: [PHP] Get Mac Address

2005-10-09 Thread Andrew Brampton

M. Sokolewicz have you ever typed arp at a command line?
It may give you a local mac address, but it is normally used to show your 
arp cache.


Now if you are on the same physical segment as the requester than you can 
obtain to mac address from parsing the output and matching it to the 
requesting IP.


For example my machine is IP 192.168.0.10, and a client on my network 
(192.168.0.188) just hit my webserver. Shelling out arp -a shows me this 
(under windows):


Interface: 192.168.0.10 --- 0x2
 Internet Address  Physical Address  Type
 192.168.0.1   00-02-78-71-53-a8 dynamic
 192.168.0.188 00-50-8d-e7-5d-6b dynamic

Now the trick is to match up  _SERVER[REMOTE_ADDR] with the correct line 
from the output, and voila this gives me the mac address of the client 
requesting from my server.


The problem you face is when the remote client is on a different physical 
segment, as such its impossible (or extremely difficult without additional 
technologies) to obtain their MAC address. As Ben said he was using a local 
intranet server I'm sure Rory Browne's post is completely valid, for request 
from his LAN.


Andrew

- Original Message - 
From: M. Sokolewicz [EMAIL PROTECTED]

To: Rory Browne [EMAIL PROTECTED]
Cc: Ben Sagal [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Sunday, October 09, 2005 11:52 PM
Subject: Re: [PHP] Get Mac Address


That will give you the *local* mac address, not that of the user visiting 
your page. The problem is the fact that the mac address is not sent as 
part of the REQUEST. As such it's not possible for PHP to find out what it 
is. So, unfortunately, no. (Though it's a very common question on this 
list)


- tul

Rory Browne wrote:

On unix
man arp

on windows
arp/h
arp/help
arp/?

sorry for short and sweet resp, but I'm falling asleep.

On 10/9/05, Ben Sagal [EMAIL PROTECTED] wrote:


I have a local intranet server, running apache1.3+php4.  Is it
possible to get the mac address of computes which access on of my php
pages?

Ben

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







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




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



Re: [PHP] Mystery about chmod and permissions

2005-10-09 Thread Al

Jeffrey Santos wrote:

To save on computing time, the results of the fileperms command are
cached... I assume when you run a new instance of the program, it uses a new
cache / old one is deleted when the first instance ends.  Either way, you
should clear the cache first:

clearstatcache();

echo Directory permissions for $dirname:  . substr(sprintf('%o',
fileperms($dirname)), -3).   //reports 0755;

Give that a try

- Jeff
-Original Message-
From: Al [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 09, 2005 3:50 PM

To: php-general@lists.php.net
Subject: [PHP] Mystery about chmod and permissions

I've got a script that checks a directory's permissions for 757 and if they
are not correct, chmods them with a cgi script.

That part works just fine.  Can alternately switch the permissions from 755
to 757 and back. I can use a ftp utility to 
check the permissions and they are correct.


The mystery is that I have a permissions check following the chmod and it
reports the permissions that existed before 
the change.


snippets:

include http://$server/cgi-bin/chg_perms.cgi?name=$fp_nameperms=$fperms;;
//e.g., $fperms= 0757;

[I've tried sleep(10) here; doesn't help]

echo Directory permissions for $dirname:  . substr(sprintf('%o',
fileperms($dirname)), -3).   //reports 0755;

If I run the script again with the same permissions, the report shows the
correct permissions.

It's as if permissions check code is executed before the chmod; but it
isn't.  I've tried echoed the times for the chmod 
code and the permissions check and the chmod code is definitely before the

permissions check.

Anyone have an explanation.?


That did it.  Thanks

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



[PHP] mambo question..??

2005-10-09 Thread bruce
hi...

i'm going through the mambo app, trying to figure out where in the code the
app starts to generate the actual menus for the Admin functions. i've
tracked the actual code that gets generated mod_fullmenu.php but i can't
seem to tell exactly how this code in the jscript gets generated... it
appears that the mod_fullmenu page is somehow included, but i can't find
out where this happens.

and yeah, i've tried to ask/send emails to people on the mambo list with no
luck. so i figured i'd ask here, if anybody has experience with playing with
the code of mambo...

thanks

bruce
[EMAIL PROTECTED]

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



Re: [PHP] mambo question..??

2005-10-09 Thread Wee Keat
Bruce,

I'm not sure what exactly you need to know, but I'll try to clarify a
few thing for you at best that I can.

bruce wrote:
 i'm going through the mambo app, trying to figure out where in the code the
 app starts to generate the actual menus for the Admin functions. i've
 tracked the actual code that gets generated mod_fullmenu.php but i can't
 seem to tell exactly how this code in the jscript gets generated... it

The full menu utilizes JSCookmenu class, where the menu items are
hardcoded in the mod_fullmenu.php, from around line: 60 - 320+


 appears that the mod_fullmenu page is somehow included, but i can't find
 out where this happens.

Here's what I don't quite understand what you mean by where this
happens. Did you mean how the mod_fullmenu.php is eval'd?

The way Mambo works is by 'including' the scripts into different
sections by using the mosLoadAdminModule('position_name') function call.
The funcion just regurgitates the PHP code so that it is interpreted.


 and yeah, i've tried to ask/send emails to people on the mambo list with no
 luck. so i figured i'd ask here, if anybody has experience with playing with
 the code of mambo...

I have quite a few years of experience in dealing with Mambo, but I'm
definitely no expert. Hope that helps anyway.



-- 
Wee Keat Chin

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



[PHP] Send postcard link

2005-10-09 Thread Roger Thomas
On server-1 I have my photogallery working. On another box, server-2, I have my 
postcard script also working great. Users can send postcards using ready 
inhouse designs or upload their own (max 100K). Both have been serving our 
community for the past  2 years or so.

Current requirement:

When I browsed my photogallery, I would like to have a button that says 'Send 
this picture as postcard'. Behind the scenes, how do I send that picture to 
server-2 postcard script?

Please advise.

--
Roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] Get Mac Address

2005-10-09 Thread Rory Browne
On 10/10/05, M. Sokolewicz [EMAIL PROTECTED] wrote:
 That will give you the *local* mac address, not that of the user
 visiting your page. The problem is the fact that the mac address is not
 sent as part of the REQUEST. As such it's not possible for PHP to find
 out what it is. So, unfortunately, no. (Though it's a very common
 question on this list)



Normally I would agree, but he said he was running a local intranet server.

arp will work, if you're on the same network as the computer you are
querying, but if not, then arp will give you the mac address of the
router.

arp can be used to get the mac of a certain machine as well(identified
by its IP), as well as listing out the cache of machines that have
recently connected.




 - tul

 Rory Browne wrote:
  On unix
  man arp
 
  on windows
  arp/h
  arp/help
  arp/?
 
  sorry for short and sweet resp, but I'm falling asleep.
 
  On 10/9/05, Ben Sagal [EMAIL PROTECTED] wrote:
 
 I have a local intranet server, running apache1.3+php4.  Is it
 possible to get the mac address of computes which access on of my php
 pages?
 
 Ben
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 



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



[PHP] I want to know if some link is online

2005-10-09 Thread Jesús Alain Rodríguez Santos
I would like to know if a web is online, a have this code:

enlace.php

?
$vivo = verde.gif;
$muerto = rojo.gif;

$enlinea = fopen($enlace, r);
 if (!$enlinea){
header(Location: $muerto);
}
 else {
   header(Location: $vivo);
  }
fclose($enlinea);
?

In other page  I hve this:

page.php

img src=estado.php?enlace=http://www.cfg.jovenclub.cu;

Somebody can tell me what it's wrong, because the image did not
show, of course that the pages and bouth image are in the same
dorectory.
Please any suggestion


-- 
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.

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



Re: [PHP] I want to know if some link is online

2005-10-09 Thread Jasper Bryant-Greene

Jesús Alain Rodríguez Santos wrote:

I would like to know if a web is online, a have this code:

enlace.php

?
$vivo = verde.gif;
$muerto = rojo.gif;

$enlinea = fopen($enlace, r);


Why not use file_exists()? Also, you probably want to use 
$_GET['enlance'] rather than $enlance.



 if (!$enlinea){
header(Location: $muerto);
}


You need to specify an absolute URI here 
(http://www.example.com/myimage.gif for example).


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] Send postcard link

2005-10-09 Thread Torgny Bjers
Roger Thomas wrote:

On server-1 I have my photogallery working. On another box, server-2, I have 
my postcard script also working great. Users can send postcards using ready 
inhouse designs or upload their own (max 100K). Both have been serving our 
community for the past  2 years or so.

Current requirement:

When I browsed my photogallery, I would like to have a button that says 'Send 
this picture as postcard'. Behind the scenes, how do I send that picture to 
server-2 postcard script?

  


The easiest way would probably be to use file_get_contents, which is
binary safe. The file_get_contents function supports opening remote
files if allow_url_fopen is activated.

An example:
$handle = fopen(ftp://user:[EMAIL PROTECTED]/somefile.txt, r);

Regards,
Torgny

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