[PHP] XSLT Transformation

2002-12-28 Thread Boris Kolev
Hello php-general,

  I have a problem with XSLT Transformation. I have in one page HTML
  that is in my php page and one $result - where i transform one XSLT
  file. When php show HTML - no problems but when i print $result
  after HTML iyt can be read. In XSLT and XML i use UTF-8 ecnoding
  after transformation i tray to use utf8_decode and encode functions
  but all in $result can be read!
  Please Help me !

  Best regards,
  Boris  mailto:[EMAIL PROTECTED]


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




RE: [PHP] object vs functions

2002-12-28 Thread Paul Reed
Objects are not simply a 'grouping' of functions, it's a fundamentally
different approach to programming where variable and functions are
grouped into objects. (OOP, or Object Oriented Programming)

Objects contain all the necessary variables to hold the information on
an item, and all the functions that work on that particular item.

A class is simply a 'blue-print' for an object. (each object is made
from that blueprint.)

Say for instance you were doing a used auto site, and this site had many
cars of different makes and models, and you wanted to assign a different
markup to each car.

Class c_Car
{
  var $make;
  var $model;
  var $color;
  var $cost;
  var $markup;

  function price()
  {
// '$this-cost' means the $cost variable in the current object.
$price=$this-cost+($this-cost*$this-markup);
return $price;
  }
}

// so I have 2 cars

$car1=new c_Car; 
$car1-cost=1;// what the car cost you.
$car1-markup=0.05;   // 5% markup from cost for this car.

$car2=new c_Car;
$car2-cost=7500; // what the car cost you.
$car2-markup=0.10;   // 10% markup from cost for this car.

echo $car1-price();  // output the price of car1, (10500).
echo $car2-price();  // output the price of car2, (8250).

As you can see, the function works internally to the object.

To learn more, you should really read up on OOP. Overall it's an easier
way to do most sites, but sometimes a simple collection of functions in
an include file may be more practical (usually for sites with very
little PHP).

In the last few months, I have shifted my own programming techniques to
use classes and I have found it tends to work better for almost every
situation. Personally, I wish I had found out about them sooner!

Hope this helps, (And I hope it makes sense, as I'm writing at 4:05am!)

Paul Reed.






-Original Message-
From: Mat Harris [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 27, 2002 21:18
To: [EMAIL PROTECTED]
Subject: [PHP] object vs functions

if i have a php script containing some functions, then all i have to do
is
include() the file and then call the functions.

if i had an object (taking the example from php.net):

?php
class foo
{
function do_foo()
{
echo Doing foo.; 
}
}

$bar = new foo;
$bar-do_foo();
?
 
what is the point of having the object, when i could just call the
functions?

what are the uses of objects over functions/groups of functions?

sorry if this is an innane or frequently asked question.

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]www.genestate.com   



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




[PHP] rounding...sort of

2002-12-28 Thread Peter Lavender
Hi everyone,

I have a nubmer: 4.1 but I only want the whole number 4, even if it's
4.9, so this rules out using round (Unless I missed a parameter).

How could I do this.. I'm drawing a blank...

Pete




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




Re: [PHP] rounding...sort of

2002-12-28 Thread Jason Wong
On Saturday 28 December 2002 17:49, Peter Lavender wrote:
 Hi everyone,

 I have a nubmer: 4.1 but I only want the whole number 4, even if it's
 4.9, so this rules out using round (Unless I missed a parameter).

 How could I do this.. I'm drawing a blank...

floor()

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Remark of Dr. Baldwin's concerning upstarts: We don't care to eat toadstools
that think they are truffles.
-- Mark Twain, Pudd'nhead Wilson's Calendar
*/


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




Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread Rick Widmer
At 08:40 PM 12/27/02 -0700, The Doctor wrote:



Is it just my or are there problems with static Aapche 1.3.27 compiles?


I don't know if it is _just_ you, but my static install compiled and is 
running just fine.

SuSE 8.0

php 4.3.0

Apache 1.3.27

Mod_SSL 2.8.12-1.3.27

OpenSSL 0.9.6h

ming 0.2a

pdflib 4.0.3

./configure --with-apache=../apache --with-mysql --with-pgsql=/usr 
--enable-cli --enable-calendar --enable-debug=no 
--with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local 
--with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr 
--enable-gd-native-ttf --with-freetype=/usr/include/freetype2 
--with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm 
--with-pspell




Script started on Fri Dec 27 20:34:45 2002
nl2k.ca//usr/source/php-4.3.0$ cat configphp

configure --prefix=/usr/contrib --localstatedir=/var 
--infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory 
--with-elf --with-x   --with-mysql --with-zlib --enable-track-vars 
--enable-debug  --enable-versioning --with-config-file-path=/usr/local/lib 
--with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp --with-gd=/usr 
--enable-imap --with-bz2 
--with-apache=/usr/source/apache_1.3.27_nonSSL/ 
--with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf 
--with-jpeg-dir=/usr --with-png-dir=/usr 
--with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib


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




[PHP] Date fields

2002-12-28 Thread Peter Goggin

I have a form with several date fields. I want to be able to set these by
selecting from a calendar display.  Does anyone know of any php function or
code which would let me do this?

Regards

Peter Goggin


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




php-general Digest 28 Dec 2002 13:02:28 -0000 Issue 1789

2002-12-28 Thread php-general-digest-help

php-general Digest 28 Dec 2002 13:02:28 - Issue 1789

Topics (messages 129482 through 129496):

Re: php app frameworks?
129482 by: Jason Sheets
129486 by: michael kimsal
129487 by: Javier

Re: exec, system , backtick
129483 by: Michael Sims
129489 by: gamin
129490 by: gamin

object vs functions
129484 by: Mat Harris
129492 by: Paul Reed

Re: PHP 4.3.0 released
129485 by: The Doctor
129495 by: Rick Widmer

some multiple array problems...
129488 by: Victor

XSLT Transformation
129491 by: Boris Kolev

rounding...sort of
129493 by: Peter Lavender
129494 by: Jason Wong

Date fields
129496 by: Peter Goggin

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
If you go to www.hotscripts.com they have several PHP application
frameworks listed.

I've investigated PHPLIB, and horde (http://www.horde.org) but wound up
creating my own framework because I have not yet found a well documented
framework that does what I need it to do.

Jason

On Fri, 2002-12-27 at 13:51, Jeff D. Hamann wrote:
 What application frameworks are avail for php?
 
 Jeff.
 
 --
 Jeff D. Hamann
 Hamann, Donald  Associates, Inc.
 PO Box 1421
 Corvallis, Oregon USA 97339-1421
 Bus. 541-753-7333
 Cell. 541-740-5988
 [EMAIL PROTECTED]
 www.hamanndonald.com
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---End Message---
---BeginMessage---
Jason Sheets wrote:

If you go to www.hotscripts.com they have several PHP application
frameworks listed.

I've investigated PHPLIB, and horde (http://www.horde.org) but wound up
creating my own framework because I have not yet found a well documented
framework that does what I need it to do.



What were you looking for that you couldn't find in other products/projects?

Thanks.



---End Message---
---BeginMessage---
[EMAIL PROTECTED] (Jason Sheets) wrote in 
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:

Have you got any documentation of it to share?

 If you go to www.hotscripts.com they have several PHP application
 frameworks listed.
 
 I've investigated PHPLIB, and horde (http://www.horde.org) but wound
 up creating my own framework because I have not yet found a well
 documented framework that does what I need it to do.
 
 Jason
 
 On Fri, 2002-12-27 at 13:51, Jeff D. Hamann wrote:
 What application frameworks are avail for php?
 
 Jeff.


-- 
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)

---End Message---
---BeginMessage---
On Sat, 28 Dec 2002 02:55:44 +0530, you wrote:

I tried a simple command line script, in all cases no_file does not exist. I
do not want the command line script to show the error on the screen but to
deliver it in the variable $r. But alas, in all 3 cases i get 'rm: canoot
remove `no_file': No such file or directory'
[script snipped]

I think this is because your error is being sent to stderr but PHP is
only capturing what is sent to stdout.  I was able to acheive your
desired results by redirecting stderr to stdout via the shell.  Try
the following, it worked for me:

#! /usr/bin/php -q
?
$r = `rm no_file 21`;
echo the value in r is $r;
?

If you need more info on the 21 part, consult the Advanced Bash
Scripting Guide here:

http://www.digitaltoad.net/docs/guide/advshell/io-redirection.html

---End Message---
---BeginMessage---

Maciek Ruckgaber Bielecki [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 how about :
 #!/usr/local/bin/php -q

 ?PHP
 $file = 'no_file';

 if(!is_file($file))
   $mess =  no such file;
 else
   $mess = shell_exec(ls $file);

 echo $mess.\n;
 ?
 regards,
 Maciek Ruckaber Bielecki


Hi Maciek,

   I used rm as an example to illustrate what i want to do, basically i need
to catch an error if it occurs and STOP the script from going ahead and
include the error in a file for later examination. I would be using 'rm,
unzip, tar, rpm' etc commands from inside a PHP script. Micheal Sims' post
has something interesting.

gamin



---End Message---
---BeginMessage---

Michael Sims [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Sat, 28 Dec 2002 02:55:44 +0530, you wrote:
--sniped --

#! /usr/bin/php -q
?
$r = `rm no_file 21`;
echo the value in r is $r;
?

If you need more info on the 21 part, consult the Advanced Bash
Scripting Guide here:

http://www.digitaltoad.net/docs/guide/advshell/io-redirection.html

Thx Michael,

   I tested what you prescribed and it works like a charm. Thanks for the
link to ABSG, a very useful Guide indeed.

Im running a linux system so i have no problem, but how would one redirect
stderr to stdout on a Win 

[PHP] Session changes from version 4.06 to 4.22 ??

2002-12-28 Thread Phil Schwarzmann
I just switched from a web host who used version 4.06 to a web host who
is using version 4.22 - Now none of my PHP scripts will start sessions
properly.  Did something change from version 4.06 to 4.22 concerning
sessions??  I e-mailed my new web host and asked if they disabled
sessionsthey said 'no'

 

Any ideas as to what I'm doing wrong??

 

Kiitos!!




[PHP] holding a page open and then redisplaying

2002-12-28 Thread David T-G
Hi, folks --

I would like to start my db query (in response to a form input) and put
up a friendly I'm working on it page (or image or text block) and then,
when the query is done and I'm ready to display the results, clear that
page and show the real stuff.  I *think* I've seen this done before, but
even if I have I haven't the slightest idea of how.  It's probably more a
browser and HTML question but this seems a likely place to learn about
tricks like that or at least get some pointers :-)

TIA  HAND  Happy Holidays

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg90834/pgp0.pgp
Description: PGP signature


[PHP] 4.3.0 compile error

2002-12-28 Thread Pentothal
I've tried to compile php 4.3.0 under RedHat 6.2 (libtool-1.4-8) and
I got this compile error:

/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2
-avoid-version -module  [... snip ...] -lcrypt -lresolv -lm -ldl
-lnsl -lcrypt  -o sapi/cli/php ext/standard/image.lo: In function
`php_handle_swc':
/usr/src/php-4.3.0/ext/standard/image.c:195: undefined reference to
`uncompress'
/usr/src/php-4.3.0/ext/standard/image.c:217: undefined reference to
`uncompress'
main/SAPI.lo: In function `sapi_header_op':
/usr/src/php-4.3.0/main/SAPI.c:526: undefined reference to
`zlib_globals'
main/SAPI.lo: In function `sapi_send_headers':
/usr/src/php-4.3.0/main/SAPI.c:675: undefined reference to
`zlib_globals'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Any hint?



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




Re: [PHP] Session changes from version 4.06 to 4.22 ??

2002-12-28 Thread John Nichel
Show some code.  Chances are, register globals is off.

Phil Schwarzmann wrote:

I just switched from a web host who used version 4.06 to a web host who
is using version 4.22 - Now none of my PHP scripts will start sessions
properly.  Did something change from version 4.06 to 4.22 concerning
sessions??  I e-mailed my new web host and asked if they disabled
sessionsthey said 'no'

 

