php-general Digest 6 Jul 2004 17:15:31 -0000 Issue 2861

Topics (messages 189763 through 189807):

Grabbing last file...
        189763 by: Ashley M. Kirchner
        189768 by: Curt Zirzow

Re: uniqid function
        189764 by: Curt Zirzow
        189767 by: Michael Gale

session, explain?
        189765 by: Louie Miranda
        189769 by: Curt Zirzow
        189771 by: Ligaya Turmelle

images outside of document root
        189766 by: Dennis Gearon
        189772 by: Curt Zirzow

Re: file locking over NFS?
        189770 by: Brent Clark
        189776 by: kyle
        189778 by: kyle
        189779 by: Manuel Lemos
        189801 by: kyle

MySql DB access upon browser close
        189773 by: Frank Voorburg

E-bay API and PHP
        189774 by: zareef ahmed
        189775 by: Brent Clements
        189780 by: Manuel Lemos

Re: file upload and permission problem.
        189777 by: Angelo binc2
        189790 by: raditha dissanayake

Form Submission
        189781 by: Shaun
        189782 by: Torsten Roehr
        189792 by: Jason Wong
        189793 by: Torsten Roehr
        189796 by: Marek Kilimajer
        189800 by: Richard Davey
        189804 by: Torsten Roehr

File Created Date?
        189783 by: Richard Davey
        189785 by: zareef ahmed
        189786 by: zareef ahmed
        189787 by: Jay Blanchard

Want to save png to file
        189784 by: Victor Spång Arthursson
        189795 by: Jason Wong

Re: PHP Web Mail
        189788 by: Christophe Chisogne
        189791 by: raditha dissanayake
        189799 by: raditha dissanayake

Recent numbers on PHP Market Penetration?
        189789 by: Bert Slagter
        189798 by: Christophe Chisogne

Re: fopen newbie question
        189794 by: Josh Close

Dynamic var
        189797 by: Pierre

Beginners question... (I think)
        189802 by: Koyaan

Two Sites - One Backend
        189803 by: Shaun
        189807 by: Gerben

user tracking
        189805 by: Christian Calloway

Database Driven Links
        189806 by: Shaun

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 ---
I have a capture script that runs every 2 minutes and dumps an image into a folder. I'm trying to write a script (which will get included in another) that will grab the last image in the folder and pass it on.


The images are saved as 'capture.####.jpg' where #### is the timestamp of the capture , starting at midnight, or 0000, and going till 2358. The structure of the folder is as follows:

   /capture/.year/month/day/capture.####.jpg

   An image captured today, at 4:28 pm, the full path/file would be:
   /capture/.2004/07/06/capture.1628.jpg
   (yes, there's a dot before the year)

So the script will have to automatically figure out the year/month/day (which I think is easy enough with a simply date function) but then will have to figure out which is the latest capture saved that it can then grab (note, I can not rely on using a date/time function because the server time may not be exactly the same as the last file saved.)

And all it has to do is figure out the last file, generate an <img...> tag and return it. Voila.

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

--- End Message ---
--- Begin Message ---
* Thus wrote Ashley M. Kirchner:
> 
>    I have a capture script that runs every 2 minutes and dumps an image 
> into a folder.  I'm trying to write a script (which will get included in 
> another) that will grab the last image in the folder and pass it on.
> 
>    The images are saved as 'capture.####.jpg' where #### is the 
> timestamp of the capture , starting at midnight, or 0000, and going till 
> 2358.  The structure of the folder is as follows:
> 
>    /capture/.year/month/day/capture.####.jpg
>
>...
> 
>    And all it has to do is figure out the last file, generate an 
> <img...> tag and return it.  Voila.

have your  image generation script do somthing like this:

  1. generate new image /capture/.year/month/day/capture.#.jpg
  2. copy /capture/.year/month/day/capture.#.jpg /capture/current.jpg


That way you can simply put in your img tag:
  <img src="/capture/current.jpg">

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--- End Message ---
--- Begin Message ---
* Thus wrote Michael Gale:
> Hello,
> 
>       I have a question about the uniqid function ... on a loaded system ...
> lets say 60 people connected with each person making 2-3 web request per
> second.
> 
> Each request running the following php command:
> 
> "$token_name=md5(uniqid(rand(), true));"
> 
> What would the odds be of the $token_name being repeated ? Is this
> something I would have to worry about ?.

