RE: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Dan Rossi
heh sorry excuse my arrogance , of then , find me a solution that doesnt
require echoing javascript ?

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 6:49 PM
To: Dan Rossi; Leif K-Brooks
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar


Now Now children.


- Original Message -
From: Dan Rossi [EMAIL PROTECTED]
To: Leif K-Brooks [EMAIL PROTECTED]
Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED];
php-general [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 6:47 PM
Subject: RE: [PHP] Re: Internet Explorer toolbar


 ??? who cares i gave a solution, there is no other #**#% way

 -Original Message-
 From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 3:39 PM
 To: daniel
 Cc: Peter Houchin; Dan; php-general
 Subject: Re: [PHP] Re: Internet Explorer toolbar


 Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
 was asked, it's doing it with javascript.

 daniel wrote:

 yes simply buffer the exact javascript code and then echo it
 
 ie
 
 $buffer .= 'a href=#

onclick=window.open('something.php','something,'scrollbars=no,width=100,he
 igh
 t=100'/a';
 
 sorry i forget the no toolbar part from the top of my head.
 
 
 = Original Message From Leif K-Brooks [EMAIL PROTECTED]
 =
 Correct, but he asked about doing it with PHP.
 
 Peter Houchin wrote:
 
 
 
 yes there is java script
 
 Dan wrote:
 
 
 
 On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
 Ochoa) wrote:
 
 
 Is there any way of using php to launch a new browser without the IE
 toolbars?
 
 
 
 No. PHP is server side, not client side.
 
 
 
 
 
 
 --
 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.
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 
 

 --
 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.




 --
 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] Re: Internet Explorer toolbar

2003-03-28 Thread Leif K-Brooks
I never said there was one, I simply said that a PHP solution was 
requested and you gave a javascript solution.  That has nothing to do 
with the PHP (!) list, and should be discussed off-list.

Dan Rossi wrote:

heh sorry excuse my arrogance , of then , find me a solution that doesnt
require echoing javascript ?
-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 6:49 PM
To: Dan Rossi; Leif K-Brooks
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar
Now Now children.

- Original Message -
From: Dan Rossi [EMAIL PROTECTED]
To: Leif K-Brooks [EMAIL PROTECTED]
Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED];
php-general [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 6:47 PM
Subject: RE: [PHP] Re: Internet Explorer toolbar
 

??? who cares i gave a solution, there is no other #**#% way

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 3:39 PM
To: daniel
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar
Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
was asked, it's doing it with javascript.
daniel wrote:

   

yes simply buffer the exact javascript code and then echo it

ie

$buffer .= 'a href=#
 

onclick=window.open('something.php','something,'scrollbars=no,width=100,he
igh
   

t=100'/a';

sorry i forget the no toolbar part from the top of my head.

 

= Original Message From Leif K-Brooks [EMAIL PROTECTED]
   

=
   

Correct, but he asked about doing it with PHP.

Peter Houchin wrote:



   

yes there is java script

Dan wrote:



 

On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:
Is there any way of using php to launch a new browser without the IE
toolbars?


No. PHP is server side, not client side.



   

 

--
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.

 

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



 

--
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.



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



 

--
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] Re: Internet Explorer toolbar

2003-03-28 Thread Ashley M. Kirchner
Leif K-Brooks wrote:

I never said there was one, I simply said that a PHP solution was 
requested and you gave a javascript solution.  That has nothing to do 
with the PHP (!) list, and should be discussed off-list.
   A solution, whether JavaScript, PHP, or other, is better than 
nothing.  All you're doing is wasting people's time with your childish 
comments.  Yes, a PHP solution was requested and it was pointed out that 
there is none, HOWEVER, there is a JavaScript one, and it was given. 
End of story.  Now, take your Raggedy Ann doll, and go sit in the corner.

--
H| I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 





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


Re: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Philip J. Newman
Mummy and Daddy sto fighting.

- Original Message -
From: Dan Rossi [EMAIL PROTECTED]
To: Philip J. Newman [EMAIL PROTECTED]; Leif K-Brooks
[EMAIL PROTECTED]
Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED];
php-general [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 7:04 PM
Subject: RE: [PHP] Re: Internet Explorer toolbar


 heh sorry excuse my arrogance , of then , find me a solution that doesnt
 require echoing javascript ?

 -Original Message-
 From: Philip J. Newman [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 6:49 PM
 To: Dan Rossi; Leif K-Brooks
 Cc: Peter Houchin; Dan; php-general
 Subject: Re: [PHP] Re: Internet Explorer toolbar


 Now Now children.


 - Original Message -
 From: Dan Rossi [EMAIL PROTECTED]
 To: Leif K-Brooks [EMAIL PROTECTED]
 Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED];
 php-general [EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 6:47 PM
 Subject: RE: [PHP] Re: Internet Explorer toolbar


  ??? who cares i gave a solution, there is no other #**#% way
 
  -Original Message-
  From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 28, 2003 3:39 PM
  To: daniel
  Cc: Peter Houchin; Dan; php-general
  Subject: Re: [PHP] Re: Internet Explorer toolbar
 
 
  Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
  was asked, it's doing it with javascript.
 
  daniel wrote:
 
  yes simply buffer the exact javascript code and then echo it
  
  ie
  
  $buffer .= 'a href=#
 

onclick=window.open('something.php','something,'scrollbars=no,width=100,he
  igh
  t=100'/a';
  
  sorry i forget the no toolbar part from the top of my head.
  
  
  = Original Message From Leif K-Brooks
[EMAIL PROTECTED]
  =
  Correct, but he asked about doing it with PHP.
  
  Peter Houchin wrote:
  
  
  
  yes there is java script
  
  Dan wrote:
  
  
  
  On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED]
(Manuel
  Ochoa) wrote:
  
  
  Is there any way of using php to launch a new browser without the IE
  toolbars?
  
  
  
  No. PHP is server side, not client side.
  
  
  
  
  
  
  --
  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.
  
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  
  
  
  
  
 
  --
  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.
 
 
 
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] url rewrite

2003-03-28 Thread Sebastian
hello,
i am not sure where to post this question, since it's partly related to PHP,
so i'll ask here.

I'd like to rewrite a url
that looks like this: /news/articles/article.php?id=255

into /news/articles/255/

any help is appreciated.

cheers,
- Sebastian


RE: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Niklas Lampén
Heh, I think this kind of idiotism and hair splitting is fun for a
change. :)
I personnally like this in this php-list that you can ask allmost
anything and get a desent answer in a short perioid of time. Lets keep
it that way, even if it takes us sometimes to javascript or some other
OT. :)


Niklas


-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED] 
Sent: 28. maaliskuuta 2003 10:17
To: Dan Rossi; Leif K-Brooks
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar


Mummy and Daddy sto fighting.

- Original Message -
From: Dan Rossi [EMAIL PROTECTED]
To: Philip J. Newman [EMAIL PROTECTED]; Leif K-Brooks
[EMAIL PROTECTED]
Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED];
php-general [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 7:04 PM
Subject: RE: [PHP] Re: Internet Explorer toolbar


 heh sorry excuse my arrogance , of then , find me a solution that 
 doesnt require echoing javascript ?

 -Original Message-
 From: Philip J. Newman [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 6:49 PM
 To: Dan Rossi; Leif K-Brooks
 Cc: Peter Houchin; Dan; php-general
 Subject: Re: [PHP] Re: Internet Explorer toolbar


 Now Now children.


 - Original Message -
 From: Dan Rossi [EMAIL PROTECTED]
 To: Leif K-Brooks [EMAIL PROTECTED]
 Cc: Peter Houchin [EMAIL PROTECTED]; Dan [EMAIL PROTECTED]; 
 php-general [EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 6:47 PM
 Subject: RE: [PHP] Re: Internet Explorer toolbar


  ??? who cares i gave a solution, there is no other #**#% way
 
  -Original Message-
  From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 28, 2003 3:39 PM
  To: daniel
  Cc: Peter Houchin; Dan; php-general
  Subject: Re: [PHP] Re: Internet Explorer toolbar
 
 
  Yes, but that has nothing do to with PHP!  It's not doing it with 
  PHP as was asked, it's doing it with javascript.
 
  daniel wrote:
 
  yes simply buffer the exact javascript code and then echo it
  
  ie
  
  $buffer .= 'a href=#
 

onclick=window.open('something.php','something,'scrollbars=no,width=10
0,he
  igh
  t=100'/a';
  
  sorry i forget the no toolbar part from the top of my head.
  
  
  = Original Message From Leif K-Brooks
[EMAIL PROTECTED]
  =
  Correct, but he asked about doing it with PHP.
  
  Peter Houchin wrote:
  
  
  
  yes there is java script
  
  Dan wrote:
  
  
  
  On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED]
(Manuel
  Ochoa) wrote:
  
  
  Is there any way of using php to launch a new browser without 
  the IE toolbars?
  
  
  
  No. PHP is server side, not client side.
  
  
  
  
  
  
  --
  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.
  
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  
  
  
  
  
 
  --
  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.
 
 
 
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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



RE: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Ernest E Vogelsinger
At 09:35 28.03.2003, Niklas Lampén said:
[snip]
Heh, I think this kind of idiotism and hair splitting is fun for a
change. :)
I personnally like this in this php-list that you can ask allmost
anything and get a desent answer in a short perioid of time. Lets keep
it that way, even if it takes us sometimes to javascript or some other
OT. :)
[snip] 

Ask anything? Really?

Well then - how can I get rich quick, do I need to use JavaScript or can it
be done with PHP?

(sorry couldn't resist...)

-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Ashley M. Kirchner
Ernest E Vogelsinger wrote:

Well then - how can I get rich quick, do I need to use JavaScript or can it
be done with PHP?
 

   I'd give you an answer, but this is a PHP list.  Apparently we're 
not allowed to give non-PHP solutions on here.  smirk

--
H| I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 





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


RE: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Niklas Lampén
I think you should use the function called
PutMoneyToMyAccount($AccountID = '123456-98765', $AmountInUSDollars =
'100');. Run it as many times as you want. This doesn't need
javascript, so this wasn't OT.. :P No need to thank me, even manual
tells you this.


Niklas


-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] 
Sent: 28. maaliskuuta 2003 10:41
To: [EMAIL PROTECTED]
Cc: 'Php-General'
Subject: RE: [PHP] Re: Internet Explorer toolbar


At 09:35 28.03.2003, Niklas Lampén said:
[snip]
Heh, I think this kind of idiotism and hair splitting is fun for a 
change. :) I personnally like this in this php-list that you can ask 
allmost anything and get a desent answer in a short perioid of time. 
Lets keep it that way, even if it takes us sometimes to javascript or 
some other OT. :)
[snip] 

Ask anything? Really?

Well then - how can I get rich quick, do I need to use JavaScript or can
it be done with PHP?

