Re: [PHP] preg_replace() ??

2002-03-01 Thread DL Neil

Monty,

 Is preg_replace() the best PHP command to use for parsing custom codes
in
 text retrieved from a database (e.g., turning [link= ] into a
href= )?

It is conventional wisdom that the PCRE functions are faster than their
EREG cousins.

However because/if you can guarantee that your 'template' links are in a
particular case then string functions (str_replace) are fastest if all.
Best of all, it is easy to perform multiple replaces (of the same
substrings) on multiple replace-pairs. NB case sensitivity!

RTFM http://www.php.net/manual/en/function.str-replace.php:
-
This function returns a string or an array with all occurences of search
in subject replaced with the given replace value. If you don't need
fancy replacing rules, you should always use this function instead of
ereg_replace() or preg_replace().

In PHP 4.0.5 and later, every parameter to str_replace() can be an
array.
-

Regards,
=dn


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




[PHP] Fixing the PHP security hole

2002-03-01 Thread Websitecd

How do I install the 406 patch?

http://wwwmsnbccom/news/717347asp?0si=-

Regards,
Joseph A Bannon

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Re: ImageMagick and Convert In Php

2002-03-01 Thread Nicke

I have exactly the same problem! Anyone who can help?

/nicke

Rick [EMAIL PROTECTED] wrote in message
news:003701c1bb50$bda0e2e0$[EMAIL PROTECTED];
Hello All,

Ok , I am about to loose my mind... this list is my last option i think  :)

this is what i have tried :
system(convert -pen black -draw 'text 120,60 YourText Here'  imageA.jpg
imageB.jpg);
The above does not work , the most i can get it imageA.jpg Becomes
imageB.jpg but the text does not get drawn

I striped the slashes, this does not work either, i su - to what my
webserver runs on to see if i can run the system command
via console, it works just fine , so i tried :