The odds are very low. uniqid() by itself is based of of time to
the microsecond. The lcg paremater randomized a psudo number to avoid
collisions at the same microsecond. And the rand(), depending on you're
system, defaults to seeding itself with including the PID. So the
seed to rand() should, in theory, be different for each differnt
request.

The md5() is rather pointless in the uniqness of the token, it will
basically prevent intruders from predicting a token. Nonetheless,
it's probably still desired in your token generation.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--- End Message ---
--- Begin Message ---
Thanks for the reply.

Michael.

On Tue, 6 Jul 2004 06:38:57 +0000
Curt Zirzow <[EMAIL PROTECTED]> wrote:

> * Thus wrote Michael Gale:
> > Hello,
> > 
> >     I have a question about the uniqid function ... on a loaded
> >     system ...
> > lets say 60 people connected with each person making 2-3 web request
> > per second.
> > 
> > Each request running the following php command:
> > 
> > "$token_name=md5(uniqid(rand(), true));"
> > 
> > What would the odds be of the $token_name being repeated ? Is this
> > something I would have to worry about ?.
> 
> The odds are very low. uniqid() by itself is based of of time to
> the microsecond. The lcg paremater randomized a psudo number to avoid
> collisions at the same microsecond. And the rand(), depending on
> you're system, defaults to seeding itself with including the PID. So
> the seed to rand() should, in theory, be different for each differnt
> request.
> 
> The md5() is rather pointless in the uniqness of the token, it will
> basically prevent intruders from predicting a token. Nonetheless,
> it's probably still desired in your token generation.
> 
> 
> Curt
> -- 
> First, let me assure you that this is not one of those shady pyramid
> schemes you've been hearing about.  No, sir.  Our model is the
> trapezoid!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
session_start();
setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
return session_id();

Can someone help me figure out what does the session of this code means?

-- 
Louie Miranda
http://www.axishift.com

--- End Message ---
--- Begin Message ---
* Thus wrote Louie Miranda:
> session_start();
> setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
> return session_id();
> 
> Can someone help me figure out what does the session of this code means?

Looking at the description of setcookie:
bool setcookie ( string name [, string value [, int expire [,
string path [, string domain [, int secure]]]]])

that sets a cookie named "cartId" with the value of what the id of
the session is for the length of 30 days.

Now of course, if the default session settings havn't been
modified, the session_id() will become invalid before the
expiration of  this cookie being set.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--- End Message ---
--- Begin Message ---
Louie Miranda wrote:

> session_start();
http://www.php.net/manual/en/function.session-start.php
> setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
http://www.php.net/manual/en/function.setcookie.php
> return session_id();
http://www.php.net/manual/en/function.session-id.php
>
> Can someone help me figure out what does the session of this code means?
>

--
Respectfully,
Ligaya Turmelle



--- End Message ---
--- Begin Message ---
I want to keep an entire library OUTSIDE of the document root. The library includes 
some imgages. How can I have the browser include the imageges?

I've hard of BASE64'ing the images into the header and decoding them using javascript. Is this the best way? Where is code to do that?
--- End Message ---
--- Begin Message ---
* Thus wrote Dennis Gearon:
> I want to keep an entire library OUTSIDE of the document root. The library 
> includes some imgages. How can I have the browser include the imageges?
> 
> I've hard of BASE64'ing the images into the header and decoding them using 
> javascript. Is this the best way? Where is code to do that? 

no, its probably the worst way. 

To have the browser reference images outside the document root
you'll have to create a php wrapper function that decides on what
to do:

<img src="/showimage.php?file=foobar.jpg">

showimage.php:
<?php

$file = $_GET['file'];

// authentication if needed...
// check for valid file, etc..

header('Content-Type: image/jpeg'); // send right content type
readfile($path_outside_docroot . $file);


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--- End Message ---
--- Begin Message ---
Hi there