(sorry couldn't resist...)

-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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


###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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



Re: [PHP] url rewrite

2003-03-28 Thread Jason Wong
On Friday 28 March 2003 16:38, Sebastian wrote:

 i am not sure where to post this question, since it's partly related to
 PHP, so i'll ask here.

Ask google or ask the archives.

 I'd like to rewrite a url
 that looks like this: /news/articles/article.php?id=255

 into /news/articles/255/

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I know the answer!  The answer lies within the heart of all mankind!
The answer is twelve?  I think I'm in the wrong building.
-- Charles Schulz
*/


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



Re: [PHP] Checkbox

2003-03-28 Thread SLanger
Hello

From a usability standpoint showing a checkbox that cannot be unchecked 
renders the checkbox obsolete. The consquence is not to show a checkbox at 
all. If you need an uncheckable checkbox because of licence aggreements or 
something like that. Or privacydeclaration type checkbox. Make it 
checkable but check on the server side if it is checked. If not render an 
error message to the client telling them why you can't process the 
form/data because the checkbox is unchecked. That way it is still up to 
the user to decide what he wants to do.
Another alternative is to build a button that has to be pressed to 
continue which does the same as the checkbox.


The important thing is:
1. Don't take away the users freedom of choice (checking / not checking)
2. Make the user feels he is in control (even though he isn't ;) )
3. Only put up control elements that actually enable the user to take 
control

Basically all three points are the same. 

I suggest to read up on usability issues. Just do a google on usability 
and software.
Cause usability is one of the things most of the webprogrammers get 
wrong... It's not important what your intention is rather what the user 
intents to do!

Please remember this is my opinion so take it or leave it. ;)

Regards
Stefan

[PHP] referer

2003-03-28 Thread Mat Harris
am i going mad or something?

i want to use the referer string from the server vars, but the
$_SERVER[REFERER] and $HTTP_SERVER_VARS[REFERER] vars are empty
and the phpinfo doesn't show the referer at all.

what's going on?

cheers

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


pgp0.pgp
Description: PGP signature


Re: [PHP] url rewrite

2003-03-28 Thread Sebastian

if that were the case I wouldn't have asked here.. perhaps i didn't find the
answer at google or the archives.

- Original Message -
From: Jason Wong [EMAIL PROTECTED]

Ask google or ask the archives.


| On Friday 28 March 2003 16:38, Sebastian wrote:
|
|  i am not sure where to post this question, since it's partly related to
|  PHP, so i'll ask here.
|
|  I'd like to rewrite a url
|  that looks like this: /news/articles/article.php?id=255
| 
|  into /news/articles/255/



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



Re: [PHP] referer

2003-03-28 Thread Sebastian
try: $_SERVER['HTTP_REFERER'];

cheers,
- Sebastian

- Original Message - 
From: Mat Harris [EMAIL PROTECTED]

| am i going mad or something?
| i want to use the referer string from the server vars, but the
| $_SERVER[REFERER] and $HTTP_SERVER_VARS[REFERER] vars are empty
| and the phpinfo doesn't show the referer at all.
| what's going on?
| cheers


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



[PHP] file

2003-03-28 Thread Diksha Neel
hi all!

i have a simple program to open and write a file.
but the file is not getting created.
can anyone please spot the mistake?
giving the code below.
thanks a lot,
diksha.
?php
echohi?how are u doing??;
$fp = fopen (sandrew.html, w);
string=htmlheadtitlehi/title/headbodyi am
fine/body/html;
$contents=fwrite($fp,string);
echo '$contents';
fclose($fp);
?


___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] file

2003-03-28 Thread Jason Wong
On Friday 28 March 2003 18:26, Diksha Neel wrote:

 i have a simple program to open and write a file.
 but the file is not getting created.
 can anyone please spot the mistake?
 giving the code below.

Turn on FULL error reporting so you can what errors (if any) there are in your 
code.

 ?php
 echohi?how are u doing??;
 $fp = fopen (sandrew.html, w);
 string=htmlheadtitlehi/title/headbodyi am

 fine/body/html;
 $contents=fwrite($fp,string);

You need to use $string.

 echo '$contents';
 fclose($fp);
 ?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A computer lets you make more mistakes faster than any other invention,
with the possible exceptions of handguns and Tequilla.
-- Mitch Ratcliffe
*/


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



RE: [PHP] file

2003-03-28 Thread Rich Gray
 hi all!

 i have a simple program to open and write a file.
 but the file is not getting created.
 can anyone please spot the mistake?
 giving the code below.

 thanks a lot,
 diksha.

 ?php
 echohi?how are u doing??;
 $fp = fopen (sandrew.html, w);
 string=htmlheadtitlehi/title/headbodyi am

 fine/body/html;
 $contents=fwrite($fp,string);
 echo '$contents';
 fclose($fp);
 ?

Hi Diksha
Some comments...

. Your string variable needs to be defined and referenced as $string not
just string  - unless this is a typo in your post
. fwrite() returns an int - you are assigning this int to $contents - what
exactly are you expecting $contents to be set to?
. Does your user or web server process have the permissions to create files
in the directory?
. What does readfile('sandrew.html'); after your fclose($fp) return?

HTH
Rich


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



[PHP] submit

2003-03-28 Thread Diksha Neel
hi all,
seems to be and off day for me.
simple things aren't working.
have this really stupid thing called dew3.html
in which is a submit button to connect to new6.php
that will in turn create a file sandrew.html.
but the submit button in dew3.html is seen but isn't
working.
help please.
sending code for dew3.html.
thanks,
diksha.
html
head
titledew/title
/head
body
form method=get action=new6.php
input type=button value=submit
/form
/body
/html
___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] submit

2003-03-28 Thread Nikunj Virani
change input type=button value=submit to input type=submit
value=submit

Regards,
Nikunj Virani
- Original Message -
From: Diksha Neel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:13 PM
Subject: [PHP] submit


 hi all,
 seems to be and off day for me.
 simple things aren't working.
 have this really stupid thing called dew3.html
 in which is a submit button to connect to new6.php
 that will in turn create a file sandrew.html.
 but the submit button in dew3.html is seen but isn't
 working.
 help please.
 sending code for dew3.html.

 thanks,
 diksha.

 html
 head
 titledew/title
 /head
 body
 form method=get action=new6.php
 input type=button value=submit
 /form
 /body
 /html


 ___
 Odomos - the only  mosquito protection outside 4 walls -
 Click here to know more!

http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomosw
n


 --
 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] referer

2003-03-28 Thread Mat Harris
On Fri, Mar 28, 2003 at 04:19:25 -0500, Sebastian wrote:
 try: $_SERVER['HTTP_REFERER'];
 
 cheers,
 - Sebastian
 
 From: Mat Harris [EMAIL PROTECTED]
 
 | am i going mad or something?
 | i want to use the referer string from the server vars, but the
 | $_SERVER[REFERER] and $HTTP_SERVER_VARS[REFERER] vars are empty
 | and the phpinfo doesn't show the referer at all.
 | what's going on?
 | cheers
 

DOH!, I knew i was going mad. That's worked a treat!

cheers :)

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


pgp0.pgp
Description: PGP signature


Re: Re: [PHP] submit

2003-03-28 Thread Diksha Neel


hi guys,
yeah, i now believe this really is an off day for me.
probably because i did not have food today!
well, my problem is a really funny one.
through dew4.html's submit button i want to get connect
to new6.php from which should open a file.
but as soon as i click on the submit button, i get
page cannot be displayed .
i dont know what to do.
giving code for new6.php.
tata,
diksha.
?php
echohi?how are u doing??;
$fp = fopen (sandrew.html, w);
$string=htmlheadtitlehi/title/headbodyi am
fine/body/html;
$contents=fwrite($fp,string);
echo '$contents';
fclose($fp);
?
___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] page cannot be displayed

2003-03-28 Thread Diksha Neel


hi guys,
yeah, i now believe this really is an off day for me.
probably because i did not have food today!
well, my problem is a really funny one.
through dew4.html's submit button i want to get connect
to new6.php from which should open a file.
but as soon as i click on the submit button, i get
page cannot be displayed .
i dont know what to do.
giving code for new6.php.
tata,
diksha.
?php
echohi?how are u doing??;
$fp = fopen (sandrew.html, w);
$string=htmlheadtitlehi/title/headbodyi am
fine/body/html;
$contents=fwrite($fp,string);
echo '$contents';
fclose($fp);
?
___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem with = new and locally created instances

2003-03-28 Thread Jens von Pilgrim
Hi,

I've got a problem with the = new construct. A code sample tells more
than 1000 words:

?php

class foo {}

$g_fooInstance = null;

class factory {
  function factory() {
global $g_fooInstance;
if (is_null($g_fooInstance)) {
  $g_fooInstance = new foo();   // -- here's the problem
//  $g_fooInstance = new foo();  // -- this works
}
  }
}

function main() {
  $theFactory = new factory();
  global $g_fooInstance;
  if (is_null($g_fooInstance)) {
echo ('This isn\'t expected - why is it null?');
  } else {
echo ('It works as expected');
  }
}

// run
main();
?

This code is running like that and demonstrates exactly the weird
behaviour.
Running this example, the variable $g_fooInstance is null in function
main(). But why? Is the reference to the constructed object descructed after
leaving the scope of function factory::factory()? Or in other words, are
locally created instances always destructed, regardless if there are other
references on the instance?
Is this a bug (the reference mechanism isn't working as expected) - or a
feature (locally created instances are immediately after leaving the scope)?
Maybe I've programmed Java too long...

Regards,

jens




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



Re: [PHP] url rewrite

2003-03-28 Thread Chris Hewitt
Sebastian wrote:

if that were the case I wouldn't have asked here.. perhaps i didn't 
find the
answer at google or the archives.

- Original Message -
From: Jason Wong [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

Ask google or ask the archives.

| On Friday 28 March 2003 16:38, Sebastian wrote:
|
|  i am not sure where to post this question, since it's partly 
related to
|  PHP, so i'll ask here.
|
|  I'd like to rewrite a url
|  that looks like this: /news/articles/article.php?id=255
| 
|  into /news/articles/255/

As a long time contributor to this list, Jason knows that this question 
has been asked many times.

To help your research, I put search engine friendly url into the list 
archive at http://marc.theaimsgroup.com at got quite a list back. One of 
these gives a reference to

http://www.faqts.com/knowledge_base/view.phtml/aid/124

which gives tutorials for doing it in PHP, mod_rewrite and/or mod_mime.

Hoping this helps.

Chris



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


RE: [PHP] Re: Internet Explorer toolbar

2003-03-28 Thread Dan Rossi
use my example , there is no possible way , i did once see a javascript()
function but obviously thats not there

-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 7:41 PM
To: [EMAIL PROTECTED]
Cc: 'Php-General'
Subject: RE: [PHP] Re: Internet Explorer toolbar


At 09:35 28.03.2003, Niklas Lampén said:
[snip]
Heh, I think this kind of idiotism and hair splitting is fun for a
change. :)
I personnally like this in this php-list that you can ask allmost
anything and get a desent answer in a short perioid of time. Lets keep
it that way, even if it takes us sometimes to javascript or some other
OT. :)
[snip]

Ask anything? Really?