Any ideas as to what I'm doing wrong??

 

Kiitos!!




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


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




Re: [PHP] 4.3.0 compile error

2002-12-28 Thread Rasmus Lerdorf
Please include your configure flags.  Chances are you need to add
--with-zlib

On Sat, 28 Dec 2002, Pentothal wrote:

 I've tried to compile php 4.3.0 under RedHat 6.2 (libtool-1.4-8) and
 I got this compile error:

 /bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2
 -avoid-version -module  [... snip ...] -lcrypt -lresolv -lm -ldl
 -lnsl -lcrypt  -o sapi/cli/php ext/standard/image.lo: In function
 `php_handle_swc':
 /usr/src/php-4.3.0/ext/standard/image.c:195: undefined reference to
 `uncompress'
 /usr/src/php-4.3.0/ext/standard/image.c:217: undefined reference to
 `uncompress'
 main/SAPI.lo: In function `sapi_header_op':
 /usr/src/php-4.3.0/main/SAPI.c:526: undefined reference to
 `zlib_globals'
 main/SAPI.lo: In function `sapi_send_headers':
 /usr/src/php-4.3.0/main/SAPI.c:675: undefined reference to
 `zlib_globals'
 collect2: ld returned 1 exit status
 make: *** [sapi/cli/php] Error 1

 Any hint?



 --
 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] 4.3.0 compile error

2002-12-28 Thread Pentothal
Rasmus Lerdorf wrote:

 Please include your configure flags.

Yes, obviously - I need to sleep longer!

./configure \
--with-apxs=/usr/sbin/apxs \
--with-config-file-path=/etc/httpd/conf \
--disable-cgi \
--with-tsrm-pthreads \
--enable-trans-sid \
--enable-sysvsem \
--enable-sysvshm \
--with-zlib=shared


 Chances are you need to add
 --with-zlib

Trying right now without shared.

  I've tried to compile php 4.3.0 under RedHat 6.2 (libtool-1.4-8) and
  I got this compile error:
 
  /bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2
  -avoid-version -module  [... snip ...] -lcrypt -lresolv -lm -ldl
  -lnsl -lcrypt  -o sapi/cli/php ext/standard/image.lo: In function
  `php_handle_swc':
  /usr/src/php-4.3.0/ext/standard/image.c:195: undefined reference to
  `uncompress'
  /usr/src/php-4.3.0/ext/standard/image.c:217: undefined reference to
  `uncompress'
  main/SAPI.lo: In function `sapi_header_op':
  /usr/src/php-4.3.0/main/SAPI.c:526: undefined reference to
  `zlib_globals'
  main/SAPI.lo: In function `sapi_send_headers':
  /usr/src/php-4.3.0/main/SAPI.c:675: undefined reference to
  `zlib_globals'
  collect2: ld returned 1 exit status
  make: *** [sapi/cli/php] Error 1
 
  Any hint?



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




Re: [PHP] XSLT Transformation

2002-12-28 Thread Khalid El-Kary
Hi,
Do you mean that the XSL style sheet is printed instead of the 
transformation result?

if that's the case, i have faced the same problem, and at that time it was 
because of the xsl: namespace check it to verify it's correct, there's a 
deprecated on of it that you may be using and sablotron doesn't use it 
anymore!

the correct namespace is:
http://www.w3.org/1999/XSL/Transform

good luck!

Regards,
Khalid Al-Kary
http://creaturesx.ma.cx/kxparse/

Hello php-general,

  I have a problem with XSLT Transformation. I have in one page HTML
  that is in my php page and one $result - where i transform one XSLT
  file. When php show HTML - no problems but when i print $result
  after HTML iyt can be read. In XSLT and XML i use UTF-8 ecnoding
  after transformation i tray to use utf8_decode and encode functions
  but all in $result can be read!
  Please Help me !

  Best regards,
  Boris  mailto:[EMAIL PROTECTED]


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



_
MSN 8 limited-time offer: Join now and get 3 months FREE*. 
http://join.msn.com/?page=dept/dialupxAPID=42PS=47575PI=7324DI=7474SU= 
http://www.hotmail.msn.com/cgi-bin/getmsgHL=1216hotmailtaglines_newmsn8ishere_3mf


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



Re: [PHP] object vs functions

2002-12-28 Thread Mat Harris
thanks it does help a lot, and I wrote mine at 4:30ish too :).

does anyone know of any tutorials or example projects I can look at to find
out about classes?

thanks for the help

On Sat, Dec 28, 2002 at 04:17:02 -0500, Paul Reed wrote:
 Objects are not simply a 'grouping' of functions, it's a fundamentally
 different approach to programming where variable and functions are
 grouped into objects. (OOP, or Object Oriented Programming)
 
 Objects contain all the necessary variables to hold the information on
 an item, and all the functions that work on that particular item.
 
 A class is simply a 'blue-print' for an object. (each object is made
 from that blueprint.)
 
 Say for instance you were doing a used auto site, and this site had many
 cars of different makes and models, and you wanted to assign a different
 markup to each car.
 
 Class c_Car
 {
   var $make;
   var $model;
   var $color;
   var $cost;
   var $markup;
 
   function price()
   {
 // '$this-cost' means the $cost variable in the current object.
 $price=$this-cost+($this-cost*$this-markup);
 return $price;
   }
 }
 
 // so I have 2 cars
 
 $car1=new c_Car; 
 $car1-cost=1;// what the car cost you.
 $car1-markup=0.05;   // 5% markup from cost for this car.
 
 $car2=new c_Car;
 $car2-cost=7500; // what the car cost you.
 $car2-markup=0.10;   // 10% markup from cost for this car.
 
 echo $car1-price();  // output the price of car1, (10500).
 echo $car2-price();  // output the price of car2, (8250).
 
 As you can see, the function works internally to the object.
 
 To learn more, you should really read up on OOP. Overall it's an easier
 way to do most sites, but sometimes a simple collection of functions in
 an include file may be more practical (usually for sites with very
 little PHP).
 
 In the last few months, I have shifted my own programming techniques to
 use classes and I have found it tends to work better for almost every
 situation. Personally, I wish I had found out about them sooner!
 
 Hope this helps, (And I hope it makes sense, as I'm writing at 4:05am!)
 
 Paul Reed.
 
 
 
 
 
 
 -Original Message-
 From: Mat Harris [mailto:[EMAIL PROTECTED]] 
 Sent: Friday, December 27, 2002 21:18
 To: [EMAIL PROTECTED]
 Subject: [PHP] object vs functions
 
 if i have a php script containing some functions, then all i have to do
 is
 include() the file and then call the functions.
 
 if i had an object (taking the example from php.net):
 
 ?php
 class foo
 {
   function do_foo()
   {
   echo Doing foo.; 
   }
 }
 
 $bar = new foo;
 $bar-do_foo();
 ?

 what is the point of having the object, when i could just call the
 functions?
 
 what are the uses of objects over functions/groups of functions?
 
 sorry if this is an innane or frequently asked question.
 
 -- 
 Mat HarrisOpenGPG Public Key ID: C37D57D9
 [EMAIL PROTECTED]  www.genestate.com   
 

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]www.genestate.com   



msg90840/pgp0.pgp
Description: PGP signature


Re: [PHP] 4.3.0 compile error

2002-12-28 Thread Pentothal
Pentothal wrote:

 Rasmus Lerdorf wrote:

  Please include your configure flags.

 Yes, obviously - I need to sleep longer!

 ./configure \
 --with-apxs=/usr/sbin/apxs \
 --with-config-file-path=/etc/httpd/conf \
 --disable-cgi \
 --with-tsrm-pthreads \
 --enable-trans-sid \
 --enable-sysvsem \
 --enable-sysvshm \
 --with-zlib=shared


  Chances are you need to add
  --with-zlib

 Trying right now without shared.

Ok. It works wen built with non-shared zlib.

Thanks!!!



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




Re: [PHP] exec, system , backtick

2002-12-28 Thread Michael Sims
On Sat, 28 Dec 2002 13:30:49 +0530, you wrote:

Im running a linux system so i have no problem, but how would one redirect
stderr to stdout on a Win machine, if it is possible at all g

I believe it works the same way on NT kernels (NT, 2000, XP) but I
could be wrong.  A friend of mine actually has an entire book on shell
scripting in NT, so apparently the NT shell has SOME functionality.
:-)

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




[PHP] Populating a list box from a database

2002-12-28 Thread Denis L. Menezes
Hello Friends,

Two days ago I had asked how to do this. Thanks for the replies. 

I have done the required code and I can see the html output(Under view- source in the 
IE browser) and see the option values for the listbox are acheived. But the listbox in 
the browser is very thin and does not show the values.

Can someone tell me what is wrong?

Thanks
denis


Re: [PHP] rounding...sort of

2002-12-28 Thread Justin French
php.net/floor

OR

?
list($w,$d) = split('.','4.9');
echo $w;
?

Justin French



on 28/12/02 8:49 PM, Peter Lavender ([EMAIL PROTECTED]) wrote:

 Hi everyone,
 
 I have a nubmer: 4.1 but I only want the whole number 4, even if it's
 4.9, so this rules out using round (Unless I missed a parameter).
 
 How could I do this.. I'm drawing a blank...
 
 Pete
 
 
 


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




Re: [PHP] Populating a list box from a database

2002-12-28 Thread Justin French
SHOW US SOME CODE!!!

none of us are mind readers... either copy a few lines from the HTML source
in IE, or from the PHP script.

Justin

on 29/12/02 4:03 AM, Denis L. Menezes ([EMAIL PROTECTED]) wrote:

 Hello Friends,
 
 Two days ago I had asked how to do this. Thanks for the replies.
 
 I have done the required code and I can see the html output(Under view-
 source in the IE browser) and see the option values for the listbox are
 acheived. But the listbox in the browser is very thin and does not show the
 values.
 
 Can someone tell me what is wrong?
 
 Thanks
 denis


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




[PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
Hello all,

I got a strange problem, a wrong php script was upladed in my hosting server and make 
my website return a dns error ! i've discoverd after one day that my index.php was a 
wrong one ! normally it should return another error related to script not to dns ! can 
someone explain me this ? Is this caused by server configuration or something else ?

this is the correct script url : http://www.dynamix-tn.com/
and this is the wrong script url : http://www.dynamix-tn.com/index-old.php

in localhost the index-old.php return this error, wich i think should be the correct 
error message (at least i can understand that my script is wrong):

Warning: fopen(tmp/sample.htm, r) - No such file or directory in tmp.class.php on 
line 43

Warning: Supplied argument is not a valid File-Handle resource in tmp.class.php on 
line 44

Warning: Supplied argument is not a valid File-Handle resource in tmp.class.php on 
line 45



Thanks,
Hatem



[PHP] Populating a list box from a database - The code

2002-12-28 Thread Denis L. Menezes
select name=OrgName[] size=5 id=OrgName 
?php 
//connecting to the database
$link = mysql_connect(localhost,lodestone,trypass);
if ($link){
   Print ;
   }  else {
   Print No connection to the database;
   }
   if (!mysql_select_db(catapult_com)){
Print Couldn't connect database;
 } else {
 Print .br\n;
 }

$sql=SELECT OrgName From TableResults ORDER BY OrgName;
$result=mysql_query($sql);

While($Organisation=mysql_fetch_array($result))
 {
 Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
 }

?
  /select

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




Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Maciek Ruckgaber Bielecki

be carefull with the results of mysql_fetch_array, array names are DB
field names, for easier access =)

?php
//connecting to the database
$link = mysql_connect(localhost,lodestone,trypass);
if(!$link)
  Print No connection to the database;

