[PHP] Scrollbars?

2002-10-07 Thread Steve Jackson

This might be off topic but I thought I'd give the list a try...
Does anyone know of any PHP or CSS or something which allows you to
change the appearance of scrollbars in Explorer and navigator?
Kind regards,
 
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




Re: [PHP] Scrollbars?

2002-10-07 Thread Justin French

yes it is off topic
no it's not PHP
yes it is CSS
yes you can try a newsgroup like comp.infosystems.www.authoring.stylesheets,
or do a simple search of google, which will surely return plenty of answers.

justin

on 07/10/02 5:01 PM, Steve Jackson ([EMAIL PROTECTED]) wrote:

 This might be off topic but I thought I'd give the list a try...
 Does anyone know of any PHP or CSS or something which allows you to
 change the appearance of scrollbars in Explorer and navigator?
 Kind regards,
 
 Steve Jackson
 Web Developer
 Viola Systems Ltd.
 http://www.violasystems.com
 [EMAIL PROTECTED]
 Mobile +358 50 343 5159
 


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




[PHP] page expires

2002-10-07 Thread Wilbert Enserink

Hi all


I'm using a lot of php in my website. Especially forms. but Aftre a form submit I get 
this message from IE that the page is expired and I have to push Refresh. Does anybody 
know why this is happening and is there a way to avoid this message??

thx. Wilbert


Warning: Page has Expired 
The page you requested was created using information you submitted in a form. This 
page is no longer available. As a security precaution, Internet Explorer does not 
automatically resubmit your information for you. 

To resubmit your information and view this Web page, click the Refresh button. 

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


RE: [PHP] page expires

2002-10-07 Thread Timothy J Hitchens

You have posted data from a previous page into this page.. FORM


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-Original Message-
From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 7 October 2002 5:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] page expires


Hi all


I'm using a lot of php in my website. Especially forms. but Aftre a form
submit I get this message from IE that the page is expired and I have to
push Refresh. Does anybody know why this is happening and is there a way
to avoid this message??

thx. Wilbert


Warning: Page has Expired 
The page you requested was created using information you submitted in a
form. This page is no longer available. As a security precaution,
Internet Explorer does not automatically resubmit your information for
you. 

To resubmit your information and view this Web page, click the Refresh
button. 

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


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




[PHP] Re: getimagesize or loop pblm

2002-10-07 Thread Tim Toohey