Well then - how can I get rich quick, do I need to use JavaScript or can it
be done with PHP?

(sorry couldn't resist...)

--
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



--
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] page cannot be displayed

2003-03-28 Thread Chris Hayes
At 12:01 28-3-2003, you wrote:

it is most likely that the error is in the referring file in dew4.html. 
check the file name and path of the page you redirect to, and check the 
form method.



hi guys,
yeah, i now believe this really is an off day for me.
probably because i did not have food today!
well, my problem is a really funny one.
through dew4.html's submit button i want to get connect
to new6.php from which should open a file.
but as soon as i click on the submit button, i get
page cannot be displayed .
i dont know what to do.
giving code for new6.php.
tata,
diksha.
?php
echohi?how are u doing??;
$fp = fopen (sandrew.html, w);
$string=htmlheadtitlehi/title/headbodyi am
fine/body/html;
$contents=fwrite($fp,string);
echo '$contents';
fclose($fp);
?
___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
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] tips on sorting an array of objects by an attribute?

2003-03-28 Thread neko
Hi Guys, Just after some experience...

What's the best way to sort an array of objects by one of their attributes,
accessed by $obj-getFoo() (its a number) ? I was thinking a bubble-sort,
making multiple passses and switching array elements until there are no more
switches to make.

Any tips? The array size is not very large (not will it ever be), so it's
doesn't have to be a super-lean sorting algorithm (no harm though ;) )

cheers,
neko



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



Re: [PHP] shell_exec question....

2003-03-28 Thread David T-G
Kalin --

Please don't hijack threads.  This question has nothing to do with your
last questions regarding email address regular expressions.  For that
matter, *that* had nothing to do with php and perl.

Mail and news messages have many headers, some of which serve to connect
messages together.  You can even change the Subject: as the discussion
evolves or forks and the messages will all still be properly related to
the right parents and children.  This is a good thing, even though
Microsoft Outlook really doesn't support it too well at all and many
users of it have no threading or sorting capabilities.

When starting a new topic, or thread, please start a fresh message.
Not only is there no chance of forgetting to change the subject but the
message also does not appear glued onto another message where it really
doesn't belong.

...and then Kalin Mintchev said...
% 
% hello list,

Hi!


% 
% what has to happened so this actually works:
% 
% $mstrng = shell_exec(/usr/sbin/zip 0041_27032003223711.zip
% 0041_27032003223711);

Are you running under safe mode, which turns off shell execs?  Can you
call anything via shell_exec?  Have you tried using system() instead?


% 
% if php is compiled as a module with apache is the apache owner the one
% that has to have writing permissions? if so - it does..

OK; that's a good start.  We need more details, though.  Tell us what
you've done and what does or doesn't happen, including any error messages
on the web page or in the apache log.


% 
% any help appreciated...
% 
% thank you


HTH  HAND

:-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://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Microsoft SQL Server varchar(500) field text concatenated at 255characters.

2003-03-28 Thread Scott Houseman
Hi There.

I am using PHP 4.3.0 on WIN32 to query data from a Microsoft SQL Server.
One field I am requesting is type VARCHAR size 500. For some reason, PHP
is returning only the first 255 characters of the text from that field.
If I change the field type to TEXT, all of the data in that field is returned.

Unfortunately, an ASP application is also using that database, and when I change
the field type to TEXT, it pukes completely.
I would rather try to resolve the issue in PHP than waste my time looking at ASP code.
Has anyone got an idea why this might be hapenning?

Many thanks.

Scott
--
Scott Houseman
Senior Software Developer
Junk Mail Publishing (Pty) Ltd
Tel. +27 12 342 3840 x3806
Fax. +27 12 342 1842
Mob. +27 82 491 8021
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] string replace problem!!

2003-03-28 Thread Thijs Lensselink
Good day ,

I have the following string.
,slideimages[0],slideimages[1],slideimages[2]
Wich starts with a ','. No my problem is i want to strip
this first and only the first ','.

i've tried 
$string = ,slideimages[0],slideimages[1],slideimages[2];
$string = preg_replace('/^./','',$string,1);

wich results in slideimages[0]slideimages[1]slideimages[2]
Can somebody help me out here??

thnx
Thijs

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



[PHP] Random Password Making.

2003-03-28 Thread Philip J. Newman
Whats the best way to make a random password with 4 letters and 2 numbers?


--
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]


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



RE: [PHP] string replace problem!!

2003-03-28 Thread Rich Gray
 Good day ,
 
 I have the following string.
 ,slideimages[0],slideimages[1],slideimages[2]
 Wich starts with a ','. No my problem is i want to strip
 this first and only the first ','.
 
 i've tried 
 $string = ,slideimages[0],slideimages[1],slideimages[2];
 $string = preg_replace('/^./','',$string,1);
 
 wich results in slideimages[0]slideimages[1]slideimages[2]
 Can somebody help me out here??
 
 thnx
 Thijs

$string = substr($string,1);

Rich

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



[PHP] Time stamp and changing to a date.

2003-03-28 Thread Philip J. Newman
$mydate = 20030328231154;

$myPrintDate=date (l dS of F Y h:i:s A,$mydate);

echo $myPrintDate;

Whats wrong

--
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]


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



RE: [PHP] Time stamp and changing to a date.

2003-03-28 Thread Rich Gray
 $mydate = 20030328231154;

 $myPrintDate=date (l dS of F Y h:i:s A,$mydate);

 echo $myPrintDate;

 Whats wrong

$mydate should be a unix style timestamp not  a MMDDHHMMSS type
date/time format...
Check the functions time() and mktime() to help you generate unix
timestamps.

HTH
Rich


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



Re: [PHP] Time stamp and changing to a date.

2003-03-28 Thread Ryan Gibson
?php
$mydate = date(20030328231154);

$myPrintDate=date (l dS of F Y h:i:s A,$mydate);

echo $myPrintDate;
?




On 28/3/03 11:44 am, Philip J. Newman [EMAIL PROTECTED] wrote:

 $mydate = 20030328231154;
 
 $myPrintDate=date (l dS of F Y h:i:s A,$mydate);
 
 echo $myPrintDate;
 
 Whats wrong


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



[PHP] gd library + animated gif

2003-03-28 Thread rush
Can GD library produce animated gif's?

rush
--
http://www.templatetamer.com/




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



RE: [PHP] Microsoft SQL Server varchar(500) field text concatenated at 255 characters.

2003-03-28 Thread Rich Gray
 Hi There.

 I am using PHP 4.3.0 on WIN32 to query data from a Microsoft SQL Server.
 One field I am requesting is type VARCHAR size 500. For some reason, PHP
 is returning only the first 255 characters of the text from that field.

 If I change the field type to TEXT, all of the data in that field
 is returned.

 Unfortunately, an ASP application is also using that database,
 and when I change
 the field type to TEXT, it pukes completely.
 I would rather try to resolve the issue in PHP than waste my time
 looking at ASP code.

 Has anyone got an idea why this might be hapenning?

 Many thanks.

 Scott

Hi Scott

I believe this is a problem because of the relatively old TDS libraries used
by native access methods...

Possible workarounds are...

. cast the data to TEXT before returning it
. use ODBC which doesn't have this problem IIRC

HTH
Rich


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



RE: [PHP] Random Password Making.

2003-03-28 Thread Mark Cubitt
try this

function randpassword () {

$length = 6;

srand((double)microtime()*100);

$string = '';

while(strlen($string) != $length)  {
$type = rand(1,2);

if ($letterammount = 4) {$type = 1;}
if ($numammount = 2) {$type = 2;}

if($type == 1) {
$string = $string . chr(rand(48,57)); // 
numbers
$numammount = ($numammount + 1);
   }
if($type == 2) {
$lettertype = rand(1,2);

  if($lettertype == 1) {$string = $string .
chr(rand(65,90));} // uppercase letters
if($lettertype == 2) {$string = $string . 
chr(rand(97,122));} //
lowercase letters
$letterammount = ($letterammount + 1);
   }
}

return($string);
}

hope that helps

Regards