if (!mysql_select_db(catapult_com)){
  Print Couldn't connect database;

$sql=SELECT OrgName From TableResults ORDER BY OrgName;

//get result or show what happened
$result=mysql_query($sql)or die(mysql_error());

//start the select
$content = select name=\organization\;

while($orgData=mysql_fetch_array($result))
{
  // note that OrgName is the field name in the database.
  // for value you may use the org_id instead, if you have one in the
DB
  $content .= option
value=\.$orgData['OrgName'].\.$orgData['OrgName']./option\n);
}

$content .=/select\n;

echo $content;

?
hope it helps :-)

--
Few are those who see with their own eyes and feel with their own
hearts.
Albert Einstein
-
Maciek Ruckaber Bielecki



On Sun, 29 Dec 2002, Denis L. Menezes wrote:

 select name=OrgName[] size=5 id=OrgName 
 ?php
 //connecting to the database
 $link = mysql_connect(localhost,lodestone,trypass);
 if ($link){
Print ;
}  else {
Print No connection to the database;
}
if (!mysql_select_db(catapult_com)){
 Print Couldn't connect database;
  } else {
  Print .br\n;
  }

 $sql=SELECT OrgName From TableResults ORDER BY OrgName;
 $result=mysql_query($sql);

 While($Organisation=mysql_fetch_array($result))
  {
  Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
  }

 ?
   /select

 --
 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] Populating a list box from a database - The code

2002-12-28 Thread John Nichel
$Organisation[1] is always going to be empty because you're only 
selecting one item per row from the DB

SELECT OrgName

If you want the same output in both places, just do this...

echo ( option value=\$Organisation[0]\$Organisation[0]\n );

Denis L. Menezes wrote:
select name=OrgName[] size=5 id=OrgName 
?php 
//connecting to the database
$link = mysql_connect(localhost,lodestone,trypass);
if ($link){
   Print ;
   }  else {
   Print No connection to the database;
   }
   if (!mysql_select_db(catapult_com)){
Print Couldn't connect database;
 } else {
 Print .br\n;
 }

$sql=SELECT OrgName From TableResults ORDER BY OrgName;
$result=mysql_query($sql);

While($Organisation=mysql_fetch_array($result))
 {
 Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
 }

?
  /select



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


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




Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Denis L. Menezes
Thanks Maciek.

With the code that you gave me, I am getting the error :

Parse error: parse error in
/usr/local/www/virtual2/66/184/35/184/html/findresults.php on line 114.

My lines are as follows :
$content.= option
value=\.$orgData['OrgName'].\.$orgData['OrgName']./option\n);

Can u help me a little bit more?

Thanks
denis






- Original Message -
From: Maciek Ruckgaber Bielecki [EMAIL PROTECTED]
To: Denis L. Menezes [EMAIL PROTECTED]
Cc: Justin French [EMAIL PROTECTED]; PHP general list
[EMAIL PROTECTED]
Sent: Sunday, December 29, 2002 1:41 AM
Subject: Re: [PHP] Populating a list box from a database - The code



 be carefull with the results of mysql_fetch_array, array names are DB
 field names, for easier access =)

 ?php
 //connecting to the database
 $link = mysql_connect(localhost,lodestone,trypass);
 if(!$link)
   Print No connection to the database;

 if (!mysql_select_db(catapult_com)){
   Print Couldn't connect database;

 $sql=SELECT OrgName From TableResults ORDER BY OrgName;

 //get result or show what happened
 $result=mysql_query($sql)or die(mysql_error());

 //start the select
 $content = select name=\organization\;

 while($orgData=mysql_fetch_array($result))
 {
   // note that OrgName is the field name in the database.
   // for value you may use the org_id instead, if you have one in the
 DB
   $content .= option
 value=\.$orgData['OrgName'].\.$orgData['OrgName']./option\n);
 }

 $content .=/select\n;

 echo $content;

 ?
 hope it helps :-)

 --
 Few are those who see with their own eyes and feel with their own
 hearts.
 Albert Einstein
 -
 Maciek Ruckaber Bielecki



 On Sun, 29 Dec 2002, Denis L. Menezes wrote:

  select name=OrgName[] size=5 id=OrgName 
  ?php
  //connecting to the database
  $link = mysql_connect(localhost,lodestone,trypass);
  if ($link){
 Print ;
 }  else {
 Print No connection to the database;
 }
 if (!mysql_select_db(catapult_com)){
  Print Couldn't connect database;
   } else {
   Print .br\n;
   }
 
  $sql=SELECT OrgName From TableResults ORDER BY OrgName;
  $result=mysql_query($sql);
 
  While($Organisation=mysql_fetch_array($result))
   {
   Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
   }
 
  ?
/select
 
  --
  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] Populating a list box from a database - The code

2002-12-28 Thread John Nichel
Closing parenthesis...remove it.

Denis L. Menezes wrote:

Thanks Maciek.

With the code that you gave me, I am getting the error :

Parse error: parse error in
/usr/local/www/virtual2/66/184/35/184/html/findresults.php on line 114.

My lines are as follows :
$content.= option
value=\.$orgData['OrgName'].\.$orgData['OrgName']./option\n);

Can u help me a little bit more?

Thanks
denis






- Original Message -
From: Maciek Ruckgaber Bielecki [EMAIL PROTECTED]
To: Denis L. Menezes [EMAIL PROTECTED]
Cc: Justin French [EMAIL PROTECTED]; PHP general list
[EMAIL PROTECTED]
Sent: Sunday, December 29, 2002 1:41 AM
Subject: Re: [PHP] Populating a list box from a database - The code




be carefull with the results of mysql_fetch_array, array names are DB
field names, for easier access =)

?php
   //connecting to the database
   $link = mysql_connect(localhost,lodestone,trypass);
   if(!$link)
 Print No connection to the database;

   if (!mysql_select_db(catapult_com)){
 Print Couldn't connect database;

   $sql=SELECT OrgName From TableResults ORDER BY OrgName;

   //get result or show what happened
   $result=mysql_query($sql)or die(mysql_error());

   //start the select
   $content = select name=\organization\;

   while($orgData=mysql_fetch_array($result))
   {
 // note that OrgName is the field name in the database.
 // for value you may use the org_id instead, if you have one in the
DB
 $content .= option
value=\.$orgData['OrgName'].\.$orgData['OrgName']./option\n);
   }

   $content .=/select\n;

   echo $content;

?
hope it helps :-)

--
Few are those who see with their own eyes and feel with their own
hearts.
Albert Einstein
-
Maciek Ruckaber Bielecki



On Sun, 29 Dec 2002, Denis L. Menezes wrote:



select name=OrgName[] size=5 id=OrgName 
   ?php
   //connecting to the database
$link = mysql_connect(localhost,lodestone,trypass);
if ($link){
  Print ;
  }  else {
  Print No connection to the database;
  }
  if (!mysql_select_db(catapult_com)){
   Print Couldn't connect database;
} else {
Print .br\n;
}

$sql=SELECT OrgName From TableResults ORDER BY OrgName;
$result=mysql_query($sql);

While($Organisation=mysql_fetch_array($result))
{
Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
}

?
 /select

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










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


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




Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread The Doctor
On Sat, Dec 28, 2002 at 04:04:14AM -0700, Rick Widmer wrote:
 At 08:40 PM 12/27/02 -0700, The Doctor wrote:
 
 
 Is it just my or are there problems with static Aapche 1.3.27 compiles?
 
 I don't know if it is _just_ you, but my static install compiled and is 
 running just fine.
 
 SuSE 8.0
 
 php 4.3.0
 
 Apache 1.3.27
 
 Mod_SSL 2.8.12-1.3.27
 
 OpenSSL 0.9.6h
 
 ming 0.2a
 
 pdflib 4.0.3
 
 ./configure --with-apache=../apache --with-mysql --with-pgsql=/usr 
 --enable-cli --enable-calendar --enable-debug=no 
 --with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local 
 --with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr 
 --enable-gd-native-ttf --with-freetype=/usr/include/freetype2 
 --with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm 
 --with-pspell
 
 
 
 
 Script started on Fri Dec 27 20:34:45 2002
 nl2k.ca//usr/source/php-4.3.0$ cat configphp
 
 configure --prefix=/usr/contrib --localstatedir=/var 
 --infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory 
 --with-elf --with-x   --with-mysql --with-zlib --enable-track-vars 
 --enable-debug  --enable-versioning --with-config-file-path=/usr/local/lib 
 --with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp --with-gd=/usr 
 --enable-imap --with-bz2 
 --with-apache=/usr/source/apache_1.3.27_nonSSL/ 
 --with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf 
 --with-jpeg-dir=/usr --with-png-dir=/usr 
 --with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib


Same result adding in --enable-cli and --with-PEAR .
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Merry Christmas 2002 and Happy 2003

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




[PHP] 4.2.3 and XML...

2002-12-28 Thread Russell P Jones
My sysadmin just complied 4.2.3 on my Apache web server but is out of town
for the next few weeks. Problem is, all my PHP/domxml stuff is SHOT and
won't work at all anymore. Does anyone know where I can track down the
documentation for 4.2.3, specifically the code changes in domxml. The
changelog's just arent indepth enough and php.net just switched over its
documentation to 4.3.0...

Any help would be hugely appreciated.

Thank you so much,

Russ Jones...

to see the error in action... http://www.collegedems.com/?x=news.php

gracias


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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Sean Burlington
Hatem Ben wrote:

Hello all,

I got a strange problem, a wrong php script was upladed in my hosting server and make my website



return a dns error ! i've discoverd after one day that my
index.php was a wrong one ! normally it should return another error
related to script not to dns ! 

I don't get a dns error on this

I get - 'zero sized reply'


can someone explain me this ?
Is this caused by server configuration or something else ?


I would say that a php error cannot directly cause dns problems - so the 
error message may be wrong ! (what is generating the message ?)

this is the correct script url : http://www.dynamix-tn.com/
and this is the wrong script url : http://www.dynamix-tn.com/index-old.php

in localhost the index-old.php return this error, wich i think should be the correct error message 
at least i can understand that my script is wrong):

Warning: fopen(tmp/sample.htm, r) - No such file or directory in tmp.class.php on line 43

Warning: Supplied argument is not a valid File-Handle resource in tmp.class.php on line 44

Warning: Supplied argument is not a valid File-Handle resource in tmp.class.php on line 45



on your test system - are these error messages the first thing outputed

if the hosting setup is configured not to report error messages - you 
may just be getting an error and no output.

you may be able to override the error reporting on a per-script basis

http://www.php.net/manual/en/function.error-reporting.php

also you could check that the file exists before opening it.

--

Sean


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



Re: [PHP] 4.2.3 and XML...

2002-12-28 Thread John Nichel
The only error I see is a call to an undefined function (xmldocfile), 
which isn't a native php function.  That doesn't have anything to do 
with php's xml functions.

Russell P Jones wrote:
My sysadmin just complied 4.2.3 on my Apache web server but is out of town
for the next few weeks. Problem is, all my PHP/domxml stuff is SHOT and
won't work at all anymore. Does anyone know where I can track down the
documentation for 4.2.3, specifically the code changes in domxml. The
changelog's just arent indepth enough and php.net just switched over its
documentation to 4.3.0...

Any help would be hugely appreciated.

Thank you so much,

Russ Jones...

to see the error in action... http://www.collegedems.com/?x=news.php

gracias





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


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




[PHP] Using strtotime on 'old' dates.

2002-12-28 Thread David J. Johnson
Is there any way to use strtotime on dates earlier than the Unix epoch?  I'm
using strtotime to reformat the date information for insertion into MySQL.
I know that if strtotime is not accomodating, I can use a javascript to
force the date to be entered in a certain format.  But now I think that the
'last week' type input to strtotime is very valuable.

Thanks,
David



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




[PHP] Sorry, really stupid question...

2002-12-28 Thread Phil Powell
Honestly, what does this do:

$fileID = fopen(nicknames.txt, a) or die(Could not open  . $path . 
/nicknames.txt);
   chmod(nicknames.txt, 0755);
   fputs($fileID, $nickname . \n); fflush($fileID); fclose($fileID);

