Re: [PHP] distinct values from a mulit-dimensional array

2003-12-23 Thread Greg Donald

array_unique perhaps?

http://php.net/array_unique

--
Greg Donald
http://destiney.com/


- Original Message - 
From: "Chakravarthy Cuddapah" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, December 22, 2003 11:22 PM
Subject: [PHP] distinct values from a mulit-dimensional array


Can anyone pls tell me with an example on how to select distinct values from
a multi-dimensional array. Moving distinct values into another array is ok.

Thanks !

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



[PHP] phphandle form wont display data

2003-12-23 Thread Jack E. Wasserstein, DDS, Inc.
This must be obvious, but I am having trouble displaying the results of a
form in the php handler.

Here is the php code in the handler:

\n";
print " the referral date is $dateofreferral .\n";
print " the patients first name is $pfirst .\n";
print " the patients last name is $plast .\n";
print " the patients telephone number is $telephone .\n";
print " the referring doctor email is $refdremail .\n";
print " the upload is $imageupload \n";



?>

I am using the get action on the actual form and I can see all of the values
being passed to the script. The spellings of the

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



[PHP] pgp form handler will not display data

2003-12-23 Thread Jack E. Wasserstein, DDS, Inc.
There must be something obvious that I am missing but I cant get the php
form handler with the script below to display the vairables. The form which
sends this data has the correct field names. I am also using the get action,
so I can see the variables and values so I know that they are being passed
correctly to the form. On submit, the form below displays as follows below.

\n";
print " the referral date is $dateofreferral .\n";
print " the patients first name is $pfirst .\n";
print " the patients last name is $plast .\n";
print " the patients telephone number is $telephone .\n";
print " the referring doctor email is $refdremail .\n";
print " the upload is $imageupload \n";



?>

output from

patreferhandler.php?%24referringdr=sample+person&[EMAIL PROTECTED]
.com&dateofreferral=12%2F03%2F03&pfirst=clientfirst&plast=clientlast&telepho
ne=555-&imageupload=&Submit=Submit

the referring doctor is .
the referral date is .
the patients first name is .
the patients last name is .
the patients telephone number is .
the referring doctor email is .
the upload is


Thanks,

Jack

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



[PHP] Re: Https

2003-12-23 Thread Homer
Sorry, but not.

I have changed it to ssl and the message is the same:

Notice: fopen(): Unable to find the wrapper "ssl" - did you forget to enable
it when you configured PHP?

I can use nothing that is out of the standard php package, because I'm doing
a script for other users that can't change their php installation.

"Manuel Lemos" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hello,
>
> On 12/22/2003 05:26 AM, Homer wrote:
> > Notice: fopen(): Unable to find the wrapper "https" - did you forget to
> > enable it when you configured PHP? in
> > C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62
>
> The line above says it all. I think the right scheme name is ssl, not
> https .
>
> Alternatively you may want to use the Curl library. It is a bit more
> complicated but using this HTTP client class it becomes much simpler and
> you can make more complex request like posting forms and handling cookies.
>
> http://www.phpclasses.org/httpclient
>
>
> -- 
>
> Regards,
> Manuel Lemos
>
> Free ready to use OOP components written in PHP
> http://www.phpclasses.org/

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



php-general Digest 23 Dec 2003 09:39:16 -0000 Issue 2489

2003-12-23 Thread php-general-digest-help

php-general Digest 23 Dec 2003 09:39:16 - Issue 2489

Topics (messages 173199 through 173228):

Re: progress in PHP
173199 by: Steve Murphy
173200 by: David T-G
173203 by: Chris W. Parker
173204 by: Ed Curtis

Re: sorting a mulit-dimensional array
173201 by: Matt Grimm

Re: Fetch Information Via a link
173202 by: Eric Holmstrom

post var check failing?
173205 by: Jas

Boolean Searches using PHP and using File System fgetss
173206 by: Vernon

Re: overload() problem
173207 by: Cliff Wells

PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP
173208 by: Dale Hersh
173211 by: Larry Brown
173212 by: Chris W. Parker
173213 by: Larry Brown

using PDI to pull from data already read into a variable?
173209 by: Larry Brown

Re: HTTP headers, IE and downloading
173210 by: Andreas Korthaus
173214 by: Larry Brown
173221 by: Manuel Lemos

UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
173215 by: Dale Hersh
173218 by: Robert Cummings
173219 by: Jake McHenry
173220 by: Justin French

Re: File Upload on a MAC-Browser didn't work
173216 by: Chris

Can't upload file greater than 11kb
173217 by: Chris

Re: Https
173222 by: Manuel Lemos
173228 by: Homer

distinct values from a mulit-dimensional array
173223 by: Chakravarthy Cuddapah
173225 by: Greg Donald

Dilema
173224 by: Jake McHenry

phphandle form wont display data
173226 by: Jack E. Wasserstein, DDS, Inc.

pgp form handler will not display data
173227 by: Jack E. Wasserstein, DDS, Inc.

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]


--
--- Begin Message ---
Well its actually a pure PHP upload meter it just uses JS to open the window. You 
could make PHP open the window as well with a little tweaking.

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 3:16 PM
To: [EMAIL PROTECTED]
Cc: Steve Murphy
Subject: Re: [PHP] Re: progress in php


Steve --

...and then Steve Murphy said...
% 
% David,
% A window will popup with the progress meter. Obviously don't block popups and try 
using a larger file if you have a high speed line, it takes a second for the meter to 
start and if the upload is done it won't popup properly.

Ah.  Since I don't use javascript I probably won't get a lot out of it :-)

Darn; I was hoping for something non-JS.  I guess I'll stick with my
browser status window.


% 
% Steve


Thanks & HAND & Happy Holidays

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

--- End Message ---
--- Begin Message ---
Steve, et al --

...and then Steve Murphy said...
% 
% Well its actually a pure PHP upload meter it just uses JS to open the window. You 
could make PHP open the window as well with a little tweaking.

Now that might interest me.  So what has been added to the PHP codebase
that makes this work?  And what tweaking would I need to do?  [Can't I
just have it display in the current window?  Why bother with a popup?]


Thanks & HAND & Happy Holidays

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



pgp0.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Steve Murphy 
on Monday, December 22, 2003 1:03 PM said:

> Well its actually a pure PHP upload meter it just uses JS to open the
> window. You could make PHP open the window as well with a little
> tweaking.

Unless I'm missing something here this is incorrect. PHP does not bother
the client side except to send data, i.e. html/javascript/etc.

On another note:

A possible solution might be to load the popup page in an iframe instead
of popping a new window. afaik you can't open a window with plain html
without a manual click?



chris.
--- End Message ---
--- Begin Message ---


> Now that might interest me.  So what has been added to the PHP codebase
> that makes this work?  And what tweaking would I need to do?  [Can't I
> just have it display in the current window?  Why bother with a popup?]

>From rumors I've heard on the list a future version of PHP may have a
progress bar function built in. Don't know if it's true or not but it
would be nice.

Ed
--- End Message ---
---

[PHP] Re: pgp form handler will not display data

2003-12-23 Thread Pavel Jartsev
Jack E. Wasserstein wrote:
There must be something obvious that I am missing but I cant get the php
form handler with the script below to display the vairables. The form which
sends this data has the correct field names. I am also using the get action,
so I can see the variables and values so I know that they are being passed
correctly to the form. On submit, the form below displays as follows below.


print " the referring doctor is $referringdr .\n";
...
Better try to use superglobals like $_GET, $_POST or $_REQUEST.

Eg.:
\n";
// etc...
?>
--
Pavel a.k.a. Papi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: need help getting one variable

2003-12-23 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> hello all i need help to enter one variable in a cookie and then retreive it back 
> later, i know this probably sounds dumb to most but this is really the first time 
> ive tried working with cookies so please bear with me, thanks for any help.
> 

http://www.php.net/setcookie is a good starting point.

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: HTTP headers, IE and downloading

2003-12-23 Thread Andreas Magnusson
Thank you for your reply!


> AFAIK the headers sent here are:
>
>  'Content-Type'  => 'application/x-octetstream', (perhaps other)
>  'Cache-Control' => 'public',
>  'Accept-Ranges' => 'bytes',
>  'Connection'=> 'close'

[snip]

> Did you try something like this:
>  
>header("Content-Type: application/pdf");
>header("Content-Disposition: inline; filename=foo.pdf");
>header("Accept-Ranges: bytes");
>header("Content-Length: $len");
>header("Expires: 0");
>header("Cache-Control: private");
>// header("Pragma: no-cache");//don't send this header!!
>
> ?>
>
> What headers are sent at this moment? Could you post them?

