OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 23 Feb 2004 05:09:19 -0000 Issue 2606

php-general-digest-helplists.php.net
Date: Sun Feb 22 2004 - 23:09:19 CST


php-general Digest 23 Feb 2004 05:09:19 -0000 Issue 2606

Topics (messages 178493 through 178510):

[SQLite] safe_mode_gid or safe_mode_exec_dir
        178493 by: user.domain.invalid

Re: Safe Mode
        178494 by: Jason Wong
        178495 by: user.domain.invalid

type casting problem
        178496 by: Armand Turpel

Detecting Binaries
        178497 by: Axel IS Main

Local define?
        178498 by: Robin 'Sparky' Kopetzky
        178500 by: Marek Kilimajer

ftp software
        178499 by: Nathan McIntyre
        178501 by: Pooya Eslami
        178502 by: electroteque
        178507 by: Shane Nelson

Re: Slightly off - was [PHP] ftp software
        178503 by: electroteque

Padding the decimals
        178504 by: Simon Fredriksson
        178505 by: Adam Bregenzer
        178508 by: John Nichel

include(...) errors
        178506 by: Kyle Goetz

Possible to write CRC/MD5 to the file?
        178509 by: Simon Fredriksson
        178510 by: Evan Nemerson

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


I want to be able to use SQLlite on my hosted (virtual) site.
SQlite will be placed in my /home/www/bin.
And need to be exicutable by Apache user or group?

Would either safe_mode_gid or safe_mode_exec_dir accomplish this?

TIA,
David

attached mail follows:


On Monday 23 February 2004 00:55, userdomain.invalid wrote:
> >>> Can safe mode be turned off in the .htaccess file?

[snip]

> According the safe-mode page http://us4.php.net/features.safe-mode in
> http.conf :
> <Directory /docroot>
> php_admin_value open_basedir /docroot
> # In your case safe_mode_include_dir
> </Directory>
>
> Can "php_admin_value" be inlcuding in the *.php pages and/or .htaccess.

manual > ini_set()

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

attached mail follows:


>>According the safe-mode page http://us4.php.net/features.safe-mode in
>>http.conf :
>><Directory /docroot>
>> php_admin_value open_basedir /docroot
>># In your case safe_mode_include_dir
>></Directory>
>>
>>Can "php_admin_value" be inlcuding in the *.php pages and/or .htaccess.
>
>
> manual > ini_set()
>
It would seem form the ini_set() comments that the answer to both is yet:

---------
There is another possibility by changing PHP Settings!

If your Webspace is able to handle ".htaccess" files, you're able to
change PHP_INI Settings through this file!

To disable register_globals you have to set:
php_value register_globals 0

If you wanna set other settings, feel free, because there is no problem!

These Settings are set before running the script, e.g. the results of
register_globals, when setting a parameter in the URL like
'foo.php?foo=stuff', is not present, $foo is unset.
----

If itīs not your server and therefore you want to hide the data in your
session variables from other users, itīs very useful to set the
session.save_handler in your scripts to shared memory with:

"ini_set('session.save_handler','mm')".

Remember: You have to set it in every script that uses the session
variables BEFORE "session_start()" or php wonīt find them.

David

attached mail follows:


Hi,
Is it possible that some functions in different php versions (4.1 .....
4.1.2 ....) has problems with type castings so that the following script has
different results in different php versions?

<?php

if(FALSE === is_file('aaaaa'))
    echo "is_file === no file<br><br>";

if(FALSE == is_file('aaaaa'))
    echo "is_file == no file<br><br>";

if(FALSE === file_exists('aaaaa'))
    echo "file_exists === no file<br><br>";

if(FALSE == file_exists('aaaaa'))
    echo "file_exists == no file<br><br>";

if(FALSE === is_dir('aaaaa'))
    echo "is_dir === no dir<br><br>";

if(FALSE == is_dir('aaaaa'))
    echo "is_dir == no dir<br><br>";