Arnaud Gonzales wrote:

 for($i=0;$i=56;$i++){

should be
for($i=0;$i56;$i++){

to loop 56 times.


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




php-general Digest 7 Oct 2002 08:03:44 -0000 Issue 1629

2002-10-07 Thread php-general-digest-help


php-general Digest 7 Oct 2002 08:03:44 - Issue 1629

Topics (messages 119013 through 119048):

Re: Can it be Done?
119013 by: Sascha Cunz
119014 by: Adriano
119015 by: Sascha Cunz
119042 by: . Edwin

need help for a where clause
119016 by: Alex Shi
119024 by: David Freeman
119025 by: Sascha Cunz
119027 by: Alex Shi

How to drop a element from an array
119017 by: Alex Shi
119018 by: Timothy J Hitchens
119019 by: Alex Shi
119020 by: Timothy J Hitchens
119021 by: John W. Holmes
119022 by: Stuart Dallas
119023 by: Alex Shi

IIS 5 - ASP  PHP dev enviorment
119026 by: JGreening
119028 by: Jason Morehouse
119029 by: John W. Holmes
119030 by: Sascha Cunz
119031 by: Brendon G

getimagesize  or loop pblm
119032 by: arnaud gonzales
119033 by: Rasmus Lerdorf
119034 by: arnaud gonzales
119036 by: Sascha Cunz
119048 by: Tim Toohey

Re: sessions without cookies *or* URLs
119035 by: David T-G
119037 by: John W. Holmes
119038 by: Justin French

server error sending email from script
119039 by: John
119040 by: Jason Reid
119041 by: Timothy J Hitchens

session.cookie_domain
119043 by: Peter Houchin

Scrollbars?
119044 by: Steve Jackson
119045 by: Justin French

page expires
119046 by: Wilbert Enserink
119047 by: Timothy J Hitchens

Administrivia:

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

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

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


--

---BeginMessage---

To produce such a JavaScript:

define('_DOMBASE', 'http://yourdomain.com');

echo 'SCRIPT language=JavaScript type=text/javascript'.\n
.'if (document.location == top.location)'.\n
.'  top.location='._DOMBASE.'/index.php?goto='
   .base64_encode($_SERVER[REQUEST_URI]).';'.\n
.'/SCRIPT';

where the index.php works like:

? if (!isset($_GET['goto']))
 $goto = home.php; else
 $goto = base64_decode($_GET['goto']);
?
FRAMESET
  someframes
  FRAME src=http://yourdomain.com/? echo $goto; ?
/FRAMESET

As Stephen reported me recently, this also works with iframes.

Sascha

Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
 Hi people,

 @ Edwin wrore:
  'Not really sure, but perhaps, with Javascript.
 
  But I'd rather recommend you to give up iframes... ;)

 Can you post an example of Javascript code checking for _parent frame?
 By the way, what's wrong with iframes?
 bye,
 Adr


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

I understand and thank you Sascha.
Curiosity: why do you use the 'base64_encode' function to send querystring
arguments? I'd rather used urlencode...

Sascha Cunz [EMAIL PROTECTED] ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
To produce such a JavaScript:

define('_DOMBASE', 'http://yourdomain.com');

echo 'SCRIPT language=JavaScript type=text/javascript'.\n
.'if (document.location == top.location)'.\n
.'  top.location='._DOMBASE.'/index.php?goto='
   .base64_encode($_SERVER[REQUEST_URI]).';'.\n
.'/SCRIPT';

where the index.php works like:

? if (!isset($_GET['goto']))
 $goto = home.php; else
 $goto = base64_decode($_GET['goto']);
?
FRAMESET
  someframes
  FRAME src=http://yourdomain.com/? echo $goto; ?
/FRAMESET

As Stephen reported me recently, this also works with iframes.

Sascha

Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
 Hi people,

 @ Edwin wrore:
  'Not really sure, but perhaps, with Javascript.
 
  But I'd rather recommend you to give up iframes... ;)

 Can you post an example of Javascript code checking for _parent frame?
 By the way, what's wrong with iframes?
 bye,
 Adr




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

should be interchangeable.

When i wrote this, i didn't want to show the real url up in browser, so i used 
base64 encoding.

Sascha

Am Sonntag, 6. Oktober 2002 23:52 schrieb Adriano:
 I understand and thank you Sascha.
 Curiosity: why do you use the 'base64_encode' function to send querystring
 arguments? I'd rather used urlencode...

 Sascha Cunz [EMAIL PROTECTED] ha scritto nel messaggio
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 To produce such a JavaScript:

 define('_DOMBASE', 'http://yourdomain.com');

 echo 'SCRIPT language=JavaScript type=text/javascript'.\n
 .'if (document.location == top.location)'.\n
 .'  top.location='._DOMBASE.'/index.php?goto='
.base64_encode($_SERVER[REQUEST_URI]).';'.\n
 .'/SCRIPT';

 where the index.php works like:

 ? if (!isset($_GET['goto']))
  $goto = home.php; else
  $goto = base64_decode($_GET['goto']);
 ?
 FRAMESET
   someframes
   FRAME src=http://yourdomain.com/? echo $goto; ?
 /FRAMESET

 As Stephen reported me recently, this also works 

[PHP] Getting fully qualified host name

2002-10-07 Thread Spongle

I need to get the fully qualified host name of the local machine, like
server.somewhere.com. Sounds simple, right? Seems not.

I'm running a CLI script in PHP 4.3-cvs (on OpenBSD) so I have no HTTP
or other global vars to look at, and it doesn't seem to be lying about
in my environment (not that I want to rely on that anyway).

The posix_uname command doesn't include the domain on non-GNU OSs. I
can get the hostname, but not the domain. Can I get it through some
other PHP command?

I'd really prefer not to resort to platform-specifics like rummaging in
/etc and parsing config files or doing something silly like a reverse
DNS lookup...

On some OS, this will give me the hostname:
$hostname = `/bin/hostname`;

However, it doesn't give me the domain, and it's highly platform
specific (i.e. it won't work on Win).

This seems like a pretty fundamental function that should be a
built-in, but it doesn't seem to be possible to do this in a
platform-independent way.

Have I missed some php_fqdn() function?

Any better ideas?

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




[PHP] sysvshm examples?

2002-10-07 Thread Geranium

Can anyone point me at some examples of using sysv shared memory,
particularly for passing values between a mod_php script and a PHP CLI
process?

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




[PHP] Signal handling

2002-10-07 Thread Geranium

Is signal handling broken in PHP 4.3-cvs? I've set up some handlers as
per the docs, but nothing happens when I send appropriate signals.

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




RE: [PHP] formatting / beautifying PHP code

2002-10-07 Thread Tony Crockford

 
 Is there a utility that formats / beautifies PHP code like 
 indent does for C
 code?

something like this?

http://tools.phpedit.net/phpCodeBeautifier/

HTH

Tony

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




[PHP] join() , can do that fast?

2002-10-07 Thread lallous

Hello,


I have:
$x = array('str1','str2','str3');

I want to convert that array to a valid javascript syntax as:

var x = ['str1','str2','str3']

I can do this in PHP:

echo sprintf(x=[%s], join(',', $x));

but that would produce:
x = [str1, str2, str3]

is there is a fast way (other than doing a loop) to have join put quote
around each array value before joining? so final result looks like:
['str1','str2',...


Thanks,
Elias



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




Re: [PHP] sessions without cookies *or* URLs

2002-10-07 Thread David T-G

John, et al --

...and then John W. Holmes said...
% 
% You can pass the session ID in a form, too. Just use POST, and make it a
% hidden element passed to the next page. 

Yeah, I figured that.


% 
% input type=hidden name=PHPSESSID value=?=$PHPSESSID?
% 
% It's no different than passing it in the URL. I hope you're not thinking

Except the URL is cleaner :-)


% that it's more secure by doing it this way. Either way the data is
% coming from the user and it can't be trusted and it can be modified. 

Agreed.


% 
% I don't know what this phobia is about passing something in the URL...

First, it's just plain cluttered :-)  Second, though, it would be nice to
not put the user's password right in the URL to then hang out in his
browser goto cache, so we have to change *sometthing*, and if we can
clean up the URL while we're at it that would be nice.


% 
% ---John Holmes...


Thanks  HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg81331/pgp0.pgp
Description: PGP signature


Re: [PHP] page expires

2002-10-07 Thread Justin French

It's a browser issue, not a PHP issue to the best of my knowledge.

Justin


on 07/10/02 5:47 PM, Wilbert Enserink ([EMAIL PROTECTED]) wrote:

 Hi all
 
 
 I'm using a lot of php in my website. Especially forms. but Aftre a form
 submit I get this message from IE that the page is expired and I have to push
 Refresh. Does anybody know why this is happening and is there a way to avoid
 this message??
 
 thx. Wilbert
 
 
 Warning: Page has Expired
 The page you requested was created using information you submitted in a form.
 This page is no longer available. As a security precaution, Internet Explorer
 does not automatically resubmit your information for you.
 
 To resubmit your information and view this Web page, click the Refresh button.
 
 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -


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




RE: [PHP] page expires

2002-10-07 Thread John W. Holmes

Use GET instead of POST. It's a browser issue and it's been discussed on
here plenty of times. Do a search.

---John Holmes...

 -Original Message-
 From: Wilbert Enserink [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 07, 2002 3:48 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] page expires
 
 Hi all
 
 
 I'm using a lot of php in my website. Especially forms. but Aftre a
form
 submit I get this message from IE that the page is expired and I have
to
 push Refresh. Does anybody know why this is happening and is there a
way
 to avoid this message??
 
 thx. Wilbert
 
 
 Warning: Page has Expired
 The page you requested was created using information you submitted in
a
 form. This page is no longer available. As a security precaution,
Internet
 Explorer does not automatically resubmit your information for you.
 
 To resubmit your information and view this Web page, click the Refresh
 button.
 
 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -



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




Re: [PHP] sessions without cookies *or* URLs

2002-10-07 Thread David T-G

Justin, et al --

...and then Justin French said...
% 
% on 07/10/02 11:32 AM, David T-G ([EMAIL PROTECTED]) wrote:
% 
%  It's a start; it confirms some of what I think I understand about
%  sessions.  Now if only I can get the session ID out of the URL without
%  using any cookies...  Any ideas, anyone?
% 
% 
% I Thought I made it clear, but I'll try again :)

Thanks :-)


% 
% You have three options for maintaining state:
% 
% - Cookies
% - URL
% - POSTed forms

OK.  I was afraid of that...


% 
% The most common method is plain cookies.  But if you want guaranteed state,

Sure, but I know that cookies won't work, so that rules them out.


% then URL is the answer.  My main problem with the URL method is that it
% requires the writer(s) to be careful when typing links... ensuring that they

Exactly.  It's cluttered and you have to be sure to get it right if
you're typing it in.


% have the session ID in them.  Impossible for a CMS.  The answer is
% enabel_trans_sid.

Well, sorta :-)


% 
% More and more hosts are compiling with enable_trans_sid... what this does
% is: attempt to pass the SID around in a cookie.  If this fails, it will

Right.


% re-write any relative URLs in your pages to include the session ID... it's

So I can code without having to put the ID on the URLs myself?  So the
transparent-ness is for the programmer?  Well, I do like that...


% the best of both worlds... transparent cookies if possible, otherwise the
% SID is passed around in a URL.

Right.


% 
% 
% So, this rules out a complaint about complicated URLs, because you don't
% have to type them.

I may not have to type it as a programmer, but the user might have to
type it as a surfer.


% 
% 
% I urge you to look around all the big sites... if they need to maintain
% state (a session) they do so with URLs... amazon.com, whatever -- they all
% do it.

Yeah, I know.


% 
% Why do you not wish to use URLs?

Because they're cluttered and it puts the session ID also in the user's
goto cache.


% 
% 
% Justin


Thanks  HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg81334/pgp0.pgp
Description: PGP signature


RE: [PHP] join() , can do that fast?

2002-10-07 Thread John W. Holmes



 -Original Message-
 From: lallous [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 07, 2002 6:09 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] join() , can do that fast?
 
 Hello,
 
 
 I have:
 $x = array('str1','str2','str3');
 
 I want to convert that array to a valid javascript syntax as:
 
 var x = ['str1','str2','str3']
 
 I can do this in PHP:
 
 echo sprintf(x=[%s], join(',', $x));

echo sprintf(x=['%s'], join(',', $x));

 but that would produce:
 x = [str1, str2, str3]
 
 is there is a fast way (other than doing a loop) to have join put
quote
 around each array value before joining? so final result looks like:
 ['str1','str2',...

---John Holmes...



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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread lallous

John, what you said would simply produce:
   var x = ['str1,str2,str3']
and not as I want:
  var x = ['str1','str2','str3']


Elias,

John W. Holmes [EMAIL PROTECTED] wrote in message
002101c26de2$982bf7d0$7c02a8c0@coconut">news:002101c26de2$982bf7d0$7c02a8c0@coconut...


  -Original Message-
  From: lallous [mailto:[EMAIL PROTECTED]]
  Sent: Monday, October 07, 2002 6:09 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] join() , can do that fast?
 
  Hello,
 
 
  I have:
  $x = array('str1','str2','str3');
 
  I want to convert that array to a valid javascript syntax as:
 
  var x = ['str1','str2','str3']
 
  I can do this in PHP:
 
  echo sprintf(x=[%s], join(',', $x));

 echo sprintf(x=['%s'], join(',', $x));

  but that would produce:
  x = [str1, str2, str3]
 
  is there is a fast way (other than doing a loop) to have join put
 quote
  around each array value before joining? so final result looks like:
  ['str1','str2',...

 ---John Holmes...





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




Re: [PHP] sessions without cookies *or* URLs

2002-10-07 Thread Justin French

on 07/10/02 7:18 PM, David T-G ([EMAIL PROTECTED]) wrote:


 % re-write any relative URLs in your pages to include the session ID... it's
 
 So I can code without having to put the ID on the URLs myself?  So the
 transparent-ness is for the programmer?  Well, I do like that...

Yes.


 % So, this rules out a complaint about complicated URLs, because you don't
 % have to type them.
 
 I may not have to type it as a programmer, but the user might have to
 type it as a surfer.

Nope.  Why would they type it?  The session is managed by PHP's session
functions... if 'page.php' has a session_start() call, it will assign a
PHPSESSID.

Yes, they may acidently bookmark or favourite a session ID, and you'd
have to read up / test on the implications of this, but given there are only
three options, you have to work through them.

If they work for amazon, they can work for you... If you rule out cookies
and POST, then guess what you're left with :)


Justin





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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread Erwin

Lallous wrote:
 John, what you said would simply produce:
var x = ['str1,str2,str3']
 and not as I want:
   var x = ['str1','str2','str3']

Elias,

did you actually tried that? Because it does produce what you want...

?
$x = Array( 'str1', 'str2', 'str3' );
echo sprintf(x=['%s'], join(',', $x));
?

produces:

x=['str1','str2','str3']


Grtz Erwin

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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread lallous

Thanks John,

sorry I didn't see the new join()'s parameters you provided, I only noticed
the new '%s' .

Elias,



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




Re: [PHP] need help for a where clause

2002-10-07 Thread Philipp Lutz

If you are using MySQL you may want to look at the CASE statement in the
Control flow functions for use with SELECT Statements
 it would look like
SELECT
CASE A.Afn
  WHEN 1 THEN B.Bfn1
  WHEN 2 THEN B.Bfn2
  WHEN 3 THEN B.Bfn3
   FROM A,B
IN MySQL
Hope That Helps.. Phil

Alex Shi [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks! This is what I need!

 Alex Shi



 Sascha Cunz [EMAIL PROTECTED] ??
 :[EMAIL PROTECTED]
 A solution on that depends strongly on how much values A.Afn would take.
For
 3, it's still okay. But i wouldn't do more.

 Against what shall the B.Bfn* be checked? What Data do you want to be
 returned
 from the query?

 try:

 SELECT ### FROM A, B WHERE
   ((A.Afn=1) AND (B.Bfn1 = ...)) OR
   ((A.Afn=2) AND (B.Bfn2 = ...)) OR
   ((A.Afn=3) AND (B.Bfn3 = ...))

 where you should replace ### with things you want to select and ... with
the
 things you want to check.

 On more than 3 different values for A.Afn, you should use a more
normalized
 version of B.

 i.e.: B contains only one Bfn field and a Reference to A.Afn.
  - SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ...

 Sascha

 Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi:
  Hi,
 
  I need a where clause in following situation:
 
  Say I want to query two tables: A and B. In table A there is field
  Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want
  to do a query, in which the where clause must do these things:
 
  if A.Afn=1, then check value of B.Bfn1;
  if A.Afn=2, then check value of B.Bfn2;
  if A.Afn=3, then check value of B.Bfn3.
 
  So how can I create such a where clause to do this?
  Thanks in advance!
 
  Alex Shi




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




RE: [PHP] sessions without cookies *or* URLs

2002-10-07 Thread John W. Holmes

 % The most common method is plain cookies.  But if you want guaranteed
 state,
 
 Sure, but I know that cookies won't work, so that rules them out.

Won't work, or you don't want to use them?

 % So, this rules out a complaint about complicated URLs, because you
don't
 % have to type them.
 
 I may not have to type it as a programmer, but the user might have to
 type it as a surfer.

Why would the user have to type in a URL with a session id? Your session
ids are only good while the user is active and they will expire after a
certain amount of time. 

 % Why do you not wish to use URLs?
 
 Because they're cluttered and it puts the session ID also in the
user's
 goto cache.

Again, why does that matter because that ID is only good while the user
is active. When they log out, it's worthless, or after a certain amount
of inactive time, it's worthless...

---John Holmes...



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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread Philipp Lutz

Read closely ! There are extra apostrophes inside the quotes !!
Phil

Lallous [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 John, what you said would simply produce:
var x = ['str1,str2,str3']
 and not as I want:
   var x = ['str1','str2','str3']


 Elias,

 John W. Holmes [EMAIL PROTECTED] wrote in message
 002101c26de2$982bf7d0$7c02a8c0@coconut">news:002101c26de2$982bf7d0$7c02a8c0@coconut...
 
 
   -Original Message-
   From: lallous [mailto:[EMAIL PROTECTED]]
   Sent: Monday, October 07, 2002 6:09 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] join() , can do that fast?
  
   Hello,
  
  
   I have:
   $x = array('str1','str2','str3');
  
   I want to convert that array to a valid javascript syntax as:
  
   var x = ['str1','str2','str3']
  
   I can do this in PHP:
  
   echo sprintf(x=[%s], join(',', $x));
 
  echo sprintf(x=['%s'], join(',', $x));
 
   but that would produce:
   x = [str1, str2, str3]
  
   is there is a fast way (other than doing a loop) to have join put
  quote
   around each array value before joining? so final result looks like:
   ['str1','str2',...
 
  ---John Holmes...
 
 





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




[PHP] Doubt on using header and setcookie functions

2002-10-07 Thread Balaji Ankem

Hi

How to set cookies using header() function and using setcookie function?

Setcookie('testcookie','Balaji',time()+3600,'/','10.145.0.1',1);

If I want to write same thing with header function how can I do that?

Is it like 

header(Set-Cookie:
name=testcookie,value=Balaji,domain=10.145.0.1,secure=1)

or

header(Set-Cookie: testcookie,Balaji,10.145.0.1,1)


Thanks in Advance
Balaji



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


[PHP] Includes

2002-10-07 Thread Rick Beckman

I'm wanting to use PHP to make updating an entire site easier by using
include() [I think that's the function] to include navigation bars, notices,
etc. on multiple pages. What's the best way to do that, and is it possible
to keep the included files from being indexed/viewed on their own (possibly
by password protecting [htaccess] the directory they are in)? Thanks in
advance for any help.

-- 
Kyrie Eleison,
Rick Beckman
www.spiritsword.com/



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




Re: [PHP] Includes

2002-10-07 Thread Andy Woolley

Hi,

The best way to do this (it's only my opinion, I'm sure there are many other
ways but this way works for me) is to create a .php file and fill it with
your most commonly used functions. You can use a .inc file, which is
probably recommended, but you will need to tell the server not to display
this file. You can do this in php.ini but it will complicate things right
now.

For a header, use a function name like drawHeader() or something and then
put all your database connection, navigation, page formatting etc in that
function.

Then, on all your pages, you just need to add the following at the top.

?
include(yourincfile.php);
drawHeader();
?

This will draw you header the same on all pages that you include the above
with. If someone navigates to yourincudefile.php all they should see is an
empty page because all the code is inside functions.

Hope this helps
Andy.


- Original Message -
From: Rick Beckman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 11:12 AM
Subject: [PHP] Includes


 I'm wanting to use PHP to make updating an entire site easier by using
 include() [I think that's the function] to include navigation bars,
notices,
 etc. on multiple pages. What's the best way to do that, and is it possible
 to keep the included files from being indexed/viewed on their own
(possibly
 by password protecting [htaccess] the directory they are in)? Thanks in
 advance for any help.

 --
 Kyrie Eleison,
 Rick Beckman
 www.spiritsword.com/



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


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




Re: [PHP] PHPDoc?

2002-10-07 Thread Matt

I know of the following...

www.phpdoc.de - used by PEAR, scattered documentation
http://phpdocu.sourceforge.net - lots more documentation, hate the framed
output
http://www.ez.no/article/articlestatic/35/1/42/ - eZ phpdoc, from the people
who make the eZ CMS

I'm interested in hearing from anyone who uses these - how widely are they
used/supported, how buggy, how well do they follow JavaDoc?


Scott Houseman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 www.phpdoc.de is one I know of.
 I'm not surewhat the current development activity is, but I think it's
still in beta.
 The front page states 'Last update: 2000/12/03' - so I don't know what's
happening there.

 Regards

 Scott

 On 10/1/2002 4:18 PM, Francis wrote:
  Is their any comparable tool/util whatever to automaticly create
  documentation from your PHP Code (like java's JavaDoc)?
 
 
 


 --
 ////
 // Scott Houseman //
 // Jam Warehouse http://www.jamwarehouse.com/ //
 // Smart Business Innovation  //
 // +27 21 4477440 / +27 82 4918021//
 ////




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




[PHP] File download doesn't work with SSL

2002-10-07 Thread 1LT John W. Holmes

Everyone,

I've had a simple download script working where a user would click on a link and the 
program would send word or excel headers instead of HTML. The file would then be 
opened in the appropriate program and the user could save/edit it.

Now that we've loaded everything under SSL, it doesn't work.

Here are the headers I send:

header(content-type: application/vnd.ms-excel; name='excel');
header(content-disposition: attachment; filename= . $filename . .xls);

Now, the pages in question are just regular HTML tables. If there is a export2=excel 
in the URL, then these two additional headers will be sent. The dialog to save/open 
the file pops up, but when you try to open/save the file, IE says it cannot be found. 
If I put in a echo before these two headers (or comment them out), the page is shown 
correctly as HTML, so the code is correct. 

Are there any special headers I have to send to enable this file download while under 
SSL, or is it something else I'm overlooking?

Thanks for any help.

---John Holmes...


[PHP] Using '/' instead of '?' in url querystring

2002-10-07 Thread Kenni Graversen

Hi,

I wonder if any of you have experience, sending variables in the url without
using the ? character.

When sending variables this is the normal way to do it:
/foo.php?id=12

But I have read that the following URL should work:
/foo.php/12/

and then fetch the id in this way:
$id = ereg_replace('[^0-9]', '', $PATH_INFO);

I have even seen it in function but the problem is that I can't get it to
work on my local apache server.
When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in
the apache error-log I can read that 'Premature end of script headers:
c:/php/php.exe'. Does anyone know what could cause this error and why the
url isn't working??

thanks

Kenni Graversen



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




[PHP] Re: Using '/' instead of '?' in url querystring

2002-10-07 Thread Johan Holst Nielsen

 When sending variables this is the normal way to do it:
 /foo.php?id=12
 
 But I have read that the following URL should work:
 /foo.php/12/
 
 and then fetch the id in this way:
 $id = ereg_replace('[^0-9]', '', $PATH_INFO);
 
 I have even seen it in function but the problem is that I can't get it to
 work on my local apache server.
 When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in
 the apache error-log I can read that 'Premature end of script headers:
 c:/php/php.exe'. Does anyone know what could cause this error and why the
 url isn't working??

Try mod_rewrite to apache...
http://httpd.apache.org/docs/mod/mod_rewrite.html
Else try http://www.phpbuilder.com/columns/tim2526.php3

Regards,
Johan


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




Re: [PHP] Does anyone knows File Maker

2002-10-07 Thread Andrew Hill

Elliot,

PHP works just fine with ODBC, using the iODBC Driver Manager as per 
the HOWTO at http://www.iodbc.org.
This should work against FMPro under Windows as well.

Best regards,
Andrew Hill
Director of Technology Evangelism - OpenLink Software
Universal Data Access and the Virtuoso Universal Server
http://www.openlinksw.com/virtuoso/whatis.htm

On Thursday, October 3, 2002, at 11:23 AM, Webmaster MBTRADINGCO wrote:

 I ran yesterday into a company that wants me to implement a solution
 with PHP and File Maker. I don't even know if it is possible, so I was
 wondering:

 A) Does anyone has any experience with filemaker?
 b) Can PHP save data from internet via ODBC to a database (other than
 the ones it supports) in a windows server?
 c) Does anyone knows if PHP supports file maker?

 Thanks in advance.


 Elliot J. Balanza



 -- 
 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] what is the best way to handle connectivity

2002-10-07 Thread salamander

Jeff,

ODBC should work just fine - you can just link --with-iodbc as per the 
HOWTOs on www.iodbc.org.
If you use a native driver than the Informix client needs to be 
installed on the same box.

Best regards,
Andrew Hill
Director of Technology Evangelism - OpenLink Software
Universal Data Access and the Virtuoso Universal Server
http://www.openlinksw.com/virtuoso/whatis.htm


On Saturday, October 5, 2002, at 11:44 PM, Jeff Bluemel wrote:

 I've got informix on a sco open server box, and my webserver has php 
 4.2.3
 with apache.  I'm wondering what the best way to handle the 
 connectivity
 into the sco box is (not concerned with how difficult this is to 
 setup, but
 rather pure speed)

 do I try to use a native driver?  if I use the native driver does 
 informix
 have to be installed on the same box?  do I just try to use odbc?

 --
 Jeff Bluemel



 -- 
 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] File download doesn't work with SSL

2002-10-07 Thread Rasmus Lerdorf

Does it work with a different browser?  Smells like an IE bug to me.

On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:

 Everyone,

 I've had a simple download script working where a user would click on a link and the 
program would send word or excel headers instead of HTML. The file would then be 
opened in the appropriate program and the user could save/edit it.

 Now that we've loaded everything under SSL, it doesn't work.

 Here are the headers I send:

 header(content-type: application/vnd.ms-excel; name='excel');
 header(content-disposition: attachment; filename= . $filename . .xls);

 Now, the pages in question are just regular HTML tables. If there is a export2=excel 
in the URL, then these two additional headers will be sent. The dialog to save/open 
the file pops up, but when you try to open/save the file, IE says it cannot be found. 
If I put in a echo before these two headers (or comment them out), the page is shown 
correctly as HTML, so the code is correct.

 Are there any special headers I have to send to enable this file download while 
under SSL, or is it something else I'm overlooking?

 Thanks for any help.

 ---John Holmes...


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




Re: [PHP] recent encrpyt decrypt code... (problems)

2002-10-07 Thread Scott Fletcher

You got to be kidding me  I use similar code and a sample of yours and I
got just about the same error message as what Jeff Bluemel got.  I checked
the PHP Info and it showed that I had the libmcrypt accepted but no
supported ciphers.  Then I posted two seperate unanswered posting until I
stumpled onto this.

I did not understand why mcrypt is required along with the libmcrypt.
Libmcrypt is just an combination of mcrypt and extra stuffs.  The url,
php.net/mcrypt said to use libmcrypt and it mentioned of no mcrypt.  So, it
was no wonder I had problem.  Now I know I did not ask the right question in
the PHP newsgroup.  I am glad to see a solution to this problem.  Thank you
for the responses and your solution to the problem as it help with Jeff
Bluemel, it now helped me too.  Thank you!

FletchSOD

P.S. Do I compile mcrypt before libmcrypt or is it the other way around?

Tom Rogers [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Friday, October 4, 2002, 3:01:53 PM, you wrote:
 JB I've seen a few other post on this, and it sounds like there is more
then
 JB one of use that is trying this script.  I've got it so that I can use
the
 JB commands, but I still get errors on the page...

 JB here is what I have done.

 JB I downloaded libmycrpt from
 JB ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt and configured it
with
 JB the following options;

 JB ./configure \
 JB  --with-included-algos=rijndael-128 arcfour stream cbc cfb\
 JB  --disable-posix-threads

 That is a class I put together. I use libmcrypt-2.5.2 configured with:

 configure --prefix=/usr --enable-ltdl-install=no

 and mcrypt-2.6.2 configured with:

 configure --prefix=/usr

 and in php configure:

 --with-mcrypt=/usr/src/mcrypt-2.6.2 (thats where it was untarred)

 and it works like a dream :)

 --
 regards,
 Tom




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




[PHP] Prevent certain cachingheaders sent by sessionssytem

2002-10-07 Thread Eric Persson

I'm using the builtin sessionssystem in some soloutions I've made but 
I'm not totally satisfied with the headers sent from it.
Especially I dont like the following line:
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0

The header above causes me some problems and I would like to exclude 
this on some pages. I read that its maybe possible to remove the whole 
line completely, but I just want to do this in certain phpfiles. Is this 
possible?

Thankful for any input..
Eric


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




Re: [PHP] Using '/' instead of '?' in url querystring

2002-10-07 Thread Nicole Lallande

Kenni,

I asked a similar question several months ago and got a lot of terrific 
info from the list.  First some links:

See this related link:

  Q How can I pass variables to a script in the url 
 like /script/var1/var2?

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

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

and


Search Engine Friendly URLs with PHP and Apache 
http://www.evolt.org/article/Search_Engine_Friendly_URLs_with_PHP_and_Ap
ache/17/15049/index.html 

Search Engine Friendly URLs (Part II)
http://www.evolt.org/article/Search_Engine_Friendly_URLs_Part_II/17/1717
1/index.html 

and finally:

http://httpd.apache.org/docs/mod/mod_rewrite.html



The approach I used was  the Apache web server's mod_rewrite (rewrite 
engine) and then apply the appropriate rules to an htaccess file.  If 
you have the rewrite engine installed (and loaded in your httpd.conf 
file), then try the following in your .htaccess file:

RewriteEngine On
RewriteRule ^foo\.php(./*) $ http://your domainname.com/foo.php?id=$1 [R]

The '.' is a concactenator in the rules so it must be escaped unless 
used as such.  If you wanted to add an ending forward slash for 
foo.php/12/ then perhaps use  (./*/)  
 
HTH,

Nicole
PS - many thanks once again to all who helped answer this question for me!

Kenni Graversen wrote:

Hi,

I wonder if any of you have experience, sending variables in the url without
using the ? character.

When sending variables this is the normal way to do it:
/foo.php?id=12

But I have read that the following URL should work:
/foo.php/12/

and then fetch the id in this way:
$id = ereg_replace('[^0-9]', '', $PATH_INFO);

I have even seen it in function but the problem is that I can't get it to
work on my local apache server.
When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in
the apache error-log I can read that 'Premature end of script headers:
c:/php/php.exe'. Does anyone know what could cause this error and why the
url isn't working??

thanks

Kenni Graversen



  


-- 

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766





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




Re: [PHP] recent encrpyt decrypt code... (problems)

2002-10-07 Thread Scott Fletcher

Never mind that!  I found the answer when I did the Google search.  It said
mHash come first, then libmcrypt then mcrypt.  So, that's what it should be.
Yea, it can also be libmcrypt 1st then mhash then mcrypt.  I got what I need
to know which is that libmcrypt should come before mcrypt.  So, it fit with
what Tom Rogers said.


Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You got to be kidding me  I use similar code and a sample of yours and
I
 got just about the same error message as what Jeff Bluemel got.  I checked
 the PHP Info and it showed that I had the libmcrypt accepted but no
 supported ciphers.  Then I posted two seperate unanswered posting until I
 stumpled onto this.

 I did not understand why mcrypt is required along with the libmcrypt.
 Libmcrypt is just an combination of mcrypt and extra stuffs.  The url,
 php.net/mcrypt said to use libmcrypt and it mentioned of no mcrypt.  So,
it
 was no wonder I had problem.  Now I know I did not ask the right question
in
 the PHP newsgroup.  I am glad to see a solution to this problem.  Thank
you
 for the responses and your solution to the problem as it help with Jeff
 Bluemel, it now helped me too.  Thank you!

 FletchSOD

 P.S. Do I compile mcrypt before libmcrypt or is it the other way around?

 Tom Rogers [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  Friday, October 4, 2002, 3:01:53 PM, you wrote:
  JB I've seen a few other post on this, and it sounds like there is more
 then
  JB one of use that is trying this script.  I've got it so that I can
use
 the
  JB commands, but I still get errors on the page...
 
  JB here is what I have done.
 
  JB I downloaded libmycrpt from
  JB ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt and configured it
 with
  JB the following options;
 
  JB ./configure \
  JB  --with-included-algos=rijndael-128 arcfour stream cbc cfb\
  JB  --disable-posix-threads
 
  That is a class I put together. I use libmcrypt-2.5.2 configured with:
 
  configure --prefix=/usr --enable-ltdl-install=no
 
  and mcrypt-2.6.2 configured with:
 
  configure --prefix=/usr
 
  and in php configure:
 
  --with-mcrypt=/usr/src/mcrypt-2.6.2 (thats where it was untarred)
 
  and it works like a dream :)
 
  --
  regards,
  Tom
 





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




[PHP] quert problems

2002-10-07 Thread Kurth Bemis (List Monkey)

what the hell i wrong in this query?

$q = UPDATE userpref WHERE username='kurth' AND preference=required_hits 
SET preference=$HTTP_POST_VARS[required_hits];

mysql_error() returns this...You have an error in your SQL syntax near 
'WHERE username='kurth' AND preference=required_hits SET preference=5' at 
line 1

what gives?

~kurth


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




Re: [PHP] quert problems

2002-10-07 Thread Phillip Erskine

SET comes before WHERE

$q = UPDATE userpref SET preference=$HTTP_POST_VARS[required_hits] WHERE 
username='kurth' AND preference=required_hits;


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


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




Re: [PHP] quert problems

2002-10-07 Thread Stuart Dallas

Kurth Bemis (List Monkey) wrote:

 what the hell i wrong in this query?

 $q = UPDATE userpref WHERE username='kurth' AND 
 preference=required_hits SET preference=$HTTP_POST_VARS[required_hits];

 mysql_error() returns this...You have an error in your SQL syntax near 
 'WHERE username='kurth' AND preference=required_hits SET preference=5' 
 at line 1

 what gives?

1) This is a PHP list, not an SQL help list

