|
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 5 Feb 2004 15:28:53 -0000 Issue 2572
php-general-digest-help
lists.php.net
Date: Thu Feb 05 2004 - 09:28:53 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 5 Feb 2004 15:28:53 -0000 Issue 2572
Topics (messages 176858 through 176894):
Re: Why my $SERVER_NAME variable is not working anymore?
176858 by: John Nichel
176859 by: John Nichel
176860 by: Gabriel Schillaci
176861 by: John Nichel
176864 by: John Nichel
multi dimension array sort help
176862 by: Justin French
176863 by: Martin Towell
176882 by: Ford, Mike [LSS]
176890 by: Matthew Vos
recursive direcotry listing
176865 by: Binay
176868 by: Ben Ramsey
MySQL: Order by
176866 by: John Taylor-Johnston
176867 by: Ben Ramsey
176878 by: Angelo Zanetti
strange problem with post method
176869 by: Giuliano Ippoliti
176872 by: Jason Wong
176874 by: Giuliano Ippoliti
Re: [SOLVED] Extract of a Paragraph
176870 by: Daniel Perez Clavero
Global.asa
176871 by: Sheni R. Meledath
Re: Using sessions with register globals off
176873 by: Phillip Jackson
Turck MMcache installtion
176875 by: Binay
176877 by: Jason Wong
Re: Recommendation on PHP encoder please
176876 by: Harry Sufehmi
176879 by: Harry Sufehmi
176880 by: Ford, Mike [LSS]
176881 by: Andrei Reinus
176884 by: Harry Sufehmi
176885 by: Harry Sufehmi
176886 by: Ford, Mike [LSS]
Re: class variables problem / array_push bug
176883 by: Vivian Steller
Sort multidimensional array - ARGH!
176887 by: Kim Steinhaug
176888 by: Kim Steinhaug
176889 by: Tom Rogers
Re: __call() implementation
176891 by: Vivian Steller
176892 by: John W. Holmes
Re: Anyone have any ideas on a upload progress bar???
176893 by: Doru Petrescu
Dynamic vs Static Builds
176894 by: John McKerrell
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Gabriel Schillaci wrote:
> Hi.
> This is a stupid question, I know.
> I'm using my old set of routines well documented and bullet proof.
> They were working just fine on Win and Linux systems, regardless of
> webserver of php version, UNTIL php 4.3.x - IIS over Win destroyed my life.
>
> Is there something I can do on php.ini file or whatever to fool PHP to keep
> recognizing the old-style posted and server variables??
>
> Yes, I know that is risky to keep working that way, but the projects I made
> were so small that its not worth to change all the code just to improve
> security!
>
> Any help will be welcome.
>
> Thanks
> Gabriel
>
> PS: I always compared PHP to IBM AS/400 RPG language, bc they share an
> incredible ROI, but now....
>
Try $_SERVER['SERVER_NAME']
http://us2.php.net/manual/en/language.variables.predefined.php
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
John Nichel wrote:
> Gabriel Schillaci wrote:
>
>> Hi.
>> This is a stupid question, I know.
>> I'm using my old set of routines well documented and bullet proof.
>> They were working just fine on Win and Linux systems, regardless of
>> webserver of php version, UNTIL php 4.3.x - IIS over Win destroyed my
>> life.
>>
>> Is there something I can do on php.ini file or whatever to fool PHP to
>> keep
>> recognizing the old-style posted and server variables??
>>
>> Yes, I know that is risky to keep working that way, but the projects I
>> made
>> were so small that its not worth to change all the code just to improve
>> security!
>>
>> Any help will be welcome.
>>
>> Thanks
>> Gabriel
>>
>> PS: I always compared PHP to IBM AS/400 RPG language, bc they share an
>> incredible ROI, but now....
>>
>
> Try $_SERVER['SERVER_NAME']
>
> http://us2.php.net/manual/en/language.variables.predefined.php
>
But if you don't want to change all of your code, and open a security
hole, you can turn 'register_globals' on in the php.ini
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
Thanks John for your quick answer.
What I'm looking for is for a miraculous way to convert or adapt my existing
code.
I already detected where are each one of my lost variables. I just want to
know if the only way I have is to manually replace every old variable by the
new one.
Hope not.
Gabriel
----- Original Message -----
From: "John Nichel" <jnichel
by-tor.com>
To: "Gabriel Schillaci" <gabriel
schillaci.com>
Cc: <php-general
lists.php.net>
Sent: Thursday, February 05, 2004 12:55 AM
Subject: Re: [PHP] Why my $SERVER_NAME variable is not working anymore?
> Gabriel Schillaci wrote:
>
> > Hi.
> > This is a stupid question, I know.
> > I'm using my old set of routines well documented and bullet proof.
> > They were working just fine on Win and Linux systems, regardless of
> > webserver of php version, UNTIL php 4.3.x - IIS over Win destroyed my
life.
> >
> > Is there something I can do on php.ini file or whatever to fool PHP to
keep
> > recognizing the old-style posted and server variables??
> >
> > Yes, I know that is risky to keep working that way, but the projects I
made
> > were so small that its not worth to change all the code just to improve
> > security!
> >
> > Any help will be welcome.
> >
> > Thanks
> > Gabriel
> >
> > PS: I always compared PHP to IBM AS/400 RPG language, bc they share an
> > incredible ROI, but now....
> >
>
> Try $_SERVER['SERVER_NAME']
>
> http://us2.php.net/manual/en/language.variables.predefined.php
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Gabriel Schillaci wrote:
> Thanks John for your quick answer.
>
> What I'm looking for is for a miraculous way to convert or adapt my existing
> code.
> I already detected where are each one of my lost variables. I just want to
> know if the only way I have is to manually replace every old variable by the
> new one.
>
> Hope not.
>
> Gabriel
You can turn 'register_globals' on in the php.ini, but it would be
better to leave it off, and change your code.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
Gabriel Schillaci wrote:
> It is already set to ON, but still getting the same message, and other
> messages such as:
> Notice: Undefined variable xxx
>
> This is another kind of error I started to receive since we moved from
> Linux/php 4.2.x to Win/php 4.3.x
>
> Until 4.2.x, this code was good for php parser:
>
> if ($a=='something')
> ...
>
> But now, php 4.3.x says that $a is undefined, and is forcing me to
> declare/make use of a variable before I can mention it.
>
> $a='';
> if ($a=='something')
Please reply to the list, and not just me. That way, when someone else
who has this problem will be able to search it in the archives.
Okay, this is the error reporting level. In the php.ini you can set
'error_reporting' to E_ALL & ~E_NOTICE to get rid of the warnings, or
you can turn 'display_errors' to Off (restart of web server needed for
the changes to take effect). Of course, it's still better to write your
code to where you don't get these warnnings.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
attached mail follows:
Hi,
I've read and re-read array_multisort(), but still can't get a grip on
how to sort my array:
Array
(
[0] => Array
(
[path_id] => 3
[year] => 2004
[month] => 02
[day] => 05
[hits] => 3
[path] => home
)
[1] => Array
(
[path_id] => 2
[year] => 2004
[month] => 02
[day] => 05
[hits] => 1
[path] => plan
)
[2] => Array
(
[path_id] => 7
[year] => 2004
[month] => 02
[day] => 05
[hits] => 1
[path] => specials
)
)
In this case, I'd like to sort the entire array on [path]. Can anyone
provide some tips or an example to start from?
Justin French
attached mail follows:
would usort() be better for this?
Martin
> -----Original Message-----
> From: Justin French [mailto:justin
indent.com.au]
> Sent: Thursday, 5 February 2004 3:33 PM
> To: php
> Subject: [PHP] multi dimension array sort help
>
>
> Hi,
>
> I've read and re-read array_multisort(), but still can't get
> a grip on
> how to sort my array:
>
> Array
> (
> [0] => Array
> (
> [path_id] => 3
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 3
> [path] => home
> )
>
> [1] => Array
> (
> [path_id] => 2
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => plan
> )
>
> [2] => Array
> (
> [path_id] => 7
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => specials
> )
>
> )
>
>
> In this case, I'd like to sort the entire array on [path].
> Can anyone
> provide some tips or an example to start from?
>
> Justin French
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On 05 February 2004 04:33, Justin French wrote:
> Hi,
>
> I've read and re-read array_multisort(), but still can't get a grip on
> how to sort my array:
>
> Array
> (
> [0] => Array
> (
> [path_id] => 3
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 3
> [path] => home
> )
... etc.
I'm pretty sure this is one where multisort() is not the best approach, and usort() (or one of its friends) is where to look.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Assuming your array is called $array1:
$paths = array();
foreach ($array1 as $data_ptr => $data)
{
if (!in_array($data['path'],$paths) $paths[] = $data;
}
sort($paths)
foreach($paths as $path_to_check)
{
foreach($array1 as $data_ptr => $data)
{
if ($data['path'] == $path_to_check)
{
/** Do your stuff here **/
}
}
}
It's a little cumbersome and probably has way too many loops, but
processor time is cheap and memory is even cheaper. I've found PHP's
array parsing to be fairly quick.
Alternatively, use the path as the index for your array; i.e:
$array1 = array("path" => array("path_id" => 3,
"year" => 2004,
"month" => "02",
"day" => "05",
"hits" => 3);
When you're parsing your log (which is what I'm assuming you're doing),
you would populate $array1 as follows:
$array1 = array();
while (parsing())
{
$array1[$path]['path_id'] = $path_id;
$array1[$path]['year'] = $year;
/** etc... **/
}
$paths = array_keys($array1);
sort($paths);
foreach($paths as $path_to_check)
{
/** Do stuff with $array1[$path_to_check] **/
}
Matt
Array
> (
> [0] => Array
> (
> [path_id] => 3
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 3
> [path] => home
> )
>
> [1] => Array
> (
> [path_id] => 2
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => plan
> )
>
> [2] => Array
> (
> [path_id] => 7
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => specials
> )
>
> )
>
On Wed, 2004-02-04 at 23:33, Justin French wrote:
> Hi,
>
> I've read and re-read array_multisort(), but still can't get a grip on
> how to sort my array:
>
> Array
> (
> [0] => Array
> (
> [path_id] => 3
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 3
> [path] => home
> )
>
> [1] => Array
> (
> [path_id] => 2
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => plan
> )
>
> [2] => Array
> (
> [path_id] => 7
> [year] => 2004
> [month] => 02
> [day] => 05
> [hits] => 1
> [path] => specials
> )
>
> )
>
>
> In this case, I'd like to sort the entire array on [path]. Can anyone
> provide some tips or an example to start from?
>
> Justin French
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBAIk0wH+kNu8/qKOwRAgrZAJ4/VeNHAP97d5F0oqGepCdz0rRWHACfbi7u
U8gdtusnmpYqI1I9IX0Keew
Vc
-----END PGP SIGNATURE-----
attached mail follows:
Hi all,
is there function which scans a particual directory recurisly and stores the content in array or other way? Listing of files should be in alphabetical way and directories should come on top.
Thanks
Binay
attached mail follows:
I don't know if there's a built-in function, but I had written this
function, which does what you're trying to do, I think. You can modify
it to store the values in an array, if you like. I just have it echoing
the files (with their full paths).
Here's the function:
function readDir ($dirPath)
{
if (is_dir($dirPath)) {
$fstream = opendir($dirPath);
while ($fentry = readdir($fstream)) {
if (is_dir("$dirPath/$fentry") && ($fentry != ".") &&
($fentry != "..")) {
echo "$dirPath/$fentry";
readDir("$dirPath/$fentry");
} elseif (is_file("$dirPath/$fentry")) {
echo "$dirPath/$fentry";
}
}
closedir($fstream);
return true;
} else {
return false;
}
}
Hope this helps!
-Ben
Binay wrote:
> Hi all,
>
> is there function which scans a particual directory recurisly and stores the content in array or other way? Listing of files should be in alphabetical way and directories should come on top.
>
> Thanks
>
> Binay
>
attached mail follows:
This is probably a MySQL question, and maybe an easy question, but I'm here to learn <|:)
When I order by number, it echoes 1,2,3,4,5,6,7,8,9,10 and hten jumps to 100...199 before it comes back to 11-19. Any way of ordering that differently?
$sql = 'SELECT * FROM '.$table.' ORDER BY number desc;';
attached mail follows:
I assume "number" is a column name in your table. If so, I'm also
guessing that it's probably of a varchar (or some other character type)
datatype. Here's why: if it's a character, then ORDER BY will sort
alphabetically. The way it sorts number alphabetically is rather odd,
but it makes sense in an alphabetical way.
If it is character data, then it should order like this:
1
10
11
12
13
2
3
4
...
To correct it, put a zero at the beginning of your single digits:
01
02
03
...
10
11
12
That will order it correctly. Otherwise, change the number column to
type int, and it should work just fine.
Hope that answers your question, and, yes, this is more of a MySQL
question. ;-)
-Ben
John Taylor-Johnston wrote:
> This is probably a MySQL question, and maybe an easy question, but I'm here to learn <|:)
>
> When I order by number, it echoes 1,2,3,4,5,6,7,8,9,10 and hten jumps to 100...199 before it comes back to 11-19. Any way of ordering that differently?
>
> $sql = 'SELECT * FROM '.$table.' ORDER BY number desc;';
attached mail follows:
make your column of type int column
-----Original Message-----
From: Ben Ramsey [mailto:br
benandliz.com]
Sent: Thursday, February 05, 2004 7:52 AM
To: php-general
lists.php.net; jt.johnston
USherbrooke.ca
Subject: [PHP] Re: MySQL: Order by
I assume "number" is a column name in your table. If so, I'm also
guessing that it's probably of a varchar (or some other character type)
datatype. Here's why: if it's a character, then ORDER BY will sort
alphabetically. The way it sorts number alphabetically is rather odd,
but it makes sense in an alphabetical way.
If it is character data, then it should order like this:
1
10
11
12
13
2
3
4
..
To correct it, put a zero at the beginning of your single digits:
01
02
03
..
10
11
12
That will order it correctly. Otherwise, change the number column to
type int, and it should work just fine.
Hope that answers your question, and, yes, this is more of a MySQL
question. ;-)
-Ben
John Taylor-Johnston wrote:
> This is probably a MySQL question, and maybe an easy question, but I'm
here to learn <|:)
>
> When I order by number, it echoes 1,2,3,4,5,6,7,8,9,10 and hten jumps to
100...199 before it comes back to 11-19. Any way of ordering that
differently?
>
> $sql = 'SELECT * FROM '.$table.' ORDER BY number desc;';
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
attached mail follows:
Hi list!
Yesterday I've installed PHP 4.3.4 and Apache 1.3.29
on my Linux Mandrake 9.1 machine with a standard
procedure:
1. cd apache_1.3.29
2. ./configure
3. cd ../php-4.3.4
4. ./configure --with-apache=../apache_1.3.29
--enable-track-vars && make && make install
5. cd ../apache_1.3.29
6. ./configure
--activate-module=src/modules/php4/libphp4.a
7. make && make install
8. cd ../php-4.3.4
9. cp php.ini-dist /usr/local/lib/php.ini
10. In httpd.conf file: "AddType
application/x-httpd-php .php"
I've encounterd a problem with this snippet of code,
where I fill a form and I pass the data to a php page
that should visualize it. Here is the code:
//Login.php
<html>
<head>
<title>TEST</title>
</head>
<form method="post" action="second.php">
<br><br><br>
NAME : <input type="text" name="ident">
<br>
PASSWORD :<input type="password" name="psw">
<br>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
//second.php
<?php
echo "NAME = $ident <br> PASSWORD = $psw";
?>
When I execute this code in my web page
http://members.lycos.co.uk/ippo80/Login.php, or in
another Apache server with PHP-4.2.3 not installed by
me, the name and password are correctly visualized
once I click the submit button:
NAME = myname
PASSWORD = mypassword
, but on my recently installed server I obtain
NAME =
PASSWORD =
indicating that variable values are not transmitted.
Have you any idea about the reason of this behaviour?
Thank you very much for the attention,
Giuliano
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
attached mail follows:
On Thursday 05 February 2004 16:41, Giuliano Ippoliti wrote:
[snip]
> 9. cp php.ini-dist /usr/local/lib/php.ini
Read the comments at the top of the file 'php.ini-recommended'. It is the same
directory as the file 'php.ini-dist'.
--
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
------------------------------------------
/*
The probability of a drink getting spilled into a console is directly
propotional to the cost of the console
-- Murphy's Laws of Broadcast Engineering n8
*/
attached mail follows:
--- Jason Wong <php-general
gremlins.biz> wrote:
> On Thursday 05 February 2004 16:41, Giuliano
> Ippoliti wrote:
>
> [snip]
>
> > 9. cp php.ini-dist /usr/local/lib/php.ini
>
> Read the comments at the top of the file
> 'php.ini-recommended'. It is the same
> directory as the file 'php.ini-dist'.
>
Thank you very much Jason: the problem was originated
by "register_globals = Off". I turned it into On and
now it works. However in the future I'll use
$_POST("...") to pass variables.
Thank you very much again,
Giuliano
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
attached mail follows:
Oops, I forget to consider, what would happened with HTML tags. Thank you
Justin. Finally I did a function similar to yours, but the addition of the
TAG control is almost perfect solution. (To trunk a word of two or three
words, does not worth. No need such complicated script (with dictionary) for
that)
Cheers!
-----Original Message-----
From: Justin French [mailto:justin
indent.com.au]
Sent: jueves, 05 de febrero de 2004 0:59
To: Brian Paulson
Cc: daniel.perez
atosorigin.com; php-general
lists.php.net
Subject: Re: [PHP] Extract of a Paragraph
On Thursday, February 5, 2004, at 02:35 AM, Brian Paulson wrote:
> $string = substr($stringname,0,50);
>
> echo $string;
>
> http://www.php.net/substr
No, that's 50 *characters* -- he wanted 50 *words*. A quick and
reasonably accurate[1] solution would be this:
Daniel,
There's a few things you need to look out for. If there's tags (like
<b> or <a>) in the text, and you chop the text inside an open tag, it
will break your pages, cause them to be invalid, and make them look
really strange. So the first thing you want to do with the text is
strip the tags.
I'd say the next issue is to only append the 'read more' link if the
article is great than the teaser limit -- that way 'read more' only
appears when it's correct.
You should wrap it in a function so that you only ever write this code
once too.
Here's a stripped-down version of what I use:
<?
function chopper($input,$wordcount,$append='')
{
$input = trim(strip_tags($input));
$words = explode(' ',$input);
$output = '';
for($i=0; $i<=$wordcount; $i++)
{
$output .= $words[$i].' ';
}
trim($output);
if( ($i == $wordcount) && (!empty($append)) )
{
$output .= $append;
}
return $output;
}
echo chopper($myText,50,"... <a href='foo'>read more</a>");
?>
[1]: It's reasonably accurate in that it breaks words on spaces, then
glues them back together up to the limit. However, there are some
words which you may consider to have a space in them, but still be
considered one word. A perfect example would be "Leonardo da Vinci"
which the above function will see as 3 words, and you may consider it
to be 2.
Justin French
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello:
Is there anything similar to 'global.asa' which is used in ASP applications
in PHP. Can anybody provide me with some details.
Sheni R Meledath
sheni
cyber-gear.com
attached mail follows:
PHP Manual:
If register_globals is enabled, then each global variable can be registered
as session variable. Upon a restart of a session, these variables will be
restored to corresponding global variables. Since PHP must know which global
variables are registered as session variables, users need to register
variables with session_register() function. You can avoid this by simply
setting entries in $_SESSION.
just set the superglobal to the desired value. to remove when you're through
you can use session_unregister('foo') or unset($_SESSION['foo']). do not
unset $_SESSION itself!!!
$_SESSION['foo'] = "bar";
~pj
> I've looked through the docs and past posts but I'm still a bit confused.
> How do I translate the following into code that can be used with
> register_globals set off.
>
> Assuming there's a preceding page that has created the session 'name' and
> registered the var 'order' with the 'name' session.
>
>
> session_name('name');
> session_register('order');
>
>
> --
> Randall Perry
> sysTame
>
> Xserve Web Hosting/Co-location
> Website Development/Promotion
> Mac Consulting/Sales
>
> http://www.systame.com/
attached mail follows:
Hi all,
I m using Turck MMcache for php source encoding. Now the server where i will deploy those file need to have turck loader installed on it. And the procedure given in the site requires compiling the source and then including the TurckLoader.so extension in php.ini file .
Now is it possible not to compile the turck source on client's server and simply include the extension TurckLoader.so(which i'll provide them) in php.ini i.e bypassing the compile face.
Please let me know .. as this is very urgent and client is not a techy person.
Thanks
Binay
attached mail follows:
On Thursday 05 February 2004 19:00, Binay wrote:
> I m using Turck MMcache for php source encoding. Now the server where i
> will deploy those file need to have turck loader installed on it. And the
> procedure given in the site requires compiling the source and then
> including the TurckLoader.so extension in php.ini file .
>
> Now is it possible not to compile the turck source on client's server and
> simply include the extension TurckLoader.so(which i'll provide them) in
> php.ini i.e bypassing the compile face.
It ought to be possible providing that you compile the extension on a server
that is similar to the client's. Similar, meaning the same versions of
support libraries, apache, php etc etc.
--
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
------------------------------------------
/*
I find you lack of faith in the forth dithturbing.
- Darse ("Darth") Vader
*/
attached mail follows:
Hi Larry, many thanks for the recommendation. That will be just perfect.
I've informed my manager about it, and I imagine he'd be happy for the fact that we'll be saving quite a lot of money as well.
Also thanks for the other recommendations - but unfortunately, we need Solaris compatibility now.
Thanks again!
Harry
On 04/02/2004 at 09:39 Larry Brown wrote:
>Check out ioncube.com. I use them and it was very easy to install and run.
>The best thing about it is that a problem with apache or apache
>configuration won't end up displaying the script contents by accident.
>(mysql log/pass info etc) It can be used to encode .inc files as well.
>Their site states compatability with Solaris.
>
>Have fun.
>
>Larry
>
>-----Original Message-----
>From: Harry Sufehmi [mailto:milis-2
harrysufehmi.com]
>Sent: Wednesday, February 04, 2004 9:11 AM
>To: php-general
lists.php.net
>Subject: [PHP] Recommendation on PHP encoder please
>
>
>Hi, my company's looking to buy a PHP encoder to secure the source code.
>The encoded scripts should be able to run on Solaris platform (Apache
>webserver), and should only require minimum changes to the server.
>
>I looked on Zend Encoder and was ready to suggest it when I realise that the
>US$ 960 tag is only for a year's license. And I don't think we have the
>budget to buy the perpetual license.
>
>Could anyone recommend other PHP encoder for us?
>
>
>Many thanks,
>Harry
--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya
v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com
attached mail follows:
On 04/02/2004 at 09:35 Chris W wrote:
>>Hi, my company's looking to buy a PHP encoder to secure the source code.
>>The encoded scripts should be able to run on Solaris platform (Apache
>webserver), and should only require minimum changes to the server.
>>
>I'm sorry I can't help you but I am curious as to what the point of this
>is. If you are running your php scripts on your servers, who are you
>trying to prevent from seeing your code? It doesn't get sent to the
>client, only the output of the script gets sent. So what is the point?
We have a server that need to be as secure as possible, since it's containing some very sensitive personal data.
We have hardened the box, setup very restrictive firewall rules to it, keeping up to date with the security patches, and so on. But just in case that a cracker still manage to break in, we'd like to make it a real hassle for him/her to read the content in the server.
So I was tasked to create a PHP application which will enable the following scenario:
# Webteam will still create contents in Dreamweaver
# Once done, upload the contents to the server using the upload script.
# The upload script will put and encrypt the contents in the server using the strongest encryption available
# Users will access the content using the second script, which will decrypt the content on-the-fly; so the URL will be something like this:
https://www.mydomain.com/view.php?file=/mydata/index.html
As you can see, the content will be secured, but the script is now becoming the weak point since it'll store the encryption key needed to decrypt the content.
So double-encoding it (using a PHP encoder) will make life finally very hard for said cracker.
by the way, if anyone's interested on such application, I'm planning to release it as an open-source application, so you'll be able to utilise it as well.
cheers, HS
--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya
v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com
attached mail follows:
On 05 February 2004 11:30, Harry Sufehmi wrote:
<...SNIP...>
> As you can see, the content will be secured, but the script
> is now becoming the weak point since it'll store the
> encryption key needed to decrypt the content.
I hope you don't mean that literally. If you're really being security conscious, the encryption keys should be in an include file that lives *outside* the Web document tree. If your include path is given relative to the including script, a hacker also has to know the local pathname to the script in order to deduce the location of the included file containing the keys.
On my site, the *only* PHP scripts visible to the Web server look like this:
<?php
ini_set('include_path', '../../relative/path/to/includes/');
require 'real_script.php';
?>
... and the only reason that the include_path is set there and not in php.ini or equivalent is that I'm not the admin of the server and don't have access to configuration files!
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
> So double-encoding it (using a PHP encoder) will make life finally very hard for said cracker.
No its not ...
if I would badly need to get this encrypted page and have access to
files ...
attached mail follows:
On 05/02/2004 at 11:48 Ford, Mike [LSS] wrote:
>On 05 February 2004 11:30, Harry Sufehmi wrote:
>> As you can see, the content will be secured, but the script
>> is now becoming the weak point since it'll store the
>> encryption key needed to decrypt the content.
>
>I hope you don't mean that literally. If you're really being security
>conscious, the encryption keys should be in an include file that lives
>*outside* the Web document tree.
Of course we'll do it like that.
And anyway I was talking about if the cracker has actually gained (root) access to that server itself - which makes putting the keys outside the web directory irrelevant.
cheers, HS
--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya
v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com
attached mail follows:
On 05/02/2004 at 14:07 Andrei Reinus wrote:
>> So double-encoding it (using a PHP encoder) will make life finally very
>hard for said cracker.
>
>No its not ...
>if I would badly need to get this encrypted page and have access to files ...
So there's a reasonably easy way to decrypt those encoded files then ? (despite those vendors' claim...)
cheers, HS
--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya
v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com
attached mail follows:
On 05 February 2004 13:10, Harry Sufehmi wrote:
> On 05/02/2004 at 11:48 Ford, Mike [LSS] wrote:
> > On 05 February 2004 11:30, Harry Sufehmi wrote:
> > > As you can see, the content will be secured, but the script
> > > is now becoming the weak point since it'll store the
> > > encryption key needed to decrypt the content.
> >
> > I hope you don't mean that literally. If you're really being
> > security conscious, the encryption keys should be in an include
> > file that lives *outside* the Web document tree.
>
> Of course we'll do it like that.
> And anyway I was talking about if the cracker has actually
> gained (root) access to that server itself - which makes
> putting the keys outside the web directory irrelevant.
OK, good -- I kind of assumed so, given your other precautions, but just
thought I'd clarify for any novices coming upon this thread in the
archives... ;)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
hi at all,
i've a very strange problem but i don't know if this a real bug or only my
imcompetence?!
it is a problem with class variables set by __constructor() function in
PHP5...
look at this code:
<?
class MyClass extends DomNode { // remove "extends DomNode" and
everything is fine
private $__arr = Array();
public function __construct() {
//$this->__arr = Array(); // uncomment this line for testing
$this->__setVar("value set inside constructor");
}
public function __setVar($classname) {
print("\n\nexecuting __setVar()\n");
print("trying to push \"" . $classname . "\" into \$this->__arr
with array_push\n");
// array_push only works in several cases...
array_push($this->__arr, $classname);
// comment following line for testing
//$this->__arr[] = $classname;
/*
foreach($this->__arr as $parentClassname) {
print($parentClassname . "\n");
}
*/
}
}
print("<pre>");
$node = new MyClass();
print_r($node);
$node->__setVar("value set outside object method");
print_r($node);
print("</pre>");
?>
output:
*******************************************
executing __setVar()
trying to push "value set inside constructor" into $this->__arr with
array_push
MyClass Object
(
[__arr:private] => Array
(
)
)
executing __setVar()
trying to push "value set outside object method" into $this->__arr with
array_push
MyClass Object
(
[__arr:private] => Array
(
[0] => value set outside object method
)
)
*******************************************
ok, in my opinion the Array $this->_arr should have a value "value set
inside constructor" after creating the object set by array_push (see output
line 2)!
But there are several cases in which this bug does not appear:
- remove "extends DomNode" from code and it works fine
...but what does DomNode with my __construct() function?!
- uncomment line 6 and it will work
...don't ask me why it works now?!
- uncomment line 19 and it will work
...seens that array_push does not work correctly.
by the way i'm using PHP5 cvs-version from 2004-05-02 10:30...
maybe you could help me out of this dilemma..
another question for the php experts: is this information enough for sending
a bug to php.bugs?
thanks for your attention.
bye
vivi
attached mail follows:
I have been messing around now for some hours and Im going mad!
Im pulling some heavy data from mySQL with count and grouping,
after this I have to calculate som values and then sort the outcome.
Therefore Im not able to let mySQL do the accuall sort.
So i stuff it into an array, and I need to sort the array and thats where
the problem occures.
1. I declare an array :
$stats_unsorted = array();
for loop start ...
1. fetch mySQL data
2. calculate values
array_push($stats_unsorted,$sum,$user);
// Eks. array_push($stats_unsorted,10,Ola);
// Eks. array_push($stats_unsorted,-5,Kaare);
// Eks. array_push($stats_unsorted,203,Nils);
// Eks. array_push($stats_unsorted,-20,Lars);
for loop end ...
We now have, e.g. this :
Array
(
[0] => Array
(
[0] => 10
[1] => Ola
)
[1] => Array
(
[0] => -5
[1] => Kaare
)
[2] => Array
(
[0] => 203
[1] => Nils
)
[3] => Array
(
[0] => -20
[1] => Tone
)
)
- - - - - - - - - - - - - - - - - - - -
Then comes the sorting part, I want to sort by this :
$stats_unsorted[x][0]
meaning the numbers, ofcourse I would surely like to know
how to sort by the names aswell, $stats_unsorted[x][1],
but I would think that is easy if I could figure out the
main command to sort this in the first place.
Ive tried several times with array_multisort(); but I cant get this
to work, :(
Help would be appretiated!
$stats_SORTED = ???;
Thanks in advance!
--
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------
attached mail follows:
OK, typically when finally biting the dust and asking for help
the answer comes falling down from above...
I figured out that a simple :
sort($stats_unsorted);
This would infact sort the first field of the subarrays.
This would mean by throwing the results back and forth
between several arrays I would in the end be able to sort
whatever I would need.
I could also insert back into the SQL and sort it by a select
statement, but I feel Arrays are there for a reason, and there
should not be any reason to bother the SQL for such a trivial
thing as sorting.
If any of you have another sollution I would sure love to know it,
since my array infact is multidimensional, and the sort() isnt,
though it for some reason solved the problem aslong as Im
sorting the first field.
--
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------
attached mail follows:
Hi,
Thursday, February 5, 2004, 11:35:34 PM, you wrote:
KS> I have been messing around now for some hours and Im going mad!
KS> Im pulling some heavy data from mySQL with count and grouping,
KS> after this I have to calculate som values and then sort the outcome.
KS> Therefore Im not able to let mySQL do the accuall sort.
KS> So i stuff it into an array, and I need to sort the array and thats where
KS> the problem occures.
KS> 1. I declare an array :
KS> $stats_unsorted = array();
KS> for loop start ...
KS> 1. fetch mySQL data
KS> 2. calculate values
KS> array_push($stats_unsorted,$sum,$user);
KS> // Eks. array_push($stats_unsorted,10,Ola);
KS> // Eks. array_push($stats_unsorted,-5,Kaare);
KS> // Eks. array_push($stats_unsorted,203,Nils);
KS> // Eks. array_push($stats_unsorted,-20,Lars);
KS> for loop end ...
KS> We now have, e.g. this :
KS> Array
KS> (
KS> [0] => Array
KS> (
KS> [0] => 10
KS> [1] => Ola
KS> )
KS> [1] => Array
KS> (
KS> [0] => -5
KS> [1] => Kaare
KS> )
KS> [2] => Array
KS> (
KS> [0] => 203
KS> [1] => Nils
KS> )
KS> [3] => Array
KS> (
KS> [0] => -20
KS> [1] => Tone
KS> )
KS> )
KS> - - - - - - - - - - - - - - - - - - - -
KS> Then comes the sorting part, I want to sort by this :
KS> $stats_unsorted[x][0]
KS> meaning the numbers, ofcourse I would surely like to know
KS> how to sort by the names aswell, $stats_unsorted[x][1],
KS> but I would think that is easy if I could figure out the
KS> main command to sort this in the first place.
KS> Ive tried several times with array_multisort(); but I cant get this
KS> to work, :(
KS> Help would be appretiated!
KS> $stats_SORTED = ???;
KS> Thanks in advance!
KS> --
KS> Kim Steinhaug
KS> ---------------------------------------------------------------
KS> There are 10 types of people when it comes to binary numbers:
KS> those who understand them, and those who don't.
KS> ---------------------------------------------------------------
You can use usort for multi dimension arrays:
<?php
function cmp($a, $b) {
if ($a[0] == $b[0]) {
return 0;
}
return ($a[0] < $b[0]) ? -1 : 1;
}
$a = array(
0 => Array(0 => 10,1 => 'Ola'),
1 => Array(0 => -5,1 => 'Kaare'),
2 => Array(0 => 203,1 => 'Nils'),
3 => Array(0 => -20,1 => 'Tone'));
usort($a, "cmp");
print_r($a);
?>
--
regards,
Tom
attached mail follows:
Hello,
as you know there is a new callback function __call($method, $params) in
php5. the __call() method of an object is called, if the method named
$method is not declared in this class.
i want this function simply call the method of another class with
"SomeClass::$method(...)" but i'm getting into trouble (bit heavy
programming!:) passing the arguments (stored as Array in $params) to the
"SomeClass::$method([arguments])" method...
further, i think i'm getting problems with objects passed through the
__call() method?!
any suggestions?
thanks
vivi
attached mail follows:
From: "Vivian Steller" <news
eecoo.de>
> i want this function simply call the method of another class with
> "SomeClass::$method(...)" but i'm getting into trouble (bit heavy
> programming!:) passing the arguments (stored as Array in $params) to the
> "SomeClass::$method([arguments])" method...
> further, i think i'm getting problems with objects passed through the
> __call() method?!
Not saying that I can help you at all, but some short, example code is
probably in order here. :)
---John Holmes...
attached mail follows:
see my message (and patch) on this topic. try http://pdoru.from.ro
--
Best regards,
Doru Petrescu
Senior Software Engineer
Astral Telecom Bucuresti
attached mail follows:
Hi,
I've been working with a PHP for a few years now. I've always thought
that on production servers, to have them working at peak efficiency, I
should have the Apache and PHP compiled as a static build. I recently
got into a debate with someone over whether this had any worthwhile
savings. Can anyone tell me which is the best solution, or point me in
the direction of a solution? I realise that it would vary from situation
to situation, so I'll tell you that my situation is high load servers
required to run as fast as possible. They get restarted once a day, and
(ideally) only get php+apache rebuilt when there's new versions out.
Thanks for any advice you can offer,
John
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]