[PHP] guidance for communicating between frames

2005-08-29 Thread R. Vijay Daniel


Hi,

Please give me some solution to communicate between two frames in php.
I need to track the actions in one frame and to report it to another frame.

regards
vijay

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



[PHP] Issue with generating asx playlist with php

2005-08-29 Thread Dan Rossi
Hi there I am trying to use php to output an asx playlist but depends 
on a special hash in the url to prevent hotlinking. I am using a 
session to store a generated token when generating the url to display 
in an embedded player. The token is added in the filename and  I am 
using rewrite rules to load another php script which does a check of 
the hash in the querystring with the token stored in the session. 
However its having unexpected results. When i add the check for the 
session token the media player either doesnt player in PC or outputs 
playlist format not recognised in Mac. If i do a check for the hash 
only its ok. Here is an example


if ($_GET['h']  $_GET['filename']  $this-hash) {

$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

breaks with this

if ($_GET['h']  $_GET['filename']  $this-token) {

$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

ideally i want it to look like

if ($_GET['h']  $_GET['filename']  
(strcmp($this-token,$this-hash)==0)) {


$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}


they are being set earlier in the script like so

$this-token = trim($_SESSION['token']);
$this-hash = trim($_GET['h']);

any ideas ?

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



[PHP] How can I format text in textarea?

2005-08-29 Thread bushra

Hi
When I enter text as more than on paragrahs in a textarea field,The text 
is displayed in one solid block of text even though I have entered it in 
paragraphs. 
How I can  to insert line breaks in the text. (The values of textarea is 
stored in database and then displayed.)



Bushra

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



RE: [PHP] PHP MySql Extension No Loading

2005-08-29 Thread Shaw, Chris - Accenture

I thought you had to put the php.ini in the c:\windows directory?

-Original Message-
From: Glen Zimmerman [mailto:[EMAIL PROTECTED]
Sent: 27 August 2005 22:39
To: php-general@lists.php.net
Subject: RE: [PHP] PHP MySql Extension No Loading


*

This e-mail has been received by the Revenue Internet e-mail service.

*

Yes, I have the dll in the right place (C:\php\ext), and PHPIniDir is set to
C:\php where php.ini is located.  I know that php.ini is being picked up,
because the changes I make to the file take affect when I restart Apache.
PHP is loading properly as the php function, phpinfo, does display the proper
information page when I run a test.  I just cannot get php_mysql.dll to load.

I have gone through the PHP installation documentation several times, but it
has not made a difference.

I just don't know what I have over looked. 







This message has been delivered to the Internet by the Revenue Internet e-mail 
service

*

Re: [PHP] How can I format text in textarea?

2005-08-29 Thread Jasper Bryant-Greene

bushra wrote:

Hi
When I enter text as more than on paragrahs in a textarea field,The text 
is displayed in one solid block of text even though I have entered it in 
paragraphs. How I can  to insert line breaks in the text. (The values of 
textarea is stored in database and then displayed.)


If you have the text in $string, then this will output it safely and 
with correct line breaks:


print(nl2br(htmlspecialchars($string)));

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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] PHP MySql Extension No Loading

2005-08-29 Thread Jasper Bryant-Greene

Shaw, Chris - Accenture wrote:

I thought you had to put the php.ini in the c:\windows directory?


Please don't top-post. He said that when he changes the php.ini file the 
changes take effect after restarting Apache, so that's not the problem. 
See my other comments below.



-Original Message-
From: Glen Zimmerman [mailto:[EMAIL PROTECTED]
Sent: 27 August 2005 22:39
To: php-general@lists.php.net
Subject: RE: [PHP] PHP MySql Extension No Loading

Yes, I have the dll in the right place (C:\php\ext), and PHPIniDir is set to
C:\php where php.ini is located.  I know that php.ini is being picked up,
because the changes I make to the file take affect when I restart Apache.
PHP is loading properly as the php function, phpinfo, does display the proper
information page when I run a test.  I just cannot get php_mysql.dll to load.


Have you placed the MySQL client library (libmysql.dll or something 
similar) into c:\windows\system32 ?


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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



[PHP] ftp_nlist dont work for me :(

2005-08-29 Thread Erik Gyepes

Hi folks!

I have compiled PHP 5.0.4 at my Slackware machine at home, I have the 
FTP support enable and I trying connect to the FTP with this little scritp:


?php
$connect = ftp_connect(ftp.slackware.at) or die(Couldn't connect to ftp 
server);
$login = ftp_login($connect,anonymous,[EMAIL PROTECTED]) or die(Couldn't login 
to ftp server);

$ftp_dir = ftp_pwd($connect) or die(error ftp dir);
$fileArray = ftp_nlist($connect,$ftp_dir) or die(error file array);

echo var_dump($fileArray);
?

And I always get: error file array, so there is problem with the ftp_nlist I think. 
But the sripts work well at my webhosting, but It dont get work it at home at my machine.

May I enable something in PHP? Some settings, or what?

Thanks very much.

Erik Gyepes

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



[PHP] Re: guidance for communicating between frames

2005-08-29 Thread Jens Schulze
You can e.g. use javascript for intra-frame communication, but for a
more specific answer we need a more specific question.

Jens

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



Re: [PHP] Issue with generating asx playlist with php

2005-08-29 Thread Dan Rossi
I have just discovered on closer debugging, the windows media plugin is 
loading the file twice, i can see the stop button flicker twice and i 
made an error log and the word loaded shows up twice, would this be 
causing an issue with the session ?


On 29/08/2005, at 5:20 PM, Dan Rossi wrote:

Hi there I am trying to use php to output an asx playlist but depends 
on a special hash in the url to prevent hotlinking. I am using a 
session to store a generated token when generating the url to display 
in an embedded player. The token is added in the filename and  I am 
using rewrite rules to load another php script which does a check of 
the hash in the querystring with the token stored in the session. 
However its having unexpected results. When i add the check for the 
session token the media player either doesnt player in PC or outputs 
playlist format not recognised in Mac. If i do a check for the hash 
only its ok. Here is an example


if ($_GET['h']  $_GET['filename']  $this-hash) {

			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

breaks with this

if ($_GET['h']  $_GET['filename']  $this-token) {

			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

ideally i want it to look like

if ($_GET['h']  $_GET['filename']  
(strcmp($this-token,$this-hash)==0)) {


			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}


they are being set earlier in the script like so

$this-token = trim($_SESSION['token']);
$this-hash = trim($_GET['h']);

any ideas ?

--
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] regular expression for time

2005-08-29 Thread babu
HI,
 
how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. 
using preg_match.
 
thanks
babu


-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos

[PHP] Protecing files

2005-08-29 Thread Thomas
 


Hi there,

How can I protect all files with extension .xml from being accessed by the
outside? For Apache can one use .htaccess (if yes, how?), is there a generic
way of keeping stalkers from viewing your config files?

Thomas





SPIRAL EYE STUDIOS 
P.O. Box 37907, Faerie Glen, 0043

Tel: +27 12 362 3486
Fax: +27 12 362 3493 
Mobile: +27 82 442 9228
Email: [EMAIL PROTECTED]
Web:  http://www.spiraleye.co.za www.spiraleye.co.za 

 



RE: [PHP] Protecing files

2005-08-29 Thread Jay Blanchard
[snip]
How can I protect all files with extension .xml from being accessed by
the
outside? For Apache can one use .htaccess (if yes, how?), is there a
generic
way of keeping stalkers from viewing your config files?
[/snip]

You can put them outside of the web root so that they are not accessible
to the general public.

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



Re: [PHP] Issue with generating asx playlist with php

2005-08-29 Thread Dan Rossi


On 29/08/2005, at 10:00 PM, Dan Rossi wrote:

I have just discovered on closer debugging, the windows media plugin 
is loading the file twice, i can see the stop button flicker twice and 
i made an error log and the word loaded shows up twice, would this be 
causing an issue with the session ?


Ok its quite obvious I just discovered the session is being created 
again when the file is loaded from the windows media plugin therefore 
token variable is not there. Any ideas what could have been doing this 
? I logged two different sess id's being created.




On 29/08/2005, at 5:20 PM, Dan Rossi wrote:

Hi there I am trying to use php to output an asx playlist but depends 
on a special hash in the url to prevent hotlinking. I am using a 
session to store a generated token when generating the url to display 
in an embedded player. The token is added in the filename and  I am 
using rewrite rules to load another php script which does a check of 
the hash in the querystring with the token stored in the session. 
However its having unexpected results. When i add the check for the 
session token the media player either doesnt player in PC or outputs 
playlist format not recognised in Mac. If i do a check for the hash 
only its ok. Here is an example


if ($_GET['h']  $_GET['filename']  $this-hash) {

			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

breaks with this

if ($_GET['h']  $_GET['filename']  $this-token) {

			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}

ideally i want it to look like

if ($_GET['h']  $_GET['filename']  
(strcmp($this-token,$this-hash)==0)) {


			$file = 
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);

$this-filename = preg_replace('/stream/','wmv',$file);
$this-tpl-compile('playlist.html');
header(Content-Type: video/x-ms-wmv);
die(trim($this-tpl-outputObject($this)));
}


they are being set earlier in the script like so

$this-token = trim($_SESSION['token']);
$this-hash = trim($_GET['h']);

any ideas ?

--
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] Protecing files

2005-08-29 Thread John Nichel

Thomas wrote:
 



Hi there,

How can I protect all files with extension .xml from being accessed by the
outside? For Apache can one use .htaccess (if yes, how?), is there a generic
way of keeping stalkers from viewing your config files?


You can put them outside of the web root, or you can use .htaccess.  For 
.htaccess, look at the Apache manual.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Re: regular expression for time

2005-08-29 Thread Al

babu wrote:

HI,
 
how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match.
 
thanks

babu


-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos


You need to be more specific about:

What is before and after the time string.  It's probably white-space. That so?

Can your HH, values be without the leading zero, e.g., 2:12:15.

Can you be certain that MM and SS will be included.  If the time is entered by users, they can get lazy and give you 
2, for example.


Given the simplest case.  $pattern= %\s(\d\d:\d\:\d\d)\s%;   [% is simply the delimitor, it can be almost any 
thing.] The \s is optional, it says white-space.


$num= preg($pattern, $string [,$match_array])  $time_value= $match_array[1];  $num of matches in case you want to test 
for none or more than 1.


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



Re: [PHP] regular expression for time

2005-08-29 Thread Leif Gregory
Hello babu,

Monday, August 29, 2005, 6:50:32 AM, you wrote:
 how can i write regular expression for time in 24-hour format i:e,
 HH:MM:SS. using preg_match.

?php
$xtime=19:59:53;
if (preg_match(/([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]/, $xtime))
  echo Good;
else
  echo Bad;
?


--TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B
 __       Geocaching:http://gps.PCWize.com
(  )  ( ___)(_  _)( ___)  TBUDP Wiki Site:  http://www.PCWize.com/thebat/tbudp
 )(__  )__)  _)(_  )__)   Roguemoticons  Smileys:http://PCWize.com/thebat
()()()(__)PHP Tutorials and snippets:http://www.DevTek.org

Save your pennies.  The dollars go to the I.R.S.

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



[PHP] Re: sscanf() not returning info

2005-08-29 Thread Dan Baker
Simon Fredriksson [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Can anyone tell me what is wrong here?

 ?php
 $data = a class=\new20030101\ href=\Zero01.jpg\Pic 1/a;
 $info = sscanf($data,a class=\%s\ href=\%s\%s/a);
 var_dump($info);
 ?

One way to do this is:
?php
$data = a class=\new20030101\ href=\Zero01.jpg\Pic 1/a;
sscanf($data,a class=\%s\ href=\%s\%s/a, $class, $href, $text);
echo Class = $classbr;
echo href = $hrefbr;
echo test = $textbr;
?

Another way is:
?php
$data = a class=\new20030101\ href=\Zero01.jpg\Pic 1/a;
list ($class, $href, $text) = sscanf($data,a class=\%s\ 
href=\%s\%s/a);
echo Class = $classbr;
echo href = $hrefbr;
echo test = $textbr;
?

DanB

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



[PHP] Computers name?

2005-08-29 Thread Gustav Wiberg

Hi there!

Is it possible to get (retrieve) the computername of the client? I just want 
the name for comparing...


/G
@varupiraten.se

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



Re: [PHP] Easier way to clean GET Variables ?

2005-08-29 Thread Jay Paulson

Can anybody point to a good resource of a collection of filtering for
common inputs such as those listed by Chris above?...

I've searched for that and generally found one of two things:

1. Nothing useful.
2. A system so baroque and complex and with so much other baggage, it
would be impossible to integrate.  See 1.

I'm looking more for code snippets or specific Regex functions for
each item, rather than a monolithic Borg-like filtering package and
have never one I liked.

That could be mostly my fault due to peculiar requirements, but there
it is.


I'd like to know this too.  As well as the examples are in this thread 
I don't think they handled multi dimensional arrays.  It'd be nice if 
they did. :)


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



[PHP] LAN IP address

2005-08-29 Thread Philippe Reynolds

Hi all,

I would like to find a way to get my computers LAN IP address through PHP.  
I tried using the gethostbyname(HOSTNAME) function, however I only got 
back the 127.0.0.1 address.


Any help is always appreciated
Cheers
Phil

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



Re: [PHP] LAN IP address

2005-08-29 Thread John Nichel

Philippe Reynolds wrote:

Hi all,

I would like to find a way to get my computers LAN IP address through 
PHP.  I tried using the gethostbyname(HOSTNAME) function, however I 
only got back the 127.0.0.1 address.


Any help is always appreciated
Cheers
Phil


Server or client IP?

Server : $_SERVER['SERVER_ADDR']
Client : $_SERVER['REMOTE_ADDR']

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] PHP MySql Extension No Loading