What does it EXACTLY do?  What I'm trying to do is very very simple:  I have the 
nickname of phil and I add it to nicknames.txt as phil + \n.  The next person 
adds his name as bob + \n.  However, this happens:

phil
philbob

Is it due to the way I'm adding to the file?  Can someone show me how to append to a 
file properly without carrying over persistent existing data like what you see above, 
instead having it like this:

phil
bob

Thanx, I'm lost here.

Phil



Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
 I don't get a dns error on this

 I get - 'zero sized reply'

  can someone explain me this ?
  Is this caused by server configuration or something else ?

 I would say that a php error cannot directly cause dns problems - so the
 error message may be wrong ! (what is generating the message ?)


This is what i get exactly :
error
The page cannot be displayed
The page you are looking for is currently unavailable; The Web site might be
experiencing technical difficulties, or you may need to adjust your browser
settings.
/error

The same message i got when a website experience dns problem ! anyway, i got
this problem accidently.

  this is the correct script url : http://www.dynamix-tn.com/
  and this is the wrong script url :
http://www.dynamix-tn.com/index-old.php
 
  in localhost the index-old.php return this error, wich i think should be
the correct error message
  at least i can understand that my script is wrong):
 
  Warning: fopen(tmp/sample.htm, r) - No such file or directory in
tmp.class.php on line 43
 
  Warning: Supplied argument is not a valid File-Handle resource in
tmp.class.php on line 44
 
  Warning: Supplied argument is not a valid File-Handle resource in
tmp.class.php on line 45
  
 

 on your test system - are these error messages the first thing outputed


Yes On my test system these are the first thing outputed (system configured
to report all errors).

 if the hosting setup is configured not to report error messages - you
 may just be getting an error and no output.

 you may be able to override the error reporting on a per-script basis

 http://www.php.net/manual/en/function.error-reporting.php

 also you could check that the file exists before opening it.

 --

 Sean


maybe this is what happened, and our national gateway return me this as a
dns error message.

Thanks,
Hatem


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




[PHP] Re: Using strtotime on 'old' dates.

2002-12-28 Thread David J. Johnson
Btw, I'm using PHP 4.2.3 on Win XP Pro.

David

David J. Johnson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there any way to use strtotime on dates earlier than the Unix epoch?
I'm
 using strtotime to reformat the date information for insertion into MySQL.
 I know that if strtotime is not accomodating, I can use a javascript to
 force the date to be entered in a certain format.  But now I think that
the
 'last week' type input to strtotime is very valuable.

 Thanks,
 David





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




Re: [PHP] 4.2.3 and XML...

2002-12-28 Thread Jason k Larson
What version of PHP were you using prior to 4.2.3?

I'm using DOMXML support extensively (pun?) in my build of 4.2.3.  So, what
errors are you getting or what makes you think its shot?

Jason k Larson


At 01:47 PM 12/28/2002 -0500, Russell P Jones wrote:

My sysadmin just complied 4.2.3 on my Apache web server but is out of town
for the next few weeks. Problem is, all my PHP/domxml stuff is SHOT and
won't work at all anymore. Does anyone know where I can track down the
documentation for 4.2.3, specifically the code changes in domxml. The
changelog's just arent indepth enough and php.net just switched over its
documentation to 4.3.0...

Any help would be hugely appreciated.

Thank you so much,

Russ Jones...

to see the error in action... http://www.collegedems.com/?x=news.php

gracias



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




Re: [PHP] Sorry, really stupid question...

2002-12-28 Thread David Rice
Hi Phil:
It probably does what you are asking it to do. Have you checked the 
value of $nickname to see if you are setting it to bob or appending 
bob to it?
i.e first time $nickname = phil
second time $nickname = philbob

HTH

David
On Saturday, December 28, 2002, at 02:24 PM, Phil Powell wrote:

Honestly, what does this do:

$fileID = fopen(nicknames.txt, a) or die(Could not open  . $path 
. /nicknames.txt);
   chmod(nicknames.txt, 0755);
   fputs($fileID, $nickname . \n); fflush($fileID); fclose($fileID);

What does it EXACTLY do?  What I'm trying to do is very very simple:  
I have the nickname of phil and I add it to nicknames.txt as phil 
+ \n.  The next person adds his name as bob + \n.  However, this 
happens:

phil
philbob

Is it due to the way I'm adding to the file?  Can someone show me how 
to append to a file properly without carrying over persistent existing 
data like what you see above, instead having it like this:

phil
bob

Thanx, I'm lost here.

Phil


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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Sean Burlington
Hatem Ben wrote:



This is what i get exactly :
error
The page cannot be displayed
The page you are looking for is currently unavailable; The Web site might be
experiencing technical difficulties, or you may need to adjust your browser
settings.
/error

The same message i got when a website experience dns problem ! anyway, i got
this problem accidently.



well thats not a dns error

it's exactly what it says it is...

the website is experiencing technical difficulties...





if the hosting setup is configured not to report error messages - you
may just be getting an error and no output.

you may be able to override the error reporting on a per-script basis

http://www.php.net/manual/en/function.error-reporting.php

also you could check that the file exists before opening it.




maybe this is what happened, and our national gateway return me this as a
dns error message.



it can be awkward to debug when you get a one-size-fits-all error message


set_error_handler() is anonther function you may find usefull

http://www.php.net/manual/en/function.set-error-handler.php

in fact there are all sorts of things you can do to help debugging - 
even if you don't want error messages apearing on the live site !

--

Sean :-)


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



Re: [PHP] Sorry, really stupid question...

2002-12-28 Thread Phil Powell
I checked, and I am adding just bob.  Turns out to be a wacky logic
problem.

nicknames.txt contains this:

phil\n
bob\n

When bob leaves the chatroom nicknames.txt becomes:

phil\n

BUT.. apparently that's not it either; the carriage return is also somehow
stripped out.  So instead it's this:

phil

so when joe comes on board instead of

phil\n
joe\n

I get

philjoe\n

Understand?  This is a complicated logic problem I can't figure out other
than doing this:

$stuff = fread($fileID, filesize(nicknames.txt, 10));
if (strlen($stuff)  0) $priorNickNewLine = \n;
...
fputs($fileID, $priorNickNewLine . $nickname . \n);

Phil
David Rice [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Phil:
 It probably does what you are asking it to do. Have you checked the
 value of $nickname to see if you are setting it to bob or appending
 bob to it?
 i.e first time $nickname = phil
 second time $nickname = philbob

 HTH

 David
 On Saturday, December 28, 2002, at 02:24 PM, Phil Powell wrote:

  Honestly, what does this do:
 
  $fileID = fopen(nicknames.txt, a) or die(Could not open  . $path
  . /nicknames.txt);
 chmod(nicknames.txt, 0755);
 fputs($fileID, $nickname . \n); fflush($fileID); fclose($fileID);
 
  What does it EXACTLY do?  What I'm trying to do is very very simple:
  I have the nickname of phil and I add it to nicknames.txt as phil
  + \n.  The next person adds his name as bob + \n.  However, this
  happens:
 
  phil
  philbob
 
  Is it due to the way I'm adding to the file?  Can someone show me how
  to append to a file properly without carrying over persistent existing
  data like what you see above, instead having it like this:
 
  phil
  bob
 
  Thanx, I'm lost here.
 
  Phil




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




Re: [PHP] Sorry, really stupid question...

2002-12-28 Thread Michael J. Pawlowsky
Why not just put the carriage return before the names then.

\nphil
\nbob


*** REPLY SEPARATOR  ***

On 28/12/2002 at 3:39 PM Phil Powell wrote:

I checked, and I am adding just bob.  Turns out to be a wacky logic
problem.

nicknames.txt contains this:

phil\n
bob\n

When bob leaves the chatroom nicknames.txt becomes:

phil\n

BUT.. apparently that's not it either; the carriage return is also somehow
stripped out.  So instead it's this:

phil

so when joe comes on board instead of

phil\n
joe\n





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




[PHP] weird MySQL resource error

2002-12-28 Thread James Brennan
I am getting a Warning: mysql_fetch_row(): supplied argument is not a valid 
MySQL result resource error only when the commented-out code bellow 
(starting from $id = bb_sponsor...) is added. If I omit the code the 
resource is recognized as valid. Can anyone explain?

Thanks,
loop

P.S. - I know my conditions for comparing values are far from accurate, but 
they work for this particular purpose.

/* variables for sponsor table insert */
	$insert = '';
	$insert_pre = INSERT INTO `bb_sponsor` ( `id` , `name` , `url` ) VALUES 
(;
	$insert_post = );\n;

	/* if inputed sponsor name exists, define it's index and url value.*/
	while ($row = mysql_fetch_row($sponsor)) {
		foreach ($bb_sponsor as $key=$value) {
			if (levenshtein($bb_sponsor[$key]['name'], $row[1]) =3 or
stristr(($bb_sponsor[$key]['name']), $row[1])) {
	$bb_sponsor[$key]['id'] = $row[0];
	$bb_sponsor[$key]['url'] = $row[2];
	}
			/*
			$id = $bb_sponsor[$key]['id'];
			$name = $bb_sponsor[$key]['name'];
			$sponsor = $bb_sponsor[$key]['url'];
			$insert = $insert . $insert_pre . '', '$name', '$sponsor' . 
$insert_post; */
}
			}

_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemailxAPID=42PS=47575PI=7324DI=7474SU= 
http://www.hotmail.msn.com/cgi-bin/getmsgHL=1216hotmailtaglines_addphotos_3mf


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



Re: [PHP] weird MySQL resource error

2002-12-28 Thread Rasmus Lerdorf
Because you are wiping out your $sponsor variable in that commented-out
code.

On Sat, 28 Dec 2002, James Brennan wrote:

 I am getting a Warning: mysql_fetch_row(): supplied argument is not a valid
 MySQL result resource error only when the commented-out code bellow
 (starting from $id = bb_sponsor...) is added. If I omit the code the
 resource is recognized as valid. Can anyone explain?

 Thanks,
 loop

 P.S. - I know my conditions for comparing values are far from accurate, but
 they work for this particular purpose.

 /* variables for sponsor table insert */
   $insert = '';
   $insert_pre = INSERT INTO `bb_sponsor` ( `id` , `name` , `url` ) VALUES
 (;
   $insert_post = );\n;

   /* if inputed sponsor name exists, define it's index and url value.*/
   while ($row = mysql_fetch_row($sponsor)) {
   foreach ($bb_sponsor as $key=$value) {
   if (levenshtein($bb_sponsor[$key]['name'], $row[1]) =3 or
   stristr(($bb_sponsor[$key]['name']), $row[1])) {
   $bb_sponsor[$key]['id'] = $row[0];
   $bb_sponsor[$key]['url'] = $row[2];
   }
   /*
   $id = $bb_sponsor[$key]['id'];
   $name = $bb_sponsor[$key]['name'];
   $sponsor = $bb_sponsor[$key]['url'];
   $insert = $insert . $insert_pre . '', '$name', '$sponsor' .
 $insert_post; */
   }
   }

 _
 Add photos to your messages with MSN 8. Get 2 months FREE*.
 
http://join.msn.com/?page=features/featuredemailxAPID=42PS=47575PI=7324DI=7474SU=
 http://www.hotmail.msn.com/cgi-bin/getmsgHL=1216hotmailtaglines_addphotos_3mf


 --
 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] fOpen in append mode on a FTP Server

2002-12-28 Thread Elna Moorhouse




What I want to do is very simple, I have a txt file on a ftp server, 
that contains the number of visits to my site. I manage to open the file 
with "fopen($filename,"r+"), but the information is not written to the 
file. I know that on a ftp server one can only open a file with fopen for 
read OR write, so I have changed the fOpen to "fopen($filename,"a") or 
fopen($filename,"w"). This does not work as I am getting a warning 
message that the file already exist and fopen fails. My ISP did not 
compile PHP with FTP enabled, so I can not use an FTP session to delete the file 
before attempting to write to the file. Is there any other way of deleting 
the file, without using an FTP session. Below is an extract from my code, 
if it will help:

? $sFileName = "ftp://myuser:[EMAIL PROTECTED]/folder/Counter.txt";

$sOutput = "12345"
$file = fopen ($sFileName, 'r+');if (!$file) 
{ echo "pUnable to 
open hitcounter file - File is temporary 
unavailable\n"; return 
$result; }
 $written = fwrite($file, 
$sOutput);  if ($written = 0) 
{ echo "pUnable to 
write hitcounter, file istemporary 
unavailable\n"; 
fclose($file); return 
$result; 
} fclose($file);
?

Withmode = r+, I get a $written as 22, but it is not written to the 
file
With mode = a or w, fopen fails.

I have been trying to get this resolved for some time now and can not get 
it to work. I am a novice PHP writer, please help!





[PHP] Resizing a png tranparent image.

2002-12-28 Thread Vincent M.
Hello,

I am trying to resize a png file, my autograph ;-)


Good result thanks to gimp:
http://boxfly.free.fr/test/test1.jpg
Bad result with php:
http://boxfly.free.fr/test/test2.jpg

This is my PHP code to resize the autograph:

$newAuto = imagecreatetruecolor( $widthImgAu, $heightImgAu) ;
imagecolortransparent($newAuto,imagecolorat($newAuto,0,0)) ;
$imgAuto = ImageCreateFromPNG($img_auto);
imagecopyresized($newAuto, $imgAuto, 0, 0, 0, 0, $widthImgAu, 
$heightImgAu, $imageInfoAu[0], $imageInfoAu[1]) ;
ImagePNG($newAuto,new_auto.png);

So I tried:
imagecopyresampled($newAuto, $imgAuto, 0, 0, 0, 0, $widthImgAu, 
$heightImgAu, $imageInfoAu[0], $imageInfoAu[1]) ;
Instead of imagecopyresized...

To copy the autograph inside the photo I do:
$newImg = ImageCreateFromJPEG($img_des);
ImageAlphaBlending($newImg, true);
ImageCopy($newImg, $newAuto, $posX, $posY, 0, 0, $widthImgAu, $heightImgAu);

But with no sucess

If I do not resize the png autograph and copy it directly inside the 
photo, that's perfect, as a result the problem is the resizing...

What do I have to do to resize a png image without loosing transparency ?

Thanks.


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



Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
it's not an IE specefic  :)) netscape or opera or whatever will return the
same error message.