For a normal file (not through PHP) the headers are:

Accept-Ranges: bytes
Connection: Close
Content-Length: 25600
Content-Type: application/msword
Date: Tue, 23 Dec 2003 09:51:19 GMT
ETag: "08f72d578c3c31:8d0"
Last-Modified: Tue, 16 Dec 2003 02:03:44 GMT
Server: Microsoft-IIS/5.0

And through PHP (my script) it is:

Accept-Ranges: bytes
Cache-Control: private
Connection: Close
Content-Disposition: inline; filename="testdoc.doc"
Content-Length: 25600
Content-Type: application/msword; name="testdoc.doc"
Date: Tue, 23 Dec 2003 10:03:35 GMT
Expires: 0
Pragma: public
Server: Microsoft-IIS/5.0
X-Powered-By: PHP/4.2.2

It seems whatever I try to set the headers I have control over, it doesn't
work...
Is there anyway one can stop PHP from sending the Pragma at all?


> If you send the same headers and the same data - there _can_not_ be any
> difference. How should your client recognize any difference? There _must_
be
> a difference! Use a very small file to test it, so you can compare the
whole
> HTTP-Header + Body easily.

Yes, there is a difference, I didn't say there wasn't, just that I couldn't
see how that (to me) small difference would actually make such a big
difference...

Thank you very much!
/Andreas

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



[PHP] Debugging using dbg and ddd on linux

2003-12-23 Thread Marco Schuler
Hello

I am looking for a way to debug my php scripts. On the web I found
Dmitri Dmitrienko's dbg. I'd like to use it with ddd on my linux
machine. Unfortunatly there is no howto on how to set up all that. I
read about a patch for ddd but could not find any further information.

As a nice to have feature would be, if I could integrate all this into
xemacs or vim.

Any comments or tips are welcome! Thanks

-- 
Cheers!
 Marco

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



[PHP] Re: File Upload on a MAC-Browser didn't work

2003-12-23 Thread Volker Dähn
Hi Chris,

I already posted it as an SAFARI-ERROR to Apple.
Maybe you could do the same.
I think, it's more possible apple fixes the problem, the more error-messages
they get.

Actually i try to identify the situation in which the skript is echoing the
TMP-Directory.

This is the form for the upload:







The following site checks the uplad and copies the file to a specific
folder:

// if the Picture was uploaded
if ($BildDatei!="" AND
is_uploaded_file($_FILES['BildDatei']['tmp_name'])) {
// Check for JPG
if ($_FILES['BildDatei']['type']=='image/pjpeg') {
// Move File
$TestFile=$UserCoverDir.$ISBNFeld.".jpg";
move_uploaded_file($_FILES['BildDatei']['tmp_name'], "$TestFile");
}
} else {
echo "Save unsuccesfull";
}

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



[PHP] Re: HTTP headers, IE and downloading

2003-12-23 Thread Andreas Korthaus
Hi!

Andreas Magnusson wrote:
> For a normal file (not through PHP) the headers are:
>
> Accept-Ranges: bytes
> Connection: Close
> Content-Length: 25600
> Content-Type: application/msword
> Date: Tue, 23 Dec 2003 09:51:19 GMT
> ETag: "08f72d578c3c31:8d0"
> Last-Modified: Tue, 16 Dec 2003 02:03:44 GMT
> Server: Microsoft-IIS/5.0
>
> And through PHP (my script) it is:
>
> Accept-Ranges: bytes
> Cache-Control: private
> Connection: Close
> Content-Disposition: inline; filename="testdoc.doc"
> Content-Length: 25600
> Content-Type: application/msword; name="testdoc.doc"

is this defined? I have never seen/used this.

I only use: "Content-Type: application/msword"

> Date: Tue, 23 Dec 2003 10:03:35 GMT
> Expires: 0
> Pragma: public
> Server: Microsoft-IIS/5.0
> X-Powered-By: PHP/4.2.2
>
> It seems whatever I try to set the headers I have control over, it
> doesn't work...
> Is there anyway one can stop PHP from sending the Pragma at all?

You could look at
http://de3.php.net/session_cache_limiter
http://de3.php.net/manual/en/ref.session.php#ini.session.cache-limiter

Perhaps you should try "none"? I use "private". But at the moment I don't
know exactly which headers are effected here, you should try out.

You can find more comments about this topic here: http://de3.php.net/header


Kind regards,
Andreas

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



[PHP] Error with Absolute URLs

2003-12-23 Thread user
Hi,

I keep getting errors on my websites, that contain absolute URLs, e.g. 
http://www.url.com/blah.html. With most, being in the folder of my 
website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but 
there's a script I use to display the network statistics of an IRC 
network, which is located on a different server, so i can't use the 
$_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to 
this. I'm almost to the stage of just asking the script owner if I can 
have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT'] 
variable.

It was working fine until the server admin updated to PHP 4.3.4, but he 
is not the best with PHP/HTML programming, so he can't help much.

Hope someone can help.

Thanks!

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


[PHP] RE: File Upload on a MAC-Browser didn't work

2003-12-23 Thread Volker Dähn
Hi Chris,

I already posted it as an SAFARI-ERROR to Apple.
Maybe you could do the same.
I think, it's more possible apple fixes the problem, the more error-messages
they get.

Actually i try to identify the situation in which the skript is echoing the
TMP-Directory.

This is the form for the upload:







The following site checks the uplad and copies the file to a specific
folder:

// if the Picture was uploaded
if ($BildDatei!="" AND
is_uploaded_file($_FILES['BildDatei']['tmp_name'])) {
// Check for JPG
if ($_FILES['BildDatei']['type']=='image/pjpeg') {
// Move File
$TestFile=$UserCoverDir.$ISBNFeld.".jpg";
move_uploaded_file($_FILES['BildDatei']['tmp_name'], "$TestFile");
}
} else {
echo "Save unsuccesfull";
}

-- 
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] Can't upload file greater than 11kb

2003-12-23 Thread Larry Brown
The mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 8:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can't upload file greater than 11kb


I've got a situation where I want to upload a file to a server then enter
the data in that file into mysql. I have used this well documented upload
form


Send this file: 





script on many php servers. However I am on one now which is not allowing me
to upload a file greater than 12kb.

I know the upload_max_filesize is 2M but something else is stopping the
upload and I don't have a clue what it is. I know you should include  in the above form but that
is only a convenience for the user.

This particular server is running php as a cgi module.

Thanks

Chris

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

2003-12-23 Thread Chakravarthy Cuddapah
Can anyone pls tell me how to prevent warnings to be displayed on the screen ?
For example, I get this message:
Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in 
test.php on line 235

 
I have code to display error messages when this occurs. But I don't want to display 
the above warning message. 
 
Thanks !



Re: [PHP] warnings

2003-12-23 Thread CPT John W. Holmes
From: "Chakravarthy Cuddapah" <[EMAIL PROTECTED]>

> Can anyone pls tell me how to prevent warnings to 
> be displayed on the screen ?
> For example, I get this message:
> Warning: ldap_get_entries(): supplied argument is 
> not a valid ldap result resource in test.php on line 235

http://us2.php.net/error_reporting

---John Holmes...

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



RE: [PHP] Re: progress in PHP

2003-12-23 Thread Steve Murphy
Actually it is very possible with PHP through the use of temporary files, which is how 
this works. I have only tested the meter with IE and Mozilla (Firebird) on Windows 
with no problems. I will test on the Mac side but because its PHP performing the 
function, browsers should not matter. 

I have also read that an upload meter function was to be added to PHP 5 but was then 
dropped, I would love it if a PHP developer could offer some insight to these rumors. 
I know this is not the correct mailing list but maybe someone knows something. 

I've also added one more download on the site which gives an example php.ini file. 
I've tested the meter with a 160MB file on 128MB RAM 500Mhz K6 system. The download 
also includes sample HTML code. I'm working on adding CSS to customize the look a 
little more. 

Hope this will answer some questions.

Steve 

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 4:44 PM
To: [EMAIL PROTECTED]; David T-G
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: progress in PHP


Steve Murphy 
on Monday, December 22, 2003 1:03 PM said:

> Well its actually a pure PHP upload meter it just uses JS to open the
> window. You could make PHP open the window as well with a little
> tweaking.