If i am not mistaken, that is a standard part of the nfs suite.
All you need to make sure is that your export is correct, and the you are
not using the
-nolock option.
Other than that if its PHP you more interested in, look at the flock()
function.

Kind Regards
Brent Clark

-----Original Message-----
From: kyle [mailto:[EMAIL PROTECTED]
Sent: Monday, July 05, 2004 6:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] file locking over NFS?


Hi all,

Is there any simple, safe, and efficiency way to do file locking over NFS?

Thanks.

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

--- End Message ---
--- Begin Message ---
Thanks a lot , your information is really useful for me.

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> kyle wrote:
> > Hi all,
> >
> > Is there any simple, safe, and efficiency way to do file locking over
NFS?
> >
> > Thanks.
> >
>
> You can mysql locks (maybe it works in other databases too):
>
> GET_LOCK(str,timeout);
> RELEASE_LOCK(str);

--- End Message ---
--- Begin Message ---
I found this from php function list manual:
"flock() will not work on NFS and many other networked file systems. Check
your operating system documentation for more details."

I wish flock can do NFS file locking, but offical manual says no to

"Brent Clark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there
>
> If i am not mistaken, that is a standard part of the nfs suite.
> All you need to make sure is that your export is correct, and the you are
> not using the
> -nolock option.
> Other than that if its PHP you more interested in, look at the flock()
> function.
>
> Kind Regards
> Brent Clark
>
> -----Original Message-----
> From: kyle [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 05, 2004 6:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] file locking over NFS?
>
>
> Hi all,
>
> Is there any simple, safe, and efficiency way to do file locking over NFS?
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hello,

On 07/06/2004 05:25 AM, Kyle wrote:
I found this from php function list manual:
"flock() will not work on NFS and many other networked file systems. Check
your operating system documentation for more details."

I wish flock can do NFS file locking, but offical manual says no to

This is not accurate. There NFS systems that were meant to support locking.

--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Hi Manuel,

Do you mean I can just use flock over NFS ?

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> On 07/06/2004 05:25 AM, Kyle wrote:
> > I found this from php function list manual:
> > "flock() will not work on NFS and many other networked file systems.
Check
> > your operating system documentation for more details."
> >
> > I wish flock can do NFS file locking, but offical manual says no to
>
> This is not accurate. There NFS systems that were meant to support
locking.
>
> -- 
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Hi,

Any help with the following is appreciated. I want to use php to store the
time that a user spent on 1 particular webpage in a mysql database. What I'm
trying to do now is:

1) using Javascript's OnLoad event I read out the time when the user 1st
opens the webpage
2) using Javascript's OnUnLoad event I read out the time when the user
leaves the webpage
3) in the same OnUnLoad event I open a new browser window using:
test.php?time=xxx, where xxx is the time difference between steps 1 and 2.
4) In the newly opened browser window I use $_GET['time'] to read out the
time in PHP and then write it to the database.
5) using Javascript's OnLoad event for this situation, I close the window
that I temporarily opened.

In a nutshell, I am opening a second window, pass on the information on the
url, and then write it to the database, and finally closing the second
window again. Not the most elegant and efficient solution and I'm hoping
someone has a better suggestion/example. Perhaps something with PHP's
sessionid timeout is possible?

Thanks,

-Frank

--- End Message ---
--- Begin Message ---
Hi,
   How can we communicate to E-bay API through PHP?
is it possible? or any alternative to E-bay API?
Basically I am going to develop a application with
E-bay functionality like Product Management, Auction
Mangement, and Digital Product delievey.

any info  as usual will be appriciated.

zareef ahmed 

=====
Zareef Ahmed :: A PHP Developer in Delhi(India).
Homepage :: http://www.zasaifi.com


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

--- End Message ---
--- Begin Message ---
Sign up for the ebay developers program and they give you access to their
api plus instructions on how to implement. You will also have access to a
sandbox environment to test your code. Be aware that once you move past the
sandbox environment, access to the ebay api is charged based on the number
of remote procedure calls you use. If I recall, you purchase in blocks.

----- Original Message ----- 
From: "zareef ahmed" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 06, 2004 2:31 AM
Subject: [PHP] E-bay API and PHP