Mark Cubitt

 -Original Message-
 From: Philip J. Newman [mailto:[EMAIL PROTECTED]
 Sent: 28 March 2003 11:33
 To: [EMAIL PROTECTED]
 Subject: [PHP] Random Password Making.


 Whats the best way to make a random password with 4 letters and 2 numbers?


 --
 Philip J. Newman.
 Head Developer
 [EMAIL PROTECTED]


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



 **
 
  This email has been virus checked by the Eclipse Internet
 MAILsafe service
 **
 
  www: http://www.eclipse.net.uk/email:
 [EMAIL PROTECTED]
 **
 




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



RE: [PHP] last questions

2003-03-28 Thread Steve Jackson
Here's a function you could use. The input from your form should be
email ($email in this script).

function valid_email($email)
{
  // check an email address is possibly valid
  if (ereg([EMAIL PROTECTED],
$email))
return true;
  else 
return false;
}

HTH

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159





 -Original Message-
 From: Jason k Larson [mailto:[EMAIL PROTECTED] 
 Sent: 28. maaliskuuta 2003 5:33
 To: Haseeb Iqbal
 Cc: PHP General list
 Subject: Re: [PHP] last questions
 
 
 Search the list archives, this question gets asked (and 
 answered) a lot.
 
 http://marc.theaimsgroup.com/?l=php-general
 
 HTH,
 Jason k Larson
 
 
 Haseeb Iqbal wrote:
  thanx to all those who replied to my previous question.
  1 more question.i need help with reqular expressions.i want 
 to check 
  valid
  (email)
  usernanes for my mail server .i.e. Qmail. any help welcome.
  thanx in advance
  Haseeb
  
 
 
 
 -- 
 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] character set problem

2003-03-28 Thread Filip De Graeve
I tried it ; it doesn't work.

é ë è results into Ú Þ Ù  standard,  using  htmlentities
é ë è results into eacute; egrave; euml; using htmlspecialchars
é ë è results into %E9%20%E8%20%EB  using  rawlurlencode


The charset  ISO-8859-1 (western europe) is supported
in my apache, php, and on the global win 2K system.
(it's native!)


Any other clues ?


Cheers!






Evan Nemerson [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 rawurlencode was originally intended for URLs, but all it does is encode
 certian characters- it can be used for anything, and if the percentage of
 characters is low enough, the returned string is smaller than that which
is
 returned by base64_encode, bin2hex, etc.

 That said, it sounds like the problem is not in php itself, but maybe your
 php_mssql.dll or freetds. Make sure you have the latest version of both.
See
 what versions were working for you- maybe something got broken in a newer
 release of one of those.



 On Thursday 27 March 2003 10:45 am, Filip De Graeve wrote:
  the problem is, there is already an application running
  (written in VB) using that ms sql server ; so i must find a way
  to enter the characters in the db in a proper way...
 
  isn't rawurlencode supposed to be used for urls?
  i'm just talking about a plain text string...
 
  is there anybody else who got any idea ?
  thank you for your quick response...
 
  regards,
 
  Filip
 
  Evan Nemerson [EMAIL PROTECTED] schreef in bericht
  news:[EMAIL PROTECTED]
 
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA1
  
   can you do a rawurlencode() on the data before you put it in the DB,
and
   a rawurldecode when you suck it out? It's a hack, but it would prolly
   work fine.
  
   On Thursday 27 March 2003 09:46 am, Filip De Graeve wrote:
Hello,
   
Using PHP 4.3.1 on a Windows 2k/Apache,
i am trying to insert some text  likeTest é à ë into a
MS SQL database.
   
The result I get using the query analyzer :
Test Ú Þ Ù
   
is not the same as you can see for yourself.
However; ms sql supports those characters when
i insert them directly into the query analyzer.
   
My locales support those characters (.be locals),
and i configured the php.ini to support the iso-8859-1 charset
(and use the mssql dll extension).
   
What's also weird, is that the function   htmlspecialchars has
no effect on the result, whilst htmlentities does have one; but then
the textfield looks like  Test eacute; egrave; euml; 
which wasn't exactly the point.
   
I used an older version of php once;
( i believe it was 4.1.1 or something) and there wasn't any bug
regarding charsets etc (on a ms sql database).
   
Can anybody give me any clue where to look
or what to do?
   
thank you,
regards
   
Filip
[EMAIL PROTECTED]
  
   - --
   Prisons are built with stones of Law, Brothels with bricks of
Religion.
  
   - -William Blake
   -BEGIN PGP SIGNATURE-
   Version: GnuPG v1.0.7 (GNU/Linux)
  
   iD8DBQE+g0SB/rncFku1MdIRAofUAJ0TbYKVYZ+tPski2l8QNT6dkDkh8wCdEjux
   8jW37HvPuBZg5aZbZywOF+0=
   =qVVT
   -END PGP SIGNATURE-

 - --
 To achieve adjustment and sanity and the conditions that follow from them,
we
 must study the structural characteristics of this world first and, then
only,
 build languages of similar structure, instead of habitually ascribing to
the
 world the primitive structure of our language.

 - -Alfred Korzybski
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.7 (GNU/Linux)

 iD8DBQE+g0s0/rncFku1MdIRAqVYAJ9Xxavy/cCPCuvKPNXfURrTv4r7NQCcDwtO
 VqQFVBtmNtSWenoUTNgUv7U=
 =Xrm1
 -END PGP SIGNATURE-




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



Re: [PHP] Problem with = new and locally created instances

2003-03-28 Thread Jason k Larson
Maybe I'm missing something here ... but what is the point of trying to create a reference 
to a new object ... it hasn't been ceated prior to make reference to.  Can't you simply 
create the new object and then make whatever (if needed) references?

--
Jason k Larson
Jens von Pilgrim wrote:
Hi,

I've got a problem with the = new construct. A code sample tells more
than 1000 words:
?php

class foo {}

$g_fooInstance = null;

class factory {
  function factory() {
global $g_fooInstance;
if (is_null($g_fooInstance)) {
  $g_fooInstance = new foo();   // -- here's the problem
//  $g_fooInstance = new foo();  // -- this works
}
  }
}
function main() {
  $theFactory = new factory();
  global $g_fooInstance;
  if (is_null($g_fooInstance)) {
echo ('This isn\'t expected - why is it null?');
  } else {
echo ('It works as expected');
  }
}
// run
main();
?
This code is running like that and demonstrates exactly the weird
behaviour.
Running this example, the variable $g_fooInstance is null in function
main(). But why? Is the reference to the constructed object descructed after
leaving the scope of function factory::factory()? Or in other words, are
locally created instances always destructed, regardless if there are other
references on the instance?
Is this a bug (the reference mechanism isn't working as expected) - or a
feature (locally created instances are immediately after leaving the scope)?
Maybe I've programmed Java too long...
Regards,

jens


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


[PHP] Problem with FirwBird date

2003-03-28 Thread André Cupini
Hello people,
I´m have a problem when work with date in a Firebird date field. By
default, Firebird set up the date format as month/day/year. I need date in
day/month/year format. In a Linux, i just add to the php.ini the following
line:
ibase.dateformat = %d/%m/%Y
But in a machine with Apache+PHP+Firebird, it´s don´t work.

Anybody help-me please?
Thanks for attention.



André Cupini - Programador

[EMAIL PROTECTED]

NeoBiz - fábrica de internet
http://www.neobiz.com.br


RE: [PHP] Problem with = new and locally created instances

2003-03-28 Thread Jens von Pilgrim
Hello,

Jason wrote:
JL Maybe I'm missing something here ... but what is the point of trying
JL to create a reference to a new object ... it hasn't been ceated prior
JL to make reference to.  Can't you simply create the new object and
JL then make whatever (if needed) references?

Uhh... maybe I'm missing someting, too?
We're talking about he followin line, don't we?

$g_fooInstance = new foo();   // -- here's the problem

IMHO this line causes no problem... using the  operator with new is
explicitly noticed in the php manual (Chapter 15):

The same syntax can be used with functions, that return references, and
with new operator (in PHP 4.0.4 and later):
$bar = new fooclass();

The problem is, that the object created in that line is destructed when the
function is left. Or, in other words, an object is destructed automatically
by the php-engine, although a) the object is still referenced and b) even no
local variable has ever referenced it.

BTW: Of course the code here doesn't make really sense (according to your
last sentence), but it's only an example for illustrating the problem.

Regards,

Jens


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



RE: [PHP] date math question

2003-03-28 Thread John W. Holmes
 This leads me to another question. If I have stored the date as an
 epoch then is there a way using PHP and MySQL to say find all the
 records that have been added this YEAR (not last 365 days)?

SELECT * FROM table WHERE YEAR(FROM_UNIXTIME(column)) =
YEAR(CUR_DATE());

Benchmark each method and see which is faster...

---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] dynamic/multidimensional arrays in classes

2003-03-28 Thread Jason k Larson
The problem here lies with the each function, I believe.  I played with this for a minute 
and that's where I ran into problems with unexpected behaviour.  Regardless, I was able to 
get expected functionality using foreach instead of the while loop.  While foreach isn't 
available in PHP3 it is in all versions of PHP4.  If you can't use foreach, writing the 
while loop differently (not using each()) should work better.

HTH,
Jason k Larson
Patrick Teague wrote:
I'm currently having a problem with another array in a class  I can't
figure it out -
class myClass
{
function myClass($arr = array( 'item1'=array('a','b','c'),
'item2'=array('a','b','c') ) )
{
print_r( $arr );
while( list($key,$val) = each($arr) )
{
print($key.=.$val);
}
}
}
now, if I say

$mine = myClass();

it only prints the print_r statement, but not the print($key.=.$val)
statment meaning it doesn't even bother entering the loop.  However if I say
$mine = myClass(array( 'item1'=array('a','b','c'),
'item2'=array('a','b','c') ) );
it prints both...  is there some reason why I need to repeat the default
value when creating the class?  I've also tried using a  string on class
creation, but no luck there either.
Patrick


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


[PHP] Pipe broken

2003-03-28 Thread Benja
Hi all,
is it possible to know in PHP if the client hit the stop button or close the
browser ?

Here is what I read on a forum :


 I was told you cannot when I asked 'way back when.

 When the user hits stop, the pipe is broken.
 Apache will attempt to spit out some more data, and will notice the pipe
 is broken, and will stop.
 But Apache doesn't inform PHP that the pipe broke.

 At least that's my vague recollection of what goes on.

More or less correct. Hopefully we will have this resolved soon.

-Rasmus


But it was in 1999 ! Is it possible to do it now ?

Thanks for your help,
Benja.

--
Benjamin Fonzé - [EMAIL PROTECTED]
WEB DEVELOPER
_

ELECTRONIC GROUP INTERACTIVE - www.electronic-group.com
World Trade Center, Moll de BARCELONA
Edificio Norte 4 Planta
08039 BARCELONA SPAIN
Tel : +34 93600 23 23 Fax : +34 93600 23 10
_



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



RE: [PHP] Connecting to a remote server

2003-03-28 Thread Roberts, Mark \(Tulsa\)
They are not on the same server...that is the problem.
They used to be on the same server, but I have had to move the application to a 
physically different server with a different DNS than the DB Server.

So, on the surface, it would seem that I should just replace 'localhost' with the dns 
name of the DB Server i.e. (http://www.xyz.com). However, this did not work. Is there 
something else that I should be doing, either in the connect string or in php 
configuration?


Mark Roberts
Sr. Systems Analyst




-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 12:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Connecting to a remote server


On Friday 28 March 2003 05:00, Roberts, Mark \(Tulsa\) wrote:
 I am needing to move one of my apps to a remote secure server that I have.
 As I have never done this before what are the general things that I must do
 to make this happen.

 I changed my connect statement from localhost to the name of the server 
  http://www.remoteservername.com http://www.remoteservername.com; and
 received an error that I could not connect, try again later.

Are you talking about the database connection? If so, then there is no need 
for the 'http://'. And if both the webserver and the DB server are on the 
same machine you can continue to use 'localhost'.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Things are not as simple as they seems at first.
- Edward Thorp
*/


-- 
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] Pipe broken

2003-03-28 Thread Marek Kilimajer
Manual - Features - Connection handling

Benja wrote:

Hi all,
is it possible to know in PHP if the client hit the stop button or close the
browser ?
Here is what I read on a forum :


 

I was told you cannot when I asked 'way back when.

When the user hits stop, the pipe is broken.
Apache will attempt to spit out some more data, and will notice the pipe
is broken, and will stop.
But Apache doesn't inform PHP that the pipe broke.
At least that's my vague recollection of what goes on.
   

More or less correct. Hopefully we will have this resolved soon.

-Rasmus

But it was in 1999 ! Is it possible to do it now ?

Thanks for your help,
Benja.
--
Benjamin Fonzé - [EMAIL PROTECTED]
WEB DEVELOPER
_
ELECTRONIC GROUP INTERACTIVE - www.electronic-group.com
World Trade Center, Moll de BARCELONA
Edificio Norte 4 Planta
08039 BARCELONA SPAIN
Tel : +34 93600 23 23 Fax : +34 93600 23 10
_


 



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


Re: [PHP] Pipe broken

2003-03-28 Thread Benja
Oups... I missed that register_shutdown_function function.

Thanks Marek.
Benja.


Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Manual - Features - Connection handling

Benja wrote:

Hi all,
is it possible to know in PHP if the client hit the stop button or close
the
browser ?

Here is what I read on a forum :




I was told you cannot when I asked 'way back when.

When the user hits stop, the pipe is broken.
Apache will attempt to spit out some more data, and will notice the pipe
is broken, and will stop.
But Apache doesn't inform PHP that the pipe broke.

At least that's my vague recollection of what goes on.



More or less correct. Hopefully we will have this resolved soon.

-Rasmus


But it was in 1999 ! Is it possible to do it now ?

Thanks for your help,
Benja.

--
Benjamin Fonzé - [EMAIL PROTECTED]
WEB DEVELOPER
_