- Original Message -
From: Paul Reed [EMAIL PROTECTED]
To: 'Hatem Ben' [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 10:19 PM
Subject: RE: [PHP] how could a php script return a dns error ?

 It's not really a dns error, that the general error that MS Internet
 Explorer spits out when it can't find the file, as opposed to showing
 you the erro 404 file not found ...

 PHP cannot give a dns error, looks like your just linking to a file that
 doesn't exist and that's IE's friendly way of telling you so ... yes ..
 a bit confusing to the developer. (Thanks again MS...)

 Try it with netscape, and I bet you'll get a 'file not found' error
 instead...

 Paul.



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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Leif K-Brooks
No, it is IE specific.  It's IE's general error message, which means the 
document contains no data in this case.

Hatem Ben wrote:

it's not an IE specefic  :)) netscape or opera or whatever will return the
same error message.

- Original Message -
From: Paul Reed [EMAIL PROTECTED]
To: 'Hatem Ben' [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 10:19 PM
Subject: RE: [PHP] how could a php script return a dns error ?

 

It's not really a dns error, that the general error that MS Internet
Explorer spits out when it can't find the file, as opposed to showing
you the erro 404 file not found ...

PHP cannot give a dns error, looks like your just linking to a file that
doesn't exist and that's IE's friendly way of telling you so ... yes ..
a bit confusing to the developer. (Thanks again MS...)

Try it with netscape, and I bet you'll get a 'file not found' error
instead...

Paul.

   



 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.





Re: [PHP] rounding...sort of

2002-12-28 Thread Rasmus Lerdorf
Use explode() please

On Sun, 29 Dec 2002, Justin French wrote:

 php.net/floor

 OR

 ?
 list($w,$d) = split('.','4.9');
 echo $w;
 ?

 Justin French



 on 28/12/02 8:49 PM, Peter Lavender ([EMAIL PROTECTED]) wrote:

  Hi everyone,
 
  I have a nubmer: 4.1 but I only want the whole number 4, even if it's
  4.9, so this rules out using round (Unless I missed a parameter).
 
  How could I do this.. I'm drawing a blank...
 
  Pete
 
 
 


 --
 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] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
Ok, this is Netscape shots 
http://www.dynamix-tn.com/28dec2002/Image1.png

If you want with lynx i'll do it, it's always the same.

Better, i can do this :
$sockhandle = @fsockopen(http://www.dynamix-tn.com/index-old.php;, 80, $errno, 
$errstr);
if(!$sockhandle) {
echo  centerh5server dynamix-tn.com not available!: $errno : 
$errstr/h5/center;
} else {
echo  centerh5server dynamix-tn.com  is available!: $errno : 
$errstr/h5/center;
}
and run it from here, it return server not available.

  - Original Message - 
  From: Leif K-Brooks 
  To: Hatem Ben 
  Cc: [EMAIL PROTECTED] 
  Sent: Saturday, December 28, 2002 10:49 PM
  Subject: Re: [PHP] how could a php script return a dns error ?


  No, it is IE specific.  It's IE's general error message, which means the document 
contains no data in this case.

  Hatem Ben wrote:

it's not an IE specefic  :)) netscape or opera or whatever will return the
same error message.

- Original Message -
From: Paul Reed [EMAIL PROTECTED]
To: 'Hatem Ben' [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 10:19 PM
Subject: RE: [PHP] how could a php script return a dns error ?

  
It's not really a dns error, that the general error that MS Internet
Explorer spits out when it can't find the file, as opposed to showing
you the erro 404 file not found ...

PHP cannot give a dns error, looks like your just linking to a file that
doesn't exist and that's IE's friendly way of telling you so ... yes ..
a bit confusing to the developer. (Thanks again MS...)

Try it with netscape, and I bet you'll get a 'file not found' error
instead...

Paul.




  


-- 
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.





Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben

- Original Message -
From: Sean Burlington [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 9:24 PM
Subject: Re: [PHP] how could a php script return a dns error ?


 Hatem Ben wrote:

 
  This is what i get exactly :
  error
  The page cannot be displayed
  The page you are looking for is currently unavailable; The Web site
might be
  experiencing technical difficulties, or you may need to adjust your
browser
  settings.
  /error
 
  The same message i got when a website experience dns problem ! anyway, i
got
  this problem accidently.
 

 well thats not a dns error

 it's exactly what it says it is...

 the website is experiencing technical difficulties...


Yep, this make a confusion for me, and a stupid error that could be solved
in one minute, was done in one day.

 if the hosting setup is configured not to report error messages - you
 may just be getting an error and no output.
 
 you may be able to override the error reporting on a per-script basis
 
 http://www.php.net/manual/en/function.error-reporting.php
 
 also you could check that the file exists before opening it.
 

  maybe this is what happened, and our national gateway return me this as
a
  dns error message.
 

 it can be awkward to debug when you get a one-size-fits-all error message


 set_error_handler() is anonther function you may find usefull

 http://www.php.net/manual/en/function.set-error-handler.php

 in fact there are all sorts of things you can do to help debugging -
 even if you don't want error messages apearing on the live site !

 --

 Sean :-)


In conclusion our ISP is blocking such websites (an internet censorship
system) and returned that message.
I have said dns error, coz for dns error we got same message (maybe the
server is assumed in all cases down), the original dns error is always
blocked and we got that message inspite.

Thanks,
Hatem


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




[PHP] file uploads double in size - help!

2002-12-28 Thread dgulbranson
I am having trouble with php file uploads where the files are arriving
corrupted and information in the file is repeated.  Perhaps some can help
point me in the right direction.

A very small text file will work fine.  Anything larger than about 2000k and
strange things happen.  In the case of a text file, after about 1100
characters, the uploaded file will repeat the text starting not from the
begining of the file but from about midway through and do this back and
forth for the length of the file, causing the file to double in size.  The
same problem happens with every file type that I've tried, .jpg, .png, .doc,
.dwg.  It also happens with all php applications that run on the server, not
just one particular piece of software, so it has to be some configuration
with the server, but I don't know where to look.

It could be something really simple as I'm just getting started.  Anything
recomendations on things to check that might point me in the right direction
would be greatly appreciated.

Derek
please reply to [EMAIL PROTECTED]



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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky
The problem is that it can mean a bunch of things

When I telnet to the server and request the document I get:

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
 HTMLHEAD
TITLE404 Not Found/TITLE
/HEADBODY
H1Not Found/H1
The requested URL /index-old.php was not found on this server.P
 HR
 ADDRESSApache/1.3.20 Server at www.vgates.com Port 80/ADDRESS
 /BODY/HTML

I am probably getting that because the server is using virtual hosts.

I've seen that also happend when a Content-type: MIME was not sent etc.

Start commenting out large chunks of your code..  turn it into a hello world to start. 
Then start adding a few lines at a time. See what happends.





*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:07 PM Hatem Ben wrote:

Ok, this is Netscape shots
http://www.dynamix-tn.com/28dec2002/Image1.png

If you want with lynx i'll do it, it's always the same.




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




Re: [PHP] file uploads double in size - help!

2002-12-28 Thread Michael J. Pawlowsky
This might help you...

http://www.phpbuilder.com/columns/florian19991014.php3?page=4




*** REPLY SEPARATOR  ***

On 28/12/2002 at 2:00 PM [EMAIL PROTECTED] wrote:

I am having trouble with php file uploads where the files are arriving
corrupted and information in the file is repeated.  Perhaps some can help
point me in the right direction.

A very small text file will work fine.  Anything larger than about 2000k
and
strange things happen.  In the case of a text file, after about 1100
characters, the uploaded file will repeat the text starting not from the
begining of the file but from about midway through and do this back and
forth for the length of the file, causing the file to double in size.  The
same problem happens with every file type that I've tried, .jpg, .png,
.doc,
.dwg.  It also happens with all php applications that run on the server,
not
just one particular piece of software, so it has to be some configuration
with the server, but I don't know where to look.

It could be something really simple as I'm just getting started.  Anything
recomendations on things to check that might point me in the right
direction
would be greatly appreciated.

Derek
please reply to [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




[PHP] RE : [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
- Original Message -
From: Michael J. Pawlowsky [EMAIL PROTECTED]
To: Hatem Ben [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 11:20 PM
Subject: Re: [PHP] how could a php script return a dns error ?


 The problem is that it can mean a bunch of things

 When I telnet to the server and request the document I get:

 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
  HTMLHEAD
 TITLE404 Not Found/TITLE
 /HEADBODY
 H1Not Found/H1
 The requested URL /index-old.php was not found on this server.P
  HR
  ADDRESSApache/1.3.20 Server at www.vgates.com Port 80/ADDRESS
  /BODY/HTML

 I am probably getting that because the server is using virtual hosts.


yeah it's using vhost. the original adress is this one
(http://www.vgates.com/~a5a5aa01/index-old.php)

 I've seen that also happend when a Content-type: MIME was not sent etc.

 Start commenting out large chunks of your code..  turn it into a hello
world to start. Then start adding a few lines at a time. See what happends.


I have just commented the code that return error (the fopen line), the
script return an empty page. Then by adding the part returning error
message, and the censorship is blocking again everything.

I guess, this was a censorship issue ! and nothing else  :))

Hatem


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




[PHP] Kerberos and AFS module

2002-12-28 Thread Turbo Fredriksson
I'm creating (not from scratch, I've taken over an existing application)
an interface to my LDAP, Qmail-LDAP, Kerberos and AFS server system.

Everything works fine from the LDAP point of view, but I'd like to be able
to create Kerberos principals and AFS entries (volumes, users etc). Now,
I guess I could do this through external meens (shell/perl scripts etc),
but I'd like to have a module in PHP that gives me access to the
Kerberos/AFS API.

Checking through the 'Net for weeks, talking about this on the MIT Kerberos
and OpenAFS lists, I've came to the conclution that there is no such thing
(yet).

What I'd like to know is 'how difficult task is this'. Naturaly some would
say 'piece of cake', while's some would say 'very difficult'. Anything is
easy once you know it, but I never made a PHP module/extension before...

I'm a C/Perl coder at heart (and for may years), but... If someone have done
the job for me previosly, I don't need to :)

I've looked at the LDAP module, and from what I can tell it's just a
wrapper to the LDAP API's... It doesn't do much it self, it relies on
the LDAP API's to take care of business. How true is this?
-- 
cryptographic Kennedy Rule Psix Qaddafi BATF Ortega terrorist 767
AK-47 toluene DES strategic Peking Mossad Waco, Texas
[See http://www.aclu.org/echelonwatch/index.html for more about this]

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




[PHP] Sendmail Security

2002-12-28 Thread Beth Gore
Hi,

If I'm taking an URL as user input from in a form, and then emailing 
that URL back to them as part of a larger message, how do I ensure that 
no-one sends anything strange to run shell commands through sendmail?

Could anyone confirm that mail() or even sendmail does take precautions 
against shell commands being executed in the message body of the email?

If not, is there an easy way to remove everything except 
:,/,.,a-Z,0-9? I've written very complicated things in the 
past and I'm sure there must be an easier way!!!

I've already made sure it's not possible to abuse sendmail with the 
user's email address, but I'm still nervous.

Thanks!

--
Beth Gore
http://www.habitformer.co.uk


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



[PHP] Problem with REQUIRE in PHP 4.3.0

2002-12-28 Thread Bc. Radek Kreja
Hello,

  I try to compile PHP 4.3.0 on OpenBSD 3.1. Compilation is OK, PHP
  runs, but not work REQUIRE and INCLUDE

  Fatal error: main() [function.main]: Failed opening required 
'./libraries/grab_globals.lib.php' (include_path='.:/usr/local/lib/php')

  This is report from phpMyAdmin, with php 4.2.3 it works well.

  On OpenBSD 3.0 runs PHP 4.3.0 well.

  My configure command:

  ./configure --with-apxs=/usr/local/httpd/bin/apxs --enable-safe-mode --enable-bcmath 
--enable-calendar --enable-dbase --enable-ftp --with-gd=/usr/local/ 
--enable-gd-native-ttf --with-jpeg-dir=/usr/local/ --with-png-dir=/usr/local/ 
--with-ttf=/usr/local/ --with-zlib=/usr/local/ --with-imap --with-mysql --with-mcrypt 
--with-mhash --with-dbm

  Where is problem and what can do?

  Thanks Radek



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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Sean Burlington
Hatem Ben wrote:

From: Sean Burlington [EMAIL PROTECTED]


it's exactly what it says it is...

the website is experiencing technical difficulties...




Yep, this make a confusion for me, and a stupid error that could be solved
in one minute, was done in one day.



[SNIP]



In conclusion our ISP is blocking such websites (an internet censorship
system) and returned that message.
I have said dns error, coz for dns error we got same message (maybe the
server is assumed in all cases down), the original dns error is always
blocked and we got that message inspite.



It's not censorship

they are economising by using a proxy server

and using one that gives unhelpful error messages

BTW - they in this case are the people providing you with your 
connection (not the web hosting company)

they are not blocking the site

but when the page returns no data - they return an error message - this 
is resonable - it just isn't very helpful for web developers.


I'd suggest that you see if you can get a direct connection for testing 
purposes - either by changing browser settings or getting another isp.

Proxys are great for saving bandwidth - but terrible for developing 
websites through :)

--

Sean


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



Re: [PHP] Kerberos and AFS module

2002-12-28 Thread Michael J. Pawlowsky
This wont be much help to you but

I use to write quite a few for ColdFusion.
Basically the first one is a bit time consuming to see what it's looking for exaclty,
after that it's a lot of cut and paste!

Like I said...  probably not very useful for you...  But I say GO FOR IT!

Especially if you have the source for the LDAP one... more cut and paste.

I use to sell them on the net afterwards for about $20.00 a pop.
I still have one (a NT user and Group Manager) that brings in a couple of hundred a 
month after 3 years.

Cheers,
Mike


*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:56 PM Turbo Fredriksson wrote:

What I'd like to know is 'how difficult task is this'. Naturaly some would
say 'piece of cake', while's some would say 'very difficult'. Anything is
easy once you know it, but I never made a PHP module/extension before...

I'm a C/Perl coder at heart (and for may years), but... If someone have
done
the job for me previosly, I don't need to :)





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




RE: [PHP] Date fields

2002-12-28 Thread David Freeman
G'day Peter

  I have a form with several date fields. I want to be able to
  set these by selecting from a calendar display.  Does anyone
  know of any php function or code which would let me do this?

If you mean having some sort of pop-up calendar display that the user
can select a date from and have this populate a form field then you'll
need to go client-side.  This usually means javascript.  The idea is to
use the javascript stuff to generate your calendar and to place the
results back in your form which php can then deal with after the form is
submitted.

How you do that, not sure (haven't done it myself) but I'm sure you'd
find examples in plenty of places (google is your friend) or you could
try www.irg.org for some pretty good javascript stuff.

CYA, Dave




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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky
Actually I got the idea he was opening a file through http as in

$fp = fsockopen (192.168.1.1, 8080, $errno, $errstr, 5);

And whatever he was trying to get at was not being allowed to be retrieved.
But I may be wrong.

Perhaps the server is behind a firewall and needs to get through the proxy.
If this is the case look at CURL.. Just point it to the proxy server,

I also use fsockopen as above to go through a proxy server.
But CURL does it better.

I basically had a similar problem which I handle as such...


if ($proxy) {
$fp = fsockopen (192.168.1.1, 8080, $errno, $errstr, 5);
} else {
$fp = fsockopen (adds.aviationweather.noaa.gov, 80, $errno, $errstr, 
5);
if (!($fp)) {
echo ($errstr);
}
}

if ($fp) {

$header = GET 
http://adds.aviationweather.noaa.gov/projects/adds/metars/index.php?metarIds=$iac 
HTTP/1.1\r\n;
$header .= Accept: */*\r\n;
$header .= Accept-Language: en-ca\r\n;
$header .= Accept-Encoding: gzip, deflate\r\n;
$header .= User-Agent: Mozilla/4.0 (compatible)\r\n;
$header .= Host: www.wimac.org\r\n;
$header .= Connection: Keep-Alive\r\n;
if ($proxy) {
$header .= Proxy-Authorization: Basic ;
$header .= base64_encode(username:password);
}
$header .= \r\n;
$header .= \r\n;

fputs ($fp, $header);

if (socket_set_timeout($fp, 5, 0)) {

$fpmetar = fopen ($fname, w+);
if (!$fpmetar) {
echo Unable to open new METAR file $fname - Using old 
METAR file\n;
} else {
while (!feof($fp)) {
fputs ($fpmetar, fgets ($fp,128));
}
fclose($fpmetar);
}
}

// close the file
fclose ($fp);
}





Mike



*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:27 PM Sean Burlington wrote:

Hatem Ben wrote:
 From: Sean Burlington [EMAIL PROTECTED]

it's exactly what it says it is...

the website is experiencing technical difficulties...



 Yep, this make a confusion for me, and a stupid error that could be
solved
 in one minute, was done in one day.


[SNIP]


 In conclusion our ISP is blocking such websites (an internet censorship
 system) and returned that message.
 I have said dns error, coz for dns error we got same message (maybe the
 server is assumed in all cases down), the original dns error is always
 blocked and we got that message inspite.


It's not censorship

they are economising by using a proxy server

and using one that gives unhelpful error messages

BTW - they in this case are the people providing you with your
connection (not the web hosting company)

they are not blocking the site

but when the page returns no data - they return an error message - this
is resonable - it just isn't very helpful for web developers.


I'd suggest that you see if you can get a direct connection for testing
purposes - either by changing browser settings or getting another isp.

Proxys are great for saving bandwidth - but terrible for developing
websites through :)

--

Sean


--
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] Sendmail Security

2002-12-28 Thread Timothy Hitchens (HiTCHO)
Regardless if mail() takes precautions you should also
check input prior to trusting it.

Note:  If mail does or doesn't if it changes in the future you
are covered if you always check.

I would suggest a simple addslashes and the (shell/sendmail)
will be fine OR better still do an array with  a callback
either removal or addslashes equiv.



Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


If you need PHP hosting with an experienced
support team 24/7 then email me today.

On Sat, 28 Dec 2002, Beth Gore wrote:

 Hi,

 If I'm taking an URL as user input from in a form, and then emailing
 that URL back to them as part of a larger message, how do I ensure that
 no-one sends anything strange to run shell commands through sendmail?

 Could anyone confirm that mail() or even sendmail does take precautions
 against shell commands being executed in the message body of the email?

 If not, is there an easy way to remove everything except
 :,/,.,a-Z,0-9? I've written very complicated things in the
 past and I'm sure there must be an easier way!!!

 I've already made sure it's not possible to abuse sendmail with the
 user's email address, but I'm still nervous.

 Thanks!

 --
 Beth Gore
 http://www.habitformer.co.uk


 --
 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] how could a php script return a dns error ?

2002-12-28 Thread John Nichel
I went to it in Netscape 4.x, 6  7, and got this

/*
Not Found
The requested URL /index-old.php was not found on this server.

Apache/1.3.20 Server at dynamix-tn.com Port 80
*/

In IE, I got

/*
The page cannot be found
The page you are looking for might have been removed, had its name 
changed, or is temporarily unavailable.



Please try the following:

If you typed the page address in the Address bar, make sure that it is 
spelled correctly.

Open the www.dynamix-tn.com home page, and then look for links to the 
information you want.
Click the  Back button to try another link.
Click  Search to look for information on the Internet.



HTTP 404 - File not found
Internet Explorer
*/

Hatem Ben wrote:
Ok, this is Netscape shots 
http://www.dynamix-tn.com/28dec2002/Image1.png

If you want with lynx i'll do it, it's always the same.

Better, i can do this :
$sockhandle = @fsockopen(http://www.dynamix-tn.com/index-old.php;, 80, $errno, $errstr);
if(!$sockhandle) {
echo  centerh5server dynamix-tn.com not available!: $errno : $errstr/h5/center;
} else {
echo  centerh5server dynamix-tn.com  is available!: $errno : $errstr/h5/center;
}
and run it from here, it return server not available.

  - Original Message - 
  From: Leif K-Brooks 
  To: Hatem Ben 
  Cc: [EMAIL PROTECTED] 
  Sent: Saturday, December 28, 2002 10:49 PM
  Subject: Re: [PHP] how could a php script return a dns error ?


  No, it is IE specific.  It's IE's general error message, which means the document contains no data in this case.

  Hatem Ben wrote:

it's not an IE specefic  :)) netscape or opera or whatever will return the
same error message.

- Original Message -
From: Paul Reed [EMAIL PROTECTED]
To: 'Hatem Ben' [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 10:19 PM
Subject: RE: [PHP] how could a php script return a dns error ?

  
It's not really a dns error, that the general error that MS Internet
Explorer spits out when it can't find the file, as opposed to showing
you the erro 404 file not found ...

PHP cannot give a dns error, looks like your just linking to a file that
doesn't exist and that's IE's friendly way of telling you so ... yes ..
a bit confusing to the developer. (Thanks again MS...)

Try it with netscape, and I bet you'll get a 'file not found' error
instead...

Paul.




  




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


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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
Sorry I've just removed the file.

- Original Message -
From: John Nichel [EMAIL PROTECTED]
To: Hatem Ben [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 29, 2002 12:55 AM
Subject: Re: [PHP] how could a php script return a dns error ?


 I went to it in Netscape 4.x, 6  7, and got this

 /*
 Not Found
 The requested URL /index-old.php was not found on this server.

 Apache/1.3.20 Server at dynamix-tn.com Port 80
 */

 In IE, I got

 /*
 The page cannot be found
 The page you are looking for might have been removed, had its name
 changed, or is temporarily unavailable.

 --
--

 Please try the following:

 If you typed the page address in the Address bar, make sure that it is
 spelled correctly.

 Open the www.dynamix-tn.com home page, and then look for links to the
 information you want.
 Click the  Back button to try another link.
 Click  Search to look for information on the Internet.



 HTTP 404 - File not found
 Internet Explorer
 */

 Hatem Ben wrote:
  Ok, this is Netscape shots
  http://www.dynamix-tn.com/28dec2002/Image1.png
 
  If you want with lynx i'll do it, it's always the same.
 
  Better, i can do this :
  $sockhandle = @fsockopen(http://www.dynamix-tn.com/index-old.php;, 80,
$errno, $errstr);
  if(!$sockhandle) {
  echo  centerh5server dynamix-tn.com not available!: $errno :
$errstr/h5/center;
  } else {
  echo  centerh5server dynamix-tn.com  is available!: $errno :
$errstr/h5/center;
  }
  and run it from here, it return server not available.
 
- Original Message -
From: Leif K-Brooks
To: Hatem Ben
Cc: [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 10:49 PM
Subject: Re: [PHP] how could a php script return a dns error ?
 
 
No, it is IE specific.  It's IE's general error message, which means
the document contains no data in this case.
 
Hatem Ben wrote:
 
  it's not an IE specefic  :)) netscape or opera or whatever will return
the
  same error message.
 
  - Original Message -
  From: Paul Reed [EMAIL PROTECTED]
  To: 'Hatem Ben' [EMAIL PROTECTED]
  Sent: Saturday, December 28, 2002 10:19 PM
  Subject: RE: [PHP] how could a php script return a dns error ?
 
 
  It's not really a dns error, that the general error that MS Internet
  Explorer spits out when it can't find the file, as opposed to showing
  you the erro 404 file not found ...
 
  PHP cannot give a dns error, looks like your just linking to a file that
  doesn't exist and that's IE's friendly way of telling you so ... yes ..
  a bit confusing to the developer. (Thanks again MS...)
 
  Try it with netscape, and I bet you'll get a 'file not found' error
  instead...
 
  Paul.
 



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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Hatem Ben
/snip
 It's not censorship
 
 they are economising by using a proxy server
 
 and using one that gives unhelpful error messages
 
 BTW - they in this case are the people providing you with your
 connection (not the web hosting company)
 
 they are not blocking the site
 
 but when the page returns no data - they return an error message - this
 is resonable - it just isn't very helpful for web developers.
 
 
 I'd suggest that you see if you can get a direct connection for testing
 purposes - either by changing browser settings or getting another isp.
 
 Proxys are great for saving bandwidth - but terrible for developing
 websites through :)
 
 --
 
 Sean
 

That proxy server is in our national backbone :))) So I need to change the
country, not only the ISP :)))

Later all,
Hatem


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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky

Well at least now you know what your solution is... Time to move!

:-)

Have a good New Year,
Mike



That proxy server is in our national backbone :))) So I need to change the
country, not only the ISP :)))