Unless I'm missing something here this is incorrect. PHP does not bother
the client side except to send data, i.e. html/javascript/etc.

On another note:

A possible solution might be to load the popup page in an iframe instead
of popping a new window. afaik you can't open a window with plain html
without a manual click?



chris.


Re: [PHP] pgp form handler will not display data

2003-12-23 Thread David T-G
Jack --

[Aha ...  I see that you provide the calling URL in this post, which
explains the near-duplication.  One question answered; a million to go!]

...and then Jack E. Wasserstein, DDS, Inc. said...
% 
% There must be something obvious that I am missing but I cant get the php
...
% 
% output from
% 
% patreferhandler.php?%24referringdr=sample+person&[EMAIL PROTECTED]
% .com&dateofreferral=12%2F03%2F03&pfirst=clientfirst&plast=clientlast&telepho
% ne=555-&imageupload=&Submit=Submit

While it looks like dateofreferral, pfirst, plast, telephone, Submit
should work, I don't at all trust the %24 nistead of & at the beginning
of the URL; it's probably turned off your input parsing.  Fix that and
try again and let us know what you get.


HTH & HAND & Happy Holidays

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



pgp0.pgp
Description: PGP signature


RE: [PHP] Dilema

2003-12-23 Thread Jake McHenry
> -Original Message-
> From: Larry Brown [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 23, 2003 9:34 AM
> To: Jake McHenry
> Subject: RE: [PHP] Dilema
> 
> 
> Can you describe the page that has all of the components you
> want to send and what you expect to recieve ie.
> 
> dropdown(hotels) dropdown(travelers) dropdown(travelers)
> dropdown(travelers) --> multiple arrays with one hotel to
> many travelers each.
> 
> or
> 
> dropdown(travelers) dropdown(hotels) dropdown(fromdates)
> dropdown(todates) -->multiple arrays with one traveler to
> many hotels on dates
> 
> can you describe the problem in this format?  (--> indicating
> data transfer to the recieving script)
> 
> Larry
> 
> -Original Message-
> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 23, 2003 1:35 AM
> To: 'Php-general'
> Subject: [PHP] Dilema
> 
> 
> Hi everyone. Hopefully someone can help me out.
> 
> Here is what I have:
> 
> The user enters traveler names on page 1. blah blah on next
> couple. Page 7 shows hotel information. I have the array of 
> travelers names being outputed into a select field on the 
> page, all fine and dandy.
> 
> Where I'm having a problem is, the user can enter as many
> hotels as they want, meaning the list of travelers will be 
> displayed for each hotel added. In the array being 
> transferred into my script via POST, they are all in one array.
> 
> How can I separate each hotel into it's own array, or somehow
> separate the traveler names in the single array?
> 
> I was thinking of making a 2 dimentional array, but not sure
> how I could do this.
> 
> I know how to create the arrays, but not sure how I can do it
> in my situation.
> 
> If anyone needs any more info, ask away.
> 
> Thanks,
> 
> Jake McHenry
> Nittany Travel MIS Coordinator
> http://www.nittanytravel.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 



All of the inputed data from the form are text boxes, not drop downs,
except the travelers, which is in a multiple select field, sized by
count($array).

Each of the text input boxes return an array, so for the first hotel,
I would have Array(date) array(hotel), etc. the value in each array[0]
is the first hotel, array[1] is the second hotel, etc. but when it
comes to the travelers, there is one array, just like the rest, but I
have no idea of knowing what travelers they chose, since the user can
select multiple travelers.

I guess what I need is a type of delimiter to distinguish where each
hotel stops, and where the new one starts, or find an alternative to
the select multiple field option.

Does this help?




Thanks,

Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com

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



[PHP] Browser randomly displays php source instead of supposed output

2003-12-23 Thread Stephan Gloor
Hello.

Randomly the php-source is displayed instead of the output
(http://www.engstringen.ch/).
Generally, the output is correct !!! It happens sometimes after 10 minutes
of browsing. Sometimes it comes up with the first clikc on the site.

This was the case when having installed apache 1.3 und php 4.1.

After ugrading to apache 2 and php 4.3.4 the bug still occurs. But the
browser shows now a file download dialog box for downloading the php -script
instead of having executed it !!!
The header of the response contains the php - mime type configured
application/x-httpd-php.

The apache config contains
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
Include conf/confixx_vhost.conf

The confixx_vhost.conf contains lots of virtual host configured on a  named
vhost basis.

php is minimally configured with
  './configure' '--with-mysql' '--with-apxs'

Linux version Linux 2.4.20.

Thanks for any hint
Stephan

--
 Gloor Informatik Zurlindenstr. 215 a 8003 Zürich
 Tel: 01 461 24 11 Fax: 01
 461 22 39 [EMAIL PROTECTED]

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



[PHP] Simple fwrite question

2003-12-23 Thread Hartley, Matt
I am trying to have a counter in a file.  With what I have below I get in
the $counterfile

0 + 01 = 01
01 + 01 = 012
012 + 01 = 01213

[snip]

  /* Add "1" to the counter */
$counter = ($counter + '01');

/* Verify counter file is writable */
if (is_writable($counterfile)); /* { */
if (!$handle = fopen($counterfile, 'a')) { 
  print "Cannot open file ($counterfile)";
  exit;
} 
/* Write to our counter file. */
  if (!fwrite($handle, $counter)) {
  print "Cannot write to file ($counterfile)";
  exit;
}
fclose($handle); 

[/snip]

How do I overwrite the existing value with my new value instead of it adding
on after the past values?

My other dilemma is, 

this counter decides what line to display in a sequence from a separate file
what command can I use to tell it when $counter is @ the last line in my
"tips" file to reset to zero

thanks
Matt


Re: [PHP] Can't use HTTPS with fgets

2003-12-23 Thread Raditha Dissanayake
Homer wrote:

And the errors are

Notice: fopen(): Unable to find the wrapper "https" - did you forget to
enable it when you configured PHP? in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62
COuld this be it? have you tried phpinfo() to see what settings are in 
effect

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simple fwrite question

2003-12-23 Thread CPT John W. Holmes
From: "Hartley, Matt" <[EMAIL PROTECTED]>

> I am trying to have a counter in a file.  With what I have below I get in
> the $counterfile
>
> 0 + 01 = 01
> 01 + 01 = 012
> 012 + 01 = 01213
>
> [snip]
>
>   /* Add "1" to the counter */
> $counter = ($counter + '01');

You're "adding" a string. That doesn't make much sense. Just use $counter++;
or $counter = $counter + 1;

> /* Verify counter file is writable */
> if (is_writable($counterfile)); /* { */
> if (!$handle = fopen($counterfile, 'a')) {
>   print "Cannot open file ($counterfile)";
>   exit;
> }
> /* Write to our counter file. */
>   if (!fwrite($handle, $counter)) {
>   print "Cannot write to file ($counterfile)";
>   exit;
> }
> fclose($handle);
>
> [/snip]
> How do I overwrite the existing value with my new value instead of it
adding
> on after the past values?

Open the file in "w" (write) mode instead of "a" (append) mode. This will
clear the file and you can write your new value to it.

Note that if two peope hit your site at the same time, you'll have issues
here because they'll both try to open and read the file. You could end up
missing hits.

Why not approach it this way, which I've seen mentioned on here. Instead of
keeping an actual number in the file, just write a character to the file.
You can then use filesize() to determine how many "hits" are in the file.



> this counter decides what line to display in a sequence from a separate
file
> what command can I use to tell it when $counter is @ the last line in my
> "tips" file to reset to zero

I don't understand what you're asking here.

---John Holmes...

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



[PHP] [Q] Best Practices Question - Directory Structures for WEB site dev using PHP

2003-12-23 Thread Michael T. Peterson
Hi,

I'm new to PHP and WEB site development, but have coded in C/C++, Java, and
multiple shells for over 20 years.  So far I've found this stuff really neat
(and challenging). Anyway, I have a few questions dealing with file
locations, [de facto] directory structures, etc., when designing a WEB Site
whose content will be managed, for the most part, using PHP.  BTW, I've read
Welling and Thompson, a lot of the docs on www.zend.com, and various other
useful PHP web sites.  I've also written some simple functions, played with
templates (inc smarty), etc.  About the only info I've been unable to find
are suggestions as to how to layout the *.php files in a WEB Site.

I develop with Dreamweaver MX on Windows XP Pro using IIS.  When complete, I
upload to my WEB host.  On Linux, I use a text editor (Visual Slick Edit)
and Apache.  Both systems have the latest stable MySQL and PHP releases.
Sources are managed with CVS.

1) How do experienced developers layout their [dev] directory hierarchy?
For example, is there an accepted place to put one's function libraries?  On
IIS (Windows XP), the default directory structure is

c:\inetpub\
AdminScripts
iissamples
mailroot
Scripts
wwwroot\
myproject1
myproject2
...
myprojectN

where the myproject* directories are my current WEB Site designs.

2) When using CVS, I should think that the PHP files would be checked-out
into a directory that IS NOT in a [local] WEB Site directory (i.e., to avoid
littering the structure with CVS directories).  When the files are ready to
be uploaded to WEB site they would then be exported into the WEB Site
directory for uploading.  Is this how you guys do things?