ELECTRONIC GROUP INTERACTIVE - www.electronic-group.com
World Trade Center, Moll de BARCELONA
Edificio Norte 4 Planta
08039 BARCELONA SPAIN
Tel : +34 93600 23 23 Fax : +34 93600 23 10
_









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



Re: [PHP] Connecting to a remote server

2003-03-28 Thread Jason Wong
On Friday 28 March 2003 21:06, Roberts, Mark \(Tulsa\) wrote:
 They are not on the same server...that is the problem.
 They used to be on the same server, but I have had to move the application
 to a physically different server with a different DNS than the DB Server.

 So, on the surface, it would seem that I should just replace 'localhost'
 with the dns name of the DB Server i.e. (http://www.xyz.com). However, this
 did not work. Is there something else that I should be doing, either in the
 connect string or in php configuration?


Please read my original reply:

 Are you talking about the database connection? If so, then there is no need
 for the 'http://'. And if both the webserver and the DB server are on the
 same machine you can continue to use 'localhost'.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
This is probably the first and last time I will openly agree for someone
to tell me were to go, and do it ;-).

- Andre Hedrick on linux-kernel
*/


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



Re: [PHP] gd library + animated gif

2003-03-28 Thread Liam Gibbs
  Can GD library produce animated gif's?

Sorry. Maybe I should read more carefully. I skipped 'animatd' for some
reason? Still, no, GD won't produce animated GIFs.


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



Re: [PHP] Problem with = new and locally created instances

2003-03-28 Thread Jason k Larson
Okay, I understand more now ...

I played with this for a couple of minutes and can see exactly where is acting odd, which 
is exactly where you indicated. :)  I tried a couple of things to keep the instance of the 
object, but the variable keeps getting set back.

One thing I did that worked was to create a variable in the factory object class and store 
a reference of the foo instance in that variable.

ex:
$g_fooInstance = new foo();
$this-fooInstance = $g_fooInstance;
I tried giving the variable values prior to it being overwritten with the reference 
pointer, and always my values prior were magically recreated after the object was 
instanciated.

Rasmus, any ideas here?  I'm thinking this is a bug.

--
Jason k Larson
Jens von Pilgrim wrote:
Hello,

Jason wrote:
JL Maybe I'm missing something here ... but what is the point of trying
JL to create a reference to a new object ... it hasn't been ceated prior
JL to make reference to.  Can't you simply create the new object and
JL then make whatever (if needed) references?
Uhh... maybe I'm missing someting, too?
We're talking about he followin line, don't we?
$g_fooInstance = new foo();   // -- here's the problem

IMHO this line causes no problem... using the  operator with new is
explicitly noticed in the php manual (Chapter 15):
The same syntax can be used with functions, that return references, and
with new operator (in PHP 4.0.4 and later):
$bar = new fooclass();
The problem is, that the object created in that line is destructed when the
function is left. Or, in other words, an object is destructed automatically
by the php-engine, although a) the object is still referenced and b) even no
local variable has ever referenced it.
BTW: Of course the code here doesn't make really sense (according to your
last sentence), but it's only an example for illustrating the problem.
Regards,

Jens



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


[PHP] Help with procmail script...

2003-03-28 Thread Al
The past problem was solved via this group with in minutes and I just 
want to say thanks on that.
The latest problem is a script that takes incoming emails to a certain 
address and puts them in the database.  I included the script below 
called 'Gateway.php'.
This worked great on my local machine with the settings in the 
/etc/aliase also included below.
But now that the host has me using the procamil.rc (also included)
I get the subject line in the body.
The only good thing so far from all of this is that I think I an use 
procmail to my advantage to strip the To: From: Subject: and Body: of 
the email and leave the rest(attachments etc) for /dev/null.
This would help alot since Outlook Exp. has some extra header info in 
the email.
So below are the scripts, any help would be appreciated.
Again all of this works perfect on my machine but they are not allowing 
me the use of the aliase file for sendmail.  Though using procmail to 
strip the above info my be better in the long run?
Thanks,
--Al

Gateway.php
#!/usr/local/bin/php -q
?php
/*  $Id: gateway.php,v 1.11 2002/10/28 15:52:27 root Exp $
 *  Copyright (C) 2002 Justin Mazzi [EMAIL PROTECTED]
 *  This program is free software; you can redistribute it and/or 
modify
 *  it under the terms of the GNU General Public License as 
published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
02111-1307  USA
 *
 *  Dont forget to come by linuxgroup.net ;-)
 */