> Hi,
>    How can we communicate to E-bay API through PHP?
> is it possible? or any alternative to E-bay API?
> Basically I am going to develop a application with
> E-bay functionality like Product Management, Auction
> Mangement, and Digital Product delievey.
>
> any info  as usual will be appriciated.
>
> zareef ahmed
>
> =====
> Zareef Ahmed :: A PHP Developer in Delhi(India).
> Homepage :: http://www.zasaifi.com
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hello,

On 07/06/2004 04:31 AM, Zareef Ahmed wrote:
Hi,
   How can we communicate to E-bay API through PHP?
is it possible? or any alternative to E-bay API?
Basically I am going to develop a application with
E-bay functionality like Product Management, Auction
Mangement, and Digital Product delievey.

You may want to try this class that is exactly meant for that:

Class: eBayAPI
http://www.phpclasses.org/ebayapi


--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
So if it is a windows box, how would I set the permissions? or is the
permissions of the person who is logged into the machine?

Thanks In advance

>>> raditha dissanayake <[EMAIL PROTECTED]> 7/5/2004 4:08:41 PM >>>
Angelo binc2 wrote:

>Hi all I am trying to upload a file using PHP.
>
>I can successfully create a folder, but when I try upload the file it
>gives me the following error when using the move_uploaded_file
function:
>
>
>Warning: move_uploaded_file(c:/program files/apache
>group/apache/htdocs/zerodocs/40/) [function.move-uploaded-file]:
failed
>to create stream: Permission denied in c:\program files\apache
>group\apache\htdocs\zero\opdocument.php on line 80
>  
>
Please post only the relevent sections of your code in future messages

instead of the complete script. You are more likely to get an answer
then.

This problem reffered to seemed to be caused by the user that owns the

webserver process not having the write permissions for the folder that

you have created. I am sure this would have been discussed in the user

contributed comments under the file uploaded sections of the manual. 
Usually giving write permissions is all that it would take.


-- 
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php 
Sneak past the PHP file upload limits.

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

--------------------------------------------------------------------
Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--- End Message ---
--- Begin Message ---
Angelo binc2 wrote:

So if it is a windows box, how would I set the permissions? or is the
permissions of the person who is logged into the machine?


That's not a PHP question! and i know very little about windows but I can tell you that you can do it by right clicking on a folder and selecting properties. Further questions would really be off topic for this list.

Thanks In advance



raditha dissanayake <[EMAIL PROTECTED]> 7/5/2004 4:08:41 PM >>>


Angelo binc2 wrote:



Hi all I am trying to upload a file using PHP.

I can successfully create a folder, but when I try upload the file it
gives me the following error when using the move_uploaded_file


function:


Warning: move_uploaded_file(c:/program files/apache
group/apache/htdocs/zerodocs/40/) [function.move-uploaded-file]:


failed


to create stream: Permission denied in c:\program files\apache
group\apache\htdocs\zero\opdocument.php on line 80




Please post only the relevent sections of your code in future messages

instead of the complete script. You are more likely to get an answer
then.






--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.


--- End Message ---
--- Begin Message ---
Hi,

How can I check if a form has been submitted, I have seen a demo that uses
the following:

if(isset($HTTP_POST_VARS))

But I understand that $HTTP_POST_VARS is depricated...

Thanks for your help

--- End Message ---
--- Begin Message ---
"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> How can I check if a form has been submitted, I have seen a demo that uses
> the following:
>
> if(isset($HTTP_POST_VARS))
>
> But I understand that $HTTP_POST_VARS is depricated...
>
> Thanks for your help

Check the $_POST superglobal:

if (isset($_POST['name_of_your_button'])) {
}

Regards, Torsten

--- End Message ---
--- Begin Message ---
On Tuesday 06 July 2004 17:50, Torsten Roehr wrote:

> > How can I check if a form has been submitted, I have seen a demo that
> > uses the following:
> >
> > if(isset($HTTP_POST_VARS))
> >
> > But I understand that $HTTP_POST_VARS is depricated...
> >
> > Thanks for your help
>
> Check the $_POST superglobal:
>
> if (isset($_POST['name_of_your_button'])) {
> }