2005-08-29 Thread Glen Zimmerman
No, according to the documentation, it goes into the directory pointed
to by PHPIniDir.  My php.ini file is being read properly when Apache
loads.  Its just when I have the line, extension=php_mysql.dll ,
uncommented that I receive the error.

 Shaw, Chris - Accenture [EMAIL PROTECTED] 08/29/2005 2:36:34 AM

I thought you had to put the php.ini in the c:\windows directory?
-Original Message-
From: Glen Zimmerman [mailto:[EMAIL PROTECTED] 
Sent: 27 August 2005 22:39
To: php-general@lists.php.net 
Subject: RE: [PHP] PHP MySql Extension No Loading


*

This e-mail has been received by the Revenue Internet e-mail service.

*
Yes, I have the dll in the right place (C:\php\ext), and PHPIniDir is
set to C:\php where php.ini is located.  I know that php.ini is being
picked up, because the changes I make to the file take affect when I
restart Apache.  PHP is loading properly as the php function, phpinfo,
does display the proper information page when I run a test.  I just
cannot get php_mysql.dll to load.
 
I have gone through the PHP installation documentation several times,
but it has not made a difference.
 
I just don't know what I have over looked.  
 
 


This message has been delivered to the Internet by the Revenue Internet
e-mail service

*



Re: [PHP] LAN IP address

2005-08-29 Thread Erik Gyepes

Hi.

I think you want to get the internal IP adress which computer uses? Am I 
right?
If yes, that is not possible with PHP directly, but it is possible with 
Java and PHP.


Erik

Philippe Reynolds wrote:


Hi all,

I would like to find a way to get my computers LAN IP address through 
PHP.  I tried using the gethostbyname(HOSTNAME) function, however I 
only got back the 127.0.0.1 address.


Any help is always appreciated
Cheers
Phil



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



Re: [PHP] LAN IP address

2005-08-29 Thread Philippe Reynolds
Yes, I would hard code my IP address but when the computer crashs the server 
assigns it a different IP address, so I have to make my code a tad more 
dynamic...


I havn't touched Java in a while, would you know the function for that?

Thanks again

I think you want to get the internal IP adress which computer uses? Am I 
right?
If yes, that is not possible with PHP directly, but it is possible with 
Java and PHP


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



Re: [PHP] PHP MySql Extension No Loading

2005-08-29 Thread Glen Zimmerman
Thanks, Jasper, that seems to have done the trick.  I'm not sure I
understand why it is necessary to put the dll in system32, since there is an
environment variable for the path that is pointing to c:\php.  I would seem
that it would pick up the dll through this env variable.

 Jasper Bryant-Greene[EMAIL PROTECTED] 08/29/2005 2:56:05 AM

Shaw, Chris - Accenture wrote:
 I thought you had to put the php.ini in the c:\windows directory?

Please don't top-post. He said that when he changes the php.ini file the 
changes take effect after restarting Apache, so that's not the problem. 
See my other comments below.

 -Original Message-
 From: Glen Zimmerman [mailto:[EMAIL PROTECTED] 
 Sent: 27 August 2005 22:39
 To: php-general@lists.php.net 
 Subject: RE: [PHP] PHP MySql Extension No Loading
 
 Yes, I have the dll in the right place (C:\php\ext), and PHPIniDir is set
to
 C:\php where php.ini is located.  I know that php.ini is being picked up,
 because the changes I make to the file take affect when I restart Apache.
 PHP is loading properly as the php function, phpinfo, does display the
proper
 information page when I run a test.  I just cannot get php_mysql.dll to
load.

Have you placed the MySQL client library (libmysql.dll or something 
similar) into c:\windows\system32 ?

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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s 

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



[PHP] Re: PHP Security

2005-08-29 Thread cron
Sorry for the split of threds, i dont have the original email.

 

This is the answer from computerworld regarding the article 
http://www.computerworld.com/securitytopics/security/holes/story/0,10801,104124,00.html
 , 



Thank you for taking the time to write in. I see your point. 

The article should have said that there was a flaw in *a* Web service protocol 
*for* PHP. Saying the PHP Web services protocol may have given readers the 
wrong idea. 

However, this particular PEAR implementation is bundled with one of the newer 
release candidates of PHP (PHP 4.4.0RC2), at which point it gets difficult to 
determine whether something is or is not part of PHP. In any case, I have 
issued a clarification at 

http://www.computerworld.com/news/corrections 

Regards, 



--
Sharon Machlis
Online Managing Editor
Computerworld
http://www.computerworld.com 

One Speen Street
P.O. Box 9171
Framingham, MA  01701-9171
Phone: +1 508 820 8231
E-mail: [EMAIL PROTECTED] 




To:[EMAIL PROTECTED] 
cc:[EMAIL PROTECTED] (bcc: cweditor) 

Subject:PHP hit by another critical flaw (104124) 


 
Hello,

This article is wrong, XML-RPC for PHP has a security flaw not PHP itself and 
php is not a Web Service Protocol. 

Angelo 





Re: [PHP] LAN IP address

2005-08-29 Thread Erik Gyepes

Okay.

There I have script for you: http://pokusy.depi.sk/internalip.zip. Just 
download it and see the source.

You can see how it works here: http://pokusy.depi.sk/inernalip/ip.php.

Hope that helps you.

Erik

Philippe Reynolds wrote:

Yes, I would hard code my IP address but when the computer crashs the 
server assigns it a different IP address, so I have to make my code a 
tad more dynamic...


I havn't touched Java in a while, would you know the function for that?

Thanks again

I think you want to get the internal IP adress which computer uses? 
Am I right?
If yes, that is not possible with PHP directly, but it is possible 
with Java and PHP





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



Re: [PHP] LAN IP address

2005-08-29 Thread Tim Van Wassenhove
On 2005-08-29, Philippe Reynolds [EMAIL PROTECTED] wrote:
 Yes, I would hard code my IP address but when the computer crashs the server 
 assigns it a different IP address, so I have to make my code a tad more 
 dynamic...

Have you had a look at tools that you get at dynip etc?

-- 
Met vriendelijke groeten,
Tim Van Wassenhove http://timvw.madoka.be

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



Re: [PHP] Issue with generating asx playlist with php

2005-08-29 Thread Andy Pieters
On Monday 29 August 2005 16:09, Dan Rossi wrote:
 ? I logged two different sess id's being created.

Hi

I have seen this behaviour as well, although in another context.  The solution 
was to have the session_start instruction be one of the very first.

In fact, in my software, the session_start is the second instruction on ALL 
pages.

?php

require_once 'globals.inc.php';

/* rest of script*/
?

And globals.inc.php is like

?php
session_start();

define(yadaydayda
?

Hope this helps



With kind regards



Andy


-- 
Registered Linux User Number 379093
Now listening to Blank and Jones and Friends (2005 week 34) - guest DJ Jochen 
Miller

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can 
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/

--


pgpkh2ZIq86nl.pgp
Description: PGP signature


Re: [PHP] kein Betreff

2005-08-29 Thread Andy Pieters
On Sunday 28 August 2005 19:26, Jan Broermann wrote:
 _
 Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle
 Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179

Lauffen sie scheissen!  Was mache Sie dar?

-- 
Registered Linux User Number 379093
Now listening to Blank and Jones and Friends (2005 week 34) - guest DJ Jochen 
Miller

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can 
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/

--


pgp7SQZQAeIbT.pgp
Description: PGP signature


Re: [PHP] kein Betreff

2005-08-29 Thread Brian P. O'Donnell
It's bad enough when somebody posts a blank email to the list, but when
people start posting blank replies, it gets really frustrating.

Please cease  desist.

Thanks

Brian

Andy Pieters [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] Easier way to clean GET Variables ?

2005-08-29 Thread Robert Cummings
On Mon, 2005-08-29 at 11:07, Jay Paulson wrote:
  Can anybody point to a good resource of a collection of filtering for
  common inputs such as those listed by Chris above?...
 
  I've searched for that and generally found one of two things:
 
  1. Nothing useful.
  2. A system so baroque and complex and with so much other baggage, it
  would be impossible to integrate.  See 1.
 
  I'm looking more for code snippets or specific Regex functions for
  each item, rather than a monolithic Borg-like filtering package and
  have never one I liked.
 
  That could be mostly my fault due to peculiar requirements, but there
  it is.
 
 I'd like to know this too.  As well as the examples are in this thread 
 I don't think they handled multi dimensional arrays.  It'd be nice if 
 they did. :)

I've adapted my previous solution for multi-dimensional retrieval using
unix directory style path lookup:

function arrayGetValue( $array, $path, $default=null )
{
$subArray = $array;

$bits = explode( '/', $path );

foreach( $bits as $aBit )
{
if( isset( $subArray[$aBit] ) )
{
$subArray = $subArray[$aBit];
}
else
{
unset( $subArray );
$subArray = $default;

break;
}
}

return $subArray;
}

function arrayGetValueProcessed( $array, $path, $process, $default=null
)
{
return $process( arrayGetValue( $array, $path, $default ) );
}

function cleanser( $value )
{
return mysql_real_escape_string( trim( $value ) ) );
}

//
// Example.
//
$title = arrayGetValueProcessed( $games, $userId.'/favourite/rpg' )


Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Automatically generated emails

2005-08-29 Thread Ravi Gogna
This is probably a really simple question, but I can't work out what to 
write! I've written a fairly standard HTML form and I would like an 
email to be generated as soon as the user clicks 'Submit'. Can you help?!


Thanks

Ravi Gogna

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



RE: [PHP] Automatically generated emails

2005-08-29 Thread Jay Blanchard
[snip]
This is probably a really simple question, but I can't work out what to 
write! I've written a fairly standard HTML form and I would like an 
email to be generated as soon as the user clicks 'Submit'. Can you
help?!
[/snip]

Yes.
























I was able to conjure up a whole page of helpfulness!
http://www.php.net/mail

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



Re: [PHP] Protecing files

2005-08-29 Thread Rory Browne
Personally I reckon that you should simply place them outside the webroot.

If you are either too lazy to do this, or too paranoid for this alone,
then you could consider renaming them from filename.xml to
.ht_filename.xml. There is a section in most default apache config
files to make filenames beginning with .ht to be unaccessable.

I would recommend against filtering out .xml files. Whilst they may
only be config files at the minute, you may in future wish to serve up
xml files. I would instead suggest that you change your naming scheme
to have config files ending in .conf, .config, .settings, or .set or
something else non-standard, and fileter out that. A file doesn't have
to be called something.xml to contain xml.

If for example you want to filter out pages ending in .conf, then you
could do something like this(assuming my understanding of apache regex
is correct - big assumption but I'm sure someone will enlighten us if
it's incorrect):
Files ~ .conf$
Order allow,deny
Deny from all
/Files

You could also shove that into a .htaccess file, but apache docs
recommend against it(or rather they recommend against the enabling of
.htaccess.



On 8/29/05, Thomas [EMAIL PROTECTED] wrote:
 
 
 
 Hi there,
 
 How can I protect all files with extension .xml from being accessed by the
 outside? For Apache can one use .htaccess (if yes, how?), is there a generic
 way of keeping stalkers from viewing your config files?
 
 Thomas
 
 
 
 
 
 SPIRAL EYE STUDIOS
 P.O. Box 37907, Faerie Glen, 0043
 
 Tel: +27 12 362 3486
 Fax: +27 12 362 3493
 Mobile: +27 82 442 9228
 Email: [EMAIL PROTECTED]
 Web:  http://www.spiraleye.co.za www.spiraleye.co.za
 
 
 
 


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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Rory Browne
You need to be __W__A__Y__ more specific. 

(the Capital letters and underscores were for added emphasis)

On 8/29/05, Ravi Gogna [EMAIL PROTECTED] wrote:
 This is probably a really simple question, but I can't work out what to
 write! I've written a fairly standard HTML form and I would like an
 email to be generated as soon as the user clicks 'Submit'. Can you help?!
 
 Thanks
 
 Ravi Gogna
 
 --
 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] Automatically generated emails

2005-08-29 Thread John Nichel

Ravi Gogna wrote:
This is probably a really simple question, but I can't work out what to 
write! I've written a fairly standard HTML form and I would like an 
email to be generated as soon as the user clicks 'Submit'. Can you help?!


Yes.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Automatically generated emails

2005-08-29 Thread Jay Blanchard
[snip]
Yes.
[/snip]

Watch out, this'll start a flood of why can't you be nice? e-mail


John, any relatives still in LA?

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



[PHP] Ping : Chris Boget

2005-08-29 Thread John Nichel

How are you weathering the storm?  I hope all is well there.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Ravi Gogna
Nice to know that newbies are well looked after on these lists. If you 
didn't wanna help, you could have not clicked reply


Jay Blanchard wrote:


[snip]
Yes.
[/snip]

Watch out, this'll start a flood of why can't you be nice? e-mail


John, any relatives still in LA?

 



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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Stephen Johnson
Ravi - 

http://www.php.net/mail

That page should get you on your way.



?php
/*

Stephen Johnson c | eh
The Lone Coder

http://www.ouradoptionblog.com
Join our journey of adoption

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

continuing the struggle against bad code

*/ 
?


 From: Ravi Gogna [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Mon, 29 Aug 2005 19:28:58 +0100
 To: Jay Blanchard [EMAIL PROTECTED]
 Cc: John Nichel [EMAIL PROTECTED], php-general@lists.php.net
 Subject: Re: [PHP] Automatically generated emails
 
 Nice to know that newbies are well looked after on these lists. If you
 didn't wanna help, you could have not clicked reply

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Robert Sossomon
Ravi Gogna is quoted as saying on 8/29/2005 1:53 PM:
 This is probably a really simple question, but I can't work out what to
 write! I've written a fairly standard HTML form and I would like an
 email to be generated as soon as the user clicks 'Submit'. Can you help?!

Sure, but what do you want the email to say?  I mean, it could be such that when
 they click submit it sends them a BOGO email where they can get two-fers of
information, but then, why did they click submit in the first place?

The answer is, it is REALLY simple to send email (even more so if the mail
server is set correctly in the ini file and on the same system), but without
more information, can't really help you except to point you to the manual or 
Google.

PHP.net:
http://us2.php.net/mail

Google:
http://www.google.com/search?sourceid=mozclientie=utf-8oe=utf-8q=PHP%3Amail

HTH,
Robert

-- 
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Chirantan Ghosh

Dude,

Im a new guy too..If u don't even provide a code do you THINK we will all 
write  email a code to u?


Chirantan Ghosh

PS: I think a little modesty is in order asking for help. We have the 
neatest, helpful people around here.


- Original Message - 
From: Ravi Gogna [EMAIL PROTECTED]

To: Jay Blanchard [EMAIL PROTECTED]
Cc: John Nichel [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Monday, August 29, 2005 2:28 PM
Subject: Re: [PHP] Automatically generated emails


Nice to know that newbies are well looked after on these lists. If you 
didn't wanna help, you could have not clicked reply


Jay Blanchard wrote:


[snip]
Yes.
[/snip]

Watch out, this'll start a flood of why can't you be nice? e-mail


John, any relatives still in LA?




--
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] Automatically generated emails

2005-08-29 Thread John Nichel

Ravi Gogna wrote:
Nice to know that newbies are well looked after on these lists. If you 
didn't wanna help, you could have not clicked reply

snip

Help != Holding One's Hand

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Automatically generated emails

2005-08-29 Thread Jay Blanchard
[snip]
Nice to know that newbies are well looked after on these lists. If you 
didn't wanna help, you could have not clicked reply
[/snip]

I think, if I recall correctly, that you were provided with the web
address of the manual specifically relating to e-mail. You asked, Can
you help?!. The answer to that is either yes, no, or maybe. I will now
refer you to the following

http://catb.org/~esr/faqs/smart-questions.html

I hope that this helps you. 

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



[PHP] Socket functions

2005-08-29 Thread Philippe Reynolds

Greetings,

When I do an ifconfig in unix, I see the the IP address for the my ethernet. 
 It follows something called inet.


Would anyone know who to manipulate the socket functions to be able to 
extract the inet IP address fromt the eth0 section??


Cheers
Phil

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



[PHP] divide-column?

2005-08-29 Thread Gustav Wiberg

Hi there!

How do I do a sort in PHP where a column in a db must be two other columns 
divided...`?


I tried to use DIV-function in MySQL but it doesn't seem to work ): Of 
course, I can hard-code it, but i want this value because of sorting ten 
largest of the resultvalue. ($gradeJoke). Ten best jokes I want to get and 
ten worst jokes.. .


Some of my code looks like this:

   while ($toarray = mysql_fetch_array($querys)) {

   $IDJoke = $toarray[IDJoke];
   $titleJoke = $toarray[titleJoke];
   $fromJoke = $toarray[fromJoke];
   $nrOfVotes = $toarray[nrOfVotes];
   $totalValueJoke = $toarray[totalValueJoke];
   $gradeJoke = $toarray[gradeJoke];

 if ($totalValueJoke 0 AND $nrOfVotes  0) {

   $gradeJoke = ($totalValueJoke / $nrOfVotes);

   }
  else {

   $gradeJoke = 0;

   }

I want this: $gradeJoke = ($totalValueJoke / $nrOfVotes);

to be integrated in MySQL, is it possible? (I guess it is, but what function 
do i USE?)


/G
@varupiraten.se

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



[PHP] Subscribing with GMail accounts

2005-08-29 Thread Stuart Murray-Smith
Hi list

I've googled... how is it that no PHP list-server email goes to any of
my gmail accounts?

This email is in itself a test ;-) so I might not even get your reply(ies).

TiA

smee

--
/bin/tar --done-dat

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Kristen G. Thorson
LOL.  They could have opened up their browser window and performed the 
following:


http://www.google.com/search?hl=enq=php+send+email+after+form+submitbtnG=Google+Search

But I think they were trying to suggest that you

1. do the same, or
2. ask a more specific question.


kgt



Ravi Gogna wrote:

Nice to know that newbies are well looked after on these lists. If you 
didn't wanna help, you could have not clicked reply


Jay Blanchard wrote:


[snip]
Yes.
[/snip]

Watch out, this'll start a flood of why can't you be nice? e-mail


John, any relatives still in LA?

 





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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Rory Browne
The thing is that we do want to help. We want everyone to have as
positive experience as possible with PHP, and I've personally spent
hours in the past helping people with their various PHP Problems, both
on this list and elsewhere, so you'll understand if I take issue with
your suggestions.

Most of us here on the PHP list, and particularly the majority of
those who have responded to this post are in the habit of bending over
backwards to help people out...

BUT: 

We need something to work with, and you haven't given us much. You
need to give us WAY more information.

What part of generating the email are you having problems with? Are
you for example having problems getting the information from the form,
in your PHP script? Are you having problems getting the mail()
function to work? Are you having problems getting the text into the
format that you want it in?

You've asked a very broad question, and unless you can focus it down a
bit, then all we can do is either ask you for clarification, or direct
you to the PHP manual. In this case, I would direct you to the pages
for predetermined variables(in this case $_GET and $_POST), sprintf,
and mail


www.php.net/manual/en/reserved.variables.php#reserved.variables.get ,
www.php.net/sprintf , and www.php.net/mail

It would take a very long answer, and a waste of ours and the manual
writers time if we simply rewrote what was already in the manual.
Having that said, feel free at any stage to ask us for clarification
of something you don't understand, but we request that you make some
reasonable effort to solve your own problems before jumping to the
list.

On 8/29/05, Ravi Gogna [EMAIL PROTECTED] wrote:
 Nice to know that newbies are well looked after on these lists. If you
 didn't wanna help, you could have not clicked reply
 
 Jay Blanchard wrote:
 
 [snip]
 Yes.
 [/snip]
 
 Watch out, this'll start a flood of why can't you be nice? e-mail
 
 
 John, any relatives still in LA?
 
 
 
 
 --
 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] Subscribing with GMail accounts

2005-08-29 Thread Greg Donald
On 8/29/05, Stuart Murray-Smith [EMAIL PROTECTED] wrote:
 I've googled... how is it that no PHP list-server email goes to any of
 my gmail accounts?
 
 This email is in itself a test ;-) so I might not even get your reply(ies).


Works fine here.


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re: [PHP] AJAX PHP

2005-08-29 Thread Chris Shiflett

Mikey wrote:

ok, so you have html like

img src=/images/graph.php name=img

and you have js like

// some event that triggers the script
document.images['img'].location = /images/updated_graph.php;

And php makes your graph. Using whatever classes you choose.


Another option is to exchange the images (using the JavaScript Mikey 
uses) after PHP has generated the image, so that there is less lag in 
between. Whatever event you use to trigger the exchange can wait on a 
response from a PHP script, and that script can generate the image 
before responding, so that when you exchange images on the client side, 
your server-side activity is already complete.


Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Dan Trainor
Rory Browne wrote:
 The thing is that we do want to help. We want everyone to have as
 positive experience as possible with PHP, and I've personally spent
 hours in the past helping people with their various PHP Problems, both
 on this list and elsewhere, so you'll understand if I take issue with
 your suggestions.
 
 Most of us here on the PHP list, and particularly the majority of
 those who have responded to this post are in the habit of bending over
 backwards to help people out...
 
 BUT: 
 
 We need something to work with, and you haven't given us much. You
 need to give us WAY more information.
 
 What part of generating the email are you having problems with? Are
 you for example having problems getting the information from the form,
 in your PHP script? Are you having problems getting the mail()
 function to work? Are you having problems getting the text into the
 format that you want it in?
 
 You've asked a very broad question, and unless you can focus it down a
 bit, then all we can do is either ask you for clarification, or direct
 you to the PHP manual. In this case, I would direct you to the pages
 for predetermined variables(in this case $_GET and $_POST), sprintf,
 and mail
 
 
 www.php.net/manual/en/reserved.variables.php#reserved.variables.get ,
 www.php.net/sprintf , and www.php.net/mail
 
 It would take a very long answer, and a waste of ours and the manual
 writers time if we simply rewrote what was already in the manual.
 Having that said, feel free at any stage to ask us for clarification
 of something you don't understand, but we request that you make some
 reasonable effort to solve your own problems before jumping to the
 list.
 
 On 8/29/05, Ravi Gogna [EMAIL PROTECTED] wrote:
 
Nice to know that newbies are well looked after on these lists. If you
didn't wanna help, you could have not clicked reply

Jay Blanchard wrote:


[snip]
Yes.
[/snip]

Watch out, this'll start a flood of why can't you be nice? e-mail


John, any relatives still in LA?




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


 
 

While we're on the subject...

Stop top-posting. ;)

Seriously, however - as others have suggested, http://www.php.net/mail
should get you well on your way.  Use the manual as your number one
reference.  If you cannot figure it out using that, then resort to the
list.  You're more than welcome to write to the list at any point in
time, however, if you do a bit of research first, it will save a
considerable amount of time for both you and us.

Hope that helps
-dant

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



[PHP] Re: Automatically generated emails

2005-08-29 Thread Manuel Lemos

Hello,

on 08/29/2005 02:53 PM Ravi Gogna said the following:
This is probably a really simple question, but I can't work out what to 
write! I've written a fairly standard HTML form and I would like an 
email to be generated as soon as the user clicks 'Submit'. Can you help?!


If you want to send HTML mail messages, you need to compose and send a 
multipart/alternative message that contains both an HTML part and an 
alternative plain text part.


If this sounds too complicated for you, you may want to try this class 
that can compose do it without making you learn all RFCs to send 
properly formatted messages. Take a look at the 
test_simple_html_mail_message.php example script.


http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



[PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Dan Trainor
Hello, all -

I was doing some thinking today about the above three subjects.  Now, I
might sound like a complete tool here because I don't think I quite know
exactly in which instances constructors and destructors can be used -
but what about inside a session?

Say I had a visitor hit a site.  A session would start, and the
constructor would preform some housekeeping with the session;  setting
data correctly, gathering other data, executing another PHP function,
yada yada.  Then, when the session expired, Mr. Destructor would come in
and clean up - from within the session.

Is this possible?  Does it work this way?  If so, or if not for that
matter, please help me out here to better understand how these three
elements interact with eachother, if at all.

Also - how would one go about handling sessions behind a load-balancing
configuration?  The best I've thought of is to use some sort of load
balancer which also has an NFS share.  Sessions are created with this
load balancer, and Apache or whatever proxy's the connection to the
machines behind the load balancer.  The machines behind the load
balancer map the NFS share from the load balancer, and are able to
interact with the session.  I'm very curious as to how session tracking
is done through multiple machines, as well.

As always, thanks again for your time.
-dant

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



Re: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Jasper Bryant-Greene

Dan Trainor wrote:

I was doing some thinking today about the above three subjects.  Now, I
might sound like a complete tool here because I don't think I quite know
exactly in which instances constructors and destructors can be used -
but what about inside a session?

Say I had a visitor hit a site.  A session would start, and the
constructor would preform some housekeeping with the session;  setting
data correctly, gathering other data, executing another PHP function,
yada yada.  Then, when the session expired, Mr. Destructor would come in
and clean up - from within the session.

Is this possible?  Does it work this way?  If so, or if not for that
matter, please help me out here to better understand how these three
elements interact with eachother, if at all.


I think that (in PHP5 -- PHP4 doesn't have real destructors) you could 
put an object inside the $_SESSION variable and it would be serialized 
in the session (as long as you had the class definition available when 
it was unserialized, i.e. before session_start() is called).


However it's really being constructed and destructed with each request. 
You could do some __sleep and __wakeup magic, possibly [1].



Also - how would one go about handling sessions behind a load-balancing
configuration?  The best I've thought of is to use some sort of load
balancer which also has an NFS share.  Sessions are created with this
load balancer, and Apache or whatever proxy's the connection to the
machines behind the load balancer.  The machines behind the load
balancer map the NFS share from the load balancer, and are able to
interact with the session.  I'm very curious as to how session tracking
is done through multiple machines, as well.


The best thing to do in this situation is to write your own 
session_save_handler that uses a database, and point it at the MySQL 
server [2]. If you really had to, you could maybe put the 
session_save_path on the NFS share [3].


Both the MySQL server and NFS share would be shared by multiple Apache 
machines (although the MySQL server may actually be a cluster if 
you're doing master-slave replication, that doesn't really matter in 
this case -- just send the writes to the master and the reads to any old 
slave), and so the session would be shared across all the machines, 
regardless of whether they get a different Apache every request.


[1] http://www.php.net/manual/en/language.oop5.magic.php
[2] http://www.php.net/session_set_save_handler
[3] http://www.php.net/session_save_path

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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



RE: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Nathan Tobik
Does your load balancer support sticky sessions?  What this means is a
client will make a request and the request will be sent through a load
balancer.  That LB will remember the client and always point the
client's requests to the same webserver.  This way you don't have to
write your own session handler like someone else suggested.  I know the
F5 load balancers are able to support sticky sessions, I don't know if
what you're using is able, but it might be worth an hour or two to look
into it.

Nate Tobik
(412)661-5700 x206
VigilantMinds

snip?

Also - how would one go about handling sessions behind a load-balancing
configuration?  The best I've thought of is to use some sort of load
balancer which also has an NFS share.  Sessions are created with this
load balancer, and Apache or whatever proxy's the connection to the
machines behind the load balancer.  The machines behind the load
balancer map the NFS share from the load balancer, and are able to
interact with the session.  I'm very curious as to how session tracking
is done through multiple machines, as well.

/snip

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



Re: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Dan Trainor
Nathan Tobik wrote:
 Does your load balancer support sticky sessions?  What this means is a
 client will make a request and the request will be sent through a load
 balancer.  That LB will remember the client and always point the
 client's requests to the same webserver.  This way you don't have to
 write your own session handler like someone else suggested.  I know the
 F5 load balancers are able to support sticky sessions, I don't know if
 what you're using is able, but it might be worth an hour or two to look
 into it.
 
 Nate Tobik
 (412)661-5700 x206
 VigilantMinds
 
 snip?
 
 Also - how would one go about handling sessions behind a load-balancing
 configuration?  The best I've thought of is to use some sort of load
 balancer which also has an NFS share.  Sessions are created with this
 load balancer, and Apache or whatever proxy's the connection to the
 machines behind the load balancer.  The machines behind the load
 balancer map the NFS share from the load balancer, and are able to
 interact with the session.  I'm very curious as to how session tracking
 is done through multiple machines, as well.
 
 /snip
 

Thanks for the reply, Nathan -

Are there any such interfaces that are software-based?  I think that
Jasper's suggestion would be the most feasable, but I'd still like to
know my options.

In my mind, hardware immediately equates to $$$, whereas software
immediately does not.

Thanks
-dant

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



Re: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Dan Trainor
Thanks for replying, Jasper -

snip

 Is this possible?  Does it work this way?  If so, or if not for that
 matter, please help me out here to better understand how these three
 elements interact with eachother, if at all.

Ah yes, me being quite new didn't take into consideration in which
versions constructors and destructors were available.  Thank you.


 I think that (in PHP5 -- PHP4 doesn't have real destructors) you could
 put an object inside the $_SESSION variable and it would be serialized
 in the session (as long as you had the class definition available when
 it was unserialized, i.e. before session_start() is called).
 

snip

 The best thing to do in this situation is to write your own
 session_save_handler that uses a database, and point it at the MySQL
 server [2]. If you really had to, you could maybe put the
 session_save_path on the NFS share [3].

I think that'sm y winner, and the best suggestion yet.  I will consider
my options.

Thanks
-dant

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



RE: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Nathan Tobik
I've never looked into some of the open-source load balancing solutions,
but I know they exist are are out there.  The F5's I mentioned are
probably around $20k each, and you need two obviously, so if you're on a
limited budget those are not the solution for you.  I'd google for open
source load balancer.  I know OpenBSD has some failover capacity through
something called CARP, but I'm not sure how that would work with your
solution.

Nate Tobik
(412)661-5700 x206
VigilantMinds

. 

Thanks for the reply, Nathan -

Are there any such interfaces that are software-based?  I think that
Jasper's suggestion would be the most feasable, but I'd still like to
know my options.

In my mind, hardware immediately equates to $$$, whereas software
immediately does not.

Thanks
-dant

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

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



Re: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Dan Trainor
Nathan Tobik wrote:
 I've never looked into some of the open-source load balancing solutions,
 but I know they exist are are out there.  The F5's I mentioned are
 probably around $20k each, and you need two obviously, so if you're on a
 limited budget those are not the solution for you.  I'd google for open
 source load balancer.  I know OpenBSD has some failover capacity through
 something called CARP, but I'm not sure how that would work with your
 solution.
 
 Nate Tobik
 (412)661-5700 x206
 VigilantMinds
 
 . 
 
 Thanks for the reply, Nathan -
 
 Are there any such interfaces that are software-based?  I think that
 Jasper's suggestion would be the most feasable, but I'd still like to
 know my options.
 
 In my mind, hardware immediately equates to $$$, whereas software
 immediately does not.
 
 Thanks
 -dant
 

Nathan -

Sure, I know of some load balancing software, but I do not know of any
that support sticky sessions out of the box.

BTW, how are these sessions passed?  Is this a client-server approach,
where the LB accepts the session data and uses a proxy to forward them
to the load balanced machine, or does the load balancer do it's thing at
perhaps Layer 2, and completely forwards the connection to the LB'd server?

Thanks!
-dant

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



[PHP] User redirection, passing HTTP AUTH credentials

2005-08-29 Thread Dan Trainor
Hello once more, all -

I was wondering if it's at all possible to redirect a user to a remote
site, while passing HTTP AUTH credentials somehow.

I've been tinkering around with making a secure login gateway, and the
first server that they log in to would negotiate the login sequence, but
the system would have to preserve HTTP USER and HTTP PASSWD to be passed
to the remote site, as to be backwards compatible with existing HTTP
AUTH-based systems.

I'd rather not use http://user:[EMAIL PROTECTED], however.  There's got to
be a different way.  I understand that the user's browser is the actual
element in which the username and password are stored for HTTP auth.  Is
there a way to inject or update this information without any
interaction from the visitor him/herself?

Thanks again!
-dant

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



[PHP] Problem With Inner Loop

2005-08-29 Thread Shaun
Hi,

The following code is attempting to display a list of work types for all the 
users in my database. However it only loops through the inner loop once and 
I can't work out why, can anyone help here please?

Thanks for your help

table
?php
include('application.php');
$staff_qid = mysql_query('SELECT
  U.User_ID,
  CONCAT_WS( , U.user_Firstname, U.User_Lastname) AS User_Name
  FROM Users U, Allocations A, Projects P
  WHERE U.User_ID = A.User_ID
  AND A.Project_ID = P.Project_ID
  AND P.Project_ID = 38
  AND (U.User_Type = Staff
   OR U.User_Type = Manager
   OR U.User_Type = Administrator)
  ORDER By User_Name');
$work_type_qid = mysql_query('SELECT
   Work_Type_ID,
   Work_Type
   FROM Work_Types
   WHERE Project_ID = 38
   ORDER BY Day_Type');
?
table
?php while( $staff_r = mysql_fetch_object( $staff_qid ) ) { ?
 tr
 ?php while( $work_type_r = mysql_fetch_object( $work_type_qid ) ) { ?
  td?php echo $work_type_r-Work_Type; ?/td
 ?php } ?
 /tr
?php } ?
/table

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



Re: [PHP] User redirection, passing HTTP AUTH credentials

2005-08-29 Thread Jasper Bryant-Greene

Dan Trainor wrote:

Hello once more, all -

I was wondering if it's at all possible to redirect a user to a remote
site, while passing HTTP AUTH credentials somehow.



Yes, but...



I'd rather not use http://user:[EMAIL PROTECTED], however.  There's got to
be a different way.  I understand that the user's browser is the actual
element in which the username and password are stored for HTTP auth.  Is
there a way to inject or update this information without any
interaction from the visitor him/herself?


That is the only way to do it. Not only that, but I don't think it works 
on IE6 with Windows XP SP2 (I think, from memory, that they disabled 
passing username and password in the URL for security reasons. Not sure, 
though, as I haven't used Windows for a long time).


I would suggest setting a cookie with the other website's domain for 
them to look at (will the browsers let you do that? never tried), or 
implementing something in the backend, like an XMLRPC request 
behind-the-scenes that identifies the user and gives them a unique ID, 
which you could then pass to site.com in the query string.


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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] Problem With Inner Loop

2005-08-29 Thread Jasper Bryant-Greene

Shaun wrote:

Hi,

The following code is attempting to display a list of work types for all the 
users in my database. However it only loops through the inner loop once and 
I can't work out why, can anyone help here please?


table
?php
include('application.php');
$staff_qid = mysql_query('SELECT
  U.User_ID,
  CONCAT_WS( , U.user_Firstname, U.User_Lastname) AS User_Name
  FROM Users U, Allocations A, Projects P
  WHERE U.User_ID = A.User_ID
  AND A.Project_ID = P.Project_ID
  AND P.Project_ID = 38
  AND (U.User_Type = Staff
   OR U.User_Type = Manager
   OR U.User_Type = Administrator)
  ORDER By User_Name');
$work_type_qid = mysql_query('SELECT
   Work_Type_ID,
   Work_Type
   FROM Work_Types
   WHERE Project_ID = 38
   ORDER BY Day_Type');
?
table
?php while( $staff_r = mysql_fetch_object( $staff_qid ) ) { ?
 tr
 ?php while( $work_type_r = mysql_fetch_object( $work_type_qid ) ) { ?
  td?php echo $work_type_r-Work_Type; ?/td
 ?php } ?
 /tr
?php } ?
/table



Well, if Project_ID is a primary key or unique key of some sort, as I 
would assume it was if it's an ID, then the $work_type_qid query will 
only return one row.


And because the query is performed outside the outer while loop, it will 
only execute once, at the start of the request. If you want the same 
SELECT query to be executed over and over (why?) then you would need to 
move the mysql_query() inside the outer while loop.


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

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Evert | Rooftop
Or you can save the the session in the database [ works good for me ] 
Sharing the cookie is easy when you have multiple boxes on the same tld 
[ or FQDN ]


Evert

Dan Trainor wrote:


Nathan Tobik wrote:
 


I've never looked into some of the open-source load balancing solutions,
but I know they exist are are out there.  The F5's I mentioned are
probably around $20k each, and you need two obviously, so if you're on a
limited budget those are not the solution for you.  I'd google for open
source load balancer.  I know OpenBSD has some failover capacity through
something called CARP, but I'm not sure how that would work with your
solution.

Nate Tobik
(412)661-5700 x206
VigilantMinds

. 


Thanks for the reply, Nathan -

Are there any such interfaces that are software-based?  I think that
Jasper's suggestion would be the most feasable, but I'd still like to
know my options.

In my mind, hardware immediately equates to $$$, whereas software
immediately does not.

Thanks
-dant

   



Nathan -

Sure, I know of some load balancing software, but I do not know of any
that support sticky sessions out of the box.

BTW, how are these sessions passed?  Is this a client-server approach,
where the LB accepts the session data and uses a proxy to forward them
to the load balanced machine, or does the load balancer do it's thing at
perhaps Layer 2, and completely forwards the connection to the LB'd server?

Thanks!
-dant

 



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



Re: [PHP] Issue with generating asx playlist with php

2005-08-29 Thread Dan Rossi
Thanks andy, I'll give this a shot however I am already doing this in 
the constructor of my class. However its just after calling the 
constructor of the base class. What I have noticed is really freaky. 
The plugin is loading my php script 4 times when loading to play a 
file, for the 3 times the session variable is there, then on the 4th 
time a new session is created but the session variable is empty :|


On 30/08/2005, at 2:43 AM, Andy Pieters wrote:


On Monday 29 August 2005 16:09, Dan Rossi wrote:

? I logged two different sess id's being created.


Hi

I have seen this behaviour as well, although in another context.  The 
solution

was to have the session_start instruction be one of the very first.

In fact, in my software, the session_start is the second instruction 
on ALL

pages.

?php

require_once 'globals.inc.php';

/* rest of script*/
?

And globals.inc.php is like

?php
session_start();

define(yadaydayda
?

Hope this helps



With kind regards



Andy


--
Registered Linux User Number 379093
Now listening to Blank and Jones and Friends (2005 week 34) - guest DJ 
Jochen

Miller

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:

 http://www.vlaamse-kern.com/sas/

--


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



RE: [PHP] Sessions, Constructors, and Destructors - Oh my!

2005-08-29 Thread Dean Maunder
 
I had the same issue not so long ago, the solution we ended up going
with was Pound for the load balancer and stock Apache webservers. Pound
supports sticky sessions which you can configure the timeout for, and
also can proxy https-http.  We also wrote our own session handlers to
allow session vars to be saved to a database.  This configuration has
been working for us over a year now.  If you need any more info, let me
know.

D.



-Original Message-
/snip

--
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] Issue with generating asx playlist with php

2005-08-29 Thread Dan Rossi
Just an update i've changed to use non cookie based sessions using 
pear's HTTP_Session so sending it in the filename string which loads in 
the query string of the php script within the plugin's file source. 
However the session isnt expiring now lol.


On 30/08/2005, at 10:32 AM, Dan Rossi wrote:

Thanks andy, I'll give this a shot however I am already doing this in 
the constructor of my class. However its just after calling the 
constructor of the base class. What I have noticed is really freaky. 
The plugin is loading my php script 4 times when loading to play a 
file, for the 3 times the session variable is there, then on the 4th 
time a new session is created but the session variable is empty :|


On 30/08/2005, at 2:43 AM, Andy Pieters wrote:


On Monday 29 August 2005 16:09, Dan Rossi wrote:

? I logged two different sess id's being created.


Hi

I have seen this behaviour as well, although in another context.  The 
solution

was to have the session_start instruction be one of the very first.

In fact, in my software, the session_start is the second instruction 
on ALL

pages.

?php

require_once 'globals.inc.php';

/* rest of script*/
?

And globals.inc.php is like

?php
session_start();

define(yadaydayda
?

Hope this helps



With kind regards



Andy


--
Registered Linux User Number 379093
Now listening to Blank and Jones and Friends (2005 week 34) - guest 
DJ Jochen

Miller

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) 
G(+)

e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a
 php cli binary:

 http://www.vlaamse-kern.com/sas/

--


--
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] Protecing files

2005-08-29 Thread Thomas
Hey guys,

Thanks for all the answers. I had not considered leaving the xml file
outside the webroot (duh!). However, in this case I don't think it would
work, as the project is working through a svn structure (and some boxes run
Linux, otherwise Win).
I thought that the .htaccess would have been the best (apparently not?).
Anyway, I will give the filtering out of the .whatever a shot.

One thing on that: how about portability? What if I didn't have access to
the httpd.conf file of Apache on the live server? How will I enable such
rules (without having to bother the server dude, who may or may not like to
do that)? From that question, .htaccess files seemm the most portable
solution.

Thanks again.

t

-Original Message-
From: Rory Browne [mailto:[EMAIL PROTECTED] 
Sent: 29 August 2005 07:59 PM
To: Thomas
Cc: php-general@lists.php.net
Subject: Re: [PHP] Protecing files

Personally I reckon that you should simply place them outside the webroot.

If you are either too lazy to do this, or too paranoid for this alone,
then you could consider renaming them from filename.xml to
.ht_filename.xml. There is a section in most default apache config
files to make filenames beginning with .ht to be unaccessable.

I would recommend against filtering out .xml files. Whilst they may
only be config files at the minute, you may in future wish to serve up
xml files. I would instead suggest that you change your naming scheme
to have config files ending in .conf, .config, .settings, or .set or
something else non-standard, and fileter out that. A file doesn't have
to be called something.xml to contain xml.

If for example you want to filter out pages ending in .conf, then you
could do something like this(assuming my understanding of apache regex
is correct - big assumption but I'm sure someone will enlighten us if
it's incorrect):
Files ~ .conf$
Order allow,deny
Deny from all
/Files

You could also shove that into a .htaccess file, but apache docs
recommend against it(or rather they recommend against the enabling of
.htaccess.



On 8/29/05, Thomas [EMAIL PROTECTED] wrote:
 
 
 
 Hi there,
 
 How can I protect all files with extension .xml from being accessed by the
 outside? For Apache can one use .htaccess (if yes, how?), is there a
generic
 way of keeping stalkers from viewing your config files?
 
 Thomas
 
 
 
 
 
 SPIRAL EYE STUDIOS
 P.O. Box 37907, Faerie Glen, 0043
 
 Tel: +27 12 362 3486
 Fax: +27 12 362 3493
 Mobile: +27 82 442 9228
 Email: [EMAIL PROTECTED]
 Web:  http://www.spiraleye.co.za www.spiraleye.co.za
 
 
 
 


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



Re: [PHP] Protecing files

2005-08-29 Thread Jasper Bryant-Greene

Thomas wrote:

Thanks for all the answers. I had not considered leaving the xml file
outside the webroot (duh!). However, in this case I don't think it would
work, as the project is working through a svn structure (and some boxes run
Linux, otherwise Win).
I thought that the .htaccess would have been the best (apparently not?).
Anyway, I will give the filtering out of the .whatever a shot.

One thing on that: how about portability? What if I didn't have access to
the httpd.conf file of Apache on the live server? How will I enable such
rules (without having to bother the server dude, who may or may not like to
do that)? From that question, .htaccess files seemm the most portable
solution.


Please don't top-post. For one application I develop, I have the whole 
thing in an SVN tree like so:


[root]
  |
  |--- includes/
  |
  |--- htdocs/

Anything that doesn't need to be requested directly goes in includes/ 
and its subdirectories, and everything else goes in htdocs/ and accesses 
stuff in includes/ when it needs to.


Apache is configured to serve from htdocs/, obviously.

There's no reason why this can't be done with any SVN setup, even in 
most shared hosting environments, although YMMV.


Jasper

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