/* Setup some vars */
$stdin = fopen(php://stdin, r);
/* Fill the values in with your info */
$sqlhost = localhost;
$sqluser = ;
$sqlpass = ;
$sqldb = ;
/* This is used for bounced emails. */
$support_email = [EMAIL PROTECTED];
$support_name = Al Nutile;
/* make the mysql connection */
mysql_connect($sqlhost, $sqluser, $sqlpass);
mysql_select_db($sqldb);
/* read in the pipe from stdin */
while (!feof($stdin)) {
$buffer = fgets($stdin, 4096);
$message[] .= $buffer;
}
/* Get the email headers */
foreach($message as $header_build) {
if (preg_match(/^$/, $header_build)) break;
$header_build = preg_replace(/:\s/, :, $header_build);
if (preg_match(/:/, $header_build)) {
$vars = preg_split(/:/, $header_build, 2);
if ($vars[1]) {
chop($header[$vars[0]] = $vars[1]);
}
}
}
/* Error out if there's an attachment */
if (preg_grep(/oundary=/, array_values($message))) {
$attachment = 1;
$email_body = Hi,\n\tSorry, your message contained one or more 
attatchments. ;
$email_body .= Our email system does not currently accept ;
$email_body .= attachments. Please attempt to resend the email ;
$email_body .= without an attachment.\n\n -$support_name\n;
$email_body .= $support_email;
$subject = Re:$header[Subject];
$from = From:$support_name$support_email;
$to = $header['From'];
mail($to, $subject, $email_body, $from);
//exit(Message had an attachment);
}

/* strip out Re:'s in subject */
if ($header['Subject']) {
$header['Subject'] = preg_replace(/\s*Re:\s*/, , 
$header['Subject']);

}

/* initialize To: header */
$string = $header['To'];
  	$separat = @;
  	$to = substr($string, 0, strlen($string)-strlen (strstr 
($string,$separat)));
$sql = select sport_id from sports where email = '$to';
$result = mysql_query($sql);
	while ($row = mysql_fetch_array($result))
 		{
$sport_id = {$row[sport_id]};
}

/* Turn from into an ID */

$from = $header['From'];
$string = preg_match(//, /$from/, $string);
		if (!$string)
	{
  $from = $from;
  } else {
			$from = substr(strrchr($from, ), 1);
  $from = str_replace(, , $from);
  }
$query = select reporter_id from reporters_info where email = 
'$from';
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
	if ($num_rows == '0')
  	{
mail($from, NEPSO || Reporters..,
			
  Sorry there was no matching username for the email sent.
  Please make sure the From address on the email is
  the same email address you used to 

RE: [PHP] gd library + animated gif[Scanned]

2003-03-28 Thread Michael Egan
There's a section on Freshmeat about the ImageMagick project with further links:

http://freshmeat.net/projects/imagemagick/?topic_id=100

Given your previous comment it's tempting to say that a search on Google for 
'ImageMagick' would, er - well - but I'll resist :-)

Regards,

Michael


 Can GD library produce animated gif's?

 The PHP manual will tell you this. I'll save you the trouble, but next
time... well... the PHP manual will tell you stuff like this:

 Since a certain version of PHP, GIFs are unsupported. I'm told they can be
 read, but as far as producing new ones (resizing, changing, etc.) there's a
 copyright issue over its encryption method. To use GD completely, go wtih
 JPG or PNG. But, there is ImageMagick(?). Check that out. Anyone got a URL?


-- 
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] Connecting to a remote server

2003-03-28 Thread Steve Jackson
Your remote server has PHP/MySQL setup?
Your DB hostname may be different from Localhost but basically your php
connection string should just reflect what host username and password
you need to use to connect to your DB. DNS has nothing to do with it.

For example this function will connect to *any* mysql database
*anywhere* provided the correct variables are inputted simply by calling
db_connect(). What I usually do is put this function in a secure place
and tell every page which needs a DB connection to include the page ie.
include ('secure/db_fns.php'); then just call it. function db_connect()
{
   $LocalHost = your_host_name;
   $User = username;
   $Password = password;
   $DBName = name_of_db;
   $result = @mysql_connect($LocalHost, $User, $Password)or
die(Could not connect to the database); 
   if (!$result)
  return false;
   if ([EMAIL PROTECTED]($DBName))
  return false;

   return $result;
}

What it sounds like your problem is, is that you don't know what your
new hostname/username/password etc is. They will likely be different on
your new server. If it's remotely hosted ask your administrator what
these variables are. If you have admin and root rights you should be
able to configure your password and find out the information yourself.

Regards,

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159





 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED] 
 Sent: 28. maaliskuuta 2003 15:24
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Connecting to a remote server
 
 
 On Friday 28 March 2003 21:06, Roberts, Mark \(Tulsa\) wrote:
  They are not on the same server...that is the problem.
  They used to be on the same server, but I have had to move the 
  application to a physically different server with a 
 different DNS than 
  the DB Server.
 
  So, on the surface, it would seem that I should just replace 
  'localhost' with the dns name of the DB Server i.e. 
  (http://www.xyz.com). However, this did not work. Is there 
 something 
  else that I should be doing, either in the connect string or in php 
  configuration?
 
 
 Please read my original reply:
 
  Are you talking about the database connection? If so, then 
 there is no 
  need for the 'http://'. And if both the webserver and the DB server 
  are on the same machine you can continue to use 'localhost'.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications 
 Development *
 --
 Search the list archives before you post 
 http://marc.theaimsgroup.com/?l=php-general
 
 --
 /*
 This is probably the first and last time I will openly agree 
 for someone to tell me were to go, and do it ;-).
 
   - Andre Hedrick on linux-kernel
 */
 
 
 -- 
 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] string replace problem!!

2003-03-28 Thread Thijs Lensselink
Hello Rich,

Thanx for the reply.
But i should have cheked my code better.
The piece of code was stuck in a for loop that's
why the ',' was removed from every slideimages[$x].

$string = substr($string,1); works great though..:)

grtz,
Thijs

-Oorspronkelijk bericht-
Van: Rich Gray [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 28 maart 2003 12:39
Aan: Thijs Lensselink; [EMAIL PROTECTED]
Onderwerp: RE: [PHP] string replace problem!!


 Good day ,
 
 I have the following string.
 ,slideimages[0],slideimages[1],slideimages[2]
 Wich starts with a ','. No my problem is i want to strip
 this first and only the first ','.
 
 i've tried 
 $string = ,slideimages[0],slideimages[1],slideimages[2];
 $string = preg_replace('/^./','',$string,1);
 
 wich results in slideimages[0]slideimages[1]slideimages[2]
 Can somebody help me out here??
 
 thnx
 Thijs

$string = substr($string,1);

Rich

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



[PHP] Anything that is changed when the browser is closed

2003-03-28 Thread Haseeb Iqbal
hi,
just wanna know if there is anything in php that can be used (besides sessions) to get 
anything from the $_SERVER that is unique and gets changed each time we close the 
browser. anything at all to check if the user has closed the browser.
regards
Haseeb


Re: [PHP] Anything that is changed when the browser is closed

2003-03-28 Thread Marek Kilimajer
If you set cookie with lifetime set to 0, the cookie is erased. Sure 
this will work only if the user has cookie enabled

Haseeb Iqbal wrote:

hi,
just wanna know if there is anything in php that can be used (besides sessions) to get 
anything from the $_SERVER that is unique and gets changed each time we close the 
browser. anything at all to check if the user has closed the browser.
regards
Haseeb
 



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


Re: [PHP] tips on sorting an array of objects by an attribute?

2003-03-28 Thread Marek Kilimajer
use usort

neko wrote:

Hi Guys, Just after some experience...

What's the best way to sort an array of objects by one of their attributes,
accessed by $obj-getFoo() (its a number) ? I was thinking a bubble-sort,
making multiple passses and switching array elements until there are no more
switches to make.
Any tips? The array size is not very large (not will it ever be), so it's
doesn't have to be a super-lean sorting algorithm (no harm though ;) )
cheers,
neko


 



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


Re: [PHP] Anything that is changed when the browser is closed

2003-03-28 Thread CPT John W. Holmes
While your script is running, you can use connection_aborted() to see if the
user has clicked the stop button or closed the window. After your script
finishes, though, then you have no way of knowing unless you use a session
cookie, which will be destroyed when the browser is closed.

---John Holmes...

- Original Message -
From: Haseeb Iqbal [EMAIL PROTECTED]
To: PHP General list [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 8:46 PM
Subject: [PHP] Anything that is changed when the browser is closed


hi,
just wanna know if there is anything in php that can be used (besides
sessions) to get anything from the $_SERVER that is unique and gets changed
each time we close the browser. anything at all to check if the user has
closed the browser.
regards
Haseeb


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



Re: [PHP] Problem with PHP

2003-03-28 Thread Marek Kilimajer
My guess is you have register_globals off. You need to use 
$_GET['get_variable'] or $_POST['post_variable']

?php
echo $_GET['get_variable'].'br';
echo $_POST['post_variable'].'br';
?
form action=?= $_SERVER['SCRIPT_NAME'] 
??get_variable=hello+i+am+a+get+variable method=post
input type=text value=hello I am a post variable
input type=submit
/form

Navratil, Jan wrote:

 

Hallo,

i have problem with running PHP4.3.1 on Apache1.3.19 on W2K.

I instaled everithng by install.txt. Is posible to load easy php pages but
when i want to Recieve data from form it does not wrok.
Please help me

Best regards Honza Navratil
   

 



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


RE: [PHP] Session Theft

2003-03-28 Thread Jon Haworth
Hi Haseeb,

 if i can get something from user end that is unique 
 for that user.for e.g. his/her IP .

Firstly, an IP address can be shared between multiple users, or it can
change constantly for one user.

Here's what a page request from an AOL user looks like (I've snipped the
request paths, but left the timestamps and IPs untouched):
205.188.209.165 - - [14/Jan/2003:13:01:36 +] 
205.188.209.9 - - [14/Jan/2003:13:01:37 +]
205.188.208.38 - - [14/Jan/2003:13:01:37 +]
205.188.208.134 - - [14/Jan/2003:13:01:38 +]
205.188.209.77 - - [14/Jan/2003:13:01:38 +]
205.188.208.136 - - [14/Jan/2003:13:01:39 +]
205.188.209.48 - - [14/Jan/2003:13:01:40 +]
205.188.208.169 - - [14/Jan/2003:13:01:40 +]
205.188.209.72 - - [14/Jan/2003:13:01:41 +]
[...]

Notice how the IP changes - they requested the page from 205.188.209.165,
and then got each of the images from a separate IP.

 but it will not work when they are behind firewall.they will 
 be assigned same IP.is there a way for me to get the IP (e.g.
 202.202.202.202 thats just an e.g. ) plus computer ip(192.168.
 0.1 e.g.) i saw once a java chat server do this.

Instead of just checking the REMOTE_ADDR, try this:

?php

  if (getenv(HTTP_X_FORWARDED_FOR)) {

  $ip = getenv(HTTP_X_FORWARDED_FOR); 
  } else { 
  $ip = getenv(REMOTE_ADDR);
  } 

  echo Your IP is $ip;

?

Cheers
Jon

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



Re: [PHP] Session Theft

2003-03-28 Thread Larry E. Ullman
i just want to figure out a way by which i can stop session theft.i 
thought
if i can get something from user end that is unique for that user.for 
e.g.
his/her IP .but it will not work when they are behind firewall.they 
will be
assigned same IP.is there a way for me to get the IP 
(e.g.202.202.202.202
thats just an e.g. ) plus computer ip(192.168.0.1 e.g.) i saw once a 
java
chat server do this.if we can do this then it will help us (SOMEWHAT).
You could store the HTTP_USER_AGENT in the session when it starts. Then 
compare the browser being used against this stored value on subsequent 
pages. HTTP_USER_AGENT won't always be unique and it's not foolproof 
but it is a little extra security with minimal effort.

Larry

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


[PHP] Session Theft

2003-03-28 Thread Haseeb Iqbal
i just want to figure out a way by which i can stop session theft.i thought
if i can get something from user end that is unique for that user.for e.g.
his/her IP .but it will not work when they are behind firewall.they will be
assigned same IP.is there a way for me to get the IP (e.g.202.202.202.202
thats just an e.g. ) plus computer ip(192.168.0.1 e.g.) i saw once a java
chat server do this.if we can do this then it will help us (SOMEWHAT).

if anyone has better suggestion just let me know
Haseeb

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



Re: [PHP] Session Theft

2003-03-28 Thread Jim Lucas
check into forcing the use of trans_sid

Jim
- Original Message -
From: Haseeb Iqbal [EMAIL PROTECTED]
To: PHP General list [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 8:48 PM
Subject: [PHP] Session Theft


 i just want to figure out a way by which i can stop session theft.i
thought
 if i can get something from user end that is unique for that user.for e.g.
 his/her IP .but it will not work when they are behind firewall.they will
be
 assigned same IP.is there a way for me to get the IP (e.g.202.202.202.202
 thats just an e.g. ) plus computer ip(192.168.0.1 e.g.) i saw once a java
 chat server do this.if we can do this then it will help us (SOMEWHAT).

 if anyone has better suggestion just let me know
 Haseeb

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




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



Re: [PHP] Session Theft

2003-03-28 Thread CPT John W. Holmes
 i just want to figure out a way by which i can stop session theft.i
thought
 if i can get something from user end that is unique for that user.for e.g.
 his/her IP .but it will not work when they are behind firewall.they will
be
 assigned same IP.is there a way for me to get the IP (e.g.202.202.202.202
 thats just an e.g. ) plus computer ip(192.168.0.1 e.g.) i saw once a java
 chat server do this.if we can do this then it will help us (SOMEWHAT).

Conduct your business over SSL. That's the only way, otherwise everything is
sent plain text and can be intercepted.

---John Holmes...


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



Re: [PHP] Session Theft

2003-03-28 Thread Marek Kilimajer
You can give the users the oportunity to turn ip check on (a checkbox in 
the login form). There is also a header that is set by many proxies to 
the ip address of the client, but I don't remember its name (maybe 
(X-)Forwarded-For)

Haseeb Iqbal wrote:

i just want to figure out a way by which i can stop session theft.i thought
if i can get something from user end that is unique for that user.for e.g.
his/her IP .but it will not work when they are behind firewall.they will be
assigned same IP.is there a way for me to get the IP (e.g.202.202.202.202
thats just an e.g. ) plus computer ip(192.168.0.1 e.g.) i saw once a java
chat server do this.if we can do this then it will help us (SOMEWHAT).
if anyone has better suggestion just let me know
Haseeb
 



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


Re: [PHP] Grid edit form

2003-03-28 Thread Andrew Powell
For the form:

for ($i=0;$i=59;$i++) {
 echo trtdinput type=text name=myfield_.$i. 
value=.$somedata[$i]./td/tr;
}

For the post back:

for ($i=0;$i=59;$i++) {
 $somedata[$i] = $_REQUEST['myfield_'.$i];
}
aap

Daniel Harik wrote:

Hello guys,

I'm trying to make grid form that will allow to edit 60 rows at the same 
time, it's not hard to make a loop that would go from 0 to 59, but  
my problem is that i don't know what rows to update as i see no way to find 
row's id after form is submitted.

Thank You Very much.

 



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


Re: [PHP] Grid edit form

2003-03-28 Thread Jim Lucas
This is untested, but I seem to recall doing something like this on a
project last year.

form method='post' action='/process.php'
!-- row #1 --
input type=text name='row[0][id]'
input type=text name='row[0][name]'
input type=text name='row[0][company]'
input type=text name='row[0][title]'
br
!-- row #2 --
input type=text name='row[1][id]'
input type=text name='row[1][name]'
input type=text name='row[1][company]'
input type=text name='row[1][title]'
br
!-- row #3 --
input type=text name='row[2][id]'
input type=text name='row[2][name]'
input type=text name='row[2][company]'
input type=text name='row[2][title]'
br
input type=submit
/form

and on the process page you will receive an array called row that has
everything in it that you need.

Jim

- Original Message -
From: Daniel Harik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 10:20 AM
Subject: [PHP] Grid edit form


 Hello guys,

 I'm trying to make grid form that will allow to edit 60 rows at the same
 time, it's not hard to make a loop that would go from 0 to 59, but
 my problem is that i don't know what rows to update as i see no way to
find
 row's id after form is submitted.

 Thank You Very much.


 --
 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] Grid edit form

2003-03-28 Thread Don Read

On 28-Mar-2003 Daniel Harik wrote:
 Hello guys,
 
 I'm trying to make grid form that will allow to edit 60 rows at the same 
 time, it's not hard to make a loop that would go from 0 to 59, but  
 my problem is that i don't know what rows to update as i see no way to
 find 
 row's id after form is submitted.
 
 Thank You Very much.
 

if ( (isset($submit))  ($submit =='Update') ) {
  while (list($id, $val) = each($row)) {
// do something with $id and $val
  }  
}


yourforloop {
   // fetch $id, $val
   echo INPUT TYPE=TEXT NAME=\row[$id]\ VALUE=\$val\;
}

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



Re: [PHP] Grid edit form

2003-03-28 Thread Andrew Powell
Then append the id to the input name.

e.g. For the input form:

while (odbc_fetch_row($rs)) {
 echo trtdinput type=text name=myfield_.odbc_result($rs, ID). 
value=.odbc_result($rs, MyFieldValue)./td/tr;
}

And to read the data:

while (odbc_fetch_row($rs)) {
 $sql = update MyTable set 
MyFieldValue='.$_REQUEST['myfield_'.odbc_result($rs, ID)].' where 
(ID=.odbc_result($rs, ID).);
 odbc_exec($db, $sql);
}

aap

Daniel Harik wrote:

Jim Lucas wrote:

 

This is untested, but I seem to recall doing something like this on a
project last year.
form method='post' action='/process.php'
!-- row #1 --
input type=text name='row[0][id]'
input type=text name='row[0][name]'
input type=text name='row[0][company]'
input type=text name='row[0][title]'
br
!-- row #2 --
input type=text name='row[1][id]'
input type=text name='row[1][name]'
input type=text name='row[1][company]'
input type=text name='row[1][title]'
br
!-- row #3 --
input type=text name='row[2][id]'
input type=text name='row[2][name]'
input type=text name='row[2][company]'
input type=text name='row[2][title]'
br
input type=submit
/form
   

Thank you for your reply, but i'm pulling records from db, and
ids won't be 1,2,3,4..n, but more random.
 




[PHP] parsing

2003-03-28 Thread Diana Castillo
Hi, when I am parsing an XML document, it doesnt parse paragraphs that have
line feeds correctly.  For instance, if the tag is
Descriptionline 1
line2
line3
/description
it loses everything before line 3 .  seems to take the line feeds as a new
node or something.
does anyone have any tips to get it to ignore the line feeds?



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



[PHP] uploading large files through php

2003-03-28 Thread Dimitar Haralanov
Hi,

I have a script that allows the user to upload a file. Sometimes the
files are going to be rather large (in the order of 60Mb). I know that
this is very dangerous but only trusted users will be able to upload
since they have to login through ssl and the entire session is through
ssl.

The problem that I am facing is that I can get the script/browser/php
to pass such large file. I have modified the upload_max_size variable in
php.ini to be larger the 60Mb but this still does not help!

Is there any hard limitation that I am unaware of?

Thanx

-- Mitko


pgp0.pgp
Description: PGP signature


[PHP] How to debug XSLT Errors?

2003-03-28 Thread Benjamin Walling
I'm trying to use the xslt_* functions, but I can't get any decent error
messages out of them.  I've used the XML and XSL I'm passing it in IE, and
it gets processed and transformed correctly.  The only error I get is:

Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in C:\Websites\iStatus\test.php on line 16

In the log, I get:

Sablotron Message on line none, level log: Parsing
'http://localhost/Simple.xsl'...

So, I have an error on line 'none'?  Can someone show me which line that is?
My XML and XSL is processed correctly by IE, so what gives here?  How can I
get it to tell me what it is having a problem with?  Without a line number
or some context, there is no way I'll ever debug this!

Using the following code:

 $xh = xslt_create();
 xslt_set_log($xh, true);
 xslt_set_log($xh, getcwd() . '\sablot.log');
 $args = array('/_xml' = $xml);
 $html = xslt_process($xh, 'arg:/_xml', http://localhost/Simple.xsl;, NULL,
$args);
 xslt_free($xh);
 echo $html;



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



[PHP] Classes

2003-03-28 Thread Donahue Ben
I have a ClassA file and a ClassB file stored in
separate directories.  I am trying to get ClassB to
initiate a ClassA object.  But since they are stored
in seperate directories I get an error.

So I tried including the ClassA file in ClassB
constructor:

function ClassB()
{
  include(../A/ClassA.class.php);
  ...
}

i cant get this working. How do i solve this problem
without having both class files in the same directory.

Ben 

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



RE: [PHP] Grid edit form

2003-03-28 Thread Ford, Mike [LSS]
 -Original Message-
 From: Daniel Harik [mailto:[EMAIL PROTECTED]
 Sent: 28 March 2003 18:55
 
 Jim Lucas wrote:
 
  This is untested, but I seem to recall doing something like 
 this on a
  project last year.
  
  form method='post' action='/process.php'
  !-- row #1 --
  input type=text name='row[0][id]'
  input type=text name='row[0][name]'
  input type=text name='row[0][company]'
  input type=text name='row[0][title]'
  br
  !-- row #2 --
  input type=text name='row[1][id]'
  input type=text name='row[1][name]'
  input type=text name='row[1][company]'
  input type=text name='row[1][title]'
  br
  !-- row #3 --
  input type=text name='row[2][id]'
  input type=text name='row[2][name]'
  input type=text name='row[2][company]'
  input type=text name='row[2][title]'
  br
  input type=submit
  /form
  
 Thank you for your reply, but i'm pulling records from db, and
 ids won't be 1,2,3,4..n, but more random.

Doesn't matter, so long as they are unique -- they don't have to be
sequential, or even in order.  Just use foreach on the row array to iterate
over the keys that are there.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] uploading large files through php

2003-03-28 Thread Larry E. Ullman
	The problem that I am facing is that I can get the script/browser/php
to pass such large file. I have modified the upload_max_size variable 
in
php.ini to be larger the 60Mb but this still does not help!

	Is there any hard limitation that I am unaware of?
You'll probably need to adjust the following:
max_execution_time = 30 ; Maximum execution time of each script, in 
seconds
max_input_time = 60	; Maximum amount of time each script may spend 
parsing request data
memory_limit = 8M  ; Maximum amount of memory a script may consume 
(8MB)
; Maximum size of POST data that PHP will accept.
post_max_size = 8M

Larry

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


[PHP] line feeds

2003-03-28 Thread Diana Castillo
How can I remove all line feeds from a document?



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



Re: [PHP] uploading large files through php

2003-03-28 Thread Dimitar Haralanov
On Fri, 28 Mar 2003 12:39:10 -0500
Larry E. Ullman wrote:

memory_limit = 8M  ; Maximum amount of memory a script may
consume 
(8MB)

Does this mean that the content of the entire file will be stored in
memory before it is written to disk?

Thanx
-- Mitko


pgp0.pgp
Description: PGP signature


[PHP] Other PHP developers in Louisville, KY?

2003-03-28 Thread Steve Magruder
Hi,

   I'm a PHP developer in Louisville, KY interested in forming a PHP
developers group.  Currently, we have three individuals signed up at
http://php.meetup.com but we need at least 5 to go forward with a first
meeting.

   If you're interested, please sign up.  It should be a lot of fun.

Regards,
   Steve



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



[PHP] Re: [PHP-INST] PHP: Cannot send session cookie - headers already sent by

2003-03-28 Thread Matt

- Original Message -
From: Atif Jakupovic [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 1:14 PM
Subject: [PHP-INST] PHP: Cannot send session cookie - headers already sent
by
 Please, could you help me to find out why I'm getting an error message
 like one below.

 Warning: session_start() [function.session-start]: Cannot send
session
 cookie - headers already sent by (output started at file1.php:2) in
 InitSession.php on line 2.

You should search the archives for that.  http://marc.theaimsgroup.com/



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



Re: [PHP] file

2003-03-28 Thread Steve Keller
At 3/28/2003 10:26 AM, Diksha  Neel wrote:

 i have a simple program to open and write a file.
 but the file is not getting created.
 can anyone please spot the mistake?
 ?php
 echohi?how are u doing??;
 $fp = fopen (sandrew.html, w);
 string=htmlheadtitlehi/title/headbodyi am
$string =

 fine/body/html;
 $contents=fwrite($fp,string);
fwrite($fp, $string);
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] What is the e-mail to unsuscribe of the mailing-list?

2003-03-28 Thread Orlando Pozo
What is the e-mail to unsuscribe of the mailing-list?

-
Yahoo! Messenger
Nueva versioacute;n: Super Webcam, voz, caritas animadas, y maacute;s #161;Gratis!

Re: [PHP] Random Password Making.

2003-03-28 Thread Steve Keller
At 3/28/2003 11:32 PM, Philip J. Newman wrote:

 Whats the best way to make a random password with 4 letters and 2 numbers?

I don't know what the best way is, but I had fun doing this one. I filled 
the first 4 elements of an array with random letters by using the minimum 
ASCII value of a letter as my random base, and the maximum ASCII letter 
value as my random max (97 is a and 122 is z). Then did the same thing 
to pick two numbers and add those to the array as well. Then I shuffled the 
array to juggle the order the letters and numbers are in, and imploded it 
into a single string. Viola.

?
// Pick 4 random letters
for ($i=0; $i4; $i++){
$thisPassArray[$i] = chr(rand(97,122));
}

// Pick 2 random numbers
for ($i=4; $i6; $i++){
$thisPassArray[$i] = chr(rand(48,57));
}

// Randomize their order
shuffle($thisPassArray);

// Implode the array into a password
$thisPass = implode(,$thisPassArray);

// Echo the password
echo $thisPass;
?
Now, of course, I didn't do any validation, ie. making sure the letters 
don't repeat, including capital letters, or anything like that. But, 
hopefully, this will give you a place to start.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

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


Re: [PHP] What is the e-mail to unsuscribe of the mailing-list?

2003-03-28 Thread Dimitar Haralanov
On Fri, 28 Mar 2003 19:42:06 +0100 (CET)
Orlando Pozo wrote:

What is the e-mail to unsuscribe of the mailing-list?

[EMAIL PROTECTED]


pgp0.pgp
Description: PGP signature


Re: [PHP] How to debug XSLT Errors?

2003-03-28 Thread Ray Hunter
Try using the command line sablot sabcmd to parse the xsl file and see
if you can get any info on the well-formness of the file.  If you dont
have the command line version I suggest downloading an application that
does xsl verification.

You could also send post the file so that we can review the xsl code.

--
Ray

On Fri, 2003-03-28 at 10:22, Benjamin Walling wrote:
 I'm trying to use the xslt_* functions, but I can't get any decent error
 messages out of them.  I've used the XML and XSL I'm passing it in IE, and
 it gets processed and transformed correctly.  The only error I get is:
 
 Warning: Sablotron error on line 1: XML parser error 4: not well-formed
 (invalid token) in C:\Websites\iStatus\test.php on line 16
 
 In the log, I get:
 
 Sablotron Message on line none, level log: Parsing
 'http://localhost/Simple.xsl'...
 
 So, I have an error on line 'none'?  Can someone show me which line that is?
 My XML and XSL is processed correctly by IE, so what gives here?  How can I
 get it to tell me what it is having a problem with?  Without a line number
 or some context, there is no way I'll ever debug this!
 
 Using the following code:
 
  $xh = xslt_create();
  xslt_set_log($xh, true);
  xslt_set_log($xh, getcwd() . '\sablot.log');
  $args = array('/_xml' = $xml);
  $html = xslt_process($xh, 'arg:/_xml', http://localhost/Simple.xsl;, NULL,
 $args);
  xslt_free($xh);
  echo $html;
 
 


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



Re: [PHP] How to debug XSLT Errors?

2003-03-28 Thread Benjamin Walling
I've got sabcmd and it is giving the same message.  I've got about 3 hours
experience with XSL, so if this file is bad, let me know.  Also, do you have
a recommendation for an xsl/xml validator?  This XSL file works for me in IE
if I return my XML to the browser along with the tag ?xml-stylesheet
type=text/xsl href=Simple.xsl?.  The problem with returning the XML is
that there is more information in the XML than I want the user to have.  I
want the transform done on the server so the user does not get the full XML.

  ?xml version=1.0 encoding=ISO-8859-1 ?

 html xsl:version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns=http://www.w3.org/TR/xhtml1/strict;
 HEAD
LINK REL=stylesheet HREF=DisplayFormat.css TYPE=text/css /
 /HEAD
 BODY CLASS=Status
 H3 CLASS=StatusActive Police Calls/H3
 TABLE CLASS=Status
 TR
  TH CLASS=Status
   Incident
  /TH
  TH CLASS=Status
   Call Time
  /TH
  TH CLASS=Status
   Address
  /TH
  TH CLASS=Status
   Building
  /TH
  TH CLASS=Status
   Apt
  /TH
  TH CLASS=Status
   Nature
  /TH
 /TR
 xsl:for-each select=root/row
  TR
  TD CLASS=Status
  xsl:value-of select=Field_InNum /
  /TD
  TD CLASS=Status
  xsl:value-of select=Field_CallTime /
  /TD
  TD CLASS=Status
  xsl:value-of select=Field_Address /
  /TD
  TD CLASS=Status
  xsl:value-of select=Field_Building /
  /TD
  TD CLASS=Status
  xsl:value-of select=Field_Apt /
  /TD
  TD CLASS=Status
  xsl:value-of select=Field_Nature /
  /TD
  /TR
 /xsl:for-each
  /TABLE
  /BODY
  /html




Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Try using the command line sablot sabcmd to parse the xsl file and see
 if you can get any info on the well-formness of the file.  If you dont
 have the command line version I suggest downloading an application that
 does xsl verification.

 You could also send post the file so that we can review the xsl code.

 --
 Ray

 On Fri, 2003-03-28 at 10:22, Benjamin Walling wrote:
  I'm trying to use the xslt_* functions, but I can't get any decent error
  messages out of them.  I've used the XML and XSL I'm passing it in IE,
and
  it gets processed and transformed correctly.  The only error I get is:
 
  Warning: Sablotron error on line 1: XML parser error 4: not well-formed
  (invalid token) in C:\Websites\iStatus\test.php on line 16
 
  In the log, I get:
 
  Sablotron Message on line none, level log: Parsing
  'http://localhost/Simple.xsl'...
 
  So, I have an error on line 'none'?  Can someone show me which line that
is?
  My XML and XSL is processed correctly by IE, so what gives here?  How
can I
  get it to tell me what it is having a problem with?  Without a line
number
  or some context, there is no way I'll ever debug this!
 
  Using the following code:
 
   $xh = xslt_create();
   xslt_set_log($xh, true);
   xslt_set_log($xh, getcwd() . '\sablot.log');
   $args = array('/_xml' = $xml);
   $html = xslt_process($xh, 'arg:/_xml', http://localhost/Simple.xsl;,
NULL,
  $args);
   xslt_free($xh);
   echo $html;
 
 




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



[PHP] : Looking functions for deal with special characters

2003-03-28 Thread ignacio . estrada
Hi, I am getting data from a database, containing special characteres (in
spanish).  After that, I want to write down this data to an ascii file
(.cvs), but when that is done the resulting strings does not keep the same
special characteres instead of that appear strange characters.  Here I want
to show the same characters as stored on the database.

Does somebody deal with this ? please let me know.

Ignacio Estrada F.





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



[PHP] Looking functions for deal with special characters

2003-03-28 Thread ignacio . estrada
Hi, I am getting data from a database, containing special characteres (in
spanish).  After that, I want to write down this data to an ascii file
(.csv).  When this file is open with excel, the resulting data on cell
(strings) does not keep the same special characteres instead of that appear
strange characters.  Here I want to show the same characters as stored on
the database.

I am using fput ($fp,string) to write data to the csv file.

Does somebody deal with this ? please let me know.

Ignacio Estrada F.




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



[PHP] imap_open and 503 Error

2003-03-28 Thread Brian Mitchell
Anyone ever encounter a 503 server error when trying to open a stream to a mailbox 
using imap_open?  If so, anyway to fix it? 
  
Thanks, 
Brian 

[PHP] webeditor

2003-03-28 Thread Daniel Guerrier
Does anyone know of an open source webeditor that I
can use to enter information into a text area field.
I have a custom CMS and I would like to add webeditor
functionality to the textarea fields

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



[PHP] Get the HTTP Server Username

2003-03-28 Thread Mike
Is there anyway to get the HTTP Server Username (something like
$_SERVER['username']) I tried printing all the variables defined in a
page (and looking at a phpinfo.php) and wasn't able to figure it out...
-- 
Mike [EMAIL PROTECTED]


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



Re: [PHP] Grid edit form

2003-03-28 Thread Jim Lucas
you missunderstood my example then.

then 1,2,3,4,...  is only for the array, you wont be setting that with the
result set from the db call.  the id from the db call with be the value of
row[1][id] on the process page.

just think of it as a multidia indexed array

Jim
- Original Message -
From: Daniel Harik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 10:54 AM
Subject: Re: [PHP] Grid edit form


 Jim Lucas wrote:

  This is untested, but I seem to recall doing something like this on a
  project last year.
 
  form method='post' action='/process.php'
  !-- row #1 --
  input type=text name='row[0][id]'
  input type=text name='row[0][name]'
  input type=text name='row[0][company]'
  input type=text name='row[0][title]'
  br
  !-- row #2 --
  input type=text name='row[1][id]'
  input type=text name='row[1][name]'
  input type=text name='row[1][company]'
  input type=text name='row[1][title]'
  br
  !-- row #3 --
  input type=text name='row[2][id]'
  input type=text name='row[2][name]'
  input type=text name='row[2][company]'
  input type=text name='row[2][title]'
  br
  input type=submit
  /form
 
 Thank you for your reply, but i'm pulling records from db, and
 ids won't be 1,2,3,4..n, but more random.

 --
 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] Grid edit form