If one can point me to docs/books/webs that cover these (and other similar
questions) I would be very grateful.  Also, if you just want to tell me how
you do it, I would appreciate that very much.

Thanks, in advance.

Michael

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



Re: [PHP] phphandle form wont display data

2003-12-23 Thread Raditha Dissanayake
check your register globals settings or user variables like 
$_REQUEST['referringdr']

all the best

Jack E. Wasserstein, DDS, Inc. wrote:

This must be obvious, but I am having trouble displaying the results of a
form in the php handler.
Here is the php code in the handler:



print " the referring doctor is $referringdr .\n";
print " the referral date is $dateofreferral .\n";
print " the patients first name is $pfirst .\n";
print " the patients last name is $plast .\n";
print " the patients telephone number is $telephone .\n";
print " the referring doctor email is $refdremail .\n";
print " the upload is $imageupload \n";


?>

I am using the get action on the actual form and I can see all of the values
being passed to the script. The spellings of the
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] String replacement problems...

2003-12-23 Thread John Clegg
Hi

I am trying to figure out how to get ereg_replace / preg_replace to 
replace a match only once.

Here is my example:

$text = "[foo] bah [foo] moo [foo] boo\n";

$ans = ereg_replace("\[foo\]{1}","FOO",$text);

or

$ans = preg_replace("/\[foo\]{1}/",$text,"FOO");

The answer I get for both I run the example

echo $ans;

FOO bah FOO moo FOO boo

Can any tell me what I am doing wrong ? I am trying only to replace the 
match once. eg

FOO bah [foo] moo [foo] boo

Any help would be appreciated...

Cheers

John Clegg

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


Re: [PHP] [Q] Best Practices Question - Directory Structures for WEB site dev using PHP

2003-12-23 Thread Matt Matijevich
[snip]
1) How do experienced developers layout their [dev] directory
hierarchy?
For example, is there an accepted place to put one's function
libraries?  On
IIS (Windows XP), the default directory structure is

c:\inetpub\
AdminScripts
iissamples
mailroot
Scripts
wwwroot\
myproject1
myproject2
...
myprojectN

where the myproject* directories are my current WEB Site designs.
[/snip]

I use some of the ideas from this page
http://www.odi.ch/prog/design/php/guide.php for laying out my sites.

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



[PHP] PHP Compile w/ Sun ONE Directory Server

2003-12-23 Thread Cameron B. Prince
Hi,

I am trying to compile PHP with LDAP support via the Sun ONE Directory
Server. I am running into a problem where some functions aren't being found
in the include or shared libraries. Here's my configure command:

export
LD_LIBRARY_PATH="/usr/lib:/usr/local/nss-3.8/lib:/usr/local/nspr-4.3/lib:/us
r/local/mysql/lib:/usr/local/lib/sparcv9:/data/sunone_php/servers/lib:/data/
sunone_php/servers/lib/sasl"

./configure --with-mysql=/usr/local/mysql \
--with-nsapi=/data/sunone_php/webservers \
--enable-libgcc \
--with-zlib-dir=/usr/local \
--with-openssl=/usr/local/ssl \
--with-ldap=/data/sunone_php/servers

The configure command completes successfully with no errors. The make
however, fails with:

Undefined   first referenced
 symbol in file