2) The SET clause goes before the WHERE clause

-- 
Stuart



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




Re: [PHP] what is the best way to handle connectivity

2002-10-07 Thread Jeff Bluemel

thanks for the FYI...  this is what I as assuming the answer was going to
be, but I wanted to make sure.

Jeff

Salamander [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jeff,

 ODBC should work just fine - you can just link --with-iodbc as per the
 HOWTOs on www.iodbc.org.
 If you use a native driver than the Informix client needs to be
 installed on the same box.

 Best regards,
 Andrew Hill
 Director of Technology Evangelism - OpenLink Software
 Universal Data Access and the Virtuoso Universal Server
 http://www.openlinksw.com/virtuoso/whatis.htm


 On Saturday, October 5, 2002, at 11:44 PM, Jeff Bluemel wrote:

  I've got informix on a sco open server box, and my webserver has php
  4.2.3
  with apache.  I'm wondering what the best way to handle the
  connectivity
  into the sco box is (not concerned with how difficult this is to
  setup, but
  rather pure speed)
 
  do I try to use a native driver?  if I use the native driver does
  informix
  have to be installed on the same box?  do I just try to use odbc?
 
  --
  Jeff Bluemel
 
 
 
  --
  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] Using '/' instead of '?' in url querystring

2002-10-07 Thread Kenni Graversen

Thanks,

These links will help me out for sure.

regards
Kenni