It might not be a good idea to rely on the "submit" button to be set. Some 
browsers do not set/send it if you didn't explicitly click on the "submit" 
button. I would use:

  if (!empty($_POST)) { ... }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Style may not be the answer, but at least it's a workable alternative.
*/

--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 06 July 2004 17:50, Torsten Roehr wrote:
>
> > > How can I check if a form has been submitted, I have seen a demo that
> > > uses the following:
> > >
> > > if(isset($HTTP_POST_VARS))
> > >
> > > But I understand that $HTTP_POST_VARS is depricated...
> > >
> > > Thanks for your help
> >
> > Check the $_POST superglobal:
> >
> > if (isset($_POST['name_of_your_button'])) {
> > }
>
> It might not be a good idea to rely on the "submit" button to be set. Some
> browsers do not set/send it if you didn't explicitly click on the "submit"
> button. I would use:
>
>   if (!empty($_POST)) { ... }

How do you check which button was pressed (read: which action should be
performed) when using this check?

Regards, Torsten

--- End Message ---
--- Begin Message --- Shaun wrote:
Hi,

How can I check if a form has been submitted, I have seen a demo that uses
the following:

if(isset($HTTP_POST_VARS))

But I understand that $HTTP_POST_VARS is depricated...

Depricated or backward compatible, depends on your view. The "hot new way" is to use $_POST superglobal array

--- End Message ---
--- Begin Message ---
Hello Jason,

Tuesday, July 6, 2004, 2:37:08 PM, you wrote:

JW> It might not be a good idea to rely on the "submit" button to be set. Some
JW> browsers do not set/send it if you didn't explicitly click on the "submit"
JW> button. I would use:

Absolutely. If you hit ENTER to submit a form (rather than click the
button) you often don't get sent the button value.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Jason,
>
> Tuesday, July 6, 2004, 2:37:08 PM, you wrote:
>
> JW> It might not be a good idea to rely on the "submit" button to be set.
Some
> JW> browsers do not set/send it if you didn't explicitly click on the
"submit"
> JW> button. I would use:
>
> Absolutely. If you hit ENTER to submit a form (rather than click the
> button) you often don't get sent the button value.
>
> Best regards,
>
> Richard Davey

I never had this problem. Usually the first submit button will come into
effect when hitting enter. And my question remains:

How do you check which button was pressed (read: which action should be
performed) when not relying on this?

Regards, Torsten

--- End Message ---
--- Begin Message ---
Hi,

Is there a way to get the timestamp when a file was CREATED? Looking
at stat I can find the modified date, last accessed and changed - but
not the created date. There doesn't appear to be a Filesystem function
for it either. I'm sure it's obvious, but it is alluding me for now.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
Hi.
[quote from php manual ]
In some Unix texts the ctime of a file is referred to
as being the creation time of the file. This is wrong.
There is no creation time for Unix files in most Unix
filesystems.
[/quote from php manual] 

http://in2.php.net/filectime

zareef ahmed

--- Richard Davey <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a way to get the timestamp when a file was
> CREATED? Looking
> at stat I can find the modified date, last accessed
> and changed - but
> not the created date. There doesn't appear to be a
> Filesystem function
> for it either. I'm sure it's obvious, but it is
> alluding me for now.
> 
> Best regards,
> 
> Richard Davey
> -- 
>  http://www.launchcode.co.uk - PHP Development
> Services
>  "I am not young enough to know everything." - Oscar
> Wilde
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


=====
Zareef Ahmed :: A PHP Developer in Delhi(India).
Homepage :: http://www.zasaifi.com


        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
Hi.
[quote from php manual ]
In some Unix texts the ctime of a file is referred to
as being the creation time of the file. This is wrong.
There is no creation time for Unix files in most Unix
filesystems.
[/quote from php manual] 

http://in2.php.net/filectime

zareef ahmed