2003-03-28 Thread Jim Lucas
you don't understand how this works then...

Jim
- Original Message -
From: Ford, Mike [LSS] [EMAIL PROTECTED]
To: 'Daniel Harik' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 28, 2003 9:44 AM
Subject: RE: [PHP] Grid edit form


  -Original Message-
  From: Daniel Harik [mailto:[EMAIL PROTECTED]
  Sent: 28 March 2003 18:55
 
  Jim Lucas wrote:
 
   This is untested, but I seem to recall doing something like
  this on a
   project last year.
  
   form method='post' action='/process.php'
   !-- row #1 --
   input type=text name='row[0][id]'
   input type=text name='row[0][name]'
   input type=text name='row[0][company]'
   input type=text name='row[0][title]'
   br
   !-- row #2 --
   input type=text name='row[1][id]'
   input type=text name='row[1][name]'
   input type=text name='row[1][company]'
   input type=text name='row[1][title]'
   br
   !-- row #3 --
   input type=text name='row[2][id]'
   input type=text name='row[2][name]'
   input type=text name='row[2][company]'
   input type=text name='row[2][title]'
   br
   input type=submit
   /form
  
  Thank you for your reply, but i'm pulling records from db, and
  ids won't be 1,2,3,4..n, but more random.

 Doesn't matter, so long as they are unique -- they don't have to be
 sequential, or even in order.  Just use foreach on the row array to
iterate
 over the keys that are there.

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

 --
 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] Get the HTTP Server Username