?>

attached mail follows:


I'm using file_get_contents() to open URLs. Does anyone know if there is
a way to look at the result and determine if the file is binary? I'd
like to be able to block binaries from being processed without having to
try to think of all the possible binary extensions and omit them with a
function that looks for these extensions.

Nick

attached mail follows:


Greetings!!

        If you define a constant within a function, is it local or global?

        Example:

        function foo()
        {
                define('BAR', 0);
        }
                
Robin Kopetzky
Black Mesa Computers/Internet Services, LLC

attached mail follows:


1. Don't hijack threads. Always start with new message if you want to
ask a question, do not reply to an existing message.

2. Do some research before posting, you already wrote almost the whole
example, so run it an see for yourself.

Robin 'Sparky' Kopetzky wrote:
> Greetings!!
>
> If you define a constant within a function, is it local or global?
>
> Example:
>
> function foo()
> {
> define('BAR', 0);
> }
>
> Robin Kopetzky
> Black Mesa Computers/Internet Services, LLC
>

attached mail follows:


Hello!

I am new both to PHP and web dev, and I am wondering what ftp software
would be best for me to use.

attached mail follows:


WS FTP is not bad.you cand download the LE version for free here: (the last
one at the end of the page!)
http://www.ipswitch.com/downloads/index.html

-Pooya

"Nathan McIntyre" <nathancorwin.ws> wrote in message
news:40392102.5090707corwin.ws...
> Hello!
>
> I am new both to PHP and web dev, and I am wondering what ftp software
> would be best for me to use.

attached mail follows:


www.smartftp.com

-----Original Message-----
From: Nathan McIntyre [mailto:nathancorwin.ws]
Sent: Monday, February 23, 2004 8:37 AM
To: php-generallists.php.net
Subject: [PHP] ftp software

Hello!

I am new both to PHP and web dev, and I am wondering what ftp software
would be best for me to use.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004

attached mail follows:


I would highly recomend filezilla:

http://filezilla.sourceforge.net/

It's open source, it works great and it doesn't have any ads or spyware like
some of the other 'free' windows ftp programs.

>
> "Nathan McIntyre" <nathancorwin.ws> wrote in message
> news:40392102.5090707corwin.ws...
> > Hello!
> >
> > I am new both to PHP and web dev, and I am wondering what ftp software
> > would be best for me to use.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


-----Original Message-----
From: electroteque [mailto:danielelectroteque.org]
Sent: Monday, February 23, 2004 12:19 AM
To: php-generallists.php.net
Subject: RE: [PHP] ftp software

www.smartftp.com

Isnt it funny i assumed you were using windoze ? Unfortunately i had to port
back to my XP machine which i use for audio stuff, X Windows gave me the
shits bad, fair enough it was a 500 celeron but still i am using a dual 533
celeron on windows no problem ?? I couldnt find a proper IDE and i ended up
having to use an ftp program that never stored the information and kedit
which wasnt the best really for development, and the machine after a while
(running Knoppix) starting slowing down to a grinding halt. Now i'm working
on my windows machine with Zend IDE and wincvs to my Sun box currently
running Solaris, but soon maybe Debian if i can work out how to boot the cd.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004

attached mail follows:


Is there any functions to pad the decimals in a number? There's round()
to put it down to two decimals, but what if I want to take it up to two?

Example:

5 -> 5.00
20 -> 20.00
4.3 -> 4.30
etc.

//Simon

attached mail follows:


On Sun, 2004-02-22 at 21:14, Simon Fredriksson wrote:
> Is there any functions to pad the decimals in a number? There's round()
> to put it down to two decimals, but what if I want to take it up to two?
>
> Example:
>
> 5 -> 5.00
> 20 -> 20.00
> 4.3 -> 4.30
> etc.