Later all,
Hatem




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




Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Paul Chvostek

I assume you want the array populated with something other than the
display name in the select, so I've made up OrgId as a field name in
your database.  How 'bout something a little easier to read, using a
more consistent style?

?php

if (!$db=mysql_connect(localhost,lodestone,trypass))
$err=mysql_error();

if (!$err) if (!mysql_select_db(catapult_com))
$err=mysql_error();

if (!$err) {
$q=SELECT OrgId,OrgName FROM TableResults ORDER BY OrgName;
if ($r=mysql_query($q,$db)) {
$options=array(); // for clarity
while ($row=mysql_fetch_array($r))
$options[$row[OrgId]]=$row[OrgName];
} else
$err=mysql_error();
}

// If all's well so far, show the select...
if ($err)
print Database error: ttb . $err . /b/tt;
else {
print select name='OrgName[]' size=5 id='OrgName'\n
foreach ($options as $id = $name)
printf(\toption value='%s'%s\n,$id,$name);
print /select\n;
}

?

Note that none of this code has been tested.  :)

p

On Sun, Dec 29, 2002 at 01:18:22AM +0800, Denis L. Menezes wrote:
 
 select name=OrgName[] size=5 id=OrgName 
 ?php 
 //connecting to the database
 $link = mysql_connect(localhost,lodestone,trypass);
 if ($link){
Print ;
}  else {
Print No connection to the database;
}
if (!mysql_select_db(catapult_com)){
 Print Couldn't connect database;
  } else {
  Print .br\n;
  }
 
 $sql=SELECT OrgName From TableResults ORDER BY OrgName;
 $result=mysql_query($sql);
 
 While($Organisation=mysql_fetch_array($result))
  {
  Print(OPTION VALUE=\$Organisation[0]\$Organisation[1]\n);
  }
 
 ?
   /select
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
  Paul Chvostek [EMAIL PROTECTED]
  Operations / Abuse / Whatever  
  it.canada, hosting and development   http://www.it.ca/


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




[PHP] IIS Quit Working

2002-12-28 Thread Stephen



Since I like new things and all, I decided to download and 
install PHP 4.3. Before, I had the latest (4.2.3) and IIS worked fine. But then, 
after uninstalling PHP and installing the new one, it just quit working. I go to 
http://localhost/ and nothing comes up except a 
"This page cannot be displayed" thing since I'm using IE. Any ideas why this is 
happening?
Thanks,Stephen Cratonhttp://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] unpack() - how to handle bitfields??

2002-12-28 Thread Tim Molendijk
Hi all,

I'm wrestling with this problem for a while now. I want to read a binary
file (created by C software) using PHP. I know of unpack(). But the C struct
that is stored in the binary file contains variables with bitfields:

struct some_struct {
char val_a : 2
int val_b : 7
}

Such a construct means that val_a is char with a bitfield of 2 and therefore
can contain values between 0 (00 binary) and 3 (11 binary). val_b is an
integer with a range of 0 (000) to 127 (111).

Now the problem is: how on earth do I handle those values with PHP's
unpack()?!? I've tried a lot of syntaxes but none of them seem to work. Can
someone please shortcut whether it is possible or not and if yes, *how*?

Thanks in advance,
Tim



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




[PHP] Form duplicate post problem

2002-12-28 Thread Pag

	Hi,

	I am having some problems with duplicate form input.
	I have a form that adds comments to an article, works fine, but if the 
user clicks on refresh, having added a comment previously, the same 
comment is added again. I tried clearing the variables after the database 
write, but the refresh somehow resends the previous values.
	Roughly, heres how my script works: (not using actual code syntax here)

	--
	if {$flag=1 AND $name!='' AND $commentbody!=''){

	inserts the comment into the database
	$flag = 0
	$name = ''
	$comment = ''
	}
	--
	routine to display the article and the existing comments here
	--
	form here
	if user clicks send, puts $flag=1 and calls same page
	--


	How can i prevent these double entries? Some command to definitely clear 
the variables?
	Thanks.

	Pag



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



Re: [PHP] Form duplicate post problem

2002-12-28 Thread Timothy Hitchens (HiTCHO)
There is a very simple solution to this on the page that
does the entries into the database simply to a header redirect
to a new page that displays the success notices etc and if they
do a back or a refresh nothing will happen as the POST data
is on the previous now removed from history page.

header('Location: http://www.yourdomain.com/success.html');

* you will need to put some GET data in the URL to show the correct page.

That will do it for you.

Remember that you can't send output on the database entry page simple
to the database calls and they do the header call as above.



Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


If you need PHP hosting with an experienced
support team 24/7 then email me today.

On Sun, 29 Dec 2002, Pag wrote:


   Hi,

   I am having some problems with duplicate form input.
   I have a form that adds comments to an article, works fine, but if the
 user clicks on refresh, having added a comment previously, the same
 comment is added again. I tried clearing the variables after the database
 write, but the refresh somehow resends the previous values.
   Roughly, heres how my script works: (not using actual code syntax here)

   --
   if {$flag=1 AND $name!='' AND $commentbody!=''){

   inserts the comment into the database
   $flag = 0
   $name = ''
   $comment = ''
   }
   --
   routine to display the article and the existing comments here
   --
   form here
   if user clicks send, puts $flag=1 and calls same page
   --


   How can i prevent these double entries? Some command to definitely clear
 the variables?
   Thanks.

   Pag



 --
 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] Form duplicate post problem

2002-12-28 Thread Pag




to a new page that displays the success notices etc and if they
do a back or a refresh nothing will happen as the POST data
is on the previous now removed from history page.


I understand, but the reason i am trying to stick with just one 
page is that i want it to be practical. I mean, the moment the user clicks 
submit the page reloads and shows his comment immediately, and give him 
the functionality of pressing refresh to see if anyone else commented in 
the meantime.
Also, by using a different page, even with a redirect back to the 
original, might take a little while, since the original is a bit heavy on 
the download side. ;-)

Pag 



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



[PHP] Directing to a URL from a radio group

2002-12-28 Thread Denis L. Menezes
Hello friends.

Somehow, I cannot find the right code here.

I have a radio group with options as follows:
value1 = orgname
value2=orgcity
value3=orgsize
value4=orghead

When the user chooses orgname he must be redirected to the page ../orgname.php
When the user chooses orgcity he must be redirected to the page ../orgcity.php
...and so on.

Can you please help me with the code?

Thanks
Denis



RE: [PHP] Form duplicate post problem

2002-12-28 Thread John W. Holmes
 to a new page that displays the success notices etc and if they
 do a back or a refresh nothing will happen as the POST data
 is on the previous now removed from history page.
 
  I understand, but the reason i am trying to stick with just
one
 page is that i want it to be practical. I mean, the moment the user
clicks
 submit the page reloads and shows his comment immediately, and give
him
 the functionality of pressing refresh to see if anyone else commented
in
 the meantime.
  Also, by using a different page, even with a redirect back to
the
 original, might take a little while, since the original is a bit heavy
on
 the download side. ;-)

You can still use one page and use a middle-man technique. The part
that processes the form input would redirect back to itself after the
data is inserted into the database, thus getting rid of the post data.
So subsequent refreshes of the page will refresh without attempting to
repost the data. 

The only other way to do it is to check the data you're about to insert
to see if it's already there. If it is, then don't insert it...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] Form duplicate post problem

2002-12-28 Thread Timothy Hitchens (HiTCHO)
The redirect using the header method is instant and if the middle
page just does the inserts and you redirect right away using PHP
it is not noticable at all.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


If you need PHP hosting with an experienced
support team 24/7 then email me today.

On Sun, 29 Dec 2002, Pag wrote:




 to a new page that displays the success notices etc and if they
 do a back or a refresh nothing will happen as the POST data
 is on the previous now removed from history page.

  I understand, but the reason i am trying to stick with just one
 page is that i want it to be practical. I mean, the moment the user clicks
 submit the page reloads and shows his comment immediately, and give him
 the functionality of pressing refresh to see if anyone else commented in
 the meantime.
  Also, by using a different page, even with a redirect back to the
 original, might take a little while, since the original is a bit heavy on
 the download side. ;-)

  Pag





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




RE: [PHP] Directing to a URL from a radio group

2002-12-28 Thread John W. Holmes
 Somehow, I cannot find the right code here.
 
 I have a radio group with options as follows:
 value1 = orgname
 value2=orgcity
 value3=orgsize
 value4=orghead
 
 When the user chooses orgname he must be redirected to the page
 ../orgname.php
 When the user chooses orgcity he must be redirected to the page
 ../orgcity.php
 ...and so on.

Say your radio group was named choice then you could do something like
this:

Header(Location: http://yourdomain.com/{$_POST['choice']}.php);

Throw in some validation to $_POST['choice'] (or $_GET['choice']) to
make sure you are directing to the directory you should be directing to.


---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] php.ini ignored! Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread omer k
redhat, apache2.0.43 (as dso).  compiles and runs without a problem

