Re: [PHP] restricting access to folders on server

2008-03-24 Thread n3or

Sudhakar schrieb:

i am using apache server and presently when i try accessing any folders of
my website i am able to browse the files ex = www.website.com/images which
is a serious security risk as i am building a forum website using php and
mysql.

in the root directory i have created a .htaccess file and whenever someone
access a file which is not on the server i have created a user friendly
message that the file does not exist instead of a 404 error message
displayed by the browser.

similar to this how can i go about restricting users to browse all my
folders in the toot directory. if anyone accesses for ex =
www.website.com/phpscripts an alert should appear asking them to enter a
username and password.

1. how can i do this using apache.
2. where do i write the username and password information and will this
apply to all the folders in the root directory or specific directories.

please advice.

thanks.

  

Hey,
I think that should be the right Thing for you: 
http://httpd.apache.org/docs/2.0/howto/auth.html


Have a nice Day
n3or

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



Re: [PHP] Why PHP4?

2008-07-28 Thread n3or

Compatibility to older Software of the hosters and sloth of the developers

Richard Heyes schrieb:

I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.

--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



Re: [PHP] anyone have HTML snippet example of HTTP method = put?

2008-08-02 Thread n3or

enctype="multipart/form-data" eventually?!

mike schrieb:

I have this:


 File: 
 


Looking in my webserver logs, it changes that to a GET.

Ideas anyone? The receiver is PHP and I am pretty sure I know how to
handle it once it is properly PUT-ted.

(I run nginx for the server and have enabled PUT as a method, supposedly)

Maybe I need to do something different on the web form though?

thanks!

  


--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



[PHP] Google Chrome

2008-09-03 Thread n3or

Shawn McKenzie schrieb:


Per Jessen wrote:

Stut wrote:


On 2 Sep 2008, at 20:23, Diogo Neves wrote:

Now is the time ;)

Indeed: http://www.google.com/chrome

But only for Windows for now :(



I guess we'll have to wait a little longer then ...


/Per Jessen, Zürich


Will somebody volunteer to test on Wine or Mono?

-Shawn



Hi,
I tried Wine with the chrome.exe of the 7-Zip packet/Google directory, 
but it failed both. The setup.exe failed too. But it was only a short test.


Error: fixme:ntdll:NtSetInformationProcess 
(0x,0x0022,0x33fbd0,0x0004) stub


--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]




--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



Re: [PHP] Altering the error_reporting

2008-09-03 Thread n3or

[EMAIL PROTECTED] schrieb:

I am looking for a way to alter the error_reporting(E_All)
 This displays 
Parse error: parse error, unexpected '}' in /var/www/html/test.php on line 7


I want to remove the file location and line number from the error
to only produce
Parse error: parse error, unexpected '}'

Why? You may ask.

I am writting a code tester in php but i do not want to display the "in" portion. 
This will make you find the error on your own. As a learning tool.


Understand I have error reporting off in the php.ini file and call the errors 
in the php script with ini_set('display_errors', 1);.

I am sure this is doable I just cant figure out how to do this without altering 
the php.ini file.

  

Hi,
you could define your own error handler: 
http://www.php.net/manual/en/function.set-error-handler.php


--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



Re: [PHP] Altering the error_reporting

2008-09-03 Thread n3or

Diogo Neves schrieb:

On Wed, Sep 3, 2008 at 6:55 PM, n3or <[EMAIL PROTECTED]> wrote:

  

[EMAIL PROTECTED] schrieb:



I am looking for a way to alter the error_reporting(E_All)
 This displays Parse error: parse error, unexpected '}' in
/var/www/html/test.php on line 7

I want to remove the file location and line number from the error
to only produce
Parse error: parse error, unexpected '}'

Why? You may ask.

I am writting a code tester in php but i do not want to display the "in"
portion. This will make you find the error on your own. As a learning tool.

Understand I have error reporting off in the php.ini file and call the
errors in the php script with ini_set('display_errors', 1);.

I am sure this is doable I just cant figure out how to do this without
altering the php.ini file.



  

Hi,
you could define your own error handler:
http://www.php.net/manual/en/function.set-error-handler.php




Parse Error on a error handler? it's possible?

  

Damn, I slept. Ignore my answer. Sorry!

--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]



Re: [PHP] Adding encryption to passwords

2008-09-19 Thread n3or
I use SHA-256 (use hash - php.net/manual/en/function.hash.php), because 
its a little bit more secure then md5 or SHA-1.


BTW: Don't forget the salts..

--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



Re: [PHP] Singletons

2008-10-20 Thread n3or

Christoph Boget schrieb:

Apart from making the constructor
private, is there any way I can ensure that there is ever only one
instance of an object?

you could use the magic method __clone.

For example:
public function __clone() { trigger_error('The singleton pattern avoids 
cloning this instance', E_USER_ERROR); }


--
Viele Gruessee
Hi,
Dominik Strauss - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


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



Re: [PHP] Singletons

2008-10-20 Thread n3or

Christoph Boget schrieb:

Apart from making the constructor
private, is there any way I can ensure that there is ever only one
instance of an object?
  

you could use the magic method __clone.
For example:
public function __clone() { trigger_error('The singleton pattern avoids
cloning this instance', E_USER_ERROR); }



Adding the above to my sample class (from my OP) did nothing.  Should it have?

thnx,
Christoph

  

Hi,
it avoids cloning of the object:
$newObject = clone $oldObject;

--
Viele Gruessee

Dominik Strauss - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]