--- Richard Davey <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a way to get the timestamp when a file was
> CREATED? Looking
> at stat I can find the modified date, last accessed
> and changed - but
> not the created date. There doesn't appear to be a
> Filesystem function
> for it either. I'm sure it's obvious, but it is
> alluding me for now.
> 
> Best regards,
> 
> Richard Davey
> -- 
>  http://www.launchcode.co.uk - PHP Development
> Services
>  "I am not young enough to know everything." - Oscar
> Wilde
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


=====
Zareef Ahmed :: A PHP Developer in Delhi(India).
Homepage :: http://www.zasaifi.com


        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
[snip]
Is there a way to get the timestamp when a file was CREATED? Looking
at stat I can find the modified date, last accessed and changed - but
not the created date. There doesn't appear to be a Filesystem function
for it either. I'm sure it's obvious, but it is alluding me for now.
[/snip]

The date CREATED would be the first MODIFIED date....once a file has
been modified the date is replaced and the orginal date is "lost to the
ether". On docs created in Window$ programs the date created is saved
for access by the application, but the date modified is what is shown if
you are exploring directory lists.

--- End Message ---
--- Begin Message ---
Hi!

Creating a transparent png using GD and PHP is (almost) no problem, but it's impossible to save…

No matter what I try, the saved image wont remember that it's transparent. I suspect the reason it works "on the fly" is because I manually set the header to image/png, but if I try so save the stream to a file, the transparency disappears…

Please please please somebody help!

Sincerely

Victor

--- End Message ---
--- Begin Message ---
On Tuesday 06 July 2004 19:48, Victor Spång Arthursson wrote:

> Creating a transparent png using GD and PHP is (almost) no problem, but
> it's impossible to save…

Here you say it's impossible to save, but then further down you contradict 
this by saying that you did manage to save it - only the transparency 
disappears.

Please try to describe your problem accurately so that you don't confuse the 
people who may want to help!

> No matter what I try, the saved image wont remember that it's
> transparent. I suspect the reason it works "on the fly" is because I
> manually set the header to image/png, but if I try so save the stream
> to a file, the transparency disappears…

OK try this:

1) stream the image, then in your browser save the image to file.

2) don't stream the image, instead save it as file on the server, then ftp (or 
whatever) the file back to your local computer.

3) now compare the two files to see if they are the same. In Windows use the 
file compare program 'fc', in *nix use 'diff'. Remember to do a binary 
comparison in both cases.

If both files are exactly the same then you've got a crappy browser - it 
should display an image file in the same manner regardless of what headers 
came with it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The avoidance of taxes is the only intellectual pursuit that carries any
reward.
                -- John Maynard Keynes
*/

--- End Message ---
--- Begin Message --- raditha dissanayake a écrit :
at the risk of starting a flame war: IMAP is the devine way of using email. POP3 sux. :-)

IMAP being a general file access protocol, there are inherent security problems to be aware of. On some srv, you could easily get /etc/passwd by simply knowing a single user/password. And users with (really very) bad passwords are quite common. Ok, it's often configuration issues, but better to know it...

Yes POP3 isnt the best one:
1. it's unsecure (clear text password)
   -- but can be improved (APOP, POP3+SSL etc)
2. not suitable for moving people, as all mail
   leaving the server's mail spool go the one
   client box hard disk, not two (synch issues)

But has advantages too
- simple and efficient
- all webmail soft generally sucks (slow, folder management etc)
- some security issues avoided with good mail client like
  mozilla (XSS, javascript stealing ident cookies, etc)
- every mail client supports it (not same with IMAP or POP3+SSL)

About webmail on a server I manage, I use these Perl ones
(sorry, not PHP):
1. neomail (html not supported, so much more secure)
2. openwebmail (html supported)
One disavantage : they run suid root...

For PHP based webmail, there are many, from memory I can
remember those quite well-known (YMMV)
- squirrelmail
- imp horde
- ilohamail
A simple google search leads many results. By example
http://www.cgi-bin.com/PHP_Scripts/Email/index.html

So, make an educated guess : check their capabilities
(only the one you needs), their security history
(just google for formmail.pl and formmail.php for
 scary stories), test some an choose the best one
that suit your needs.

Just my 2cents,

Christophe
--- End Message ---
--- Begin Message ---
Justin Patrin wrote:

On Mon, 5 Jul 2004 13:01:08 -0400, John Hicks <[EMAIL PROTECTED]> wrote:


On Monday 05 July 2004 07:33 am, I.A. Gray wrote:


Thanks- looked at Squirrel Mail. Looks really good,
however we use POP3- I don't think Squirrel Mail
uses POP3 does it?


Most if not all web-based mail clients use IMAP since a
web-based (i.e. browser-based) client can't store the
received mail on the local computer the way a
POP3-based email client does.



I'm not sure why there's all this talk about not using POP3. You can
leave messages on the server with POP3 as well, it's just not as fully
featured as IMAP. Some webmail clients *do* support POP3 while leaving
the messages on the server. In fact, I think that the PHP functions
are the same for both IMAP and POP.


Very true. However to do the same with POP3 takes a lot more effort and I thought programmers are supposed to be lazy ;-)


-- Raditha Dissanayake. --------------------------------------------- http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits.

--- End Message ---
--- Begin Message ---
Christophe Chisogne wrote:

raditha dissanayake a écrit :

at the risk of starting a flame war: IMAP is the devine way of using email. POP3 sux. :-)


IMAP being a general file access protocol, there are inherent
security problems to be aware of. On some srv, you could easily
get /etc/passwd by simply knowing a single user/password.

Please explain how.

1. it's unsecure (clear text password)
   -- but can be improved (APOP, POP3+SSL etc)

you can use SSL with IMAP too.

--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.

--- End Message ---
--- Begin Message ---
Good afternoon,

I'm looking for recent numbers of the PHP Market Penetration - if possible compared to ASP/JSP. The netcraft survey only shows apache vs. IIS, can't find anything about PHP there.

Thanks!

Bert
--- End Message ---
--- Begin Message --- Bert Slagter a écrit :
I'm looking for recent numbers of the PHP Market Penetration - if possible compared to ASP/JSP. The netcraft survey only shows apache vs. IIS, can't find anything about PHP there.

It seems you didnt search Google very long.

Simple google searches like
"number of sites running php site:netcraft.com"
lead to results on netcraft.com, by example
a "php vs coldfusion vs jsp" page [1] found via link
on the 2003/08 netcraft survey [2]

but netcraft now wants money to access some informations,
by example a $1800 subscription seen on their ssl survey page[3]

Google leads me to Zend.com, who thinks (February 18, 2002)
"the number of web sites running PHP now exceeding 7 million" [4]
But other sources provide more recent figures [5,6]

Finding more information is left as exercice ;-)

Christophe

[1] PHP growing surprisingly strongly on Windows
http://news.netcraft.com/archives/2003/08/30/php_growing_surprisingly_strongly_on_windows.html

[2] netcraft survey 2003/08
http://news.netcraft.com/archives/2003/08/

[3] Netcraft SSL Survey
http://news.netcraft.com/archives/2003/04/09/netcraft_ssl_survey.html

[4] Zend Unveils New Face of PHP Encoding
http://www.zend.com/news/zendpr.php?id=47

[5] Usage Stats for June 2004
http://www.php.net/usage.php

[6] Apache Module Report (July 1st, 2004)
http://www.securityspace.com/s_survey/data/man.200406/apachemods.html

--- End Message ---
--- Begin Message ---
Can you post your code so we can see what might be going on?

-Josh


On Mon, 5 Jul 2004 13:06:58 -0400, Joe Carey <[EMAIL PROTECTED]> wrote:
> I'm trying to read a text file from one server from another.  When I read
> from server A to B it works fine and I get the text output that I'm looking
> for.  But when I read from B to A I get "Failed to open stream: FTP server
> reports 550 Can't check for file existence"  I'm sure that its something how
> the server is configured but I can't figure out what I need to ask my host
> to change.  Any ideas please?
> 
> Joe Carey
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.712 / Virus Database: 468 - Release Date: 6/29/2004
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
Hi all
I've a little problem with creating a dynamic var.
This is my line code :
$erreur .='Le champs '.${'corresp_chps[\''.$champs.'\']'}.'<br>';
Yes i need the quote, cause it's not my var but a webservice one and the
name var is 001 so i've indexed my array with '001' etc..;
Thx a lot 

