php-windows Digest 15 Dec 2004 15:07:36 -0000 Issue 2507
Topics (messages 25158 through 25161):
Re: [PHP-DEV] im convert php-screw to windows dll
25158 by: Andrew van Dyk
25159 by: Christian Schneider
Re: Substr function
25160 by: S.D.Price
Re: Session_start() not working
25161 by: Jason Barnett
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 ---
Hi,
Sorry... PHP Screw is a module to encrypt your PHP files so you
don't distribute the source code. It works perfectly in UNIX, but
im trying to convert it to windows. My conversion compiles etc
fine, but it doesn't overwrite the zend_fopen function, so I havn't
been able to get it to work properly yet..
http://freshmeat.net/projects/phpscrew/
----- Original Message -----
From: "Wez Furlong" <[EMAIL PROTECTED]>
To: "Andrew" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 17:18 PM
Subject: Re: [PHP-DEV] im convert php-screw to windows dll
> What is PHP Screw ?
> What are you trying to do?
> Let's have more detail and more incentive to actually download and
> look through the zip file.
>
> --Wez.
>
> On Mon, 13 Dec 2004 15:06:23 +0200, Andrew <[EMAIL PROTECTED]> wrote:
> > Hi..
> >
> > I'm trying to get PHP Screw working on Windows thru Visual C++ compiling
> > it as a windows DLL, everything works except it doesn't actually replace
the
> > fopen function, it seems to ignore that command. I would really like to
get
> > this working, I have a project that you can look at if you are
interested:
> >
> > http://koula.co.za/screwdll.zip
> >
> > I am creating files in c:/ to check if a function runs, and only the
> > pm9screw_open
> > doesn't run, when replacing zend_open with it
> >
> > Thanks if you can help
> >
> > Regards
> > Andrew
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--- End Message ---
--- Begin Message ---
Andrew Van Dyk wrote:
Sorry... PHP Screw is a module to encrypt your PHP files so you
don't distribute the source code. It works perfectly in UNIX, but
Just a quick note for people considering using PHP Screw: It is
absolutely trivial to decrypt such a file as the encryption algorithm is
datap[i] = (char)pm9screw_mycryptkey[(datalen - i) % cryptkey_len] ^
(~(datap[i]));
See <http://www.schneier.com/crypto-gram-9902.html#snakeoil> for an
essay by Bruce Schneier of what he thinks of home-grown crypto :-)
Regards,
- Chris
--- End Message ---
--- Begin Message ---
Thanks for this George. I found a way to grab the file size of the
document and enter it in the DB as either KB or MB
$documentsize = $_FILES['thefile']['size'];
// if document size is less than 1MB round up
number to nearest KB
if ($documentsize <= 1048576) {
$documentsize = $documentsize / 1024;
$documentsize = round($documentsize);
$documentsize .= "KB";
}
// if document size is greater than 1MB round
up number to MB with 2 decimals
else {
$documentsize = $documentsize / 1048576;
$documentsize = round($documentsize, 2);
$documentsize .= "MB";
}
This might be useful for someone if they want to show the link to an
uploaded document with file size information displayed.
Steven
-----Original Message-----
From: George Pitcher [mailto:[EMAIL PROTECTED]
Sent: 14 December 2004 13:50
To: S.D.Price
Subject: RE: [PHP-WIN] Substr function
Steven,
You need to start by checking what might be passed. I assume that you
going to work on 'name'. What will that be and will it always be
consistent? Will all files have three character extensions (mine
don't!)? If these are consistent, then you can use
substr($name,0,strlen($name)-4) to provide the name element and
substr($name,strlen($name)-3),3) to provide the extension, but i think
that explode() is better.
$name = "filename.pdf";
$split = explode(".",$name);
$fname = $split[0];
$extn = $split[1];
That might help you.
Cheers
George
> -----Original Message-----
> From: S.D.Price [mailto:[EMAIL PROTECTED]
> Sent: 14 December 2004 1:41 pm
> To: php windows
> Subject: [PHP-WIN] Substr function
>
>
>
>
> Hi can anyone explain to me how to manipluate strings. I have
> generated a file name
>
> ($_FILES['documenturl']['name'])
>
> Out of this server variable I need to grab the file and the extension
> and put them into seperate fields for database upload. Any idea how to
> do this by using substr?
>
> Thanks
> Steven
>
>
>
>
>
>
>
>
--- End Message ---
--- Begin Message ---
S.D.Price wrote:
Hi can anyone help me, I have moved my application from a Unix server to
a Windows based server but suddenly I don't seem able to use sessions I
get
Warning: session_start() [function.session-start
<http://www.php.net/function.session-start> ]:
open(C:\PHP\sessiondata\sess_60e5549c6f6404994f9a7ae55f0db968, O_RDWR)
Search the archives of this list for O_RDWR, this has been answered
before.
failed: Permission denied (13)
Can anyone tell me which setting I need to change in the script/php.ini
file or directory to allow sessions to run.
Thanks
Steven Price
--- End Message ---