2003-03-28 Thread Don Read

On 28-Mar-2003 Mike wrote:
 Is there anyway to get the HTTP Server Username (something like
 $_SERVER['username']) I tried printing all the variables defined in a
 page (and looking at a phpinfo.php) and wasn't able to figure it out...
 -- 
 Mike [EMAIL PROTECTED]
 

$_SERVER['PHP_AUTH_USER'];

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



[PHP] Checking a string for # of charactors.

2003-03-28 Thread Philip J. Newman
I would like to check that a string as more than 20 charactors in it.  Can
someone point me in the right direction.

Thanks ..

--
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]



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



RE: [PHP] Checking a string for # of charactors.

2003-03-28 Thread Johnson, Kirk
http://www.php.net/manual/en/function.strlen.php

Kirk


 I would like to check that a string as more than 20 
 charactors in it.  Can
 someone point me in the right direction.
 

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



Re: [PHP] last questions

2003-03-28 Thread David T-G
Steve, et al --

...and then Steve Jackson said...
% 
...
%   // check an email address is possibly valid
%   if (ereg([EMAIL PROTECTED],
% $email))
...

You could just downcase the address and save some chars; email is
case-insensitive.

You've left out the '+' character used for name+extensions under sendmail
(and perhaps postfix).

You allow an ending . on a hostnmae, which you shouldn't.  It looks like
you could switch your two [] expressions on the right side and lose the \.
in the middle and be OK.


% 
% HTH


HTH  HAND

:-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://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Re: Include Question

2003-03-28 Thread Tim Burden
You could try this instead:

 Checklogin.php

 if (!$name || !password) {
$message = $enter_info;
 }

 if ($message){
include (login.php);
echo $message;
exit;
 }

But the way you had it should work, you might just need to
global $message;
right before the echo in login.php in case it is inside a function

- Original Message -
From: Beauford.2002 [EMAIL PROTECTED]
Newsgroups: php.general
To: PHP General [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 3:47 PM
Subject: Include Question


 Hi,

 First, I fixed my other problem of the stack overflow by moving the files
 back to the root directory (although I would rather have them in a login
 directory). Anyway, I have a question regarding the include function. I
have
 a login script in a file called login.php - in this file it includes
 checklogin.php and loginerrors.php. If the user inputs an incorrect login
I
 assign $messages the appropriate error from loginerrors, then I re-include
 login.php where I want to show the error message, but no matter what I do
 the error message will not show up.

 Example.

 Login.php 

 Enter your Name:
 Enter Your Password:
 if ($message) { echo $message; }

 Checklogin.php

 if (!$name || !password) {
 $message = $enter_info;
 include (login.php);
 exit;
 }

 Any help is appreciated.




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



[PHP] odbc_connect and segmentation fault

2003-03-28 Thread Joel Vorpagel
Can anyone help me out? I'm running PHP 4.3.1 on
Apache 1.3.23 with unixODBC 2.2.3. I'm using ODBC to
connect to my db2 database. I was testing out some
scripts that connect to a database to run select and
insert statements. When I run the scripts on my test
site (through the browser) everything appears to work
fine. The data is displayed, the insert works and the
scripts seem to work from start to finish. However,
when I run my script from the command line I get the
correct output - but after that I receive a
segmentation fault. I think the odbc_connect statement
is causing this. When I test this out on a simple php
script (that only creates a connection to the db
through odbc_connect), it causes a segmentation fault
when run from the command line. Does anybody have any
ideas or know the resolution?

Thanks in advance!

Joel

?php   
putenv(DB2INSTANCE=db2inst1);
$conn = odbc_connect('DB','User', 'Pass');

if ($conn = 0)
{
   echo Connection not set;
}
?

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



  1   2   >