$a = escapeshellcmd('-pen black -draw');
$b = escapeshellarg('text 120,20  YourTextHere);
$c = escapeshellcmd(test.jpg doggy.jpg);
system(convert $a $b $c);

Same as the above, imageA becomes imageB and thats it. Permissions for
testing are -rwxrwxrwx

a basic test with system(convert -scale 500x600 imageA.jpg imageB.jpg); =
Works Perfect

I am sorry for coming to the list for help , but i am at a final loss, i
have also tried shell_exec and exec to clear anything up. I have hit the
imagemagick mail list and i got  Php Might have some issues so if anyone
can lend a hand to get that system command to work , i would be most
appreciative.

Best Wishes
Rick Wilson




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




[PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all, 
Here's the scenario

masterfileinc lives in /var/www/includes/ and contains this line:

include(/var/www/includes/anotherfileinc);

in indexphp I include masterfileinc and thus get anotherfileinc
Simple (I hope)

What I'd like to know though is, is it possible to have the include line
in masterfileinc specify a url *relative* to itself?


like:

// masterfileinc
include(anotherfileinc); // now the path is relative


Many thanks

- -- 
- ---
 wwwexplodingnetcom   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers

-BEGIN PGP SIGNATURE-
Version: GnuPG v106 (GNU/Linux)

iD8DBQE8f1VMHpvrrTa6L5oRAogTAJ46IwBbwFVLnVhNEG2qIj9ZqzXX1QCeMinj
6Y7FWqh5wFGqVEYe58LkZTM=
=YtcD
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] File Copy

2002-03-01 Thread Andy Delcambre

I am a complete php newbie but i have a quick question  I was wondering if
there is a way to copy a file from a remote site to your local server?  I
want to grab a picture off of a site and store it locally to be displayed
later Thanks alot,
Andy




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Re: File Copy

2002-03-01 Thread Henrik Hansen

[EMAIL PROTECTED] (Andy Delcambre) wrote:

  I am a complete php newbie but i have a quick question.  I was wondering if
  there is a way to copy a file from a remote site to your local server?  I
  want to grab a picture off of a site and store it locally to be displayed
  later. Thanks alot,


use the fopen function to save the image to your local site, ex:

$fp = fopen(http://site.com/image.gif;, r);
$buffer = ;
while (!feof ($fp)) {
$buffer .= fgets($fp, 4096);
}
fclose($fp);

$fp = fopen(/local/file.gif, wb);
fwrite($fp, $buffer);
fclose($fp);

untested but it should work (TM).

-- 
Henrik Hansen

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




[PHP] ImageMagick and Convert In PHP

2002-03-01 Thread Nicke

I have exactly the same problem! Anyone who can help?

/nicke

Rick [EMAIL PROTECTED] wrote in message
news:003701c1bb50$bda0e2e0$[EMAIL PROTECTED];
Hello All,

Ok , I am about to loose my mind... this list is my last option i think  :)

this is what i have tried :
system(convert -pen black -draw 'text 120,60 YourText Here'  imageA.jpg
imageB.jpg);
The above does not work , the most i can get it imageA.jpg Becomes
imageB.jpg but the text does not get drawn

I striped the slashes, this does not work either, i su - to what my
webserver runs on to see if i can run the system command
via console, it works just fine , so i tried :

$a = escapeshellcmd('-pen black -draw');
$b = escapeshellarg('text 120,20  YourTextHere);
$c = escapeshellcmd(test.jpg doggy.jpg);
system(convert $a $b $c);

Same as the above, imageA becomes imageB and thats it. Permissions for
testing are -rwxrwxrwx

a basic test with system(convert -scale 500x600 imageA.jpg imageB.jpg); =
Works Perfect

I am sorry for coming to the list for help , but i am at a final loss, i
have also tried shell_exec and exec to clear anything up. I have hit the
imagemagick mail list and i got  Php Might have some issues so if anyone
can lend a hand to get that system command to work , i would be most
appreciative.

Best Wishes
Rick Wilson






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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Jason Wong

On Friday 01 March 2002 17:12, [EMAIL PROTECTED] wrote:
 How do I install the 4.0.6 patch?

 http://www.msnbc.com/news/717347.asp?0si=-

Depends on how you originally installed your PHP. Was it from RPM? Or source? 
Or whatever?


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
It is the wise bird who builds his nest in a tree.
*/

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




Re: [PHP] PDF creation with PDF-LIB samples?

2002-03-01 Thread Jason Wong

On Friday 01 March 2002 13:37, Andras Kende wrote:
 Hello,

 Trying to create some pdf documents on the fly with php and mysql..

 I search the web but not yet found any easy way to do this...

Did you try google?: pdf php

 Tried Yaps but it requires ghostscript which didnt install on a cobalt raq4
 because it it requires some more programs (glibc...etc..)...

 Anyone can give some hint where to start?

pc4p is a very nice php class for use with pdflib. Easy to use and pretty 
powerful.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Though a program be but three lines long,
someday it will have to be maintained.
-- The Tao of Programming
*/

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




Re: [PHP] PDF creation with PDF-LIB samples?

2002-03-01 Thread Henrik Hansen

[EMAIL PROTECTED] (Jason Wong) wrote:

  On Friday 01 March 2002 13:37, Andras Kende wrote:
 Hello,

 Trying to create some pdf documents on the fly with php and mysql..

 I search the web but not yet found any easy way to do this...

  Did you try google?: pdf php

 Tried Yaps but it requires ghostscript which didnt install on a cobalt raq4
 because it it requires some more programs (glibc...etc..)...

 Anyone can give some hint where to start?

  pc4p is a very nice php class for use with pdflib. Easy to use and pretty 
  powerful.

also give HTMLDOC a go, it creates pdf's from plain html (using a
system() call).

I got problems when creating multiple pages with pc4p, but a fix
should (or is it fixed) be on the way.

-- 
Henrik Hansen

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




Re: [PHP] ImageMagick and Convert In PHP

2002-03-01 Thread Andrey Hristov

Hi,
I had problem with ImageMagick's identify. When trying to use with a shell command in 
PHP big problems!
Why. Trace of identify showed that it wants to create a temporary file in the 
directory where the scripts is but the apache/php runs
under nobody:nobody but the web directories are owned by andy:web . so identify fails. 
Maybe my problem and yours have something in
commong.
try :
strace your_command_here
and see the output.

Best regards,
Andrey Hristov

- Original Message -
From: Nicke [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 12:06 PM
Subject: [PHP] ImageMagick and Convert In PHP


 I have exactly the same problem! Anyone who can help?

 /nicke

 Rick [EMAIL PROTECTED] wrote in message
 news:003701c1bb50$bda0e2e0$[EMAIL PROTECTED];
 Hello All,

 Ok , I am about to loose my mind... this list is my last option i think  :)

 this is what i have tried :
 system(convert -pen black -draw 'text 120,60 YourText Here'  imageA.jpg
 imageB.jpg);
 The above does not work , the most i can get it imageA.jpg Becomes
 imageB.jpg but the text does not get drawn

 I striped the slashes, this does not work either, i su - to what my
 webserver runs on to see if i can run the system command
 via console, it works just fine , so i tried :

 $a = escapeshellcmd('-pen black -draw');
 $b = escapeshellarg('text 120,20  YourTextHere);
 $c = escapeshellcmd(test.jpg doggy.jpg);
 system(convert $a $b $c);

 Same as the above, imageA becomes imageB and thats it. Permissions for
 testing are -rwxrwxrwx

 a basic test with system(convert -scale 500x600 imageA.jpg imageB.jpg); =
 Works Perfect

 I am sorry for coming to the list for help , but i am at a final loss, i
 have also tried shell_exec and exec to clear anything up. I have hit the
 imagemagick mail list and i got  Php Might have some issues so if anyone
 can lend a hand to get that system command to work , i would be most
 appreciative.

 Best Wishes
 Rick Wilson






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




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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Websitecd

Depends on how you originally installed your PHP Was it from RPM? Or source? 

Or whatever?


It was the source Should I just re-install the whole thing?

Regards,
Joseph A Bannon

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Javascript question...

2002-03-01 Thread Philip Jeffs

Hi,

I know this is a PHP list but i thought someone might be able to help me out.

I was looking at the Levi's website the other day and i noticed a cool script on there 
for opening pop-ups. They have managed to get rid of the usual window borders 
altogether and it looks really good.

They have managed to do it by opening the pop-up window in full screen mode and then 
making the window smaller and positioning it in a certain place on screen.

I've figured out how to open it, shrink it and position it but for some reason i the 
scroll bars are always there. The levi's site has no scroll bars.

Does anyone know how to get rid of the scroll bars?

Thanks in advance,

Phil



Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Girish Nath

Hi

Unpack and copy the patch diff to the php4.0.6/main source directory, then
use :

patch  rfc1867.c rfc1867.c.diff-4.0.6

then the usual configure, make, make install.

Regards


Girish
--
www.girishnath.co.uk


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 11:27 AM
Subject: Re: [PHP] Fixing the PHP security hole


Depends on how you originally installed your PHP. Was it from RPM? Or
source?

Or whatever?


It was the source. Should I just re-install the whole thing?

Regards,
Joseph A. Bannon

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




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




RE: [PHP] Javascript question...

2002-03-01 Thread Sven Jacobs

 script 
function openpopup(){
var popurl=url
winpops=window.open(popurl,Solution,width=500,height=400,)
}   
 //openpopup()
/script

   input type=submit  value=Escalations onClick=openpopup()

Kind Regards
Sven
-Original Message-
From: Philip Jeffs [mailto:[EMAIL PROTECTED]]
Sent: vendredi 1 mars 2002 12:41
To: PHP LIST
Subject: [PHP] Javascript question...


Hi,

I know this is a PHP list but i thought someone might be able to help me
out.

I was looking at the Levi's website the other day and i noticed a cool
script on there for opening pop-ups. They have managed to get rid of the
usual window borders altogether and it looks really good.

They have managed to do it by opening the pop-up window in full screen mode
and then making the window smaller and positioning it in a certain place on
screen.

I've figured out how to open it, shrink it and position it but for some
reason i the scroll bars are always there. The levi's site has no scroll
bars.

Does anyone know how to get rid of the scroll bars?

Thanks in advance,

Phil



[PHP] PHP 4.1.2 - apache 1.3.20 - irix 6.5, build problem

2002-03-01 Thread Blazej Piotrowski

When i try to build php with mySql and apxs configuration goes ok but on
make install I get this:

118# make
Making all in Zend
/bin/sh /libtool --silent --mode=compile
gcc -DHAVE_CONFIG_H -I -I -I/main   -D_XPG_IV -DIRIX -DMOD_SSL=208104 -D
USE_HSREGEX -DEAPI -DUSE_EXPAT -I/TSRM  -g -O2 -prefer-pic -c
zend_operatorsc
zend_operatorsc: In function `multi_convert_to_long_ex':
zend_operatorsc:566: parse error before zval
zend_operatorsc:566: parse error before zval
zend_operatorsc:566: parse error before zval
zend_operatorsc:566: parse error before zval
zend_operatorsc:566: parse error before zval
zend_operatorsc:566: parse error before ')' token
zend_operatorsc: In function `multi_convert_to_double_ex':
zend_operatorsc:581: parse error before zval
zend_operatorsc:581: parse error before zval
zend_operatorsc:581: parse error before zval
zend_operatorsc:581: parse error before zval
zend_operatorsc:581: parse error before zval
zend_operatorsc:581: parse error before ')' token
zend_operatorsc: In function `multi_convert_to_string_ex':
zend_operatorsc:596: parse error before zval
zend_operatorsc:596: parse error before zval
zend_operatorsc:596: parse error before zval
zend_operatorsc:596: parse error before zval
zend_operatorsc:596: parse error before zval
zend_operatorsc:596: parse error before ')' token
*** Error code 1 (bu21)
*** Error code 1 (bu21)

What goes wrong, can anyone help
TIA





-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] include() and paths

2002-03-01 Thread DL Neil

Hi Nick,

 masterfile.inc lives in /var/www/includes/ and contains this line:
 include(/var/www/includes/anotherfile.inc);

 in index.php I include masterfile.inc and thus get anotherfile.inc.

 What I'd like to know though is, is it possible to have the include
line
 in masterfile.inc specify a url *relative* to itself?
 like:
 // masterfile.inc
 include(anotherfile.inc); // now the path is relative.


AFAIK the options are absolute addressing, relative addressing (to the
php.ini), and http access.

RTFM the four pages from
http://www.php.net/manual/en/function.require.php. There's quite a bit
of advice/experience in the user annotations!

Regards,
=dn


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




Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then DL Neil declared
  masterfileinc lives in /var/www/includes/ and contains this line:
  include(/var/www/includes/anotherfileinc);
 
  in indexphp I include masterfileinc and thus get anotherfileinc
 
  What I'd like to know though is, is it possible to have the include
 line
  in masterfileinc specify a url *relative* to itself?
  like:
  // masterfileinc
  include(anotherfileinc); // now the path is relative
 
 
 AFAIK the options are absolute addressing, relative addressing (to the
 phpini), and http access
 
 RTFM the four pages from
 http://wwwphpnet/manual/en/functionrequirephp; There's quite a bit
 of advice/experience in the user annotations!

Please don't RTFM me, that's the first place I went I didn't find what
I'm looking for so I came here
- -- 
- ---
 wwwexplodingnetcom   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers

-BEGIN PGP SIGNATURE-
Version: GnuPG v106 (GNU/Linux)

iD8DBQE8f2/pHpvrrTa6L5oRAgH+AJ0bbArcqX1Um1muNIjV789qCEvv/gCfW9RA
jFT4TxiP5n4tUpgPl5NAG1I=
=/ZY3
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] include() and paths

2002-03-01 Thread Nick Winfield

On Fri, 1 Mar 2002, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * and then DL Neil declared
   masterfileinc lives in /var/www/includes/ and contains this line:
   include(/var/www/includes/anotherfileinc);
  
   in indexphp I include masterfileinc and thus get anotherfileinc
  
   What I'd like to know though is, is it possible to have the include
  line
   in masterfileinc specify a url *relative* to itself?
   like:
   // masterfileinc
   include(anotherfileinc); // now the path is relative
 
 
  AFAIK the options are absolute addressing, relative addressing (to the
  phpini), and http access
 
  RTFM the four pages from
  http://wwwphpnet/manual/en/functionrequirephp; There's quite a bit
  of advice/experience in the user annotations!

 Please don't RTFM me, that's the first place I went I didn't find what
 I'm looking for so I came here

I didn't catch the first part of this thread (rampant deletion ahoy) so
please excuse if I am talking nadgers  The way I see it, if you are
calling includes/requires from within other includes, the path is that of
the script that makes the first include  If that makes any sense

So if you have a file called includesphp in your /home/webroot that
includes/requires files in a subdir called /home/webroot/stuff/ and those
files include/require other files within that same directory (such as
/home/webroot/stuff/classcheesephp), then the includes would look like
this:

# indexphp
include(includesphp);





# includesphp
include(stuff/dbstuffphp);





# stuff/dbstuffphp
include (stuff/classcheesephp);





Am I making any sense? :-)

Regards,

Nick Winfield


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] PHP and Apache Win32

2002-03-01 Thread Gordon Bergström

Greetings

Got a, I think, pretty easy question if you know of it

Running Apache with PHP I always get a 500 Error page when I try to access
the php file I have run phpexe -i and it all looks good I am running php
as a DSO under Apache In Apache errorlog there is a line that say

[Fri Mar 01 13:30:46 2002] [error] [client 127001] couldn't spawn child
process: c:/program files/apache group/apache/htdocs/php/testphp

Here is the relevant lines in httpdconf:

--Snipet
LoadModule php4_module modules/php4apachedll

AddModule mod_php4c


ScriptAlias /php/ C:/Program Files/Apache Group/Apache/htdocs/php/
Directory C:/Program Files/Apache Group/Apache/htdocs/php
 AllowOverride None
 Options None
 Order allow,deny
 Allow from all
/Directory


I suspect that there is an error there somewhere, but can't figure out what

Regards

Gordon



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Building secure authentification with sessions

2002-03-01 Thread Andy

Hi there,

I did recently read an article about security Now I absolutly see the need
of recoding my authentification procedure on a community site

There are questions I hoped some of you guys can answer


1 Is storing sensitive data like permission level secure in session
variables?

2 What could be a good way to session register a user and know which users
are online, know their permission level in congungtion with a MySQL db?

3 Is it better to store the needed info about the user in a db table
holding all current sessions, or to store it in more than 1 session
variable

4 Maybe someone can relate to a good site dealing with security issuses on
this topic I would really like to avoid that some hacker gets admin access
on my website :-)

Thanx for any hints,

Cheers Andy



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Pros/Cons over PHP_SELF vs script

2002-03-01 Thread Team GotFusion

I am on the Gotfusion.com team, formerly Team NetObjects. We are a group of technical 
professionals providing assistance to web developers who use NetObjects Fusion.

Given the many requests wanting to know how to incorporate PHP into NOF, We are 
currently writing a PHP /mySQL tutorial in Fusion for these users. If interest holds, 
we may also consider developing a suite of components for our non-coding developers.

So, here is my question:

What are the pros and cons of using PHP_SELF over a calling script when manipulating 
data in a form? Development books show either or both with no preference given. What 
is considered good form over bad? What is technically cleaner vs. technically faster?  
What are the hardware pitfalls?  In developing a tutorial, we at gotfusion would like 
to include these pointers or cautions to give our developers enough information to 
make an informed decision as to which method to choose (both methods are in the 
tutorial.)

Please post here so that anyone else may also read and perhaps learn something. If you 
know of any links to sites that have more info on this, please also feel free to post 
those.

Thanks for your help and assistance.  
Tami Burke
Team Gotfusion  (www.gotfusion.com)
Honey House Designs (www.honeyhousedesigns.com)
-



Re: [PHP] include() and paths

2002-03-01 Thread DL Neil

and Nick Wilson opined in what could be seen to be an arrogant
fashion...
 * and then DL Neil declared
   masterfile.inc lives in /var/www/includes/ and contains this line:
   include(/var/www/includes/anotherfile.inc);
  
   in index.php I include masterfile.inc and thus get
anotherfile.inc.
  
   What I'd like to know though is, is it possible to have the
include
  line
   in masterfile.inc specify a url *relative* to itself?
   like:
   // masterfile.inc
   include(anotherfile.inc); // now the path is relative.
 
 
  AFAIK the options are absolute addressing, relative addressing (to
the
  php.ini), and http access.
 
  RTFM the four pages from
  http://www.php.net/manual/en/function.require.php. There's quite a
bit
  of advice/experience in the user annotations!

 Please don't RTFM me, that's the first place I went. I didn't find
what
 I'm looking for so I came here.

It's a two-way street: please tell us what you have done so that we
don't waste our time trying to help you with 'basic' suggestions when
you're looking for 'the next step up'. Particularly if your enquiry is
basically the hope that the (good quality/fine) manual doesn't mention
something - a most unlikely scenario.
=dn


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




Re: [PHP] the date90 fucntions gone haywire!

2002-03-01 Thread Georgie Casey

the time stamp i'm giving its perfect! i echoed some already and there's no
problem. i'm using the code:
$time = date(d-m-y, $timestamp);

the £timestamp i'm feeding its is perfect, with the year first, then month,
date, etc...
Dl Neil [EMAIL PROTECTED] wrote in message
077b01c1c0aa$7531dd20$c200a8c0@jrbrown..">news:077b01c1c0aa$7531dd20$c200a8c0@jrbrown..;
 Hi Georgie,

  The date() function is returning the 19th of Januray 2038 as *ALL*
 dates no
  matter what timestamp i feed it! whats goin on??


 Result outside the UNIX epoch.
 Sounds like DATE()'s being fed some crazy data.
 What is the server's ToD clock showing?
 Make sure you debugECHO the source data before you feed it to DATE().
 Post some code and results from the browser and we may be able to point
 fingers!

 Regards,
 =dn




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




[PHP] URL cloaking?

2002-03-01 Thread Daniel Alsén

Hi,

my webhost offers wildcard dns for subdomains. However - the subdomains only
redirects from sub.domain.com to domain.com/sub.

I want to cloak the url to remain sub.domain.com. Is there any easy way to
do that with a php-snipplet?

Regards
# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 705 38 10 30 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #


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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread PHP Tester

I'm having the same question,
  How do I install the 4.0.6 patch?
I installed PHP from the RPM.


Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 On Friday 01 March 2002 17:12, [EMAIL PROTECTED] wrote:
  How do I install the 4.0.6 patch?
 
  http://www.msnbc.com/news/717347.asp?0si=-

 Depends on how you originally installed your PHP. Was it from RPM? Or
source?
 Or whatever?


 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 It is the wise bird who builds his nest in a tree.
 */



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




[PHP] PHP Patch 4.0.6

2002-03-01 Thread PHP Tester

I went to phpnet and I downloaded the patch for php 406 and after I
extract the file I got a file called rfc1867cdiff-406 when I try to
execute it, it opens a text editor and show me the source code,


I have to compile this file?
If so which compiler I have to use?

Thanks



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Fixing the PHP security hole

2002-03-01 Thread PHP Tester

How do I install the 406 patch?
I installed PHP from the RPM



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Global Variable Change

2002-03-01 Thread Thomas Brodkorb

Hi folks,

small problem with globals:

I would like to set a variable global called Language

This seems to be not a really problem, but it is

Indexphp:

?php {
  session_start();
  if (!session_is_registered('Language')) {
session_register('Language');
$Language = 1031;
  }
 
?

But all other pages do not have really access to this variable without
calling start_session() from within the other pages()

If I call, it works

Now the real problem

I would like to set $Language by an Hyperlink with image hyperlinks, but it
doesnt change anything
Within the hyperlink I call setlanguagephp?lang=1033

?php {
  session_start();
  if ( ($lang  1031) and ($lang  1033) ) {
$lang= 1031; }
  $Language = $lang;
  if (session_is_registered('Language')) {
session_unregister('Language');
  }
  session_register('Language');
} ?

But it doesnt change ANYTHING 


Please Help

Thomas



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Jason Wong

On Friday 01 March 2002 22:40, PHP Tester wrote:
 I'm having the same question,
   How do I install the 4.0.6 patch?
 I installed PHP from the RPM.

If you're using RH Linux then they have already put out an update. Check on 
their website (or run up2date).


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Man's reach must exceed his grasp, for why else the heavens?
*/

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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread PHP Tester

Actually I'm using Linux-Mandrake 8.1.

I should be able to run the red hat patch over my mandrake distribution?

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 On Friday 01 March 2002 22:40, PHP Tester wrote:
  I'm having the same question,
How do I install the 4.0.6 patch?
  I installed PHP from the RPM.

 If you're using RH Linux then they have already put out an update. Check
on
 their website (or run up2date).


 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Man's reach must exceed his grasp, for why else the heavens?
 */



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




[PHP] problems with replacing line breaks

2002-03-01 Thread Tom Kincaid

I'm trying to replace line breaks with html code and am having problems For 
single lines preg_replace(/\n/,br,$text) or
ereg_replace(\n,br,$text) adds the br but doesn't remove the line 
break While preg_replace(/\n\n/,p,$text) doesn't find any double line 
breaks, even though they're there Why doesn't this work?




_
Chat with friends online, try MSN Messenger: http://messengermsncom


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] user input in HTML

2002-03-01 Thread Erik Price

I was hoping to solicit an opinion:

There are some text areas where HTML-savvy users could choose to 
embolden their text or emphasize it by using HTML.  But if I use 
htmlspecialchars() or htmlentities(), then this is not possible, even 
though it makes my site safer by eliminating any HTML-related characters 
that could compromise the site (like img tags or trying to close the 
textarea tag and execute code).  But I have seen some sites 
(admittedly running Slash, which is Perl and not PHP-based) that accept 
certain tags.

Do sites do this by running htmlspecialchars() on their users' input, 
and then running a custom function that does substr() on safe 
entities, turning them back into true tags?  Or is there some other 
method of allowing only certain HTML tags?  BTW, the substr() idea is 
just something I came up with in the shower, and might not even properly 
work or be efficient.

Thanks


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Re: Does anybody have code for this?

2002-03-01 Thread Demitrious S. Kelly

function scramble($string) {
$count2++;
while ( $count2 != strlen($string) ) {
$bad=1;
while ( $bad == 1 ) {
$rand=rand(0, (strlen($string) - 1));
if ( $used[$rand] != 1 ) {
$bad=0;
$used[$rand]=1;
}
}
$newstring.=substr($string, $rand, 1);
$count2++;
}
return($newstring);
}

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 28, 2002 11:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Does anybody have code for this?

on 3/1/02 2:43 AM, Monty at [EMAIL PROTECTED] wrote:

 Maybe try looking into the crypt() or md5() functions on php.net.
These will
 encrypt a string more than scramble, but maybe one of these serves
the
 purpose.
No, that isn't what I'm looking for.  It's not for encryption.  I just
need
a function that scrambles a string.



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





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




RE: [PHP] session/cookies

2002-03-01 Thread Johnson, Kirk

Start by adding a session_start() to the 2nd file, then see what happens.

Kirk

 Hi again, I am doing a simple example of cookies and my 
 server seems to
 get frozen.
 
 Basically, what I do is:
 
 file01.php:
 ?
  session_start();
  seession_register(sess_var);
  sess_var = Hello;
 ?
 
 file02.php
 ?
  echo $sess_var;
  session_unregister(sess_var);
 ?
 
 What ends up happening when I go to the second file is the server just
 opens the file forever never showing the content, and ends up 
 giving me
 an error message.

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




Re: [PHP] preg_replace() ??

2002-03-01 Thread Erik Price


On Thursday, February 28, 2002, at 10:33  PM, Monty wrote:

 Is preg_replace() the best PHP command to use for parsing custom codes 
 in
 text retrieved from a database (e.g., turning [link= ] into a 
 href= )?



Use preg only if you need the power of regexes.  If you are just looking 
to replace certain predefined strings with other strings, then you 
should use substr() it's faster.

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] problems with replacing line breaks

2002-03-01 Thread Tyler Longren

why don't you just use the nl2br() function?

Tyler

- Original Message -
From: Tom Kincaid [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 9:11 AM
Subject: [PHP] problems with replacing line breaks


 I'm trying to replace line breaks with html code and am having problems.
For
 single lines preg_replace(/\n/,br,$text) or
 ereg_replace(\n,br,$text) adds the br but doesn't remove the line
 break. While preg_replace(/\n\n/,p,$text) doesn't find any double
line
 breaks, even though they're there. Why doesn't this work?




 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




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




[PHP] Active Directory

2002-03-01 Thread Sven Jacobs

Hey All


Does anybody have any idea how to authenticate agains a Active Directory
Server with PHP ?
And if sow :
-- How does it work 
-- What do I need to install 
-- Some sample code would be nice :-)

Kind Regards
Sven



[PHP] Re: problems with replacing line breaks

2002-03-01 Thread Julio Nobrega Trabalhando

Have you tried nl2br()?
--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Tom Kincaid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 I'm trying to replace line breaks with html code and am having problems.
For
 single lines preg_replace(/\n/,br,$text) or
 ereg_replace(\n,br,$text) adds the br but doesn't remove the line
 break. While preg_replace(/\n\n/,p,$text) doesn't find any double
line
 breaks, even though they're there. Why doesn't this work?




 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com




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




[PHP] PHP/MySQL/Row Locking

2002-03-01 Thread Aaron Gould

I have MySQL Max 4.0.1-2 alpha installed on my server.  I am using the PHP
PEAR DB interface to access it.  The version of PHP is the latest, 4.1.2.

My question is -- how do I implement the locking of rows through PEAR?  I am
aiming to support transactions in my application.

From what I understand, implementing requires persistent database
connections.  With my PEAR experience so far, I've only done the basic steps
of interfacing with the database.  I do this in separate functions -- one
for getting the data and displaying it in forms, and one for saving the
data.  In each function, a database connection is made and then
disconnected.  Hence the connections are not persistent.

Because this uses more than one function, does this approach make locking
impossible, and hence necessitating a rewrite of the database portion of my
app?

Perhaps someone knows of a web page that addresses PEAR/DB locking, or could
share some tips?

Thanks,
--
Aaron Gould
[EMAIL PROTECTED]
Web Developer





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




Re: [PHP] patching a lower version.

2002-03-01 Thread Jason Wong

On Friday 01 March 2002 22:19, you wrote:
 I went to php.net and I downloaded the patch for php 4.06 and after I
 extract the file I got a file called rfc1867.c.diff-4.0.6 when I try to
 execute it, it opens a text editor and show me the source code,
 .

 I have to compile this file?
 If so which compiler I have to use?

To quote an earlier reply:

Unpack and copy the patch diff to the php4.0.6/main source directory, then
use :

patch  rfc1867.c rfc1867.c.diff-4.0.6

then the usual configure, make, make install.



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
No man is an island, but some of us are long peninsulas.
*/

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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Jason Wong

On Friday 01 March 2002 23:01, PHP Tester wrote:
 Actually I'm using Linux-Mandrake 8.1.

 I should be able to run the red hat patch over my mandrake distribution?

You can try :) But I would rather use MDK's own update (MDKSA-2002:017)


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
It is easy when we are in prosperity to give advice to the afflicted.
-- Aeschylus
*/

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




Re: [PHP] How to get the URL into a var?

2002-03-01 Thread Moriyoshi Koizumi

Hi,

have you tried this one?


$dir = dirname( $HTTP_SERVER_VARS['PHP_SELF'] );


Moriyoshi Koizumi




Andy [EMAIL PROTECTED] wrote:

 Hi there,
 
 I am trying to find out which dir the user is browsing. How can I get the
 URL into a var? I tryed path_info, but it only returns the filename.
 
 Here is an example:
 
 URL: http://www.server.com/subapp/test.php
 
 Should return :
 
 subapp
 
 Is this possible??
 
 Thanx for any help
 
 Cheers Andy



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




Re: [PHP] Pros/Cons over PHP_SELF vs script

2002-03-01 Thread Erik Price


On Friday, March 1, 2002, at 07:44  AM, Team GotFusion wrote:

 What are the pros and cons of using PHP_SELF over a calling script when
 manipulating data in a form? Development books show either or both with
 no preference given. What is considered good form over bad? What is
 technically cleaner vs. technically faster?  What are the hardware
 pitfalls?  In developing a tutorial, we at gotfusion would like to
 include these pointers or cautions to give our developers enough
 information to make an informed decision as to which method to choose
 (both methods are in the tutorial.)

First of all, I always assumed (yes assume, meaning I'm not sure at all) 
that the reason this method is so popular is that many programmers are 
used to working with stateful environments, unlike HTTP, and in a 
sense, if you pass your variables correctly, this is closer to that 
example -- you aren't writing a bunch of separate scripts, you are 
writing just one that has different forms depending on how it's being 
called.  This seems more akin to a traditional script, such as one you 
might encounter in Perl or Python.

Secondly, I think that it is conceptually easier on the complete novice 
to have them be separate -- a calling script and a called script.  
Although it made perfect sense when I finally realized how 
./randompage.php was able to display different content depending on 
which if or switch statement it was in, until then I was just like 
how can this ./randompage.php that I am viewing be the same page as the 
previous ./randompage.php ?  It was initially kind of mind boggling.  I 
think that is the reason that Wrox's Beginning PHP (which I learned 
from) used separate pages, because it is conceptually cleaner.

I think that once you have this whole single page script thing down, 
it's ten times easier to have one script that does a lot of code than a 
bunch of separate ones -- in terms of managing my data.  I hate having 
fifty files in a directory, or a whole tree of directories to keep track 
of, when I don't have to.  There is possibly a tradeoff in speed, 
however, because there is more data and info being parsed at a time.  
Something to consider.  I don't really know.

Finally, and this is kind of a weak argument for me to make, it is 
probably easier to send faked POST or GET data to a separate page than 
it is to try to send it to a single page in a different instantiation.  
That sounds confusing, let me re-explain what I mean:  If you have a 
single script with a 'switch' statement, or 'if' statements, that look 
for specific variables before even considering the user's input (in POST 
data), then you are just a tiny bit more secure in that a potential 
attacker needs to figure out more conditions before they can try to send 
faked POST or GET data as form inputs.  IOW, if the user is trying to 
get their own data into your database, and they send a $_POST['user_id'] 
variable at the script, they had better make sure that they have also 
included whatever $_POST['action'] variable is needed to tell the 
switch statement to even look for a $_POST['user_id'] variable.  
Otherwise, they can send that 'user_id' variable all they want, but the 
code that accepts this variable doesn't care because it hasn't been 
activated by the 'switch'.  This is something that is not necessarily 
true of a separate, standalone page, because it might not be looking for 
this criteria before accepting $_POST['user_id'].  Of course, a good 
coder needs to be much more dilligent than this and anticipate this kind 
of thing, because this is only a further level of difficulty and not an 
impossibility for a clever attacker.  (Obviously a clever attacker would 
have considered this and would be sending values for any hidden form 
fields on previous instances of the script, etc, to bypass the supposed 
security lent by the 'switch' statement.)

Hope that helps, please discuss if I am off base in any of this.



Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Fixing the PHP security hole

2002-03-01 Thread Gaylen Fraley

Just for my own edification and understanding, do you (technically) have to
do the configure since you haven't changed the configuration?


Girish Nath [EMAIL PROTECTED] wrote in message
002901c1c115$c4608b60$0a0a@AERIS..">news:002901c1c115$c4608b60$0a0a@AERIS..;
 Hi

 Unpack and copy the patch diff to the php4.0.6/main source directory, then
 use :

 patch  rfc1867.c rfc1867.c.diff-4.0.6

 then the usual configure, make, make install.

 Regards


 Girish
 --
 www.girishnath.co.uk




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




Re: [PHP] preg_replace() ??

2002-03-01 Thread Erik Price


On Friday, March 1, 2002, at 10:34  AM, Erik Price wrote:


 On Thursday, February 28, 2002, at 10:33  PM, Monty wrote:

 Is preg_replace() the best PHP command to use for parsing custom codes 
 in
 text retrieved from a database (e.g., turning [link= ] into a 
 href= )?



 Use preg only if you need the power of regexes.  If you are just 
 looking to replace certain predefined strings with other strings, then 
 you should use substr() it's faster.



Whoops, I meant str_replace()  !





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Help me!!!Can I use PHP to send SMS message???

2002-03-01 Thread LaserJetter

If you had a suitable cable, phone and controlling software, You could send
the SMS using the mobile phone. Not sure how you interface with external
apps from PHP though.



Frank Hertogs [EMAIL PROTECTED] wrote in message
004f01c1c0a4$b5752f50$3400a8c0@fritzzz57619dp..">news:004f01c1c0a4$b5752f50$3400a8c0@fritzzz57619dp..;
 Another way of doing it is thru an e-mail to sms gateway; free or paid.
 That way you could make a simple form and use mail();

 Just a thought.

 Frank.


 -Oorspronkelijk bericht-
 Van: Simon Willison [mailto:[EMAIL PROTECTED]]
 Verzonden: donderdag 28 februari 2002 12:30
 Aan: hei
 CC: [EMAIL PROTECTED]
 Onderwerp: Re: [PHP] Help me!!!Can I use PHP to send SMS message???

 hei wrote:

 Help me!!!Can I use PHP to send SMS message???If yes, how can I use
 it???
 
 
 (((Please e-mail the answer to me [EMAIL PROTECTED])))
 
 One very cheeky way of doing this would be to sign up to one of the free

 SMS services on the web (such as lycos mobile) and set up a PHP script
 that can pretend to be a browser, log in to your account and post a
 message to the send SMS form. You could do this using something along
 the lines of CURL or Snoopy (I recommend  Snoopy as it doesn't require
 anything to be installed on your web server):

 http://snoopy.sourceforge.net/

 You would have to figure out how the authentication scheme for your
 chosen web-based SMS service works (most of them use cookies). The main
 disadvantage is that it's a bit of a dirty hack and it would stop
 working if the free web service went down or changed the way its
 authentication / SMS form worked. Free services also tend to limit you
 to a certain number of messages a day.

 The professional alternative is to invest in some kind of web to SMS
 gateway, but I think that's quite an expensive option.


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





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




[PHP] passing array of variables in a query string

2002-03-01 Thread Diana Castillo

I was wondering if someone could help me
with this:
 what I need to know is how to pick up an array of variables from
 a query string such as:
 http://wwwarchiprocom/testphp?state=ABstate=BC
 If I use $state, I get only the last one




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] empty() texarea

2002-03-01 Thread John Fulton


I can't seem to get empty() to check if someone has left
a textarea unanswered in an online form with code like
the following:

textarea rows=8 cols=50 name=open_why_good_consult
?echo $open_why_good_consult?
/textarea 

if(empty($open_why_good_consult)) {
print Please fill in why you would be a good consultant;
}


Any ideas?  It seems to work for things like this:

input type=text name=user_name size=8 value=?echo $user_name?

if empty($user_name) {
print Please fill in a username;
}

I suppose it is because the variable is not getting posted  Is
there a way to post the variable?   

Thanks  

  John


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] empty() texarea

2002-03-01 Thread Andrey Hristov

When register_globals is on try this:

if ($open_why_good_consult){

}

Regards,
Andrey
- Original Message - 
From: John Fulton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:45 PM
Subject: [PHP] empty()  texarea


 
 I can't seem to get empty() to check if someone has left
 a textarea unanswered in an online form with code like
 the following:
 
 textarea rows=8 cols=50 name=open_why_good_consult
 ?echo $open_why_good_consult?
 /textarea 
 
 if(empty($open_why_good_consult)) {
 print Please fill in why you would be a good consultant;
 }
 
 
 Any ideas?  It seems to work for things like this:
 
 input type=text name=user_name size=8 value=?echo $user_name?
 
 if empty($user_name) {
 print Please fill in a username;
 }
 
 I suppose it is because the variable is not getting posted.  Is
 there a way to post the variable?   
 
 Thanks.  
 
   John
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] passing array of variables in a query string

2002-03-01 Thread Andrey Hristov

It is in the TODO list of PHP. The behaviour will be changed in such a case.
You can get the string from $QUERY_STRING
explode it with $ar=explode('',$QUERY_STRING);
and some other small things to get all stuff with same name in an array

Regards,
Andrey
- Original Message - 
From: Diana Castillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:42 PM
Subject: [PHP] passing array of variables in a query string


 I was wondering if someone could help me
 with this:
  what I need to know is how to pick up an array of variables from
  a query string such as:
  http://www.archipro.com/test.php?state=ABstate=BC
  If I use $state, I get only the last one.
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




[PHP] get the median from an array of integers

2002-03-01 Thread Erik Price

What is the best way to get the median value from an array of integers?

I have a very long form, which is essentially the same mini-form (group 
of fields) repeated a number of times with different names (simple 
though, I use a 'for' loop to give each field a number that corresponds 
to which mini-form it belongs to).

This was an efficient way for me to let the user specify how many 
mini-forms they need to fill out for their purposes, because it might 
not always be the same.  HOWEVER... at the end of the day, when they are 
done filling out this long form full of groups of inputs, it needs to be 
added to a database.  That's the easy part.  The hard part is that I 
need to echo a value back to the user -- and this value corresponds to 
the median of all the values in field X.  Wait, this is too hard to 
explain.  Let me simplify:

The web page features ten listboxes, each of which contains the same 
options.  Let's say that you can choose A, B, C, D, or E from each 
listbox.  Submit the form, run some code to figure out which was 
most-frequently selected, and then display that value on the next page.

That's all I really want to do, but I'm pretty bad at math -- I could 
enter all the values into an array and run some kind of averaging code 
on them, but the problem is that I don't want an average, I need the 
most-chosen value.

Thanks if you have any advice.


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] PHP and Apache Win32

2002-03-01 Thread [EMAIL PROTECTED]

Yes, you have got a few thing mixed up, to be exact DSO and CGI

The DSO module containing the PHP engine is loaded into Apache,
and therefore it doesn't the CGI version (phpexe) anymore

So 'ScriptAlias' is only needed for CGI installations, and you don't
need the 'Directory'
part either

All you need besides 'AddModule' to load the module, is a specification
of what file extensions (php) should be run through PHP This can be
done with 'AddType', for example:

 AddType application/x-httpd-php phtml php
 AddType application/x-httpd-php-source phps


bvr

 [Fri Mar 01 13:30:46 2002] [error] [client 127001] couldn't spawn 
child
 process: c:/program files/apache group/apache/htdocs/php/testphp
 
 Here is the relevant lines in httpdconf:
 
 --Snipet
 LoadModule php4_module modules/php4apachedll
 
 AddModule mod_php4c
 
 
 ScriptAlias /php/ C:/Program Files/Apache Group/Apache/htdocs/php/
 Directory C:/Program Files/Apache Group/Apache/htdocs/php
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
 /Directory
 
 
 I suspect that there is an error there somewhere, but can't figure out 
what
 
 Regards
 
 Gordon
 
 
 





-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] empty() texarea

2002-03-01 Thread Erik Price


On Friday, March 1, 2002, at 11:45  AM, John Fulton wrote:


 I can't seem to get empty() to check if someone has left
 a textarea unanswered in an online form with code like
 the following:

 textarea rows=8 cols=50 name=open_why_good_consult
 ?echo $open_why_good_consult?
 /textarea

In cases where you have provided a default value to fill in the form, 
you can't use empty() to test the value of the result.  What I would 
recommend that you do is you test to see if the value is the same as 
what it was filled in by default, and if so, you know the user hasn't 
changed anything.

?php
$original_good_consult = $_POST['openWhyGoodConsult'];
?
textarea rows=8 cols=50 name=openWhyGoodConsult
?php echo $openWhyGoodConsult; ?
/textarea
input type=hidden name=originalGoodConsult value=?php echo 
$original_good_consult; ? /

...later in the script

if ($_POST['openWhyGoodConsult'] == $_POST['originalGoodConsult']) {
// then you know nothing has changed, the values are the same,
// so take some action to remind them such as echoing Please
// fill in the Good Consult field or whatever
} else {
// then you know they have entered a new value, so you can
// perform whatever code you need to on that
}



HTH

Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] trouble with telnet.

2002-03-01 Thread Sean Kennedy

Hello,

I telneted to my web server and I would like to see if they have MySQL. Is there a 
certain sentence I type to see if they have MySQL? Thank you,

-Sean



Re: [PHP] empty() texarea

2002-03-01 Thread Andrey Hristov

Hi Erik,
I think that you look for array_count_values().

Regards,
Andrey
- Original Message - 
From: Erik Price [EMAIL PROTECTED]
To: John Fulton [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:58 PM
Subject: Re: [PHP] empty()  texarea


 
 On Friday, March 1, 2002, at 11:45  AM, John Fulton wrote:
 
 
  I can't seem to get empty() to check if someone has left
  a textarea unanswered in an online form with code like
  the following:
 
  textarea rows=8 cols=50 name=open_why_good_consult
  ?echo $open_why_good_consult?
  /textarea
 
 In cases where you have provided a default value to fill in the form, 
 you can't use empty() to test the value of the result.  What I would 
 recommend that you do is you test to see if the value is the same as 
 what it was filled in by default, and if so, you know the user hasn't 
 changed anything.
 
 ?php
 $original_good_consult = $_POST['openWhyGoodConsult'];
 ?
 textarea rows=8 cols=50 name=openWhyGoodConsult
 ?php echo $openWhyGoodConsult; ?
 /textarea
 input type=hidden name=originalGoodConsult value=?php echo 
 $original_good_consult; ? /
 
 ...later in the script
 
 if ($_POST['openWhyGoodConsult'] == $_POST['originalGoodConsult']) {
 // then you know nothing has changed, the values are the same,
 // so take some action to remind them such as echoing Please
 // fill in the Good Consult field or whatever
 } else {
 // then you know they have entered a new value, so you can
 // perform whatever code you need to on that
 }
 
 
 
 HTH
 
 Erik
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] trouble with telnet.

2002-03-01 Thread Andrey Hristov

locate mysqld
whereis mysql

Regards,
Andrey

- Original Message -
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:05 PM
Subject: [PHP] trouble with telnet.


Hello,

I telneted to my web server and I would like to see if they have MySQL. Is there a 
certain sentence I type to see if they have
MySQL? Thank you,

-Sean



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




RE: [PHP] trouble with telnet.

2002-03-01 Thread Vlad Kulchitski


Actually there's a nice bash command:

$ which mysql

that is supposed to show you the folder where binary is
I mean my understanding is if there's 'mysql' binary that
means mysql is installed

alternatively you can do this also:

$ find / mysql*// what this one will do is it will start
looking for mysql on your filesystem and give you results at the end

Hope this was helpful
Vlad
ps I think the commands Andrey pointed out work also


--
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




RE: [PHP] passing array of variables in a query string

2002-03-01 Thread Kevin Stone

To form an array of values in the GET string append brackets to the end
of each variable name...

http://www.archipro.com/test.php?state[]=ABstate[]=BC

for($i=0; $icount($state); $i++)
{
echo $state . br;
}

Result:
AB
BC

Hope this helps.  :)

-Kevin

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 9:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] passing array of variables in a query string

I was wondering if someone could help me
with this:
 what I need to know is how to pick up an array of variables from
 a query string such as:
 http://www.archipro.com/test.php?state=ABstate=BC
 If I use $state, I get only the last one.




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




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




[PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Sean Kennedy

Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Nick Winfield declared
 I didn't catch the first part of this thread (rampant deletion ahoy) so
 please excuse if I am talking nadgers  The way I see it, if you are
 calling includes/requires from within other includes, the path is that of
 the script that makes the first include  If that makes any sense

Sure does, just wondered if anyone could see a way round my little wish
:-) AFAIK there is no easy way to do this and as neither the manual nor
this list has been able to tell me different I'll have to find another
solution Thanks for the help though!
- -- 
- ---
 wwwexplodingnetcom   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers

-BEGIN PGP SIGNATURE-
Version: GnuPG v106 (GNU/Linux)

iD8DBQE8f7q1HpvrrTa6L5oRArMgAJ9ETCkt5vxJSVs7O9Ervfkl9wxc4gCdFG9q
Hp8nJGb56lec5ckoIbdb7WI=
=4FXP
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then DL Neil declared
   RTFM the four pages from
   http://wwwphpnet/manual/en/functionrequirephp; There's quite a
 bit
   of advice/experience in the user annotations!
 
  Please don't RTFM me, that's the first place I went I didn't find
 what
  I'm looking for so I came here
 
 It's a two-way street: please tell us what you have done so that we
 don't waste our time trying to help you with 'basic' suggestions when
 you're looking for 'the next step up' Particularly if your enquiry is
 basically the hope that the (good quality/fine) manual doesn't mention
 something - a most unlikely scenario

If you just want to rude and superior please do it elsewhere, this is a
busy list

- -- 
- ---
 wwwexplodingnetcom   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers

-BEGIN PGP SIGNATURE-
Version: GnuPG v106 (GNU/Linux)

iD8DBQE8f7r8HpvrrTa6L5oRAttAAKCWKkby/MBC5rVbJjUAhGahyOJkawCffA2o
c3G6zp9KuN2ie8A/y9rEpl4=
=cyUe
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




RE: [PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Hunter, Ray

It did not find it with your classpath...

Try using locate or slocate, this should find it...

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Sean Kennedy [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 10:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] hmm.. more trouble with telnet.


Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



Re: [PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Andrey Hristov

I think -  no mysql is available
what did locate mysql returned?

Regards,
Andrey
- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:27 PM
Subject: [PHP] hmm.. more trouble with telnet.


Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



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




Re: [PHP] user input in HTML

2002-03-01 Thread bvr


Use strip_tags()

http://wwwphpnet/manual/en/functionstrip-tagsphp

Erik Price wrote:

 I was hoping to solicit an opinion:




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] mysql and telnet.

2002-03-01 Thread Sean Kennedy

Hello,

Thanks for the advice... But now I need to know what all this means:

/home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
/home/sites/home/web/CFIDE/administrator/datasources/drivers/myodbc_mysql.cfm
/home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
/home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.cfm
/home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
/home/coldfusion/lib/CFmysql15.so
/home/coldfusion/scripts/mysql_expire.cfm

Thanks,

-Sean



Re: [PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Jeff Sheltren

How about just typing 'mysql'  (without the quotes) if it is on the 
system and in a directory which is in your path (it should be if your host 
knows what they're doing), then that will connect to mysql for you  If 
that doesn't work, then you can either try using 'find' (type 'man find') 
for more info, or you can email your host and just ask them :)

Jeff

At 10:27 AM 3/1/2002 -0700, you wrote:
Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] mysql and telnet.

2002-03-01 Thread Andrey Hristov

.cfm are ColdFusion files(like .php or .pl)

Regards,
Andrey
- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:36 PM
Subject: [PHP] mysql and telnet.


Hello,

Thanks for the advice... But now I need to know what all this means:

/home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
/home/sites/home/web/CFIDE/administrator/datasources/drivers/myodbc_mysql.cfm
/home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
/home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.cfm
/home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
/home/coldfusion/lib/CFmysql15.so
/home/coldfusion/scripts/mysql_expire.cfm

Thanks,

-Sean



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




[PHP] RE: Andrey this is for you.

2002-03-01 Thread Sean Kennedy

hello,

locate mysql returned this:

/home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
/home/sites/home/web/CFIDE/administrator/datasources/drivers/myodbc_mysql.cfm
/home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
/home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.cfm
/home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
/home/coldfusion/lib/CFmysql15.so
/home/coldfusion/scripts/mysql_expire.cfm 

what does this mean? do i have mysql? thanks,

-sean



[PHP] PHP and Java

2002-03-01 Thread Proyecto de Grado

 I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

   I did compile php with-java

   1) Java section in php.ini
   [Java]
   java.home = /usr/java1.2
   java.class.path = /usr/local/lib/php/php_java.jar
   java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
   java.library.path = /usr/local/lib/php

   2) prueba.php
   html
   body
   ?
 $system = new Java();
 print Java version=.$system-getProperty(java.version). br\n;
 print Java vendor=.$system-getProperty(java.vendor). p\n\n;
 print OS=.$system-getProperty(os.name). .
 $system-getProperty(os.version). on .
 $system-getProperty(os.arch). br\n;

 $formatter = new Java(java.text.SimpleDateFormat,
   ,  dd,  'at' h:mm:ss a );

 print $formatter-format(new Java(java.util.Date)).\n;

   ?
   html


   the error in browser is:
   Fatal error: Cannot instantiate non-existent class: java in
   /usr/local/apache/htdocs/remotemanager/users/java.php on line 4

 3)  when I run apache in error.log

  PHP Warning:  Unable to load dynamic library './libphp_java.so' -
 ld.so.1:
  /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No
such
 file  or directory in Unknown on line 0
  [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
  configured --
   resuming normal operations
  [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) :



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




RE: [PHP] PHP and Java

2002-03-01 Thread Hunter, Ray

Is the libphp_java.so located in your apache libexec directory?



Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 10:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and Java


 I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

   I did compile php with-java

   1) Java section in php.ini
   [Java]
   java.home = /usr/java1.2
   java.class.path = /usr/local/lib/php/php_java.jar
   java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
   java.library.path = /usr/local/lib/php

   2) prueba.php
   html
   body
   ?
 $system = new Java();
 print Java version=.$system-getProperty(java.version). br\n;
 print Java vendor=.$system-getProperty(java.vendor). p\n\n;
 print OS=.$system-getProperty(os.name). .
 $system-getProperty(os.version). on .
 $system-getProperty(os.arch). br\n;

 $formatter = new Java(java.text.SimpleDateFormat,
   ,  dd,  'at' h:mm:ss a );

 print $formatter-format(new Java(java.util.Date)).\n;

   ?
   html


   the error in browser is:
   Fatal error: Cannot instantiate non-existent class: java in
   /usr/local/apache/htdocs/remotemanager/users/java.php on line 4

 3)  when I run apache in error.log

  PHP Warning:  Unable to load dynamic library './libphp_java.so' -
 ld.so.1:
  /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No
such  file  or directory in Unknown on line 0
  [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
  configured --
   resuming normal operations
  [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) :



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



[PHP] Tank you very much for all

2002-03-01 Thread Michele Salerno

I unsubscribe the mailing list, i haven't help in mailing-list.
I'haven't response the my post...

Cancello la sottoscrizione perché vedo che non ho risposte da nessuno, e solitamente 
faccio iscrizioni per imparare e non solo per dare. Pensavo che qui avrei trovato 
pace, ma solo perché non conosco l'inglese devo essere tagliato fuori...e non 
l'accetto!
Ciao a tutti
Michele

--
Web Master di:
http://www.coopmediante.it
Web Administrator di:
http://www.mediateca2000.net



[PHP] Re: hmm.. more trouble with telnet.

2002-03-01 Thread J Smith


It means bash can't find the file called mysql If it could, it would 
show you a path to the file, like

$ whereis mysql
mysql: /usr/bin/mysql

If your server has locate or slocate, try them instead (This assumes they 
have an up to date locate database If not, you may have to run updatedb, 
if you have the proper permissions)

J


Sean Kennedy wrote:

 Hello,
 
 When I type in 'whereis mysql' it says 'mysql:' so what does that mean?
 
 -Sean


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




RE: [PHP] RE: Andrey this is for you.

2002-03-01 Thread Demitrious S. Kelly

Type: 

find / -name mysql -type f 2 /dev/null

if  you see something like /usr/local/bin/mysql then you do (that dosent
mean that the demon is running, but the client is at least installed...

to see if you have the daemon installed 

find / -name safe_mysqld -type f 2 /dev/null

and to see if it's running type netstat -lnp and look for port 3306,
or mysql in the listing...


-Original Message-
From: Sean Kennedy [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: Andrey this is for you.

hello,

locate mysql returned this:

/home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
/home/sites/home/web/CFIDE/administrator/datasources/drivers/myodbc_mysq
l.cfm
/home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
/home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.c
fm
/home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
/home/coldfusion/lib/CFmysql15.so
/home/coldfusion/scripts/mysql_expire.cfm 

what does this mean? do i have mysql? thanks,

-sean


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




RE: [PHP] PHP and Java

2002-03-01 Thread Proyecto de Grado

no, it isn't. it is in usr/local/lib/php/modules

 Is the libphp_java.so located in your apache libexec directory?



 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java


  I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

I did compile php with-java

1) Java section in php.ini
[Java]
java.home = /usr/java1.2
java.class.path = /usr/local/lib/php/php_java.jar
java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
java.library.path = /usr/local/lib/php

2) prueba.php
html
body
?
  $system = new Java();
  print Java version=.$system-getProperty(java.version). br\n;
  print Java vendor=.$system-getProperty(java.vendor). p\n\n;
  print OS=.$system-getProperty(os.name). .
  $system-getProperty(os.version). on .
  $system-getProperty(os.arch). br\n;

  $formatter = new Java(java.text.SimpleDateFormat,
,  dd,  'at' h:mm:ss a );

  print $formatter-format(new Java(java.util.Date)).\n;

?
html


the error in browser is:
Fatal error: Cannot instantiate non-existent class: java in
/usr/local/apache/htdocs/remotemanager/users/java.php on line 4

  3)  when I run apache in error.log

   PHP Warning:  Unable to load dynamic library './libphp_java.so' -
  ld.so.1:
   /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No
 such  file  or directory in Unknown on line 0
   [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
   configured --
resuming normal operations
   [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl)
:



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




RE: [PHP] PHP and Java

2002-03-01 Thread Hunter, Ray

If you are running this on apache then it needs to be in the libexec
directory of apache where it looks for the *.so modules that are to be
loaded.

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 10:56 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP and Java


no, it isn't. it is in usr/local/lib/php/modules

 Is the libphp_java.so located in your apache libexec directory?



 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java


  I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

I did compile php with-java

1) Java section in php.ini
[Java]
java.home = /usr/java1.2
java.class.path = /usr/local/lib/php/php_java.jar
java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
java.library.path = /usr/local/lib/php

2) prueba.php
html
body
?
  $system = new Java();
  print Java version=.$system-getProperty(java.version). br\n;
  print Java vendor=.$system-getProperty(java.vendor). p\n\n;
  print OS=.$system-getProperty(os.name). .
  $system-getProperty(os.version). on .
  $system-getProperty(os.arch). br\n;

  $formatter = new Java(java.text.SimpleDateFormat,
,  dd,  'at' h:mm:ss a );

  print $formatter-format(new Java(java.util.Date)).\n;

?
html


the error in browser is:
Fatal error: Cannot instantiate non-existent class: java in
/usr/local/apache/htdocs/remotemanager/users/java.php on line 4

  3)  when I run apache in error.log

   PHP Warning:  Unable to load dynamic library './libphp_java.so' -
  ld.so.1:
   /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: 
 No such  file  or directory in Unknown on line 0
   [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
   configured --
resuming normal operations
   [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: 
 fcntl)
:



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



Re: [PHP] mysql and telnet.

2002-03-01 Thread bvr


What do you want to know?

Is my ISP offering mysql ?
Is it available to me ?
Is it installed on this particular server ?

WHAT?

If you would like to use MySQL, you should have *access* to a
mysql server If you don't know a username and password, you probably 
haven't

And as you say it, you connected to your *web* server
Doesn't that sorta mean it's not a *database* server ?

bvr

bvr


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Re: get the median from an array of integers

2002-03-01 Thread Daniel Grace


 The web page features ten listboxes, each of which contains the same
 options  Let's say that you can choose A, B, C, D, or E from each
 listbox  Submit the form, run some code to figure out which was
 most-frequently selected, and then display that value on the next page

 That's all I really want to do, but I'm pretty bad at math -- I could
 enter all the values into an array and run some kind of averaging code
 on them, but the problem is that I don't want an average, I need the
 most-chosen value


As for the median value, there's a relatively easy way to do this in PHP:

1 Sort the array   (sort())
2 Count the number of elements in the array   (count())
3 Take the element that is equal to half the number of the elements
(rounded to an int, which way you round doesn't matter)
(really_easy_code())

Might be off-by-1 but that's fixed easily enough

-- Daniel Grace



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] PHP and Java

2002-03-01 Thread Richard Fox

From my experience getting Java to run w/ PHP and Apache on RedHat 70, you
can try setting the LD_LIBRARY_PATH environment variable ( without which my
Java would not run) set to the location of libjavaso, libjvmso, and
php_javajar, in my case (without line feeds)

 LD_LIBRARY_PATH=/usr/java/j2sdk140/jre/lib/i386:
/usr/java/j2sdk140/jre/lib/i386/server:/usr/local/lib/php

Rich



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] echo array and integrate two forms

2002-03-01 Thread Andrea Caldwell

Hope this doesn't sound too lame from the newbie I have a form, code shown
here that has input fields for each row I'd like to do two things:

1) Change the REALNAME field to just echo the row  not have an input field
(I've tried to do this  it just echoes my code back to me)

2) Integrate a second form here that uses the same $result, but points to
another page to 'modify entry' instead of 'remove entry' How could I
implement this?

Thanks for any help in advance, it is MUCH appreciated!!

__
while ($row = mysql_fetch_assoc($result)) {

echo('

table border=1 cellpadding=5
form name=remove method=post action=remove_entryphp
tr
td NAME
/td
tdinput type=text size=25 name=phone
value='$row[realname]'/td
tr
tdOFFICE PHONE
/td
td
input type=text size=25 name=phone value='$row[phone]'
/td
/tr
tr
td
input type=submit name=remove value=Remove Entry/td
/tr
/form
/table');
}
?




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] inspiration needed on problem s

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all
I'm all out of inspiration in finding an elegant solution to a little
problem, hope you guys can lend a hand :-)

I have a form thats values are object properties The object is carried
in the current session

As a result my reset button won't work as the object still exists and so
does it's properties How can I make it so that the reset destroys or
resets the properties?

Many thanks
- -- 
- ---
 wwwexplodingnetcom   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers

-BEGIN PGP SIGNATURE-
Version: GnuPG v106 (GNU/Linux)

iD8DBQE8f8mgHpvrrTa6L5oRAqZsAKCdaQkIQOgs1dTRbvHcfoEj9VYhiwCgk8r6
xlWPCeA3HyvhBeEYikNxMLM=
=itz4
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Has anybody used whizhost?

2002-03-01 Thread Leif K-Brooks

I'm thinking of switching my website t whizhost (http://hizhostcom/)
It has more features than my current host, and is a dollar a month less
Has anybody ever used them?  Please tell me if they were good or not 

-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] RE PHP

2002-03-01 Thread Proyecto de Grado



I used 
LD_LIBRARYPATH=/usr/local/lib:/usr/java1.2/jre/lib/sparc:/usr/local/lib/php/modules  
but the problems
1) PHP Warning:  Unable to load dynamic library './libphp_java.so' - ld.so.1: 
 /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No 
 such  file  or directory in Unknown on line 0 
 [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 
 configured --resuming normal operations 
 [Fri Mar  1 12:06:01 2002] [notice] Accept mutex continued.

2)   Fatal error: Cannot instantiate non-existent class: java in 
 /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 

follow.


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java

From my experience getting Java to run w/ PHP and Apache on RedHat 7.0, you
can try setting the LD_LIBRARY_PATH environment variable ( without which my
Java would not run) set to the location of libjava.so, libjvm.so, and
php_java.jar, in my case (without line feeds)

 LD_LIBRARY_PATH=/usr/java/j2sdk1.4.0/jre/lib/i386:
/usr/java/j2sdk1.4.0/jre/lib/i386/server:/usr/local/lib/php

Rich

 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java



no, it isn't. it is in usr/local/lib/php/modules

 Is the libphp_java.so located in your apache libexec directory?



 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java


  I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

I did compile php with-java

1) Java section in php.ini
[Java]
java.home = /usr/java1.2
java.class.path = /usr/local/lib/php/php_java.jar
java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
java.library.path = /usr/local/lib/php

2) prueba.php
html
body
?
  $system = new Java();
  print Java version=.$system-getProperty(java.version). br\n;
  print Java vendor=.$system-getProperty(java.vendor). p\n\n;
  print OS=.$system-getProperty(os.name). .
  $system-getProperty(os.version). on .
  $system-getProperty(os.arch). br\n;

  $formatter = new Java(java.text.SimpleDateFormat,
,  dd,  'at' h:mm:ss a );

  print $formatter-format(new Java(java.util.Date)).\n;

?
html


the error in browser is:
Fatal error: Cannot instantiate non-existent class: java in
/usr/local/apache/htdocs/remotemanager/users/java.php on line 4

  3)  when I run apache in error.log

   PHP Warning:  Unable to load dynamic library './libphp_java.so' -
  ld.so.1:
   /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No
 such  file  or directory in Unknown on line 0
   [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
   configured --
resuming normal operations
   [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) 




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




[PHP] mod_rewrite

2002-03-01 Thread Adrian Murphy

I'm building a website buider app and I'm giving users a
url of the form  username.mysite.com but I want to redirect
all url's that end with mysite.com to a script and query
the db based on username.I've learned that I need to use
mod_rewrite for this.The documentation suggests that this will cause
extra load on the cpu.should I be worried about this?
I'm hosting with a third party.What will their reaction to this be.
Has anyone done this sort of thing and is it advisable.
I don't want to redirect from a 404 page as there's a search engine issue with that.
As a side issue,there may be a lot of database updating
involed in the site and i'm wondering should i use mysql(i am at the moment).
any real world examples of the performance of mysql?I know it's great for selects.
Thanx
adrian murphy



[PHP] compile php with GD2

2002-03-01 Thread Hendrik

hi there,

i tried to compile php with GD2 support and the following configure line:

./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-curl 
--with-swf=/usr/local/flash --enable-ftp --with-gd=/usr/lib --with-jpeg-dir=/usr/local 
--with-xpm-dir=/usr/X11R6 --with-png-dir=/usr --with-imap --with-ming 
--enable-magic-quotes --with-mysql --enable-safe-mode --enable-track-vars --with-ttf 
--enable-versioning --with-zlib




...but i allways get the following error:



checking whether to include include FreeType 1.x support... yes
checking whether to include T1lib support... no
configure: error: Unable to find libgd.(a|so) anywhere under yes




Problem is, that the libgd.a file IS located in /usr/lib, as set in --with-gd, but it 
doesnt matter how i edit the line, i allways get this error.

Does anyone have an idea, what i could try to get it compiled?



Regards,



Duncan




Re: [PHP] inspiration needed on problem s

2002-03-01 Thread Steven Walker

Nick,

If I understand the problem correctly, the form reset button doesn't
work when the form is prefilled with POST data.

To overcome this, I created reset button of type='submit' value='Reset'.
When loading the form page I test to see if submit=='Reset' or 'Submit'.
If it equals 'Reset', then I clear all the data.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, March 1, 2002, at 10:34  AM, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all
 I'm all out of inspiration in finding an elegant solution to a little
 problem, hope you guys can lend a hand :-)

 I have a form thats values are object properties. The object is carried
 in the current session.

 As a result my reset button won't work as the object still exists and so
 does it's properties. How can I make it so that the reset destroys or
 resets the properties?

 Many thanks
 - --
 - ---
  www.explodingnet.com   |Projects, Forums and
 +Articles for website owners
 - -- Nick Wilson -- |and designers.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8f8mgHpvrrTa6L5oRAqZsAKCdaQkIQOgs1dTRbvHcfoEj9VYhiwCgk8r6
 xlWPCeA3HyvhBeEYikNxMLM=
 =itz4
 -END PGP SIGNATURE-

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


Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Re: PHP and Java

2002-03-01 Thread Proyecto de Grado



I used 
LD_LIBRARYPATH=/usr/local/lib:/usr/java1.2/jre/lib/sparc:/usr/local/lib/php/modules  
but the problems
1) PHP Warning:  Unable to load dynamic library './libphp_java.so' - ld.so.1: 
 /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No 
 such  file  or directory in Unknown on line 0 
 [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 
 configured --resuming normal operations 
 [Fri Mar  1 12:06:01 2002] [notice] Accept mutex continued.

2)   Fatal error: Cannot instantiate non-existent class: java in 
 /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 

follow.


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java

From my experience getting Java to run w/ PHP and Apache on RedHat 7.0, you
can try setting the LD_LIBRARY_PATH environment variable ( without which my
Java would not run) set to the location of libjava.so, libjvm.so, and
php_java.jar, in my case (without line feeds)

 LD_LIBRARY_PATH=/usr/java/j2sdk1.4.0/jre/lib/i386:
/usr/java/j2sdk1.4.0/jre/lib/i386/server:/usr/local/lib/php

Rich

 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java



no, it isn't. it is in usr/local/lib/php/modules

 Is the libphp_java.so located in your apache libexec directory?



 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java


  I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

I did compile php with-java

1) Java section in php.ini
[Java]
java.home = /usr/java1.2
java.class.path = /usr/local/lib/php/php_java.jar
java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
java.library.path = /usr/local/lib/php

2) prueba.php
html
body
?
  $system = new Java();
  print Java version=.$system-getProperty(java.version). br\n;
  print Java vendor=.$system-getProperty(java.vendor). p\n\n;
  print OS=.$system-getProperty(os.name). .
  $system-getProperty(os.version). on .
  $system-getProperty(os.arch). br\n;

  $formatter = new Java(java.text.SimpleDateFormat,
,  dd,  'at' h:mm:ss a );

  print $formatter-format(new Java(java.util.Date)).\n;

?
html


the error in browser is:
Fatal error: Cannot instantiate non-existent class: java in
/usr/local/apache/htdocs/remotemanager/users/java.php on line 4

  3)  when I run apache in error.log

   PHP Warning:  Unable to load dynamic library './libphp_java.so' -
  ld.so.1:
   /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No
 such  file  or directory in Unknown on line 0
   [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
   configured --
resuming normal operations
   [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) 





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




Re: [PHP] PHP and Java

2002-03-01 Thread Richard Fox

Minor point, but you do mean LD_LIBRARY_PATH, not LD_LIBRARYPATH right?

Also, set

[Java]
extension = libphp_javaso
extension_dir = (pathname to libphp_javaso)

Rich



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] posting data with curl

2002-03-01 Thread wm

is there a way using curl or another way to post data to a script, but
then to actually
be tranferred to that page? (of course i mean without a submit
buttonan auto post sort of thing) using curl the script seems to
wait for return data and
doesn't give control to the url that the data was passed to

i know this is possible using the submit() function with javascript, but
that won't work
for this situation

any ideas? is there something in curl that i'm missing that will do
this?
i tried followlocation and it didn't seem to work?

thanks




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Re: posting data with curl

2002-03-01 Thread Julio Nobrega Trabalhando

  Submit the data to the action= url of the form, not to the form's page.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Wm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 is there a way using curl or another way to post data to a script, but
 then to actually
 be tranferred to that page? (of course i mean without a submit
 buttonan auto post sort of thing.). using curl the script seems to
 wait for return data and
 doesn't give control to the url that the data was passed to.

 i know this is possible using the submit() function with javascript, but
 that won't work
 for this situation.

 any ideas? is there something in curl that i'm missing that will do
 this?
 i tried followlocation and it didn't seem to work?

 thanks.






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




[PHP] Re: PHP and Java

2002-03-01 Thread Proyecto de Grado

the var is LD_LIBRARY_PATH  ok!

[Java]
javahome=/usr/java12
javaclasspath=/usr/local/lib/php/php_javajar:/usr/java12/srcjar
javalibrarypath=/usr/local/lib/php/extensions/no-debug-non-zts-20010901:/usr/java12/jre/lib/sparc
javalibrary=/usr/java12/jre/lib/sparc/libjavaso
extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20010901 
(it is ok!)
extension=libphp_javaso



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




RE: [PHP] Re: PHP and Java

2002-03-01 Thread Hunter, Ray

What needs to be done here: You need to have the libphp_java.so in the
libexec directory of apache so that it can load the module.  Your error 2 is
because the module is not loaded.  Fix the 1 problem and the second will go
away.  

Plus,  I would run Tomcat and have that handle of all your java and access
php through java...This is faster and reliable.  Java in php is not as
faster or reliable.  Check the php documentation on this...

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 01, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: PHP and Java




I used
LD_LIBRARYPATH=/usr/local/lib:/usr/java1.2/jre/lib/sparc:/usr/local/lib/php/
modules  
but the problems
1) PHP Warning:  Unable to load dynamic library './libphp_java.so' -
ld.so.1: 
 /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No 
 such  file  or directory in Unknown on line 0 
 [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 
 configured --resuming normal operations 
 [Fri Mar  1 12:06:01 2002] [notice] Accept mutex continued.

2)   Fatal error: Cannot instantiate non-existent class: java in 
 /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 

follow.


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
 mailto:[EMAIL PROTECTED]%5D
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java

From my experience getting Java to run w/ PHP and Apache on RedHat 7.0, 
you can try setting the LD_LIBRARY_PATH environment variable ( without 
which my Java would not run) set to the location of libjava.so, 
libjvm.so, and php_java.jar, in my case (without line feeds)

 LD_LIBRARY_PATH=/usr/java/j2sdk1.4.0/jre/lib/i386:
/usr/java/j2sdk1.4.0/jre/lib/i386/server:/usr/local/lib/php

Rich

 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
 mailto:[EMAIL PROTECTED]%5D
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java



no, it isn't. it is in usr/local/lib/php/modules

 Is the libphp_java.so located in your apache libexec directory?



 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] 
 mailto:[EMAIL PROTECTED]%5D
mailto:[EMAIL PROTECTED]%5D
 Sent: Friday, March 01, 2002 10:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP and Java


  I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7

I did compile php with-java

1) Java section in php.ini
[Java]
java.home = /usr/java1.2
java.class.path = /usr/local/lib/php/php_java.jar
java.library=/usr/java1.2/jre/lib/sparc/libjvm.so
java.library.path = /usr/local/lib/php

2) prueba.php
html
body
?
  $system = new Java();
  print Java version=.$system-getProperty(java.version). br\n;
  print Java vendor=.$system-getProperty(java.vendor). p\n\n;
  print OS=.$system-getProperty(os.name). .
  $system-getProperty(os.version). on .
  $system-getProperty(os.arch). br\n;

  $formatter = new Java(java.text.SimpleDateFormat,
,  dd,  'at' h:mm:ss a );

  print $formatter-format(new Java(java.util.Date)).\n;

?
html


the error in browser is:
Fatal error: Cannot instantiate non-existent class: java in
/usr/local/apache/htdocs/remotemanager/users/java.php on line 4

  3)  when I run apache in error.log

   PHP Warning:  Unable to load dynamic library './libphp_java.so' -
  ld.so.1:
   /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: 
 No such  file  or directory in Unknown on line 0
   [Fri Mar  1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1
   configured --
resuming normal operations
   [Fri Mar  1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: 
 fcntl)





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



[PHP] Re: PHP and Java

2002-03-01 Thread Proyecto de Grado

the var is LD_LIBRARY_PATH  ok!

[Java]
javahome=/usr/java12
javaclasspath=/usr/local/lib/php/php_javajar:/usr/java12/srcjar
javalibrarypath=/usr/local/lib/php/extensions/no-debug-non-zts-20010901:/usr/java12/jre/lib/sparc
 

javalibrary=/usr/java12/jre/lib/sparc/libjavaso
extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20010901 
(it is ok!)
extension=libphp_javaso

the problem continue
1) PHP Warning:  Unable to load dynamic library '/libphp_javaso' - 
ldso1: /usr/ local/apache/bin/httpd: fatal: /libphp_javaso: open 
failed: No such  file  or directory in Unknown on line 0 [Fri Mar  1 
12:06:01 2002] [notice] Apache/1322 (Unix) PHP/411 configured --
resuming normal operations [Fri Mar  1 12:06:01 2002] [notice] Accept 
mutex continued

2)   Fatal error: Cannot instantiate non-existent class: java in 
/usr/local/apache/htdocs/remotemanager/users/javaphp on line 4
follow


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP] Unofficial Cobalt PHP 4.1.2 PKG available

2002-03-01 Thread Andres Petralli

Hi Everyone,

I was urged to compile a new php 4.1.2. module to fix that security bug
in earlier versions for our Cobalt RaQ servers. I made a nice *.pkg file
which everyone can get on
ftp://ftp.cobalthosting.ch/pub/optional/RaQ3-PHP-4.1.2-1.pkg  should
anyone be interested in it.

legal protection
BE AWARE, THIS IS NO OFFICIAL COBALT PKG. NO WARRANTY IS GIVEN BY
ANYONE!
/legal protection

If anyone would like to install it on their system, just go on, but I
will not give any warranty on that PKG. Should you find something wrong
with the package, please write to me personally at
a.petralli@arpanet.remove-nospam.ch . I will be commited to fix any
bugs and post new versions of the pkg to the ftp server.

The package expects an updated system, up to the latest kernel upgrade.
It comes with the following libraries and functions:

- expat XML
- GD 1.8.4 für WBMP, PNG, JPEG, kein GIF Support
- Freetype 2
- PDFLib
- LDAP
- IMAP4
- MySQL
- PostgresSQL
- Zlib
- T1Lib
- FTP Support
- Sockets Support
- PCRE

Also let me know, if you liked the package, should you use it...

Greets,

Andres

-- 
Andres Petralli, Arpanet AG
Steinengraben 18, 4002 Basel, Switzerland
Tel: +41 (0)61 276 96 60, Fax: +41 (0)61 276 96 66
http://www.arpanet.ch/
PGP: CDD7 E772 D14B 407A 4343  6901 74A5 A74D AE98 6BE4  

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




Re: Re: [PHP] compile php with GD2

2002-03-01 Thread Hendrik

hi again,

well sorry about that, it worked when i changed it to:

./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-curl 
--with-swf=/usr/local/flash --enable-ftp --with-gd=/usr --with-jpeg-dir=/usr/local 
--with-xpm-dir=/usr/X11R6 --with-png-dir=/usr --with-imap 
--with-ming=/usr/src/ming-0.2a --enable-magic-quotes --with-mysql --enable-safe-mode 
--enable-track-vars --with-ttf --enable-versioning --with-zlib

...however, now i ran into another problem: Ming!
The source is located /usr/src/ming-0.2a
and the installed files are located:
/usr/lib
/usr/include

but neither of these 3 is accepted in the configure line.
Or can i just leave it in the configure line and then just add the php_ming.so file, 
copy it into the extension dir and add it to php.ini file?

Regards,

Duncan






[PHP] Non printable page

2002-03-01 Thread Diana Castillo

Is there any way tomake a page that cannot be printed??



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] Re: get the median from an array of integers

2002-03-01 Thread Erik Price


On Friday, March 1, 2002, at 02:28  PM, Jason Wong wrote:

 On Saturday 02 March 2002 02:03, Daniel Grace wrote:
 As for the median value, there's a relatively easy way to do this in 
 PHP:

 I think Erik has gotten his terms mixed. He wants the most-chosen 
 value,
 which is the mode and not median.

 To get the mode, use array_count_values();


I told you guys I was bad at math!  I don't even remember the terms... 
thanks to everyone who replied to this thread with advice, it looks like 
I can do:

- grab all values from the desired inputs and slap them into an array
- run the array against array_count_values() to get the number of each
   input value in that array (in the form of a new array)
- rsort the resulting new array (of 'value = occurrences' form) to put 
the
   highest-numbered array at the beginning of the array
- the key of the first element in this rsorted array is the value I am
   looking for -- the most-chosen value from the initial user inputs
- array_flip the array inside the first element of the rsorted array to 
make
   the key into the value and vice versa
- my desired value is now the value of the first element in the array

It seems like a lot of work, but sounds logical.  The end result is the 
most-chosen value from the user inputs becomes the value of the first 
element in the array returned by array_count_values() after that array 
has been rsorted and flipped.

Crazy!


Erik

PS: can anyone see a flaw in this scheme?  Can anyone even tell what I'm 
talking about?





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Non printable page

2002-03-01 Thread Scott St. John

Black background, white text used to work :)


On Fri, 1 Mar 2002, Diana Castillo wrote:

 Is there any way tomake a page that cannot be printed??
 
 
 
 

-- 



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] Non printable page

2002-03-01 Thread Lars Torben Wilson

Diana Castillo writes:
 Is there any way tomake a page that cannot be printed??

No. If you display data on my machine I can do anything with it,
since it must exist on my machine in some form in order to be
displayed.


-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] passing array of variables in a query string

2002-03-01 Thread Richard Baskett

If you have control over the query string, just name your variable 'state[]'
and then when it is passed through the query string as:

http://www.archipro.com/test.php?state[]=ABstate[]=BC

PHP will see that it is an array and will parse it as such and you can
access the variables as an array.

Cheers!

Rick

We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action. - Frank
Tibolt

 - Original Message -
 From: Diana Castillo [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, March 01, 2002 6:42 PM
 Subject: [PHP] passing array of variables in a query string
 
 
 I was wondering if someone could help me
 with this:
 what I need to know is how to pick up an array of variables from
 a query string such as:
 http://www.archipro.com/test.php?state=ABstate=BC
 If I use $state, I get only the last one.


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




  1   2   >