And this is the array depending of
$corresp_chps=array (
'001' => 'Société',
'002' => 'Adresse',
'003' => 'Complément',
'004' => 'Code postal',
'005' => 'Ville',
'006' => 'Comté/Cedex',
'007' => 'Pays',
'008' => 'Téléphone',
'025' => 'Gsm',
'009' => 'Fax',
'012' => 'Civilité',
'013' => 'Nom',
'014' => 'Prénom',
'015' => 'Email',
'026' => 'Web',
'036' => 'Fonction',
'010' => 'Question A',
'011' => 'Question A autre',
'016' => 'Question B',
'017' => 'Question B autre',
'035' => 'Question C',
'042' => 'Question C autre',
'033' => 'Coupon SNCF');

--- End Message ---
--- Begin Message ---
Unfortunately I'm not well informed about php and everything that comes with
it.
My site is created by someone who is totally out of the picture at ther
moment and I have a problem
On my site it was possible to create "aktueeltjes" (newsflashes) and add
them on the "aktueeltjes" part of my site
I logged in as user or administrator (depended on what I planned to do). I
filled in the formula, ...my password... and a new 'aktueeltje' was on line.

A few moths I haven't used it. (edited or added someting) Yesterday I did
everything as usual
Now I can still log in... but whenI  have edited someting or added a
newsflash... I fill in my password ...send.... and it refuses to do anything

Instead of that I get a warning:

Warning: fopen(news.txt) [function.fopen]: failed to create stream:
Permission denied in /www/htdocs/~~~~~/site/_actueel/admin/ed.php on line 88

Warning: fwrite(): supplied argument is not a valid stream resource in
/www/htdocs/~~~~~/site/_actueel/admin/ed.php on line 90

(instead of ~~~~~~ my sitename appeared off course... but to avoid problems
with certain individuals :-)))

Can anyone give me a hint please?
I have no experience at all with this kind of problems
You can also mail me if you like:  " writetokoyaan(A)hotmail.com

Tnxxxxx a lot
Koyaan

--- End Message ---
--- Begin Message ---
Hi,

I have created an online scheduling system using PHP and MySQL. The site is
uses CSS for the presentation and each page uses a header and footer file so
that only core functionality is contained in each page. I now need to create
another site which runs using the same database and function files but looks
completely different. So the only files I would need to add here are a new
header, footer and CSS file. The new site will allow limited functionality
to the current site. The functionality will be limited by the options
viewable in the menu.

My question is how can I configure the site such that if URL X is entered
then the relevant header footer and CSS files are loaded and if URL Y is
entered a different header, footer and CSS file is loaded?

Thanks for your help

--- End Message ---
--- Begin Message ---
Are you using 2 different servers or just one? if only one then how would
URL X and URL Y look?
Since X and Y will refer to a different file, my suggestion is to change the
include('X-header') to inlcude('Y-header') in the Y version.

Some more info whould be nice

"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have created an online scheduling system using PHP and MySQL. The site
is
> uses CSS for the presentation and each page uses a header and footer file
so
> that only core functionality is contained in each page. I now need to
create
> another site which runs using the same database and function files but
looks
> completely different. So the only files I would need to add here are a new
> header, footer and CSS file. The new site will allow limited functionality
> to the current site. The functionality will be limited by the options
> viewable in the menu.
>
> My question is how can I configure the site such that if URL X is entered
> then the relevant header footer and CSS files are loaded and if URL Y is
> entered a different header, footer and CSS file is loaded?
>
> Thanks for your help

--- End Message ---
--- Begin Message ---
Hey everybody,

I am looking for some type of user tracking/stat collecting package. I am
sure there's a million; any recommendations? We have some specific needs as
well, so mostly likely I will be have to make some code changes. So the
simpler package the better.

Christian

--- End Message ---
--- Begin Message ---
Hi,

I am modifying my site so that links for each page are held in a database to
make my site more portable. However if I have link such as
edit_user.php?user_id=$_GET[user_id] stored in the database will the $_GET
variable get processed and the appropriate value returned to the browser?

Thanks for your help

--- End Message ---

Reply via email to