Nicole Lallande [EMAIL PROTECTED] skrev i en meddelelse
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Kenni,

 I asked a similar question several months ago and got a lot of terrific
 info from the list.  First some links:

 See this related link:

   Q How can I pass variables to a script in the url
  like /script/var1/var2?

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

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

 and


 Search Engine Friendly URLs with PHP and Apache
 http://www.evolt.org/article/Search_Engine_Friendly_URLs_with_PHP_and_Ap
 ache/17/15049/index.html

 Search Engine Friendly URLs (Part II)
 http://www.evolt.org/article/Search_Engine_Friendly_URLs_Part_II/17/1717
 1/index.html

 and finally:

 http://httpd.apache.org/docs/mod/mod_rewrite.html



 The approach I used was  the Apache web server's mod_rewrite (rewrite
 engine) and then apply the appropriate rules to an htaccess file.  If
 you have the rewrite engine installed (and loaded in your httpd.conf
 file), then try the following in your .htaccess file:

 RewriteEngine On
 RewriteRule ^foo\.php(./*) $ http://your domainname.com/foo.php?id=$1 [R]

 The '.' is a concactenator in the rules so it must be escaped unless
 used as such.  If you wanted to add an ending forward slash for
 foo.php/12/ then perhaps use  (./*/)

 HTH,

 Nicole
 PS - many thanks once again to all who helped answer this question for me!

 Kenni Graversen wrote:

 Hi,
 
 I wonder if any of you have experience, sending variables in the url
without
 using the ? character.
 
 When sending variables this is the normal way to do it:
 /foo.php?id=12
 
 But I have read that the following URL should work:
 /foo.php/12/
 
 and then fetch the id in this way:
 $id = ereg_replace('[^0-9]', '', $PATH_INFO);
 
 I have even seen it in function but the problem is that I can't get it to
 work on my local apache server.
 When I try to write /foo.php/12/ I get a '500 Internal Server Error' and
in
 the apache error-log I can read that 'Premature end of script headers:
 c:/php/php.exe'. Does anyone know what could cause this error and why the
 url isn't working??
 
 thanks
 
 Kenni Graversen
 
 
 
 
 

 --
 
 Nicole Lallande
 [EMAIL PROTECTED]
 760.753.6766
 






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




[PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com

Hi everyone,
I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even 
slower when accessing a mySQL database.  It's a PIII-800 with 256MB 
RAM.  It is otherwise a great machine, and fast.

Any suggestions?

Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] running slow on Win2k

2002-10-07 Thread Gerard Samuel

I have a dev setup running IIS/MSSQL  Apache/MySQL on a w2k box with 
800PIII/128M Ram.  It flies for me.
php 4.2.2 as isapi

Support @ Fourthrealm.com wrote:

 Hi everyone,
 I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and 
 even slower when accessing a mySQL database.  It's a PIII-800 with 
 256MB RAM.  It is otherwise a great machine, and fast.

 Any suggestions?

 Peter


 - - - - - - - - - - - - - - - - - - - - -
 Fourth Realm Solutions
 [EMAIL PROTECTED]
 http://www.fourthrealm.com
 Tel: 519-739-1652
 - - - - - - - - - - - - - - - - - - - - -



-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




Re: [PHP] running slow on Win2k

2002-10-07 Thread @ Edwin

Hello,

On Tuesday, October 8, 2002 12:19 AM
Support @ Fourthrealm.com wrote:
 Hi everyone,
 I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
 slower when accessing a mySQL database.  It's a PIII-800 with 256MB
 RAM.  It is otherwise a great machine, and fast.

 Any suggestions?


Perhaps, you can increase your RAM. Better yet, take Win2k and IIS off and
install Linux and Apache. I'm sure next time you'll ask, why is it faster?

- E

 Peter


 - - - - - - - - - - - - - - - - - - - - -
 Fourth Realm Solutions
 [EMAIL PROTECTED]
 http://www.fourthrealm.com
 Tel: 519-739-1652
 - - - - - - - - - - - - - - - - - - - - -


 --
 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: session cookies

2002-10-07 Thread Scott Fletcher

Hi Jeff,

I manage the website for the credit report reseller.  We don't normally
use cookie but we use session only.  You were expressing some concern about
someone knowing the session id.  What we normally use is we used the
encrypted session id and use use long aphanumeric number.  This make it hard
for someone to crack the code.  We also use certain features that check the
session id and if it is a mismatch, we logged the user out.  The only
problem we had is that when the user closed the browser, the session was not
destroyed but we have a work around to it.  That is when the user logged in
again, we can tell if it is the same user or not and issue a new session id.
We also use the feature like logging the user out if the user is idle for 15
mintues.

If you want a copy of the sample code and analyze it then give me a
holler!  Then I'll post it here.  By the way, I enjoyed your other posting
about the encryption problem with libmcrypt.  I had the same problem as
yours until I read it and found out that I need to install the mcrypt too.
So, I filed the PHP bug making a request that the documentation be updated
to include more information about mcrypt.

FletchSOD

Jeff Bluemel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I put this block of code in, and all of the array's they should send back
 are 100% blank.  I will try the protoscope to see what I can turn up on
 this.


 Chris Shiflett [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Jeff,
 
  One quick thought ...
 
  Is your cookie domain the same domain as the URL domain you are using to
  test this? If not, the browser will not send the cookie, so that is a
  potential reason for this behavior.
 
  If the domain is the same, I see no reason why this shouldn't work, but
  I have two ideas you can try.
 
  1. Rather than using the name of the cookie, try this on the receiving
 page:
 
  pre
  ?
  print_r($_COOKIE);
  ?
  /pre
 
  This should dump the entire array to the screen and would reveal any
  naming problems.
 
  2. View the HTTP transactions themselves to make sure the proper
  Set-Cookie and Cookie headers are being used. There are several
  utilities that can help do this, and I recently wrote one in PHP (it's a
  quick hack though) you can get at http://protoscope.org/. The messages
  of interest are the original HTTP response from your Web server (which
  should contain the Set-Cookie header) and any future HTTP request (which
  should contain the Cookie header). This is the most reliable way to
  really analyze these types of problems.
 
  Hopefully these ideas will help uncover something.
 
  Chris
 
  Jeff Bluemel wrote:
 
  ok - no cookie exists...  I have Netscape set to accept all cookies.
  
 





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




Re: [PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com

Edwin,
I have no interest in getting into a Win2K/Linux debate.  There are 
strengths and reasons for using both systems.

I run other applications (ASP, .NET, iHTML, MSSQL) without any problems, 
and they all work very quickly.  Win2K is my primary development 
environment as it matches the systems my clients use.

So, I just need to know if there are some tweaks I should be considering to 
speed up PHP?


Peter


At 12:31 AM 10/8/2002 +0900, @ Edwin wrote:
Hello,

On Tuesday, October 8, 2002 12:19 AM
Support @ Fourthrealm.com wrote:
  Hi everyone,
  I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
  slower when accessing a mySQL database.  It's a PIII-800 with 256MB
  RAM.  It is otherwise a great machine, and fast.
 
  Any suggestions?
 

Perhaps, you can increase your RAM. Better yet, take Win2k and IIS off and
install Linux and Apache. I'm sure next time you'll ask, why is it faster?

- E

  Peter
 
 
  - - - - - - - - - - - - - - - - - - - - -
  Fourth Realm Solutions
  [EMAIL PROTECTED]
  http://www.fourthrealm.com
  Tel: 519-739-1652
  - - - - - - - - - - - - - - - - - - - - -
 
 
  --
  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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] File download doesn't work with SSL

2002-10-07 Thread 1LT John W. Holmes

 Does it work with a different browser?  Smells like an IE bug to me.

Doesn't everything with IE smell like a bug?

Anyhow, it works fine with Netscape. Opera will not open the file, but will
save-as just fine when prompted.

I'm off to search MS...deity of choice help me...

---John Holmes...


  Everyone,
 
  I've had a simple download script working where a user would click on a
link and the program would send word or excel headers instead of HTML. The
file would then be opened in the appropriate program and the user could
save/edit it.
 
  Now that we've loaded everything under SSL, it doesn't work.
 
  Here are the headers I send:
 
  header(content-type: application/vnd.ms-excel; name='excel');
  header(content-disposition: attachment; filename= . $filename .
.xls);
 
  Now, the pages in question are just regular HTML tables. If there is a
export2=excel in the URL, then these two additional headers will be sent.
The dialog to save/open the file pops up, but when you try to open/save the
file, IE says it cannot be found. If I put in a echo before these two
headers (or comment them out), the page is shown correctly as HTML, so the
code is correct.
 
  Are there any special headers I have to send to enable this file
download while under SSL, or is it something else I'm overlooking?
 
  Thanks for any help.
 
  ---John Holmes...



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




Re: [PHP] File download doesn't work with SSL

2002-10-07 Thread 1LT John W. Holmes

I believe in miracles. I have searched Microsoft and the first link was
actually related to my problem...

Okay, I found an IE issue where downloads over SSL will choke when you send
a no-cache header. It says to use a no-store cache-control header, instead.
I tried this:

header(cache-control: no-store);
header(content-type: application/vnd.ms-excel; name='excel');
header(content-disposition: attachment; filename= . $filename .
.xls);

and I'm still getting the same thing. Is the no-cache cache-control header
sent automatically by PHP at all? I don't have one set explicitly in my
code.

Any help is appreciated.

---John Holmes...

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL


 Does it work with a different browser?  Smells like an IE bug to me.

 On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:

  Everyone,
 
  I've had a simple download script working where a user would click on a
link and the program would send word or excel headers instead of HTML. The
file would then be opened in the appropriate program and the user could
save/edit it.
 
  Now that we've loaded everything under SSL, it doesn't work.
 
  Here are the headers I send:
 
  header(content-type: application/vnd.ms-excel; name='excel');
  header(content-disposition: attachment; filename= . $filename .
.xls);
 
  Now, the pages in question are just regular HTML tables. If there is a
export2=excel in the URL, then these two additional headers will be sent.
The dialog to save/open the file pops up, but when you try to open/save the
file, IE says it cannot be found. If I put in a echo before these two
headers (or comment them out), the page is shown correctly as HTML, so the
code is correct.
 
  Are there any special headers I have to send to enable this file
download while under SSL, or is it something else I'm overlooking?
 
  Thanks for any help.
 
  ---John Holmes...



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




[PHP] eregi_replace help

2002-10-07 Thread Jennifer Swofford

Hello all,

I am trying to use php to read through an html file and replace all image
paths, like such:

Change images/firstimage.gif to http://www.blah.com/firstimage.gif; ...
Change somesuch/images/secondimage.jpg to
http://www.blah.com/secondimage.jpg;

So I am going through the file and matching the image path strings,
stripping them down to just the image name using basename, and then adding
http://www.blah.com/; onto the beginning of them.  Except it's not working,
and I'm not sure where my logic has gone awry.  Instead of replacing each
image path with its respective image name, it is replacing all image paths
with the *same* image name.

Here is the code.  (Yes I'm new, I apologize for the mess, there are a few
lines in there I'm using for debugging purposes, to show me what it's
doing.)

?
$filename = newexample.html;
$fd = fopen ($filename, r);
$contents = fread ($fd, filesize ($filename));

while (preg_match('{()([A-z0-9_/-](\/))*[A-z0-9_/-]+(.gif|.jpg)}',
$contents, $matches)) {

echo bMATCHED:/b .$matches[0].br\n;

$base = basename($matches[0]);
$newimage = http://www.blah.com/.$base;
echo brbase: .$base.br;
echo new image: .$newimage.br;
echo hr;

$contents = eregi_replace('\/*[A-z0-9_/-]+(.gif|.jpg)', $newimage,
$contents);

print $contents;

}

fclose ($fd);

?

When I run it, I get:

~
MATCHED: blah/images/first.gif

base: first.gif
new image: http://www.blah.com/first.gif

Here it prints the contents of the html file, except all images look like
http://www.blah.com/first.gif; (when there are supposed to be lots of other
images, such as second.jpg, etc).
~

Where have I gone wrong?  Thanks to all, as usual, for your hints and help.

Jen


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




Re: [PHP] File download doesn't work with SSL

2002-10-07 Thread Rasmus Lerdorf

Nope, PHP does not send that.