sasl_client_step
/data/sunone_php/servers/lib/libldap50.so
sasl_encode
/data/sunone_php/servers/lib/libldap50.so
sasl_getprop
/data/sunone_php/servers/lib/libldap50.so
sasl_setprop
/data/sunone_php/servers/lib/libldap50.so
sasl_decode
/data/sunone_php/servers/lib/libldap50.so
sasl_client_new
/data/sunone_php/servers/lib/libldap50.so
sasl_client_init
/data/sunone_php/servers/lib/libldap50.so
sasl_set_alloc
/data/sunone_php/servers/lib/libldap50.so
sasl_dispose
/data/sunone_php/servers/lib/libldap50.so
sasl_client_start
/data/sunone_php/servers/lib/libldap50.so
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `sapi/cli/php'


I added /data/sunone_php/servers/lib/sasl to the library path in the hopes
that it would find the functions there, but still no dice. I've also tried
compiling my own copy of sasl and pointing to it, but I'm not sure which
version to use and that didn't work either.

If I configure without LDAP, everything works fine. I desparately need to
get this going as we aren't going to be able to use PHP without LDAP support
and we have deadlines approaching quickly.

Any help or ideas would be greatly appreciated.

Thanks,
Cameron

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



Re: [PHP] Re: progress in PHP

2003-12-23 Thread Raditha Dissanayake
Join the 11,000 people who use megaupload progress bar (with a little 
help from perl)
http://www.sourceforge.net/projects/megaupload/

Steve Murphy wrote:

Well its actually a pure PHP upload meter it just uses JS to open the window. You could make PHP open the window as well with a little tweaking.

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 3:16 PM
To: [EMAIL PROTECTED]
Cc: Steve Murphy
Subject: Re: [PHP] Re: progress in php
Steve --

...and then Steve Murphy said...
% 
% David,
% A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly.

Ah.  Since I don't use javascript I probably won't get a lot out of it :-)

Darn; I was hoping for something non-JS.  I guess I'll stick with my
browser status window.
% 
% Steve

Thanks & HAND & Happy Holidays

:-D
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] String replacement problems...

2003-12-23 Thread CPT John W. Holmes
From: "John Clegg" <[EMAIL PROTECTED]>
> I am trying to figure out how to get ereg_replace / preg_replace to
> replace a match only once.

The fourth parameter to preg_replace() is an integer limit to how many
matches you want to allow. So, if you only want 1 replacement to occur, pass
1. :)

---John Holmes...

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



Re: [PHP] Re: progress in PHP

2003-12-23 Thread Ed Curtis

> Join the 11,000 people who use megaupload progress bar (with a little
> help from perl)
> http://www.sourceforge.net/projects/megaupload/

 I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.

Ed

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



[PHP] Assist with session persistance

2003-12-23 Thread Terry Romine
I have a site that is using $_SESSION['variablename'] for many 
variables that are loaded when the user first enters the site 
(index.php), and then referenced on each page (display.php):

ex: index.php
session_start();
$agencyID=9;
$agencyName="fremont";
$_SESSION['agencyID'] = $agencyID;
$_SESSION['agencyName'] = $agencyName;
ex: display.php
session_start();
$agencyID=$_SESSION['agencyID'];
$agencyName=$_SESSION['agencyName'];
But after awhile, the session seems to fail and I end up back at the 
index page because the $agencyID gets voided. Is there a timeout on 
sessions other than closing the browser? If so, is there a way to set 
timeout if one doesn't have server admin access? Should I be doing 
something like:

ex: display.php
session_start();
$agencyID=$_SESSION['agencyID'];
$agencyName=$_SESSION['agencyName'];
$_SESSION['agencyID'] = $agencyID;
$_SESSION['agencyName'] = $agencyName;
to update the session variables with each page?

Terry

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


[PHP] apache chroot + mail()

2003-12-23 Thread Ruben Vanhoutte
Hi,

I am having a problem using the mail() command inside a chrooted
apache/php installation on linux with qmail.
Nothing apears in the logs, nothing in apache error logs , neither in
php error logs..
And.. no mail gets send.. Nothing to see in my mailer daemon logs neither..
Exempt from php.ini:
===
[mail function]
SMTP = 127.0.0.1
===
Can anyone help pls ?

Tnx

--

Ruben Vanhoutte

Systems Admin
X-Treme Webhosting
Zakske 10
8000 Brugge
Belgium
Fortis 001-3688345-93
Btw: BE 518.853.394
HR: 95181
http://www.x-tremewebhosting.net


The information contained in this message or any of its attachments may 
be confidential and is intended for the exclusive use of the 
addressee(s). Any disclosure, reproduction, distribution or other 
dissemination or use of this communication is strictly prohibited 
without the express permission of the sender. Visibility email is for 
business use only.
*

-- Quote Of The Day --
Self Test for Paranoia: You know you have it when you can't think of 
anything that's your own fault.
-- Quote Of The Day --

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


[PHP] Re: Assist with session persistance

2003-12-23 Thread Matt Grimm
The directive session.cookie_lifetime in your php.ini is what a session
cookie timeout defaults to.  You can manually set the lifetime when you
create it using session_set_cookie_params().

http://us3.php.net/manual/en/function.session-set-cookie-params.php

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


"Terry Romine" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a site that is using $_SESSION['variablename'] for many
> variables that are loaded when the user first enters the site
> (index.php), and then referenced on each page (display.php):
>
> ex: index.php
> session_start();
> $agencyID=9;
> $agencyName="fremont";
> $_SESSION['agencyID'] = $agencyID;
> $_SESSION['agencyName'] = $agencyName;
>
> ex: display.php
> session_start();
> $agencyID=$_SESSION['agencyID'];
> $agencyName=$_SESSION['agencyName'];
>
> But after awhile, the session seems to fail and I end up back at the
> index page because the $agencyID gets voided. Is there a timeout on
> sessions other than closing the browser? If so, is there a way to set
> timeout if one doesn't have server admin access? Should I be doing
> something like:
>
> ex: display.php
> session_start();
> $agencyID=$_SESSION['agencyID'];
> $agencyName=$_SESSION['agencyName'];
> $_SESSION['agencyID'] = $agencyID;
> $_SESSION['agencyName'] = $agencyName;
>
> to update the session variables with each page?
>
> Terry

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



Re: [PHP] Assist with session persistance

2003-12-23 Thread Matt Matijevich
[snip]
ex: display.php
session_start();
$agencyID=$_SESSION['agencyID'];
$agencyName=$_SESSION['agencyName'];

But after awhile, the session seems to fail and I end up back at the 
index page because the $agencyID gets voided. Is there a timeout on 
sessions other than closing the browser? If so, is there a way to set 
timeout if one doesn't have server admin access? Should I be doing 
something like:
[/snip]

There is a session timeout. http://ch.php.net/session take a look at
the variable session.gc_maxlifetime . I am not sure how to change this
if you dont have admin access.

You could store the session info in a db and right your own clean up
routines.

I think you can skip this:
$agencyID=9;
$agencyName="fremont";

and just do this:
$_SESSION['agencyID'] = 9;
$_SESSION['agencyName'] = "fremont";

then just use the $_SESSION vars in your scripts.

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



Re: [PHP] Re: progress in PHP

2003-12-23 Thread James Kaufman
On Tue, Dec 23, 2003 at 11:46:50AM -0500, Ed Curtis wrote:
> 
> > Join the 11,000 people who use megaupload progress bar (with a little
> > help from perl)
> > http://www.sourceforge.net/projects/megaupload/
> 
>  I tried. It wasn't worth all the perl mods I would to have had to
> install to make it work.
> 
> Ed
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
php approach to displaying a progress bar. I haven't used it, but the demos
look good.

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
http://www.linuxforbusiness.net

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



[PHP] Re: Https

2003-12-23 Thread Manuel Lemos
Hello,

On 12/23/2003 07:39 AM, Homer wrote:
Sorry, but not.

I have changed it to ssl and the message is the same:

Notice: fopen(): Unable to find the wrapper "ssl" - did you forget to enable
it when you configured PHP?
If you read the warning message you can see that you can use your 
solution if you enable ssl streams in your configuration.



I can use nothing that is out of the standard php package, because I'm doing
a script for other users that can't change their php installation.
In that case, you need to resort to a Curl based solution as Curl 
extension is available since much earlier PHP versions (PHP 4.0.2).

In that case you may want to try that HTTP client class that simplifies 
a lot the access to the Web resources via SSL using Curl if available. 
It also supports accessing HTTPS pages via a proxy accessible http 
without SSL, so no Curl library is necessary.

http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: progress in PHP

2003-12-23 Thread Manuel Lemos
Hello,

On 12/23/2003 03:31 PM, James Kaufman wrote:
Join the 11,000 people who use megaupload progress bar (with a little
help from perl)
http://www.sourceforge.net/projects/megaupload/
I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.


Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
php approach to displaying a progress bar. I haven't used it, but the demos
look good.
This a different thing. This is meant to track progress of server side 
tasks. File uploading is a client side task.

Unfortunately, AFAIK there is no way to handle streams of HTTP requests. 
Therefore, there is no way to handle upload progress with a PHP only 
solution.

The Raditha megaupload solution is based on a combination of Perl with 
PHP. It is probably the solution that uses more PHP but the hard work is 
done using Perl.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: progress in PHP

2003-12-23 Thread Larry Brown
How does perl show progress of the upload if it is a server side scripting
language and php can't do it because it is server side?

-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: progress in PHP


Hello,

On 12/23/2003 03:31 PM, James Kaufman wrote:
>>>Join the 11,000 people who use megaupload progress bar (with a little
>>>help from perl)
>>>http://www.sourceforge.net/projects/megaupload/
>>
>> I tried. It wasn't worth all the perl mods I would to have had to
>>install to make it work.
>
>
> Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
> php approach to displaying a progress bar. I haven't used it, but the
demos
> look good.

This a different thing. This is meant to track progress of server side
tasks. File uploading is a client side task.

Unfortunately, AFAIK there is no way to handle streams of HTTP requests.
Therefore, there is no way to handle upload progress with a PHP only
solution.

The Raditha megaupload solution is based on a combination of Perl with
PHP. It is probably the solution that uses more PHP but the hard work is
done using Perl.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
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: progress in PHP

2003-12-23 Thread David T-G
Raditha, et al --

...and then Raditha Dissanayake said...
% 
% Join the 11,000 people who use megaupload progress bar (with a little 
% help from perl)
% http://www.sourceforge.net/projects/megaupload/

Sounds nice.

Does it require JS in the browser?


TIA & HAND & Happy Holidays

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



pgp0.pgp
Description: PGP signature


Re: [PHP] Re: progress in PHP

2003-12-23 Thread Manuel Lemos
Hello,

On 12/23/2003 03:56 PM, Larry Brown wrote:
How does perl show progress of the upload if it is a server side scripting
language and php can't do it because it is server side?
Because PHP does not provide support to handle the raw HTTP request. By 
the time that PHP scripts starts executing, PHP already processed the 
uploaded copying the incoming data to a temporary file. OTOH, Perl 
provides support to handle the incoming HTTP request as it happens, not 
after it is done.


-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: progress in PHP
Hello,

On 12/23/2003 03:31 PM, James Kaufman wrote:

Join the 11,000 people who use megaupload progress bar (with a little
help from perl)
http://www.sourceforge.net/projects/megaupload/
I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.


Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
php approach to displaying a progress bar. I haven't used it, but the
demos

look good.


This a different thing. This is meant to track progress of server side
tasks. File uploading is a client side task.
Unfortunately, AFAIK there is no way to handle streams of HTTP requests.
Therefore, there is no way to handle upload progress with a PHP only
solution.
The Raditha megaupload solution is based on a combination of Perl with
PHP. It is probably the solution that uses more PHP but the hard work is
done using Perl.


--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Variable variables

2003-12-23 Thread Richard Baskett
Ok I am trying to create a variable from the value of a variable plus some
extra text tagged on the end of it.

So for example:

$test = '_over';
$$CONFIG['island'].$test = 'testing';
echo "hawaii = $hawaii_over";

How can I do this? Im sure it's possible, but it just is not working for me
:(

Thanks!

Rick

"Trust in the Lord with all your heart, And lean not on your own
understanding; In all your ways acknowledge Him, And he shall direct your
paths." - Proverbs 3:5-6

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



Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
I don't believe that the MAX_FILE_SIZE needs to be there. It will only
terminate the upload process at the client, rather than wait for the upload
to complete.

Anyway with or without MAX_FILE_SIZE the upload process is being terminated
after the file is uploaded.

When the form is submitted, the selected file is uploaded to the server's
temp directory then copied to the maps dir.  For some reason, when the file
size exceeds 11kb (very small) the process
gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
messages and the POST script throws an error message if it can't find the
file
in the temp directory. I've uploaded several file sizes up to the max of 2MB
and it appears the file is being uploaded. I base this assumption on the
fact the upload time is proportional to the file size. When the file size is
greater than 11kb it appears that the file is deleted from the temp dir.

Still no idea what is going on.
Chris

"Larry Brown" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The  must be before the ...type="file"... tag and after  Mozilla Firebird as the client) If you have it in there and remember it is
> in bytes not kb and set it to a size large enough the script accepting the
> file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having
the
> temporary file.  Then you take that hidden tag out and do the same the
> $_FILE['tmp_name'] variable will be empty since it did not recieve the
file.
> So I know at least in my case that the hidden field has to be there.
>
> Larry
>
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 22, 2003 8:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Can't upload file greater than 11kb
>
>
> I've got a situation where I want to upload a file to a server then enter
> the data in that file into mysql. I have used this well documented upload
> form
>
> 
> Send this file: 
>
> 
>
> 
>
> script on many php servers. However I am on one now which is not allowing
me
> to upload a file greater than 12kb.
>
> I know the upload_max_filesize is 2M but something else is stopping the
> upload and I don't have a clue what it is. I know you should include
 type="hidden" name="MAX_FILE_SIZE" value="3"> in the above form but
that
> is only a convenience for the user.
>
> This particular server is running php as a cgi module.
>
> Thanks
>
> Chris
>
> --
> 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: progress in PHP

2003-12-23 Thread Raditha Dissanayake
Hi

To Manuel: You have answered the questions better than i could have :-) 
thanx. Yes perl is used because it gives access to raw post data.

To Ed: If you are on a standard rpm distro all the modules are probably 
there already.  and thus megaupload becomes plug and play.

To David: It does use a javascript to make a popup that's all. If you 
eliminate the popup and show the progress bar in a frame you don't need 
any javascript at all

To Everyone: Enjoy your christmas.

best regards
raditha


Manuel Lemos wrote:

Hello,

On 12/23/2003 03:56 PM, Larry Brown wrote:

How does perl show progress of the upload if it is a server side 
scripting
language and php can't do it because it is server side?


Because PHP does not provide support to handle the raw HTTP request. 
By the time that PHP scripts starts executing, PHP already processed 
the uploaded copying the incoming data to a temporary file. OTOH, Perl 
provides support to handle the incoming HTTP request as it happens, 
not after it is done.


-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: progress in PHP
Hello,

On 12/23/2003 03:31 PM, James Kaufman wrote:

Join the 11,000 people who use megaupload progress bar (with a little
help from perl)
http://www.sourceforge.net/projects/megaupload/


I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.


Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
php approach to displaying a progress bar. I haven't used it, but the


demos

look good.


This a different thing. This is meant to track progress of server side
tasks. File uploading is a client side task.
Unfortunately, AFAIK there is no way to handle streams of HTTP requests.
Therefore, there is no way to handle upload progress with a PHP only
solution.
The Raditha megaupload solution is based on a combination of Perl with
PHP. It is probably the solution that uses more PHP but the hard work is
done using Perl.





--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Raditha Dissanayake
Hi,

It's often said in many newsgroups and articles that the max_file_size 
is next to useless. It's also said that once IE starts uploading it will 
not stop even if you keep you foot on the stop button!

If i remembers the earlier messages you have said the php.ini settings 
are correct. If so it could well be that you might be having 
misconfigured proxy server or firewall in the way. 

Apache also has a setting (LimitRequestBody) that could effect your upload.

all the best

Chris wrote:

I don't believe that the MAX_FILE_SIZE needs to be there. It will only
terminate the upload process at the client, rather than wait for the upload
to complete.
Anyway with or without MAX_FILE_SIZE the upload process is being terminated
after the file is uploaded.
When the form is submitted, the selected file is uploaded to the server's
temp directory then copied to the maps dir.  For some reason, when the file
size exceeds 11kb (very small) the process
gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
messages and the POST script throws an error message if it can't find the
file
in the temp directory. I've uploaded several file sizes up to the max of 2MB
and it appears the file is being uploaded. I base this assumption on the
fact the upload time is proportional to the file size. When the file size is
greater than 11kb it appears that the file is deleted from the temp dir.
Still no idea what is going on.
Chris
"Larry Brown" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

The 
   

It
 

must be before the ...type="file"... tag and after 
Mozilla Firebird as the client) If you have it in there and remember it is
in bytes not kb and set it to a size large enough the script accepting the
file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having
   

the
 

temporary file.  Then you take that hidden tag out and do the same the
$_FILE['tmp_name'] variable will be empty since it did not recieve the
   

file.
 

So I know at least in my case that the hidden field has to be there.

Larry

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 8:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can't upload file greater than 11kb
I've got a situation where I want to upload a file to a server then enter
the data in that file into mysql. I have used this well documented upload
form

Send this file: 




script on many php servers. However I am on one now which is not allowing
   

me
 

to upload a file greater than 12kb.

I know the upload_max_filesize is 2M but something else is stopping the
upload and I don't have a clue what it is. I know you should include
   


 

type="hidden" name="MAX_FILE_SIZE" value="3"> in the above form but
   

that
 

is only a convenience for the user.

This particular server is running php as a cgi module.

Thanks

Chris

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

 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Variable variables

2003-12-23 Thread John W. Holmes
Richard Baskett wrote:
Ok I am trying to create a variable from the value of a variable plus some
extra text tagged on the end of it.
So for example:

$test = '_over';
$$CONFIG['island'].$test = 'testing';
${$CONFIG['island'].$test} = 'testing';

echo "hawaii = $hawaii_over";
Why not just use an array for all of this? Almost every time variable 
variables are used, it's a workaround to just using arrays. I don't know 
why these even exist, honestly...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Assist with session persistance

2003-12-23 Thread John W. Holmes
Terry Romine wrote:


Is there a timeout on 
sessions other than closing the browser? If so, is there a way to set 
timeout if one doesn't have server admin access? 
Session timeout is controlled by the session.gc_maxlifetime setting. 
It's the number of seconds after which session files will be seen as old 
and removed (if they aren't accessed in that time).

If you want the session to persist outside of the browser closing, then 
you can set the lifetime of the session cookie. Be sure to raise 
gx_maxlifetime to match what you set the cookie lifetime to, also.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Variable variables

2003-12-23 Thread Richard Baskett
on 12/23/03 11:04, John W. Holmes at [EMAIL PROTECTED] wrote:

> Richard Baskett wrote:
>> Ok I am trying to create a variable from the value of a variable plus some
>> extra text tagged on the end of it.
>> 
>> So for example:
>> 
>> $test = '_over';
>> $$CONFIG['island'].$test = 'testing';
> 
> ${$CONFIG['island'].$test} = 'testing';
> 
>> echo "hawaii = $hawaii_over";
> 
> Why not just use an array for all of this? Almost every time variable
> variables are used, it's a workaround to just using arrays. I don't know
> why these even exist, honestly...

I might not be sure what you mean, about using an array for all of that, but
within one line of code, it is taking care of a variable that will change
depending on the config island variable. Otherwise I would have needed to
use a switch statement, which is a whole lot more than just one variable.
But then again if your array solution would work in one line.. then I would
love to see it!

Cheers!

Rick

"It is the mark of an educated mind to be able to entertain a thought
without accepting it." - Aristotle

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



Re: [PHP] Re: HTTP headers, IE and downloading

2003-12-23 Thread John W. Holmes
Andreas Magnusson wrote:

And through PHP (my script) it is:

Accept-Ranges: bytes
Cache-Control: private
I've had the cache-control header cause problems with IE in the past. 
It's sent by starting a session, not something you manually send. You 
can change it using the session functions, though. Try setting it to 
"none".

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread David T-G
Chris --

...and then Chris said...
% 
% script on many php servers. However I am on one now which is not allowing me
% to upload a file greater than 12kb.

What does phpinfo() say for

  post_max_size
  upload_max_filesize

and what quota and disk space affect the web server process and temp dir?


HTH & HAND

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



pgp0.pgp
Description: PGP signature


[PHP] Headers Problem

2003-12-23 Thread Beauford
I'm getting the following error. My question is, where would I use the
ob_start() and ob_end_flush() function so I can get rid of this. I have read
the PHP manual, but not quite getting it.Or if there is a better way?

This is how the files work. update-corrections-input.php (user inputs info
by a form). This file includes another file - restricted.inc. The form in
update-corrections-input.php calls update-corrections-write.php which
processes the input and then includes update-corrections-input.php again. So
basically it just brings the user back to the form again.

Any input is appreciated

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at
/usr/local/apache/htdocs/supreme/updates/update-corrections-write.php:2) in
/usr/local/apache/php/includes/restricted.inc on line 1

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



Re: [PHP] Headers Problem

2003-12-23 Thread John W. Holmes
Beauford wrote:

I'm getting the following error. My question is, where would I use the
ob_start() and ob_end_flush() function so I can get rid of this. I have read
the PHP manual, but not quite getting it.Or if there is a better way?
Don't work around the problem with output buffering; try fixing it.

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at
/usr/local/apache/htdocs/supreme/updates/update-corrections-write.php:2) in
/usr/local/apache/php/includes/restricted.inc on line 1
You must have session_start() before any output. You've placed it on 
line 1 of restricted.inc, but output was started on line 2 of 
update-corrections-write.php. If you're going to include restricted.inc 
and start a session, include it before there is output.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
post_max_size: 8M
upload_max_filesize: 10M

what quota and disk space affect the web server process and temp dir

This site is hosted by a third party:
Disk space is 400MB only a fraction is used.
temp dir -- unknown


Chris --

...and then Chris said...
%
% script on many php servers. However I am on one now which is not allowing
me
% to upload a file greater than 12kb.

What does phpinfo() say for

  post_max_size
  upload_max_filesize

and what quota and disk space affect the web server process and temp dir?


HTH & HAND

"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
It has been my experience that max_file_size does terminate the upload
process if you include it in the form.
But you are right, if it gets to the upload, your stuck.

LimitRequestBody is beyond my control as the site is hosted by a third
party.

Thanks
Chris


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> It's often said in many newsgroups and articles that the max_file_size
> is next to useless. It's also said that once IE starts uploading it will
> not stop even if you keep you foot on the stop button!
>
> If i remembers the earlier messages you have said the php.ini settings
> are correct. If so it could well be that you might be having
> misconfigured proxy server or firewall in the way.
>
> Apache also has a setting (LimitRequestBody) that could effect your
upload.
>
> all the best
>
> Chris wrote:
>
> >I don't believe that the MAX_FILE_SIZE needs to be there. It will only
> >terminate the upload process at the client, rather than wait for the
upload
> >to complete.
> >
> >Anyway with or without MAX_FILE_SIZE the upload process is being
terminated
> >after the file is uploaded.
> >
> >When the form is submitted, the selected file is uploaded to the server's
> >temp directory then copied to the maps dir.  For some reason, when the
file
> >size exceeds 11kb (very small) the process
> >gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
> >messages and the POST script throws an error message if it can't find the
> >file
> >in the temp directory. I've uploaded several file sizes up to the max of
2MB
> >and it appears the file is being uploaded. I base this assumption on the
> >fact the upload time is proportional to the file size. When the file size
is
> >greater than 11kb it appears that the file is deleted from the temp dir.
> >
> >Still no idea what is going on.
> >Chris
> >
> >"Larry Brown" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >
> >
> >>The  >>
> >>
> >It
> >
> >
> >>must be before the ...type="file"... tag and after  >>Mozilla Firebird as the client) If you have it in there and remember it
is
> >>in bytes not kb and set it to a size large enough the script accepting
the
> >>file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having
> >>
> >>
> >the
> >
> >
> >>temporary file.  Then you take that hidden tag out and do the same the
> >>$_FILE['tmp_name'] variable will be empty since it did not recieve the
> >>
> >>
> >file.
> >
> >
> >>So I know at least in my case that the hidden field has to be there.
> >>
> >>Larry
> >>
> >>-Original Message-
> >>From: Chris [mailto:[EMAIL PROTECTED]
> >>Sent: Monday, December 22, 2003 8:55 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Can't upload file greater than 11kb
> >>
> >>
> >>I've got a situation where I want to upload a file to a server then
enter
> >>the data in that file into mysql. I have used this well documented
upload
> >>form
> >>
> >>
> >>Send this file: 
> >>
> >>
> >>
> >>
> >>
> >>script on many php servers. However I am on one now which is not
allowing
> >>
> >>
> >me
> >
> >
> >>to upload a file greater than 12kb.
> >>
> >>I know the upload_max_filesize is 2M but something else is stopping the
> >>upload and I don't have a clue what it is. I know you should include
> >>
> >>
> > >
> >
> >>type="hidden" name="MAX_FILE_SIZE" value="3"> in the above form but
> >>
> >>
> >that
> >
> >
> >>is only a convenience for the user.
> >>
> >>This particular server is running php as a cgi module.
> >>
> >>Thanks
> >>
> >>Chris
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.

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



RE: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN

2003-12-23 Thread Chris W. Parker
Justin French 
on Monday, December 22, 2003 6:12 PM said:

> Sounds more like the mysql field is a varchar255, rather than maybe a
> mediumtext, and only the first 255 chars are getting inserted into the
> DB?
> 
> But I could be horribly wrong :)

In an effort to keep this thread going and hopefully find an answer op
left out some important information this time around. (He posted a
related question yesterday.)

He is not using MySQL. He is using MSSQL. According to what he said in
another thread the database has stored all the data without being
cutoff. I imagine he's able to view it in another way aside from
retrieving it via php to verify it's been inserted completely.


Does this help anyone narrow it down? (because I certainly have no
idea.)



Chris.

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



Re: [PHP] apache chroot + mail()

2003-12-23 Thread Tom Rogers
Hi,

Wednesday, December 24, 2003, 3:02:33 AM, you wrote:
RV> Hi,

RV> I am having a problem using the mail() command inside a chrooted
RV> apache/php installation on linux with qmail.
RV> Nothing apears in the logs, nothing in apache error logs , neither in
RV> php error logs..
RV> And.. no mail gets send.. Nothing to see in my mailer daemon logs neither..

RV> Exempt from php.ini:
RV> ===
RV> [mail function]
RV> SMTP = 127.0.0.1
RV> ===

RV> Can anyone help pls ?

RV> Tnx

RV> -- 

RV> Ruben Vanhoutte

RV> Systems Admin
RV> X-Treme Webhosting
RV> Zakske 10
RV> 8000 Brugge
RV> Belgium
RV> Fortis 001-3688345-93
RV> Btw: BE 518.853.394
RV> HR: 95181


RV> http://www.x-tremewebhosting.net

RV> 

RV> The information contained in this message or any of its attachments may 
RV> be confidential and is intended for the exclusive use of the 
RV> addressee(s). Any disclosure, reproduction, distribution or other 
RV> dissemination or use of this communication is strictly prohibited 
RV> without the express permission of the sender. Visibility email is for 
RV> business use only.
RV> 
*

RV> -- Quote Of The Day --
RV> Self Test for Paranoia: You know you have it when you can't think of 
RV> anything that's your own fault.
RV> -- Quote Of The Day --


from inside a chroot jail you will never get mail to work, try using one of the
many classes that are around to do SMTP mailing.

-- 
regards,
Tom

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



Re: [PHP] Re: HTTP headers, IE and downloading

2003-12-23 Thread Andreas Magnusson
"John W. Holmes" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Andreas Magnusson wrote:
>
> > And through PHP (my script) it is:
> >
> > Accept-Ranges: bytes
> > Cache-Control: private
>
> I've had the cache-control header cause problems with IE in the past.
> It's sent by starting a session, not something you manually send. You
> can change it using the session functions, though. Try setting it to
> "none".

Thanks, I tried that and it actually worked!...once...so since the number
of bytes that IE downloads from my file seems to vary each time, I guess
it was just a flux of luck that it downloaded the whole file this once
sigh...

It drives me nuts to think about it, it's just so weird...

/Andreas

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



[PHP] Unlinking files.

2003-12-23 Thread Scott Holden
How can I unlink files in a directory that are, for example older than 1
hour?

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



Re: [PHP] Unlinking files.

2003-12-23 Thread Mike Migurski
>How can I unlink files in a directory that are, for example older than 1
>hour?

`find /path/to/dir -cmin +60 -type f -print0 | xargs -0 rm -f`;

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] [Newbie Guide] For the benefit of new members

2003-12-23 Thread Ma Siva Kumar
===
This message is for the benefit of new subscribers 
and those new to PHP.  Please feel free to add 
more points and send to the list.
===
1. If you have any queries/problems about PHP try 
http://www.php.net/manual/en first. You can 
download a copy and use it offline also. 

Please also try http://www.php.net/manual/faq.php 
to get answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for 
"php YOUR QUERY" may fetch you relevant results 
within the first 10 results, if you are lucky.

3. There is a searchable archive of the mailing 
list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and you 
may get answer to your query from the earlier 
discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through the 
list archives. If you want a chosen list try this 
link : http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want to find 
out what extensions are available?

Just put the following code into a file with a 
.php extension and access it through your 
webserver:

 

If PHP is installed you will see a page with a lot 
of information on it. If PHP is not installed (or 
not working correctly) your browser will try
to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead 
of posting the whole script, try doing some 
research yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the details of 
your efforts (following steps 1, 2 & 3) and ask 
for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes 
place BEFORE the output reaches the client. 
Therefore, it is not possible to access the 
users'  computer related information (OS, screen 
size etc) using PHP. You need to go for 
JavaScript and ask the question in a JavaScript 
list.

On the other hand you can access the information 
that is SENT by the user's browser when a client 
requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. - contributed by Wouter van Vliet 
and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. Avoid 
general subjects like "Help!!", "A Question" etc.  
Especially avoid blank subjects. 

8. When you want to start a new topic, open a new 
mail composer and enter the mailing list address 
[EMAIL PROTECTED] instead of replying to 
an existing thread and replacing the subject and 
body with your message.

9. It's always a good idea to post back to the 
list once you've solved your problem. People 
usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your 
solution you're helping the next person with the 
same question. [contribued by Chris W Parker]

10. Ask smart questions  
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,
-- 
Integrated Management Tools for leather industry
--
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

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



Re: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN

2003-12-23 Thread John W. Holmes
Chris W. Parker wrote:

Justin French 
on Monday, December 22, 2003 6:12 PM said:

Sounds more like the mysql field is a varchar255, rather than maybe a
mediumtext, and only the first 255 chars are getting inserted into the
DB?
But I could be horribly wrong :)


In an effort to keep this thread going and hopefully find an answer op
left out some important information this time around. (He posted a
related question yesterday.)
He is not using MySQL. He is using MSSQL. According to what he said in
another thread the database has stored all the data without being
cutoff. I imagine he's able to view it in another way aside from
retrieving it via php to verify it's been inserted completely.
Does this help anyone narrow it down? (because I certainly have no
idea.)
This problem comes up every now and then, but I can't find anything good 
in the archives. Basically, if you're using a varchar (or nvarchar?) 
column, you can only have a max size of 255 characters. Anything larger 
needs to use a text column. I think this is dependent upon the library 
you're using to access MSSQL (like an ODBC limitation?), so you should 
look at other libraries to see if this was fixed.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Re: progress in PHP

2003-12-23 Thread Manuel Lemos
Hello,

On 12/23/2003 03:56 PM, Larry Brown wrote:
How does perl show progress of the upload if it is a server side scripting
language and php can't do it because it is server side?
The problem is not showing progress but rather tracking progress.

What you seem to not be understanding is that PHP handles uploads 
internally. So, by the time a PHP script that gets the submitted upload 
form starts running, the upload was already ended and the uploaded files 
were copied to some temporary files.

PHP itself does not give you a chance to track the progress of the 
upload because that is something handled at the HTTP request level.

The Perl solution is based on a script that handles and tracks the 
upload and another that shows the progress. That is why you need to show 
progress in a popup or a separate frame.


-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 12:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: progress in PHP
Hello,

On 12/23/2003 03:31 PM, James Kaufman wrote:

Join the 11,000 people who use megaupload progress bar (with a little
help from perl)
http://www.sourceforge.net/projects/megaupload/
I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.


Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
php approach to displaying a progress bar. I haven't used it, but the
demos

look good.


This a different thing. This is meant to track progress of server side
tasks. File uploading is a client side task.
Unfortunately, AFAIK there is no way to handle streams of HTTP requests.
Therefore, there is no way to handle upload progress with a PHP only
solution.
The Raditha megaupload solution is based on a combination of Perl with
PHP. It is probably the solution that uses more PHP but the hard work is
done using Perl.


--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: progress in PHP

2003-12-23 Thread Jeremy Johnstone
FWIW, here is a link to a PHP extension which enables the ability to
track the progress of a PHP upload. I did not write the extension, so if
it breaks something I am not responsible. It was previously discussed on
the php-dev mailing list ([EMAIL PROTECTED]) a month or two ago,
but it was never decided if it would be officially added into PHP.

http://pdoru.from.ro/

-Jeremy

On Tue, 2003-12-23 at 23:15, Manuel Lemos wrote:

> Hello,
> 
> On 12/23/2003 03:56 PM, Larry Brown wrote:
> > How does perl show progress of the upload if it is a server side scripting
> > language and php can't do it because it is server side?
> 
> The problem is not showing progress but rather tracking progress.
> 
> What you seem to not be understanding is that PHP handles uploads 
> internally. So, by the time a PHP script that gets the submitted upload 
> form starts running, the upload was already ended and the uploaded files 
> were copied to some temporary files.
> 
> PHP itself does not give you a chance to track the progress of the 
> upload because that is something handled at the HTTP request level.
> 
> The Perl solution is based on a script that handles and tracks the 
> upload and another that shows the progress. That is why you need to show 
> progress in a popup or a separate frame.
> 
> 
> > -Original Message-
> > From: Manuel Lemos [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 23, 2003 12:46 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Re: progress in PHP
> > 
> > 
> > Hello,
> > 
> > On 12/23/2003 03:31 PM, James Kaufman wrote:
> > 
> Join the 11,000 people who use megaupload progress bar (with a little
> help from perl)
> http://www.sourceforge.net/projects/megaupload/
> >>>
> >>>I tried. It wasn't worth all the perl mods I would to have had to
> >>>install to make it work.
> >>
> >>
> >>Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure
> >>php approach to displaying a progress bar. I haven't used it, but the
> > 
> > demos
> > 
> >>look good.
> > 
> > 
> > This a different thing. This is meant to track progress of server side
> > tasks. File uploading is a client side task.
> > 
> > Unfortunately, AFAIK there is no way to handle streams of HTTP requests.
> > Therefore, there is no way to handle upload progress with a PHP only
> > solution.
> > 
> > The Raditha megaupload solution is based on a combination of Perl with
> > PHP. It is probably the solution that uses more PHP but the hard work is
> > done using Perl.
> 
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> Free ready to use OOP components written in PHP
> http://www.phpclasses.org/


Re: [PHP] Re: progress in PHP

2003-12-23 Thread Manuel Lemos
Hello,

On 12/24/2003 03:47 AM, Jeremy Johnstone wrote:
FWIW, here is a link to a PHP extension which enables the ability to
track the progress of a PHP upload. I did not write the extension, so if
it breaks something I am not responsible. It was previously discussed on
the php-dev mailing list ([EMAIL PROTECTED]) a month or two ago,
but it was never decided if it would be officially added into PHP.
http://pdoru.from.ro/
This is not really an extension but rather a patch to change PHP 
behaviour in order to store upload progress in files that can be 
examined by another process.

Apparently, nobody with enough karma seemed interested to commit the 
patch. It probably needs further checking to ensure that it is safe to 
execute, especially in shared environments where different hosting 
clients may be using the same Web server.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Error with Absolute URLs

2003-12-23 Thread Brad
Hi,

I keep getting errors on my websites, that contain absolute URLs, e.g. 
http://www.url.com/blah.html. With most, being in the folder of my 
website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but 
there's a script I use to display the network statistics of an IRC 
network, which is located on a different server, so i can't use the 
$_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to 
this. I'm almost to the stage of just asking the script owner if I can 
have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT'] 
variable.

It was working fine until the server admin updated to PHP 4.3.4, but he 
is not the best with PHP/HTML programming, so he can't help much.

Hope someone can help.

Thanks!

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


[PHP] How do I make these two MySQL queries into one line?

2003-12-23 Thread Dave G
PHP Gurus,
I'll consider myself lucky to get a response so close to
Christmas, but here goes.

I have two tables. One contains member information, and one
lists which groups the members belong to. I want to select the email
address of active members from the member information table, and I want
to select only the members which belong to a particular group. Right now
I can only think to accomplish this in two lines:
$query1 = "SELECT member_id FROM groups WHERE group_id =" .
$chosenGroup
Then, take the results and do another query:
$query2 = "SELECT email FROM members WHERE active = yes AND
member_id =" . $query1Results

But surely there's a way to collapse this into one MySQL line.

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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