I assume you mean adding zeros to the end for displaying, not for
further calculation? Look at printf[1] and sprintf[2]. Here's an
example:
printf("%.3f", 4.1) // 4.100

[1] http://www.php.net/printf
[2] http://www.php.net/sprintf

--
Adam Bregenzer
adambregenzer.net
http://adam.bregenzer.net/

attached mail follows:


Simon Fredriksson wrote:
>
> Is there any functions to pad the decimals in a number? There's round()
> to put it down to two decimals, but what if I want to take it up to two?
>
> Example:
>
> 5 -> 5.00
> 20 -> 20.00
> 4.3 -> 4.30
> etc.
>
> //Simon
>

http://www.php.net/manual/en/function.sprintf.php
http://www.php.net/manual/en/function.number-format.php

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


yeah so i'm running 4.3.0 (other versions are problematic w/Abyss
webserver)

i can't seem to get my include() stuff to work -anymore-

used to work...not anymore after all the PHP changes

so my root directory for the webserver is F:\webpage\webpage\
which would be http://localhost/

i have 3 files
f:\webpage\webpage\new_album.php
f:\webpage\webpage_admin\prvMySQL.php
f:\webpage\webpage\includes\prvBodyStyling.php

album.php has the lines:

include('./includes/prvBodyStyling.php');
include('../webpage_admin/prvMySQL.php');

a quick note: prvBodyStyling.php contains the function intro()

i am sure prvbodystyling and prvmysql have 0 errors in them, as I have
used them before w/o any modifications...it's like the change in version
of PHP created this problem...i dunno...

anyways, i get the error:

Warning: main(./includes/prvBodyStyling.php) [function.main]: failed to
create stream: No error in F:\webpage\webpage\new_album.php on line 2

Warning: main() [function.main]: Failed opening
'./includes/prvBodyStyling.php' for inclusion
(include_path='.;c:\php\includes') in F:\webpage\webpage\new_album.php on
line 2

Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at
F:\webpage\webpage\new_album.php:2) in F:\webpage\webpage\new_album.php on
line 5

Fatal error: Call to undefined function: intro() in
F:\webpage\webpage\new_album.php on line 12

please give me some feedback!

--
\Kyle Goetz
BS Pure Mathemetics, BA Japanese 2006
The University of Texas

Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

attached mail follows:


I wonder if it's possible to write the MD5 or CRC checksum of my
scriptfile to the scriptfile. I know that if I change it, the value will
change, but is there any way to calculate what it will be?

Not just displaying it for the user, but actually having it written in
the file. Could be pretty usefull when distributing scripts. No worries
about losing the md5-file or sfv, etc.

Just some thoughts.

//Simon

attached mail follows:


On Sunday 22 February 2004 08:20 pm, Simon Fredriksson wrote:
> I wonder if it's possible to write the MD5 or CRC checksum of my
> scriptfile to the scriptfile. I know that if I change it, the value will
> change, but is there any way to calculate what it will be?

What you would have to do is find a collision, which is thankfully difficult
to do- if it were easy, MD5 would be useless. Theoretically, you could modify
say John The Ripper and have it brute force something, but you may end up
waiting a few lifetimes :)
>
> Not just displaying it for the user, but actually having it written in
> the file. Could be pretty usefull when distributing scripts. No worries
> about losing the md5-file or sfv, etc.

I'd recommend PGP/GPG signing instead- anyone can create a valid MD5 checksum,
but only you can cryptographically sign your files (theoretically- if someone
else can, you've got serious problems)

Everyone seems happy enough with detached signatures. Also, you could use the
OpenPGP specification to do what you want, just like when you send a
PGP-signed e-mail the signature and the message are all in a single
container. You may have to hack GPG a bit (not as difficult as you'd think)
to have the PGP stuff in PHP comments, but i think you could do it... Sorry,
I'm rambling.
>
> Just some thoughts.
>
> //Simon

--
Evan Nemerson
evancoeus-group.com
http://coeusgroup.com/en