On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:

 I believe in miracles. I have searched Microsoft and the first link was
 actually related to my problem...

 Okay, I found an IE issue where downloads over SSL will choke when you send
 a no-cache header. It says to use a no-store cache-control header, instead.
 I tried this:

 header(cache-control: no-store);
 header(content-type: application/vnd.ms-excel; name='excel');
 header(content-disposition: attachment; filename= . $filename .
 .xls);

 and I'm still getting the same thing. Is the no-cache cache-control header
 sent automatically by PHP at all? I don't have one set explicitly in my
 code.

 Any help is appreciated.

 ---John Holmes...

 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: 1LT John W. Holmes [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, October 07, 2002 10:08 AM
 Subject: Re: [PHP] File download doesn't work with SSL


  Does it work with a different browser?  Smells like an IE bug to me.
 
  On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
 
   Everyone,
  
   I've had a simple download script working where a user would click on a
 link and the program would send word or excel headers instead of HTML. The
 file would then be opened in the appropriate program and the user could
 save/edit it.
  
   Now that we've loaded everything under SSL, it doesn't work.
  
   Here are the headers I send:
  
   header(content-type: application/vnd.ms-excel; name='excel');
   header(content-disposition: attachment; filename= . $filename .
 .xls);
  
   Now, the pages in question are just regular HTML tables. If there is a
 export2=excel in the URL, then these two additional headers will be sent.
 The dialog to save/open the file pops up, but when you try to open/save the
 file, IE says it cannot be found. If I put in a echo before these two
 headers (or comment them out), the page is shown correctly as HTML, so the
 code is correct.
  
   Are there any special headers I have to send to enable this file
 download while under SSL, or is it something else I'm overlooking?
  
   Thanks for any help.
  
   ---John Holmes...
 



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




Re: [PHP] eregi_replace help

2002-10-07 Thread Jennifer Swofford

BTW - I have found errors in the regular expression that I was matching so
don't bother to point those out.  ;)  That shouldn't affect the nature of
the problem I was asking about.

--- Jennifer Swofford [EMAIL PROTECTED] wrote:
 Hello all,

 I am trying to use php to read through an html file
 and replace all image
 paths, like such:

snip


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




[PHP] parsing variables through webpages

2002-10-07 Thread Edgard Berendsen

I send hidden variables from a form to a php. In the php
I have the following code to convert the global vars sent:

If  (isset($_GET['foo']))
$foo = $_GET['foo']
else
$foo = 0;

But this only works using the GET method!

Thanks for your answer.



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




[PHP] PHP Informix Win

2002-10-07 Thread Juraj Hasko

Hello,

I would like to know if someone uses PHP (on Win[9x,2k,xp]) connection
to Informix server in other way than trough ODBC. I'm trying do it, but
without any success.
Thank you in advance.

Juraj Hasko



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




[PHP] MAIL taking 60 seconds to send... (too long)

2002-10-07 Thread Negretti, John (CCI-San Diego)

Hello All,

I have a script which is using mail() to send an e-mail message.  It seems to 
be working, yet taking as long as 60-65 seconds just to send the e-mail.  The e-mail 
has no attachments and only has one line in it.  Does anyone have experience with this 
issue.  I am using PHP/4.0.6 on Linux Redhat with Apache/1.3.22.  Also, not to 
mention when I test it with IIS, I get a Failed to Receive error.  Thanks for any 
help.

John Negretti


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




Re: [PHP] eregi_replace help

2002-10-07 Thread Marco Tabini

Jennifer--

A couple of things. eregi_replace does not have a limitation parameter,
which means that if you use it *all* the strings that match your pattern
will be replace with the new pattern. In your case, if I read your code
correctly (and I may not--I'm doing this from memory), the eregi
replacement you perform will change *all* the paths you have in your
file, and not just the first one, which, I believe, is what you're
looking for. 

Also, there shouldn't be any need to make the replacements one by one. A
single replacement should be enough if all the original paths have to be
transformed into the same URL.

For example:

ereg_replace ({/images/}{test.(jpg|gif)},
http://www.microsoft.com/images/\\2;, $t);

This would replace any occurrence of /images/*.gif and /images/*.jpg
to http://www.microsoft.com/images/*.gif; or *.jpg respectively (once
again, double check my regex...doing this from memory). If you *do* need
to change each occurrence individually, then you should use preg()
instead, which uses Perl syntax and has a limitation parameter.

Also--a minor thing and I'm sure you thought of it, but you're not
saving the file at the end :-)

Hope this helps.

Cheers,


Marco

On Mon, 2002-10-07 at 20:01, Jennifer Swofford wrote:
 Hello all,
 
 I am trying to use php to read through an html file and replace all image
 paths, like such:
 
 Change images/firstimage.gif to http://www.blah.com/firstimage.gif; ...
 Change somesuch/images/secondimage.jpg to
 http://www.blah.com/secondimage.jpg;
 
 So I am going through the file and matching the image path strings,
 stripping them down to just the image name using basename, and then adding
 http://www.blah.com/; onto the beginning of them.  Except it's not working,
 and I'm not sure where my logic has gone awry.  Instead of replacing each
 image path with its respective image name, it is replacing all image paths
 with the *same* image name.
 
 Here is the code.  (Yes I'm new, I apologize for the mess, there are a few
 lines in there I'm using for debugging purposes, to show me what it's
 doing.)
 
 ?
 $filename = newexample.html;
 $fd = fopen ($filename, r);
 $contents = fread ($fd, filesize ($filename));
 
 while (preg_match('{()([A-z0-9_/-](\/))*[A-z0-9_/-]+(.gif|.jpg)}',
 $contents, $matches)) {
 
 echo bMATCHED:/b .$matches[0].br\n;
 
 $base = basename($matches[0]);
 $newimage = http://www.blah.com/.$base;
 echo brbase: .$base.br;
 echo new image: .$newimage.br;
 echo hr;
 
 $contents = eregi_replace('\/*[A-z0-9_/-]+(.gif|.jpg)', $newimage,
 $contents);
 
 print $contents;
 
 }
 
 fclose ($fd);
 
 ?
 
 When I run it, I get:
 
 ~
 MATCHED: blah/images/first.gif
 
 base: first.gif
 new image: http://www.blah.com/first.gif
 
 Here it prints the contents of the html file, except all images look like
 http://www.blah.com/first.gif; (when there are supposed to be lots of other
 images, such as second.jpg, etc).
 ~
 
 Where have I gone wrong?  Thanks to all, as usual, for your hints and help.
 
 Jen
 
 
 -- 
 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] MAIL taking 60 seconds to send... (too long)

2002-10-07 Thread Marco Tabini

Hey John--

Couple of ideas:

1) Is your sendmail configured as a relay? As such your PHP process may
have to wait for the e-mail to be relayed before returning, which might
explain why it's taking so long. The same might happen if your machine
is very busy (although that has never happened to me)

2) Under IIS, you must configure a mail server in order for mail() to
work, because Windows does not have an MTA similar to sendmail installed
by default. You can do so in your php.ini file. Note that the MTA
doesn't have to be on a separate computer--if you use Windows SMTP and
configure it properly it should do just fine to use localhost as your
mail host.

Hope this helps.


Marco

On Mon, 2002-10-07 at 12:25, Negretti, John (CCI-San Diego) wrote:
 Hello All,
 
   I have a script which is using mail() to send an e-mail message.  It seems to 
be working, yet taking as long as 60-65 seconds just to send the e-mail.  The e-mail 
has no attachments and only has one line in it.  Does anyone have experience with 
this issue.  I am using PHP/4.0.6 on Linux Redhat with Apache/1.3.22.  Also, 
not to mention when I test it with IIS, I get a Failed to Receive error.  Thanks 
for any help.
 
 John Negretti
 
 
 -- 
 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] parsing variables through webpages

2002-10-07 Thread Marco Tabini

You can use $_POST in a similar fashion to retrieve values from form
that have been posted with the POST method. 

Also, you can use $_REQUEST to catch both at the same time. In this
case, you may have a problem if the same variable is passed through both
GET and POST, in that one will override the other depending on how your
php.ini is set up.


On Mon, 2002-10-07 at 12:19, Edgard Berendsen wrote:
 I send hidden variables from a form to a php. In the php
 I have the following code to convert the global vars sent:
 
 If  (isset($_GET['foo']))
 $foo = $_GET['foo']
 else
 $foo = 0;
 
 But this only works using the GET method!
 
 Thanks for your answer.
 
 
 
 -- 
 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] running slow on Win2k

2002-10-07 Thread @ Edwin

Peter,

On Tuesday, October 8, 2002 12:40 AM
Support  Fourthrealm.com wrote:
 Edwin,
 I have no interest in getting into a Win2K/Linux debate.  There are
 strengths and reasons for using both systems.


Of course... Most of the time I code on my Windoze machine. (Besides, I use
it most of the time for writing to the ML :) But the only test server I have
is a linux box.

 I run other applications (ASP, .NET, iHTML, MSSQL) without any problems,
 and they all work very quickly.  Win2K is my primary development
 environment as it matches the systems my clients use.

...also I use Windoze browsers for testing...

 So, I just need to know if there are some tweaks I should be considering
to
 speed up PHP?

I see. (Sorry about my first comment.)

Well, I'm not really aware of any (ini) settings that would drastically
change the speed PHP. However, there are some programming techniques
(already discussed in the list) that would speed up your scripts. (e.g.,
caching the results of your sql query on a text file and calling that file
later on perhaps, etc.) But if you're already doing something similar, I
guess, the bottleneck would be the hardware.

Add more RAMs if possible, change to a faster harddisk (SCSI or use RAID),
get another PIII-800 and upgrade your motherboard to dual CPU, etc.--I'm
sure your boss (if you have one and if you can convince him/her that it's
necessary) will even be happy to get you a new workstation. You're running a
lot of other applications so I'm pretty sure you'll benefit from a faster
machine.

Why do the other app run faster? I don't really know. But, maybe, IIS is
just friendlier with its relatives...

Just my opinion...

- E

[snip]

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




Re: [PHP] Includes

2002-10-07 Thread Bryan Koschmann - GKT

Yes that is the proper usage.

Maybe you could check the referrer and only display if from the webserver?
I can't remember if a .htaccess would work with that sort of thing, as
password protecting would of course require a password :) Unless this
isn't a public site and you want a password.

Bryan


 On Mon, 7 Oct 2002, Rick Beckman wrote:

|I'm wanting to use PHP to make updating an entire site easier by using
|include() [I think that's the function] to include navigation bars, notices,
|etc. on multiple pages. What's the best way to do that, and is it possible
|to keep the included files from being indexed/viewed on their own (possibly
|by password protecting [htaccess] the directory they are in)? Thanks in
|advance for any help.
|
|


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




Re: [PHP] MAIL taking 60 seconds to send... (too long)

2002-10-07 Thread @ Edwin

Hello,

Perhaps, a DNS setting problem?

- E

On Tuesday, October 08, 2002 1:25 AM
Negretti, John (CCI-San Diego) wrote:


Hello All,

I have a script which is using mail() to send an e-mail message.  It seems
to be working, yet taking as long as 60-65 seconds just to send the e-mail.
The e-mail has no attachments and only has one line in it.  Does anyone have
experience with this issue.  I am using PHP/4.0.6 on Linux Redhat with
Apache/1.3.22.  Also, not to mention when I test it with IIS, I get a
Failed to Receive error.  Thanks for any help.

John Negretti


--
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] MAIL taking 60 seconds to send... (too long)

2002-10-07 Thread Brad Pauly

Maybe your /etc/hosts file.

What does you maillog say?

# tail /var/log/maillog

Brad

On Mon, 2002-10-07 at 10:52,  Edwin wrote:
 Hello,
 
 Perhaps, a DNS setting problem?
 
 - E
 
 On Tuesday, October 08, 2002 1:25 AM
 Negretti, John (CCI-San Diego) wrote:
 
 
 Hello All,
 
 I have a script which is using mail() to send an e-mail message.  It seems
 to be working, yet taking as long as 60-65 seconds just to send the e-mail.
 The e-mail has no attachments and only has one line in it.  Does anyone have
 experience with this issue.  I am using PHP/4.0.6 on Linux Redhat with
 Apache/1.3.22.  Also, not to mention when I test it with IIS, I get a
 Failed to Receive error.  Thanks for any help.
 
 John Negretti
 
 
 --
 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




Re: [PHP] Includes

2002-10-07 Thread @ Edwin

Yes, you can use .htacess for that purpose though you don't need to password
protect the folder. I'm sure if you check the archives you'll find a way to
do it.

Something like this: (Thanks to Justin)

http://marc.theaimsgroup.com/?l=php-generalm=103266066416399w=2

- E

On Tuesday, October 8, 2002 1:40 AM
Bryan Koschmann - GKT wrote:
 Yes that is the proper usage.

 Maybe you could check the referrer and only display if from the webserver?
 I can't remember if a .htaccess would work with that sort of thing, as
 password protecting would of course require a password :) Unless this
 isn't a public site and you want a password.

 Bryan


  On Mon, 7 Oct 2002, Rick Beckman wrote:

 |I'm wanting to use PHP to make updating an entire site easier by using
 |include() [I think that's the function] to include navigation bars,
notices,
 |etc. on multiple pages. What's the best way to do that, and is it
possible
 |to keep the included files from being indexed/viewed on their own
(possibly
 |by password protecting [htaccess] the directory they are in)? Thanks in
 |advance for any help.
 |
 |


 --
 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] uploading files

2002-10-07 Thread Donahue Ben

I am uploading a gif file using
is_upload_file($filename) function.
I save the file with a file name img1.gif.  It seems
to work fine.  But when I delete the file img1.gif
then upload a different gif file and save it as
img1.gif,  it displays the first image i uploaded not
the most recent one, why is this?  Is there a way to
get around it?

Ben

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com

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




[PHP] Source files (.phps) cutting off prematurely

2002-10-07 Thread Jason Young

Hey guys and gals...

I'm not sure if this is Apache, PHP, or a browser issue.. but..

.phps files get cut off while trying to access them in a browser.. 
anyone ever have a problem with this?

I can't exactly calculate where in any particular file its doing this, 
but refreshing the page causes it to stop in the same place, so its not 
random..

Any help would be appreciated
-Jason


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




[PHP] Re: uploading files

2002-10-07 Thread Jason Young

How are you handling the transfer of files between its temporary area 
and where it's going to be stored?

If you're copying instead of moving, I would imagine the file in the 
temp directory would still be present.

-Jason


Donahue Ben wrote:
 I am uploading a gif file using
 is_upload_file($filename) function.
 I save the file with a file name img1.gif.  It seems
 to work fine.  But when I delete the file img1.gif
 then upload a different gif file and save it as
 img1.gif,  it displays the first image i uploaded not
 the most recent one, why is this?  Is there a way to
 get around it?
 
 Ben
 
 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com


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




Re: [PHP] Re: uploading files

2002-10-07 Thread Kevin Stone

Possibly.  But temp files created during execution should be destroyed when
the script exists. So either copying or moving shouldn't make any
difference.  Besides that I think the difference is strictly semantic.
Another possibility is that this is a browser cache issue.
-Kevin

- Original Message -
From: Jason Young [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 11:24 AM
Subject: [PHP] Re: uploading files


 How are you handling the transfer of files between its temporary area
 and where it's going to be stored?

 If you're copying instead of moving, I would imagine the file in the
 temp directory would still be present.

 -Jason


 Donahue Ben wrote:
  I am uploading a gif file using
  is_upload_file($filename) function.
  I save the file with a file name img1.gif.  It seems
  to work fine.  But when I delete the file img1.gif
  then upload a different gif file and save it as
  img1.gif,  it displays the first image i uploaded not
  the most recent one, why is this?  Is there a way to
  get around it?
 
  Ben
 
  __
  Do you Yahoo!?
  Faith Hill - Exclusive Performances, Videos  More
  http://faith.yahoo.com


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



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




Re: [PHP] uploading files

2002-10-07 Thread 1LT John W. Holmes

How are you deleting the file? How are you moving the temp file to the
permanent area? Are you sure it's not a browser cache issue?

---John Holmes...

- Original Message -
From: Donahue Ben [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 1:22 PM
Subject: [PHP] uploading files


 I am uploading a gif file using
 is_upload_file($filename) function.
 I save the file with a file name img1.gif.  It seems
 to work fine.  But when I delete the file img1.gif
 then upload a different gif file and save it as
 img1.gif,  it displays the first image i uploaded not
 the most recent one, why is this?  Is there a way to
 get around it?

 Ben

 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com

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



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




[PHP] Chat with php

2002-10-07 Thread Oliver Witt

I attempted to write a oage that you can chat on with php. It ended up
being a page that reloads itself all the time which isn't really what I
wanted. But I didn't know how to do it differently. Is there another
way? I heard something about flush()?
Kind regards,
Oliver


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




Re: [PHP] File download doesn't work with SSL

2002-10-07 Thread Rouvas Stathis

John,

problem is broken HTTP/1.1 implementation of Internet Exploder.
Make your server downgrade to HHTP/1.0.
e.g. for apache:

example
IfModule mod_setenvif.c

#
# The following directives modify normal HTTP response behavior.
# The first directive disables keepalive for Netscape 2.x and
browsers that
# spoof it. There are known problems with these browser
implementations.
# The second directive is for Microsoft Internet Explorer 4.0b2
# which has a broken HTTP/1.1 implementation and does not properly
# support keepalive when it is used on 301 or 302 (redirect)
responses.
#
BrowserMatch Mozilla/2 nokeepalive
BrowserMatch MSIE nokeepalive downgrade-1.0 force-response-1.0

#
# The following directive disables HTTP/1.1 responses to browsers
which
# are in violation of the HTTP/1.0 spec by not being able to grok a
# basic 1.1 response.
#
BrowserMatch RealPlayer 4\.0 force-response-1.0
BrowserMatch Java/1\.0 force-response-1.0
BrowserMatch JDK/1\.0 force-response-1.0

/IfModule
/example

copy BrowserMatch line in SSL virtual server section too.

-Stathis.

Rasmus Lerdorf wrote:
 
 Nope, PHP does not send that.
 
 On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
 
  I believe in miracles. I have searched Microsoft and the first link was
  actually related to my problem...
 
  Okay, I found an IE issue where downloads over SSL will choke when you send
  a no-cache header. It says to use a no-store cache-control header, instead.
  I tried this:
 
  header(cache-control: no-store);
  header(content-type: application/vnd.ms-excel; name='excel');
  header(content-disposition: attachment; filename= . $filename .
  .xls);
 
  and I'm still getting the same thing. Is the no-cache cache-control header
  sent automatically by PHP at all? I don't have one set explicitly in my
  code.
 
  Any help is appreciated.
 
  ---John Holmes...
 
  - Original Message -
  From: Rasmus Lerdorf [EMAIL PROTECTED]
  To: 1LT John W. Holmes [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Monday, October 07, 2002 10:08 AM
  Subject: Re: [PHP] File download doesn't work with SSL
 
 
   Does it work with a different browser?  Smells like an IE bug to me.
  
   On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
  
Everyone,
   
I've had a simple download script working where a user would click on a
  link and the program would send word or excel headers instead of HTML. The
  file would then be opened in the appropriate program and the user could
  save/edit it.
   
Now that we've loaded everything under SSL, it doesn't work.
   
Here are the headers I send:
   
header(content-type: application/vnd.ms-excel; name='excel');
header(content-disposition: attachment; filename= . $filename .
  .xls);
   
Now, the pages in question are just regular HTML tables. If there is a
  export2=excel in the URL, then these two additional headers will be sent.
  The dialog to save/open the file pops up, but when you try to open/save the
  file, IE says it cannot be found. If I put in a echo before these two
  headers (or comment them out), the page is shown correctly as HTML, so the
  code is correct.
   
Are there any special headers I have to send to enable this file
  download while under SSL, or is it something else I'm overlooking?
   
Thanks for any help.
   
---John Holmes...
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Rouvas Stathis
[EMAIL PROTECTED]
http://www.di.uoa.gr/~rouvas

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




Re: [PHP] Chat with php

2002-10-07 Thread Robert Cummings

You can have your script enter a loop to check for data in a database.
If data output it then calls the flush() function to output to the browser.
Then sleep for some time, then wakeup and repeat. You may have issues
with some browsers using this technique, but generally it does work.
The key is that you never close the connection to the browser. You'll
also want to occasionally output some invisible content, otherwise the
connection_status() stuff never give the right value (at least not in
4.1.2) It struck me that these functions update their flags on output
only. Which means you need to output something to the browser to detect
that the user has hit stop, or has disconnected.

Cheers,
Rob.

Oliver Witt wrote:
 
 I attempted to write a oage that you can chat on with php. It ended up
 being a page that reloads itself all the time which isn't really what I
 wanted. But I didn't know how to do it differently. Is there another
 way? I heard something about flush()?
 Kind regards,

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Chat with php

2002-10-07 Thread Marco Tabini

But, Robert, doesn't this technique leave a connection open on the
server--and, won't it cause the server to run out of resources after a
very finite number of connections has been established?


Marco

On Mon, 2002-10-07 at 14:07, Robert Cummings wrote:
 You can have your script enter a loop to check for data in a database.
 If data output it then calls the flush() function to output to the browser.
 Then sleep for some time, then wakeup and repeat. You may have issues
 with some browsers using this technique, but generally it does work.
 The key is that you never close the connection to the browser. You'll
 also want to occasionally output some invisible content, otherwise the
 connection_status() stuff never give the right value (at least not in
 4.1.2) It struck me that these functions update their flags on output
 only. Which means you need to output something to the browser to detect
 that the user has hit stop, or has disconnected.
 
 Cheers,
 Rob.
 
 Oliver Witt wrote:
  
  I attempted to write a oage that you can chat on with php. It ended up
  being a page that reloads itself all the time which isn't really what I
  wanted. But I didn't know how to do it differently. Is there another
  way? I heard something about flush()?
  Kind regards,
 
 -- 
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'
 
 -- 
 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] Chat with php

2002-10-07 Thread Brad Dameron


Another way is to use javascript with PHP to pull the database every so many
seconds. I have seen this in I think it was PHPChat. Been a long time
however.

---
Brad Dameron
Network Account Executive
TSCNet Inc.
 www.tscnet.com
Silverdale, WA. 
1-888-8TSCNET



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 07, 2002 11:07 AM
 To: Oliver Witt
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Chat with php


 You can have your script enter a loop to check for data in a database.
 If data output it then calls the flush() function to output to
 the browser.
 Then sleep for some time, then wakeup and repeat. You may have issues
 with some browsers using this technique, but generally it does work.
 The key is that you never close the connection to the browser. You'll
 also want to occasionally output some invisible content, otherwise the
 connection_status() stuff never give the right value (at least not in
 4.1.2) It struck me that these functions update their flags on output
 only. Which means you need to output something to the browser to detect
 that the user has hit stop, or has disconnected.

 Cheers,
 Rob.

 Oliver Witt wrote:
 
  I attempted to write a oage that you can chat on with php. It ended up
  being a page that reloads itself all the time which isn't really what I
  wanted. But I didn't know how to do it differently. Is there another
  way? I heard something about flush()?
  Kind regards,

 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'

 --
 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] Chat with php

2002-10-07 Thread Marco Tabini

Simple trick (well, not so simple, but kind of a Columbus' Egg):

1) Create an img tag in your web page that is hidden

2) Point the img tag to a php script that returns:

1) An image with a pixel width of 1 if there is new data to pick
   up from the server
2) An image with a pixel width of 0 otherwise

3) Create a javascript that refreshes the image every second (or every
two seconds, or however often you feel necessary--the more often, the
more responsive and real time your chat system will be).

4) Add an OnLoad event to the img tag that points to a Javascript that
checks the width of the newly reloaded image. If the width is one, then
you reload your chat text content (which you may want to put in an
iframe to avoid having to reload the whole page).

I don't have a script to show unfortunately, as it would probably be too
complicated and long for the list (and I have no time to write
it...sigh), but hopefully, this will give you the gist of it.

Cheers,


Marco

On Mon, 2002-10-07 at 13:43, Oliver Witt wrote:
 I attempted to write a oage that you can chat on with php. It ended up
 being a page that reloads itself all the time which isn't really what I
 wanted. But I didn't know how to do it differently. Is there another
 way? I heard something about flush()?
 Kind regards,
 Oliver
 
 
 -- 
 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] Sockets

2002-10-07 Thread Asmodean

Hey everyone,

Does anybody know what the current support / functionality for PHP
with sockets is? According to the documentation, all the socket_
functions should be included in PHP = 4.1.0. I'm currently running
4.2.1 and PHP doesn't seem to recognize these functions (socket_send,
socket_write, etc).

Anybody know if there's anything special I have to do to get it
working?

// Asmodean


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




Re: [PHP] Chat with php

2002-10-07 Thread Oliver Witt

Brad Dameron schrieb:

 Another way is to use javascript with PHP to pull the database every so many
 seconds. I have seen this in I think it was PHPChat. Been a long time
 however.


Well, that's pretty much how I've done it. And it is pretty crappy...
Olli



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




Re: [PHP] File download doesn't work with SSL

2002-10-07 Thread 1LT John W. Holmes

Stathis,

Thanks for the tip. Any idea how to fix IIS regarding this issue?

---John  Holmes...

- Original Message -
From: Rouvas Stathis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: 1LT John W. Holmes [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 2:00 PM
Subject: Re: [PHP] File download doesn't work with SSL


 John,

 problem is broken HTTP/1.1 implementation of Internet Exploder.
 Make your server downgrade to HHTP/1.0.
 e.g. for apache:

 example
 IfModule mod_setenvif.c

 #
 # The following directives modify normal HTTP response behavior.
 # The first directive disables keepalive for Netscape 2.x and
 browsers that
 # spoof it. There are known problems with these browser
 implementations.
 # The second directive is for Microsoft Internet Explorer 4.0b2
 # which has a broken HTTP/1.1 implementation and does not properly
 # support keepalive when it is used on 301 or 302 (redirect)
 responses.
 #
 BrowserMatch Mozilla/2 nokeepalive
 BrowserMatch MSIE nokeepalive downgrade-1.0 force-response-1.0

 #
 # The following directive disables HTTP/1.1 responses to browsers
 which
 # are in violation of the HTTP/1.0 spec by not being able to grok a
 # basic 1.1 response.
 #
 BrowserMatch RealPlayer 4\.0 force-response-1.0
 BrowserMatch Java/1\.0 force-response-1.0
 BrowserMatch JDK/1\.0 force-response-1.0

 /IfModule
 /example

 copy BrowserMatch line in SSL virtual server section too.

 -Stathis.

 Rasmus Lerdorf wrote:
 
  Nope, PHP does not send that.
 
  On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
 
   I believe in miracles. I have searched Microsoft and the first link
was
   actually related to my problem...
  
   Okay, I found an IE issue where downloads over SSL will choke when you
send
   a no-cache header. It says to use a no-store cache-control header,
instead.
   I tried this:
  
   header(cache-control: no-store);
   header(content-type: application/vnd.ms-excel; name='excel');
   header(content-disposition: attachment; filename= . $filename .
   .xls);
  
   and I'm still getting the same thing. Is the no-cache cache-control
header
   sent automatically by PHP at all? I don't have one set explicitly in
my
   code.
  
   Any help is appreciated.
  
   ---John Holmes...
  
   - Original Message -
   From: Rasmus Lerdorf [EMAIL PROTECTED]
   To: 1LT John W. Holmes [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Monday, October 07, 2002 10:08 AM
   Subject: Re: [PHP] File download doesn't work with SSL
  
  
Does it work with a different browser?  Smells like an IE bug to me.
   
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
   
 Everyone,

 I've had a simple download script working where a user would click
on a
   link and the program would send word or excel headers instead of HTML.
The
   file would then be opened in the appropriate program and the user
could
   save/edit it.

 Now that we've loaded everything under SSL, it doesn't work.

 Here are the headers I send:

 header(content-type: application/vnd.ms-excel;
name='excel');
 header(content-disposition: attachment; filename= .
$filename .
   .xls);

 Now, the pages in question are just regular HTML tables. If there
is a
   export2=excel in the URL, then these two additional headers will be
sent.
   The dialog to save/open the file pops up, but when you try to
open/save the
   file, IE says it cannot be found. If I put in a echo before these two
   headers (or comment them out), the page is shown correctly as HTML, so
the
   code is correct.

 Are there any special headers I have to send to enable this file
   download while under SSL, or is it something else I'm overlooking?

 Thanks for any help.

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

 --
 Rouvas Stathis
 [EMAIL PROTECTED]
 http://www.di.uoa.gr/~rouvas

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

2002-10-07 Thread Marco Tabini

Yep, if you're using UNIX and compiling from source, you must add this
switch to the command line when you're configuring and compiling PHP:

 --enable-sockets

(e.g.: ./configure --enable-sockets). If you're using a prepackaged
version (RPM or Windows) then you should look into the documentation for
your version to see if this extension was included when the package was
compiled from the source.

Cheers,


Marco

On Mon, 2002-10-07 at 14:22, Asmodean wrote:
 Hey everyone,
 
 Does anybody know what the current support / functionality for PHP
 with sockets is? According to the documentation, all the socket_
 functions should be included in PHP = 4.1.0. I'm currently running
 4.2.1 and PHP doesn't seem to recognize these functions (socket_send,
 socket_write, etc).
 
 Anybody know if there's anything special I have to do to get it
 working?
 
 // Asmodean
 
 
 -- 
 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] Chat with php

2002-10-07 Thread Marco Tabini

Oliver--

I'm afraid I wasn't too clear! If you do it the way I'm suggesting, your
page will look like it's reloading ONLY when there is new data
available, and not continuously. PHPChat is an example--it looks really
good and doesn't do any of the annoying things that reloading the page
usually does (like the stupid click click click in IE).


Marco

On Mon, 2002-10-07 at 14:25, Oliver Witt wrote:
 Brad Dameron schrieb:
 
  Another way is to use javascript with PHP to pull the database every so many
  seconds. I have seen this in I think it was PHPChat. Been a long time
  however.
 
 
 Well, that's pretty much how I've done it. And it is pretty crappy...
 Olli
 
 
 
 -- 
 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] edit simple text file

2002-10-07 Thread Hitesh Aidasani

Hello,
 
I have a question that I was hoping somebody here could answer or
atleast point me in the right direction.

I maintain a series of mailing lists for our organization.  Currently, I
edit the distribution lists myself, but I would like to offload this
administration to the departments themselves.  
 
Ideally, I could set up a web site that would let them edit the dist
file themselves, and then save the changes.  The php file would simply
load up a text file from a fixed location, and then display it in a
form.  The user could then edit and save the file to the same location
from where it was opened.  Basically, I need a very simple text editor
done in PHP.  Unfortunately, when I search for “PHP text editor” I get
development tools.
 
Any help would be greatly appreciated,
 
-Hitesh



Re: [PHP] Chat with php

2002-10-07 Thread Oliver Witt

Marco Tabini schrieb:

 Simple trick (well, not so simple, but kind of a Columbus' Egg):

 1) Create an img tag in your web page that is hidden

 2) Point the img tag to a php script that returns:

 1) An image with a pixel width of 1 if there is new data to pick
up from the server
 2) An image with a pixel width of 0 otherwise

 3) Create a javascript that refreshes the image every second (or every
 two seconds, or however often you feel necessary--the more often, the
 more responsive and real time your chat system will be).

 4) Add an OnLoad event to the img tag that points to a Javascript that
 checks the width of the newly reloaded image. If the width is one, then
 you reload your chat text content (which you may want to put in an
 iframe to avoid having to reload the whole page).

 I don't have a script to show unfortunately, as it would probably be too
 complicated and long for the list (and I have no time to write
 it...sigh), but hopefully, this will give you the gist of it.

 Cheers,

 Marco


Okay, that sounds like something i can do, i just need to know how to hide
and how to point the img tag at something.
Olli



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




Re: [Fwd: Re: [PHP] Chat with php]

2002-10-07 Thread Oliver Witt

Marco Tabini schrieb:

 Ok, off the top of my head (please don't be upset if it doesn't work
 right off, because I'm doing this from memory):

 Web page:

 script language=javascript

 function checkimage()
 {
 if (document.all.image1.width == 1)
 {
 document.all.fr1.src=http://www.mysite.com/chat.php;;
 }
 }

 function reloadimg()
 {
 document.all.image1.src=http://www.mysite.com/img.php;;
 setInterval (reloadimg(), 2000);  // every 2 secs
 }

 /script

 body
 iframe name=fr1 src=chat.php

 img style=display=none src=http://www.mysite.com/chat.php;
 onLoad=javascript:checkimage();
 /body

 In chat.php you simply push out whatever is in the database (the whole
 thing--or you come up with some method of just printing out what has
 changed since the last poll, which is trivial and beyond the point
 here).

 In img.php:

 ?

 function checkdb()
 {
 // This returns true if new data is available
 }

 $filename = (checkdb() ? '1pixel.gif' : '2pixel.gif');

 header (Content-type: image/gif);
 readfile ($filename);

 ?

 1pixel.gif is a one-pixel wide image, while 2pixel.gif is two pixels
 wide (it just occurred to me that you can't have a zero-pixels wide
 image, which would be quite pointless). The script basically reads in
 either file and spits it out after setting the content type.

 Once more, this script, as is, probably won't work because it was
 programmed in my messy head rather than in a proper PHP environment, but
 it should give you an idea of what needs to be done. In particular,
 remember to use the display CSS attribute rather than visibility so
 that the image will not take up any space on your page.

 Also, an apology--I seem to have mailed some messages twice by mistake.
 I was checking e-mail between eating my lunch and trying to get a tie on
 and things might have gotten a bit out of hand ;-)

 Let me know how it turns out!


Thanks, I will try that script as soon as I find some time, probably tomorrow.
But it seems to do the same thing as reloading would do: clicking all the time.
But I'll try it tomorrow.
Kind regards,
Oliver


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




Re: [PHP] Grabbing auto_increment during insert?

2002-10-07 Thread Marco Tabini

If you're using MySQL:

mysql_insert_id

If you're using MSSQL, you need to execute SELECT IDENTITY right after
your insertion operation. The result will give you the ID of your last
insertion. This won't work well if you're doing a bulk insert, though.


On Mon, 2002-10-07 at 15:46, Jason Young wrote:
 Apologies for what's probably an extremely newbie question..
 
 Is there any way to have a database return its auto_increment field 
 during insert?  I have two different tables, when one inserts, I'd like 
 to be able to assign the value of the new auto_increment field to 
 another field in another table.
 
 I guess I COULD go and make the second table auto_increment along with 
 it, but that would require a complete rewrite, and I'd like to avoid that...
 
 Anyone have ideas, suggestions, or preferably.. an answer to my question? :)
 
 Thanks
 -Jason
 
 
 -- 
 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] File download doesn't work with SSL

2002-10-07 Thread Rouvas Stathis

John,

sorry, don't know zip about IIS.
I got the info from
URL:http://www.squirrelmail.org/wiki/InternetExplorerVersusSSL though.
Maybe they have more to say...

-Stathis.

1LT John W. Holmes wrote:
 
 Stathis,
 
 Thanks for the tip. Any idea how to fix IIS regarding this issue?
 
 ---John  Holmes...
 
 - Original Message -
 From: Rouvas Stathis [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: 1LT John W. Holmes [EMAIL PROTECTED]
 Sent: Monday, October 07, 2002 2:00 PM
 Subject: Re: [PHP] File download doesn't work with SSL
 
  John,
 
  problem is broken HTTP/1.1 implementation of Internet Exploder.
  Make your server downgrade to HHTP/1.0.
  e.g. for apache:
 
  example
  IfModule mod_setenvif.c
 
  #
  # The following directives modify normal HTTP response behavior.
  # The first directive disables keepalive for Netscape 2.x and
  browsers that
  # spoof it. There are known problems with these browser
  implementations.
  # The second directive is for Microsoft Internet Explorer 4.0b2
  # which has a broken HTTP/1.1 implementation and does not properly
  # support keepalive when it is used on 301 or 302 (redirect)
  responses.
  #
  BrowserMatch Mozilla/2 nokeepalive
  BrowserMatch MSIE nokeepalive downgrade-1.0 force-response-1.0
 
  #
  # The following directive disables HTTP/1.1 responses to browsers
  which
  # are in violation of the HTTP/1.0 spec by not being able to grok a
  # basic 1.1 response.
  #
  BrowserMatch RealPlayer 4\.0 force-response-1.0
  BrowserMatch Java/1\.0 force-response-1.0
  BrowserMatch JDK/1\.0 force-response-1.0
 
  /IfModule
  /example
 
  copy BrowserMatch line in SSL virtual server section too.
 
  -Stathis.
 
  Rasmus Lerdorf wrote:
  
   Nope, PHP does not send that.
  
   On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
  
I believe in miracles. I have searched Microsoft and the first link
 was
actually related to my problem...
   
Okay, I found an IE issue where downloads over SSL will choke when you
 send
a no-cache header. It says to use a no-store cache-control header,
 instead.
I tried this:
   
header(cache-control: no-store);
header(content-type: application/vnd.ms-excel; name='excel');
header(content-disposition: attachment; filename= . $filename .
.xls);
   
and I'm still getting the same thing. Is the no-cache cache-control
 header
sent automatically by PHP at all? I don't have one set explicitly in
 my
code.
   
Any help is appreciated.
   
---John Holmes...
   
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
   
   
 Does it work with a different browser?  Smells like an IE bug to me.

 On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:

  Everyone,
 
  I've had a simple download script working where a user would click
 on a
link and the program would send word or excel headers instead of HTML.
 The
file would then be opened in the appropriate program and the user
 could
save/edit it.
 
  Now that we've loaded everything under SSL, it doesn't work.
 
  Here are the headers I send:
 
  header(content-type: application/vnd.ms-excel;
 name='excel');
  header(content-disposition: attachment; filename= .
 $filename .
.xls);
 
  Now, the pages in question are just regular HTML tables. If there
 is a
export2=excel in the URL, then these two additional headers will be
 sent.
The dialog to save/open the file pops up, but when you try to
 open/save the
file, IE says it cannot be found. If I put in a echo before these two
headers (or comment them out), the page is shown correctly as HTML, so
 the
code is correct.
 
  Are there any special headers I have to send to enable this file
download while under SSL, or is it something else I'm overlooking?
 
  Thanks for any help.
 
  ---John Holmes...

   
  

-- 
Rouvas Stathis
[EMAIL PROTECTED]
http://www.di.uoa.gr/~rouvas

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




Re: [PHP] eregi_replace help

2002-10-07 Thread Jennifer Swofford

Thank you Marco!

Between your post and the other stuff I happened to find at the same time, I
got it working.  Turned out I was making it much more difficult than it had
to be.  I ended up with:

?
$filename = newexample.html;
$fd = fopen ($filename, r);
$contents = fread ($fd, filesize ($filename));

$contents =
preg_replace(/(\)([A-z0-9]+(\/))*([A-z0-9]+)(\.)(jpg|gif)(\)/,
\http://www.blah.com/$4.$6\;, $contents);

echo $contents;
fclose ($fd);
?

Lo and behold, it works.  Thanks all!

Jen

--- Marco Tabini [EMAIL PROTECTED] wrote:
 Jennifer--

 A couple of things. eregi_replace does not have a
 limitation parameter,
 which means that if you use it *all* the strings
 that match your pattern
 will be replace with the new pattern. In your case,
 if I read your code
 correctly (and I may not--I'm doing this from
 memory), the eregi
 replacement you perform will change *all* the paths
 you have in your
 file, and not just the first one, which, I believe,
 is what you're
 looking for.

 Also, there shouldn't be any need to make the
 replacements one by one. A
 single replacement should be enough if all the
 original paths have to be
 transformed into the same URL.

 For example:

 ereg_replace ({/images/}{test.(jpg|gif)},
 http://www.microsoft.com/images/\\2;, $t);

 This would replace any occurrence of /images/*.gif
 and /images/*.jpg
 to http://www.microsoft.com/images/*.gif; or *.jpg
 respectively (once
 again, double check my regex...doing this from
 memory). If you *do* need
 to change each occurrence individually, then you
 should use preg()
 instead, which uses Perl syntax and has a limitation
 parameter.

 Also--a minor thing and I'm sure you thought of it,
 but you're not
 saving the file at the end :-)

 Hope this helps.

 Cheers,


 Marco


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




Re: [PHP] how to build a webmail

2002-10-07 Thread Marco Tabini

Try this:

http://www.horde.org/imp/

On Mon, 2002-10-07 at 16:26, Nagib Abi Fadel wrote:
 
 Hi i want to build a webmail with PHP, can someone give me some guidelines.
 
 thx.
 
 
 
 -
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos,  more
 faith.yahoo.com



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




[PHP] Deleting multiple items from database using checkboxes

2002-10-07 Thread Davy Obdam

Hi people,.

I have a guestbook admin page were i would like to delete one item or
more items from the database if necessary. I have modified my normal
guestbookpage so that it has checkboxes in front of every entry. This is
my code:

input type=\checkbox\ name=\dele[]\ value=\.$sql['entryID'].\

Now i can select multiple items. But i have tried to delete em, but it
only deletes one item from the database, my query looks like this :
DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
for your time.


Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]



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




Re: [PHP] Deleting multiple items from database using checkboxes

2002-10-07 Thread Marco Tabini

Try WHERE EntryID IN ( . implode ($dele, ',') . )

However:

1) Anybody could fake a form post or query url to delete any data in
your database
2) It would also be possible to create a more dangerous post that could
give the attacker control over your entire database

Thus, I assume that you will want to put a *lot* of checking around that
code!


Marco

On Mon, 2002-10-07 at 16:05, Davy Obdam wrote:
 Hi people,.
 
 I have a guestbook admin page were i would like to delete one item or
 more items from the database if necessary. I have modified my normal
 guestbookpage so that it has checkboxes in front of every entry. This is
 my code:
 
 input type=\checkbox\ name=\dele[]\ value=\.$sql['entryID'].\
 
 Now i can select multiple items. But i have tried to delete em, but it
 only deletes one item from the database, my query looks like this :
 DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
 for your time.
 
 
 Best regards,
  
 Davy Obdam,
 mailto:[EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



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




[PHP] Re: [PHP-WIN] Deleting multiple items from database using checkboxes

2002-10-07 Thread Aitor

my querylooks like this :
DELETE  FROM gastenboek WHERE entryID=$dele .

I think that the mySQL query should look like:

DELETE * FROM gastenboek WHERE entryID=$dele

so, you should do something like this:

DELETE $thinks_to_delete FROM gastenboek WHERE entryID=$dele

After the DELETE you must say what to delete from the table. If you want
to delete more than one thing you should use more than one variable, one for
each entry.

I hope this help you because I'm a newbie with this. :)


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




Re: [PHP] Deleting multiple items from database using checkboxes

2002-10-07 Thread Ing. Raúl González Rodríguez

You can use the following code to delete multiple items:

  if(isset($dele)  (count($dele)  0)) {
 $sql = delete from gastenboek where (entryID='$dele[0]');
 for($i=1; $icount($dele); $i++)
  $sql .=  or (entryID='$dele[$i]');
 $res = mysql_query($sql, $connection);
  }

Raul

- Original Message -
From: Davy Obdam [EMAIL PROTECTED]
To: Php Mailinglist [EMAIL PROTECTED]; Php-Windows Mailing
[EMAIL PROTECTED]
Sent: Monday, October 07, 2002 4:05 PM
Subject: [PHP] Deleting multiple items from database using checkboxes


 Hi people,.

 I have a guestbook admin page were i would like to delete one item or
 more items from the database if necessary. I have modified my normal
 guestbookpage so that it has checkboxes in front of every entry. This is
 my code:

 input type=\checkbox\ name=\dele[]\ value=\.$sql['entryID'].\

 Now i can select multiple items. But i have tried to delete em, but it
 only deletes one item from the database, my query looks like this :
 DELETE  FROM gastenboek WHERE entryID=$dele . Can anyone help me. Thanks
 for your time.


 Best regards,

 Davy Obdam,
 mailto:[EMAIL PROTECTED]



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





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




[PHP] detecting POST variables

2002-10-07 Thread Anup

Hello, I have been dealing with different form proccessing PHP scripts. When
I start a new job I usually have a script that just takes the form POST
values and prints them to the screen, so I know what I'm working with.  Now
I have a question say the form has 1 field named FirstName. If the field
is left blank, sometimes my script will print the key and NO value, or it
will just print out nothing, ie NO key or value.

any ideas.  Could it be the server (IIS or Unix/Linux) of the form and the
server (IIS or Unix/Linux)  of the script.?
Since I do jobs for different people and environments any combination of
servers are possible.

The reason, for this post is that I don't know if I should always put code
to check for validilty using isset all the time or should I put it in just
in case the script gets moved. I want to pinpoint this so that I can write
more effective code.





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




RE: [PHP] parsing variables through webpages

2002-10-07 Thread David Freeman


  I send hidden variables from a form to a php. In the php
  I have the following code to convert the global vars sent:
  
  If  (isset($_GET['foo']))
  $foo = $_GET['foo']
  else
  $foo = 0;
  
  But this only works using the GET method!

If you're sending the variable using POST then use $_POST['foo']
instead.

You should consider the source of your information to help avoid
malicious code injection too.  If you _know_ that you've passed a
variable using GET then don't accept the same variable as POST and vice
versa.  You should probably also do some sanity checking on the data
that is passed to ensure that it's what you're expecting.  For example,
if you're passing a number then make sure you've actually got a number
instead of some malicious code that some net-nasty decided to feed to
your php script.

CYA, Dave




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




RE: [PHP] running slow on Win2k

2002-10-07 Thread David Freeman


  I have no interest in getting into a Win2K/Linux debate.  There are 
  strengths and reasons for using both systems.

Good for you, I was about to post something similar.  For the record my
dev environment is a laptop with a Celeron 1.2/256MB/WinXP Pro and it's
running Apache, MySQL and PHP just fine.  My production environment is
typically *nix in various flavours.

  So, I just need to know if there are some tweaks I should be 
  considering to speed up PHP?

How did you install the software?  There aren't particular tweaks that
I'm aware of.  I used to use PHPTriad or some such but when I moved to
XP Pro the version I had didn't seem to want to play the game so I went
out and downloaded the relevant Windows versions for each package and
installed them manually using the guides on the relevant web sites.  It
may have taken a little longer to do but it works perfectly - to the
point where I leave Apache and MySQL running permanently on my laptop
and they have little or no impact on the machine in normal use.

If you've installed from relevant Win versions then there shouldn't be
much tweaking to be done - particularly if you've followed the install
guides for each package. I found the install guides to be very good.

CYA, Dave




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




[PHP] Re: mail subjects and iso-8859-15

2002-10-07 Thread Manuel Lemos

Hello,

On 10/07/2002 06:32 PM, Kek Le Rouge wrote:
 Hello, I have configured a pop sever on my PC, and I'd like to enable poeple 
 to read ther mails from a http server (for those who haven't outlook in fact)
 Well, I manage to print the subjets of the mail, but if appears like that:
 
 pardon, j'ai tout =?iso-8859-15?q?effac=E9?=
 
 So, I'd love to find a function who would convert that into this
 
 pardon, j'ai tout effacé
 
 (sorry this is french, but ,well, it doesn't matter)
 Does this function exists, and else, where could I find the way to decript 
 it... 

That is q-encoding. You may want to try this MIME message composing and 
sending class that among other things can encode headers to support 
specific encodings:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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




[PHP] Referrer

2002-10-07 Thread Alex Shi

How can know the referrer of a script?
Let's say script B is linked from script/page A. Is it possible to
obtain A's name in script B?

Alex

-- 
---
TrafficBuilder Network: 
http://www.bestadv.net/index.cfm?ref=7029


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




RE: [PHP] Referrer

2002-10-07 Thread Timothy J Hitchens

You can't know the name of the script but you can know the complete URI
(if available) $_SERVER['HTTP_REFERER']


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-Original Message-
From: Alex Shi [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 8 October 2002 9:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Referrer


How can know the referrer of a script?
Let's say script B is linked from script/page A. Is it possible to
obtain A's name in script B?

Alex

-- 
---
TrafficBuilder Network: 
http://www.bestadv.net/index.cfm?ref=7029


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



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




[PHP] Re: detecting POST variables

2002-10-07 Thread nicos

You should use
foreach($_POST as $key = $value) {
echo $key.':'.$value;
}
Btw thats just an example to get all $_POST values, all superglobals are
arrays.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

Anup [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Hello, I have been dealing with different form proccessing PHP scripts.
When
 I start a new job I usually have a script that just takes the form POST
 values and prints them to the screen, so I know what I'm working with.
Now
 I have a question say the form has 1 field named FirstName. If the field
 is left blank, sometimes my script will print the key and NO value, or it
 will just print out nothing, ie NO key or value.

 any ideas.  Could it be the server (IIS or Unix/Linux) of the form and the
 server (IIS or Unix/Linux)  of the script.?
 Since I do jobs for different people and environments any combination of
 servers are possible.

 The reason, for this post is that I don't know if I should always put code
 to check for validilty using isset all the time or should I put it in just
 in case the script gets moved. I want to pinpoint this so that I can write
 more effective code.







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




[PHP] Database help

2002-10-07 Thread Jef

I am querying a database to populate a list. The list is suppose to start
with the first line of information in the database and continue untill have
been displayed.

The problem I am having is the first line in the database is not being
displayed. The display starts on the second line.

Here are the MySQL commands to retrieve the data...

 $fSelect = SELECT lot,size,price FROM properties WHERE status =
'Available' ORDER BY lot ASC;
 $fSql = mysql_query($fSelect, $db) or DIE(Unable to retrieve data);
$useFields = mysql_fetch_array($fSql, MYSQL_ASSOC);

The next line prints the lot field to the screen. The number printed to the
screen is the second lot number that matches this database query.

Any suggestions on how to get the first information displayed to the screen?




Jef



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




[PHP] Re: NEXT() and/or PREV()

2002-10-07 Thread nicos

sure, get an array with all your filenames, get the current position with
$_SERVER['PHP_SELF'] and then use next() or prev().

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

Jef [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 I need some help with the NEXT() and PREV() functions. I want to use them
 with a webpage to direct which page is viewed by the user. If NEXT is
 selected then I would like the next information pulled from the database.
If
 the PREV is selected I would like the previous information pulled from the
 database viewed.

 Any suggestions?
 I have gone through the manual on these two functions but nothing has
 worked.


 Thank you,
 Jef





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




[PHP] Re: detecting POST variables

2002-10-07 Thread Anup


This  is a snippet of what I use:
code
 foreach ($HTTP_POST_VARS  as $Index=$Value) {
  echo DEBUG ::: POST Key: $Index; POST Value: $Valuebr\n;
 }
/code
But I just want to know why sometimes when the form has empty values, that
sometimes it prints the key's name but not the actual value.
Assume the form has a textbox with name=FirstName, sometimes I get
DEBUG ::: POST Key: FirstName; POST Value:
OR
empty string
###
it looks like the first case has FirstName as a key in the POST array, where
as the latter doesn't.






[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You should use
 foreach($_POST as $key = $value) {
 echo $key.':'.$value;
 }
 Btw thats just an example to get all $_POST values, all superglobals are
 arrays.

 --

 Nicos - CHAILLAN Nicolas
 [EMAIL PROTECTED]
 www.WorldAKT.com - Hébergement de sites Internet

 Anup [EMAIL PROTECTED] a écrit dans le message de news:
 [EMAIL PROTECTED]
  Hello, I have been dealing with different form proccessing PHP scripts.
 When
  I start a new job I usually have a script that just takes the form POST
  values and prints them to the screen, so I know what I'm working with.
 Now
  I have a question say the form has 1 field named FirstName. If the
field
  is left blank, sometimes my script will print the key and NO value, or
it
  will just print out nothing, ie NO key or value.
 
  any ideas.  Could it be the server (IIS or Unix/Linux) of the form and
the
  server (IIS or Unix/Linux)  of the script.?
  Since I do jobs for different people and environments any combination of
  servers are possible.
 
  The reason, for this post is that I don't know if I should always put
code
  to check for validilty using isset all the time or should I put it in
just
  in case the script gets moved. I want to pinpoint this so that I can
write
  more effective code.
 
 
 
 





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




  1   2   >