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:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
On Monday 23 February 2004 00:55, [EMAIL PROTECTED] 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
*/
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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>";
?>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Hello!
I am new both to PHP and web dev, and I am wondering what ftp software
would be best for me to use.
--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello!
>
> I am new both to PHP and web dev, and I am wondering what ftp software
> would be best for me to use.
--- End Message ---
--- Begin Message ---
www.smartftp.com
-----Original Message-----
From: Nathan McIntyre [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 8:37 AM
To: [EMAIL PROTECTED]
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
--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > 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
>
>
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: electroteque [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 12:19 AM
To: [EMAIL PROTECTED]
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
[EMAIL PROTECTED]
http://adam.bregenzer.net/
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
yeah so i'm running 4.3.0 (other versions are problematic w/Abyss
(Bwebserver)
(B
(Bi can't seem to get my include() stuff to work -anymore-
(B
(Bused to work...not anymore after all the PHP changes
(B
(Bso my root directory for the webserver is F:\webpage\webpage\
(Bwhich would be http://localhost/
(B
(Bi have 3 files
(Bf:\webpage\webpage\new_album.php
(Bf:\webpage\webpage_admin\prvMySQL.php
(Bf:\webpage\webpage\includes\prvBodyStyling.php
(B
(Balbum.php has the lines:
(B
(Binclude('./includes/prvBodyStyling.php');
(Binclude('../webpage_admin/prvMySQL.php');
(B
(Ba quick note: prvBodyStyling.php contains the function intro()
(B
(Bi am sure prvbodystyling and prvmysql have 0 errors in them, as I have
(Bused them before w/o any modifications...it's like the change in version
(Bof PHP created this problem...i dunno...
(B
(Banyways, i get the error:
(B
(BWarning: main(./includes/prvBodyStyling.php) [function.main]: failed to
(Bcreate stream: No error in F:\webpage\webpage\new_album.php on line 2
(B
(BWarning: main() [function.main]: Failed opening
(B'./includes/prvBodyStyling.php' for inclusion
(B(include_path='.;c:\php\includes') in F:\webpage\webpage\new_album.php on
(Bline 2
(B
(BWarning: session_start() [function.session-start]: Cannot send session
(Bcache limiter - headers already sent (output started at
(BF:\webpage\webpage\new_album.php:2) in F:\webpage\webpage\new_album.php on
(Bline 5
(B
(BFatal error: Call to undefined function: intro() in
(BF:\webpage\webpage\new_album.php on line 12
(B
(Bplease give me some feedback!
(B
(B--
(B\Kyle Goetz
(BBS Pure Mathemetics, BA Japanese 2006
(BThe University of Texas
(B
(BUsing M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
[EMAIL PROTECTED]
http://coeusgroup.com/en
--- End Message ---