php4.3.0release fails to utilize php.ini settings. ignores changes to the
ini file.

./configure --with-config-file-path=/usr/local/apache2/conf/php.ini --with-a
pxs2=/usr/local/apache2/bin/apxs --with-mysql   (got no errors)

this was not an issue when i had 4.3.0RC2 installed in the exact same
manner!

ive tried this twice, reinstalling apache as well with not difference and
since php otherwise works with its defaults i have a feeling this might be a
bug with the release!?

any help appreciated,
omer.


The Doctor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sat, Dec 28, 2002 at 04:04:14AM -0700, Rick Widmer wrote:
  At 08:40 PM 12/27/02 -0700, The Doctor wrote:
 
 
  Is it just my or are there problems with static Aapche 1.3.27 compiles?
 
  I don't know if it is _just_ you, but my static install compiled and is
  running just fine.
 
  SuSE 8.0
 
  php 4.3.0
 
  Apache 1.3.27
 
  Mod_SSL 2.8.12-1.3.27
 
  OpenSSL 0.9.6h
 
  ming 0.2a
 
  pdflib 4.0.3
 
  ./configure --with-apache=../apache --with-mysql --with-pgsql=/usr
  --enable-cli --enable-calendar --enable-debug=no
  --with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local
  --with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr
  --enable-gd-native-ttf --with-freetype=/usr/include/freetype2

 --with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm
  --with-pspell
 
 
 
  
  Script started on Fri Dec 27 20:34:45 2002
  nl2k.ca//usr/source/php-4.3.0$ cat configphp
  
  configure --prefix=/usr/contrib --localstatedir=/var
  --infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory
  --with-elf --with-x   --with-mysql --with-zlib --enable-track-vars
 
--enable-debug  --enable-versioning --with-config-file-path=/usr/local/lib
 
--with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp --with-gd=/usr
  --enable-imap --with-bz2
  --with-apache=/usr/source/apache_1.3.27_nonSSL/
  --with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf
  --with-jpeg-dir=/usr --with-png-dir=/usr
  --with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib
 

 Same result adding in --enable-cli and --with-PEAR .

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

 --
 Member - Liberal International On 11 Sept 2001 the WORLD was violated.
 This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED]
 Society MUST be saved! Extremists must dissolve.
 Merry Christmas 2002 and Happy 2003



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




[PHP] include option and calling only part of a file.

2002-12-28 Thread Stephen of Blank Canvas
Hi Everyone,
 
I have one file with several sections of code which I have so far
accessed using a good old fashioned - - if ($HTTP_GET_VARS['action'] ==
Update) - - however I now want to include this code within some other
web pages, I thought I may be able to use the following code  - -
include(/modules.php?action=Update) - - however the code does not run.
Hoping someone can help me out on a way to overcome this.  I am running
IIS 5, and PHP 4.2.3
 
Thanks
 
Stephen



[PHP] snmpget

2002-12-28 Thread Gareth Hastings
I can't get this to work, I'm using RH 8 with php 4.2.2.

Is there a way to fix this? I think its something to do with ucd-snmp
and me needing to use net-snmp but I'm not sure.

Any ideas?

Thanks



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




[PHP] PHP 4.3.0, function removed?

2002-12-28 Thread Detritus
Can't see anything in the changelog but after upgrading to 4.3.0 I get an error when 
using leak();
Fatal error: Call to undefined function: leak() in .

I was previously using 4.2.3 and it worked fine.
I upgraded with the Windows Binaries (PHP 4.3.0 installer [1,028Kb] - 27 December 
2002) and running on Win2k/Apache.

The function still shows as being a function as such..
http://www.php.net/manual/en/function.leak.php
and there is no notices that it won't work with 4.3.0

I can probably run the script without the function fine but has anyone else found any 
problems with using this function in 4.3.0 or have I configured something wrong? :P




Re: [PHP] Form duplicate post problem

2002-12-28 Thread Pag



The redirect using the header method is instant and if the middle
page just does the inserts and you redirect right away using PHP
it is not noticable at all.



I gave up on reinventing the wheel and i am trying to use that 
middle-page method you guys mentioned. To make things a little more 
transparent to the user, i thought of using a popup window instead, you 
know, a tiny window pops up, with the code to insert the comment on the 
database, and closes right after it does so.

but err..how can i close it right after the database insert?

Pag 



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



Re: [PHP] PHP 4.3.0, function removed?

2002-12-28 Thread Sterling Hughes
leak() is only included if you compile PHP with debug mode.

Out of interest, why on earth would someone in user-space be using
the leak() function.

-Sterling

 Can't see anything in the changelog but after upgrading to 4.3.0 I get an error when 
using leak();
 Fatal error: Call to undefined function: leak() in .
 
 I was previously using 4.2.3 and it worked fine.
 I upgraded with the Windows Binaries (PHP 4.3.0 installer [1,028Kb] - 27 December 
2002) and running on Win2k/Apache.
 
 The function still shows as being a function as such..
 http://www.php.net/manual/en/function.leak.php
 and there is no notices that it won't work with 4.3.0
 
 I can probably run the script without the function fine but has anyone else found 
any problems with using this function in 4.3.0 or have I configured something wrong? 
:P
 

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




Re: [PHP] Form duplicate post problem

2002-12-28 Thread Michael J. Pawlowsky


You can close it with JavaScript.

Something like

script language=JavaScript
function open_a_window_please(){
lovechild = window.open(childpage.htm);
/script

Now we have a name that can tell the browser which window to close.
We're ready to use the window.close() method. In the parent page add the following 
closing link:

body
a href=javascript: open_a_window_please()Click here to open a window./a
a href=javascript:lovechild.close()Click here to close the child window./a
/body


Dont forget you will need to use flush betwen your major parts otherwise it might 
not get sent to the browser right away.

Mike

P.S. Alot of PC's dont allow window.open anymore. People install ad blockers so it 
doesn't work.


*** REPLY SEPARATOR  ***



 I gave up on reinventing the wheel and i am trying to use that
middle-page method you guys mentioned. To make things a little more
transparent to the user, i thought of using a popup window instead, you
know, a tiny window pops up, with the code to insert the comment on the
database, and closes right after it does so.

 but err..how can i close it right after the database insert?

 Pag



--
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] PHP 4.3.0, function removed?

2002-12-28 Thread Detritus
Ah thank you. :)
I can't remember why it was added but its never done any noticable harm. :P

- Original Message -
From: Sterling Hughes [EMAIL PROTECTED]
To: Detritus [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 29, 2002 4:28 AM
Subject: Re: [PHP] PHP 4.3.0, function removed?


 leak() is only included if you compile PHP with debug mode.

 Out of interest, why on earth would someone in user-space be using
 the leak() function.

 -Sterling

  Can't see anything in the changelog but after upgrading to 4.3.0 I get
an error when using leak();
  Fatal error: Call to undefined function: leak() in .
 
  I was previously using 4.2.3 and it worked fine.
  I upgraded with the Windows Binaries (PHP 4.3.0 installer [1,028Kb] - 27
December 2002) and running on Win2k/Apache.
 
  The function still shows as being a function as such..
  http://www.php.net/manual/en/function.leak.php
  and there is no notices that it won't work with 4.3.0
 
  I can probably run the script without the function fine but has anyone
else found any problems with using this function in 4.3.0 or have I
configured something wrong? :P
 

 --
 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] include option and calling only part of a file.

2002-12-28 Thread John W. Holmes
 I have one file with several sections of code which I have so far
 accessed using a good old fashioned - - if ($HTTP_GET_VARS['action']
==
 Update) - - however I now want to include this code within some
other
 web pages, I thought I may be able to use the following code  - -
 include(/modules.php?action=Update) - - however the code does not
run.
 Hoping someone can help me out on a way to overcome this.  I am
running
 IIS 5, and PHP 4.2.3

When you include() a file, it has the same variable scope as the file it
was included from. So, if you have the following code:

$action = Update;
include(modules.php);

Then you can use $action in modules.php and it'll be set to Update.
modules.php will have the same variables as the file that included it. 

I hope that helps...

---John Holmes...



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




Re: [PHP] PHP 4.3.0, function removed?

2002-12-28 Thread gamin

Detritus [EMAIL PROTECTED] wrote in message
006401c2aef5$6cc70cc0$8800a8c0@rincewind">news:006401c2aef5$6cc70cc0$8800a8c0@rincewind...
 Ah thank you. :)
 I can't remember why it was added but its never done any noticable harm.
:P


Flavouring code with documentation can sometimes be useful. g
Happy new year

gamin.



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




[PHP] Re: [PHP-DEV] Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread Rick Widmer
At 11:29 AM 12/28/02 -0700, The Doctor wrote:

On Sat, Dec 28, 2002 at 04:04:14AM -0700, Rick Widmer wrote:
 At 08:40 PM 12/27/02 -0700, The Doctor wrote:
 ./configure --with-apache=../apache --with-mysql --with-pgsql=/usr
 --enable-cli --enable-calendar --enable-debug=no
 --with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local
 --with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr
 --enable-gd-native-ttf --with-freetype=/usr/include/freetype2
 --with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm
 --with-pspell


vs.



 configure --prefix=/usr/contrib --localstatedir=/var
 --infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory
 --with-elf --with-x   --with-mysql --with-zlib --enable-track-vars
 --enable-debug  --enable-versioning 
--with-config-file-path=/usr/local/lib
 --with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp 
--with-gd=/usr
 --enable-imap --with-bz2
 --with-apache=/usr/source/apache_1.3.27_nonSSL/
 --with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf
 --with-jpeg-dir=/usr --with-png-dir=/usr
 --with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib


What I have that you do not:
   cli - create command line interface executable program.
   calendar - fancy tricks with dates.
   pear - a library of handy functions
   gd-native-ttf
   pdflib - create pdf files
   ming - create swf files
   magic-quotes - eliminates a lot of addslashes()
   mm - I'm not sure
   pspell - spelling checker

I don't think anything I added would make any difference.

Things that look wrong to me:

--with-low-memory, --with-elf and --with-x are not listed as valid options 
in ./configure --help, and look scary to me.  Get rid of them.


You used enable-zlib, but the correct statement is with-zlib or with-zlib-dir.


--enable-track-vars - is enabled by default and ignored for a couple of php 
versions now.

--enable-versioning - is only needed when you want to run more than one PHP 
module version at the same time.



The next thing to try...

xpm-dir, bz2, imap, iconv  are the modules you are using that I am 
not.  Try compiling without them and see what happens.



I don't see where any of these _should_ affect things, but I've gotten in 
trouble before using options I did not need...

--prefix - --with-apache specifies where the resulting files are placed, so 
prefix is not relevant to static install.

localstatedir, infodir, mandir - not relevant to a static install because a 
php module does not use any of the directories specified by these.



Rick


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



[PHP] preg_split

2002-12-28 Thread Mr Nik Frengle
I have the following code with a rather odd behaviour:

htmlheadtitleTest/title/headbody
?php
$string='This is some text which will eventually need
to be splitp
Hopefully it gets done here/pp
I would like that very much/p
pbut whether it will happen or not/p
 
 pis difficult to say./p';
$Xarray=preg_split('/(?=p)/',$string,-1,
'SPLIT_DELIM_CAPTURE');
$count=count($Xarray);
for ($i=0;$i  $count;){
print $Xarray[$i];
//print $i;
$i++;
}
?
/body/html

The behaviour is that on the last 'p' delimiter that
is supposed to be returned instead returns 'p',
leaving of the first ''. Below is the source:

htmlheadtitleTest/title/headbody
This is some text which will eventually need to be
splitp
Hopefully it gets done here/pp
I would like that very much/p
pbut whether it will happen or not/p
 
 pis difficult to say./p/body/html

This was done as a test to figure out what was going
on. I am probably making some stupid newbie mistake,
but I have no idea what it is. Any ideas?

Best,
Nik

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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