Fw: [PHP] Translating email to (real) plain text...

2001-12-28 Thread David Bouw

Hi Richard,

> > So far so good! Only problem which I have is that some (=most)
> > people create email with clients that output email with HTML
> > codes (Internet Explorer for example)..

> Internet Explorer is a browser, it doesn't create email.
It was a bit late, I meant Outlook Express which comes/came with Internet Explorer..

> Does anyone khow how this is done..?
> Use either the imap extension, or the mimeDecode class available
> in PEAR, or here:
> http://www.phpguru.org

Thanks for the tip!  I grabbed (your) code and tried to decode some messages..
This (almost) worked perfectly..!!!. I only have the following problem: I (also) 
use
your html.mime.mail class, for generating outgoing messages in php... :-)

All messages generated by this class I can't decode the body.. :-(

Because I am using your mime_mail.class quite some time I took a look at the version I 
was
using.. I saw that I was still running 1.26..  I can remember that when I installed 
it, I
had a
lot of trouble getting the HTML emails to display correctly.. Back then I fixed it by
removing all the
'\r'  characters in the source..  (I think this is the reason the decode class won't
decode the
body..)

I grabbed version (2.0.3) with the hope that it would work out of the box.. But I still
(now) have the same problem
which I had with 1.26
I saw that you could define the CRLF yourself, I fiddled with '\n', '\r\n' and a few
others..  But this doesn't seem to do anything for me...  :-(

I have attached the -not-working- generated email.. This was done using PHP 4.0.6 and 
the
internal mail function..
(Qmail delivered the email.)

I will give the smtp class a try tomorrow to see if that will work, but I still don't
really understands what it does.. (Does it inject the email
in mailer for the given IP number..?? Or does it try to deliver email himself to 
different
hosts..?)

I will try to solve the html.mime.class problems, and I think that will then also solve
the decoding problem I have now..

 Bye Bye
David


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Modify someone else's session register

2001-12-28 Thread Dave Brotherstone

Not really, but you could...

You would somehow have to get the session id from user 2 to user 3 (this
would depend how your site worked).  Then you could access the session
variables - it depends how your sessions are stored.  If they were stored in
a database, then you could read them (by default they're in /tmp, in a
fairly easy to follow format).  I probably wouldn't recommend changing the
variables in there (/tmp) though - but you could if they were held in a
database.  I believe you can change the "session handler" in order to do
this, but I've never done it.

Dave.

> -Original Message-
> From: Alex Vargas [mailto:[EMAIL PROTECTED]]
> Sent: 28 December 2001 02:23
> To: [EMAIL PROTECTED]
> Subject: [PHP] Modify someone else's session register
>
>
> Hi.
>
> Let's suppose I have 3 users in my site, each of them generating their
> respective session variables. Assuming I have a session variable named
> $variable, I'll end up in the server with 3 values: $variable_1,
> $variable_2
> and $variable_3.
>
> My question is: is there a way I can change let's say the variable of the
> second user when the third user is running the php script? Can I
> access (and
> change) the session registers generated by the users?
>
> Thanks for your help,
>
> Alex.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: hotmail settings POP and SMTP under Mozilla

2001-12-28 Thread Jerry

It's not a PHP question, is it ?

I didn't test it with Mozilla, but with MSIE it works:
Go to your Hotmail Inbox, and bookmark it.
For me it was working only with M$ Windows XP not previous versions...

Jerry

Ger wrote:
> hi guys ,

> Does anybody know how to set up my mail reader (Mozilla ) to
> be able to read and send mail with my HOTMAIL account ?

> What should I put in POP ? and SMTP servers ?

> I wasn't be able to find this information ..

> Thanks in advance

> Ricardo














-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RESOLVED(maybe):Warning: Cannot send session cookie

2001-12-28 Thread Jerry Verhoef (UGBI)

mysql_query($query) or die(mysql_error($link_identifier));

die stops the script.

Or if you want a more subtile way you can try this

$result_identifier=@mysql_query($query);
if (!$result_identifier)
{
// Do some nice error handeling 
}

Jerry Verhoef

-Original Message-
From: David Jackson [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 4:09 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] RESOLVED(maybe):Warning: Cannot send session cookie


All --
It appears that the problem was a table design problems,
my primary index wasn't set to auto-increment? So I was trying to
insert records with duplicate keys !!
This of course leads to another question, how do I return SQL error messages
to the browser?

Thanks,
David

-- 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php code beautifier

2001-12-28 Thread Jerry Verhoef (UGBI)

What is a code beautifier?

-Original Message-
From: George Nicolae [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 1:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php code beautifier


do you know if exist a php code beautifier for win32? pls tell me the
address.

--


Best regards,
George Nicolae
IT Manager
___
X-Playin - Professional Web Design
www.x-playin.f2s.com






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MsSQL from FreeBSD

2001-12-28 Thread Valentin V. Petruchek

> OK, we're talking about Linux, right?

No ;) FreeBsd 4.x don't know exactly about x

> I'll bet `cat /proc/sys/fs/file-max` gives you 4096
>
> Try upping the file descriptor limit in /proc/sys/fs/file-max. That
> may or may not solve the problem; worth a try. How much memory does
> the client machine (the one you `configure'd) have?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Modify someone else's session register

2001-12-28 Thread Jerry Verhoef (UGBI)

No

Maybe you should consider database option or flat files to give info from
one user to the another?

Jerry Verhoef


-Original Message-
From: Alex Vargas [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 3:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Modify someone else's session register


Hi.

Let's suppose I have 3 users in my site, each of them generating their
respective session variables. Assuming I have a session variable named
$variable, I'll end up in the server with 3 values: $variable_1, $variable_2
and $variable_3.

My question is: is there a way I can change let's say the variable of the
second user when the third user is running the php script? Can I access (and
change) the session registers generated by the users?

Thanks for your help,

Alex.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: RESOLVED(maybe):Warning: Cannot send session cookie

2001-12-28 Thread Daniel Grace


"David Jackson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> All --
> It appears that the problem was a table design problems,
> my primary index wasn't set to auto-increment? So I was trying to
> insert records with duplicate keys !!
> This of course leads to another question, how do I return SQL error
messages
> to the browser?
>
> Thanks,
> David
>

Out of habit, I abstract all of the MySQL functions to handle this. My
current setup for http://hosting.venura.net/ (still under construction).
outputs error messages like this:

function sqlQuery($query, $secure = 0) {
 $result = mysql_query($query);
 if(!$result) {
  if($secure) {
   $query = '*** hidden ***';
  }
  else {
/* This is just an oddity from how I construct some queries, primarily
INSERTs. If all of your queries are on a single line of text with no
leading/trailing whitespace or you don't care about appearance, you can
delete this section of the code */

   $query = explode("\n", $query);
   foreach($query as $line => $text) {
$query[$line] = trim($text);
   }
   $query = implode("\n", $query);
  }

  die('Oops...Sorry, but something seems to have gone
terribly wrong...

MySQL Error Number:  ' . htmlspecialchars(mysql_errno()) . '
MySQL Error Description: ' . htmlspecialchars(mysql_error()) . '

Query Text:
' . htmlspecialchars($query) . '


(Yes, you probably have found a bug.)
  ');
 } else return ($result);
}


This will dump the query, error number and error description whenever a SQL
query fails. You can set the optional second parameter ($secure) to true if
your query involves anything that you don't want the end-user to see, such
as updating a password or something like that.

disclaimer: I didn't check to see what database engine you're using. If
you're using MySQL, this should work, otherwise use something similiar.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Modify someone else's session register

2001-12-28 Thread Jerry Verhoef (UGBI)

this is an option but it will surely break easily. 

I am not completly sure, but i think that sessions variables are write to
the "session handler" at the end of the script. (maybe one of guru's can
clarify this?)

But if this is true consider this:

user 1: is running a script/requesting a page
user 2: is writing to the session variables of user 1
user 1: script is ending and writing the session variables to the session
handler. And writes over the modified session variables.

Jerry Verhoef

-Original Message-
From: Dave Brotherstone [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Modify someone else's session register


Not really, but you could...

You would somehow have to get the session id from user 2 to user 3 (this
would depend how your site worked).  Then you could access the session
variables - it depends how your sessions are stored.  If they were stored in
a database, then you could read them (by default they're in /tmp, in a
fairly easy to follow format).  I probably wouldn't recommend changing the
variables in there (/tmp) though - but you could if they were held in a
database.  I believe you can change the "session handler" in order to do
this, but I've never done it.

Dave.

> -Original Message-
> From: Alex Vargas [mailto:[EMAIL PROTECTED]]
> Sent: 28 December 2001 02:23
> To: [EMAIL PROTECTED]
> Subject: [PHP] Modify someone else's session register
>
>
> Hi.
>
> Let's suppose I have 3 users in my site, each of them generating their
> respective session variables. Assuming I have a session variable named
> $variable, I'll end up in the server with 3 values: $variable_1,
> $variable_2
> and $variable_3.
>
> My question is: is there a way I can change let's say the variable of the
> second user when the third user is running the php script? Can I
> access (and
> change) the session registers generated by the users?
>
> Thanks for your help,
>
> Alex.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Persistent connection to Oracle with OCI

2001-12-28 Thread Berlina

Hi to everybody,

Im trying to use persistents connections to an Oracle Database through PHP,
for manageing transactions, and have some problems.

My Schema:

* Web Server: Apache 1.3.22 on a Linux RedHat 7.0
* PHP: 4.1.1 compiled with oracle module functions (OCI*)
* Data Base: Oracle 8.1.7 on a Windows NT Server

I need to manage transactions to database. For it i made a test pages like
this:

* 1 index page that generate some frames and open a persistent connection to
Oracle
* 1 frame that made an insert to one table of the database, and reopen the
persistent connection
* 1 frame that made an insert to another table of the same database, and
reopen the persistent  connection
* 1 frame with 2 buttons, one for execute a Commit and another for execture
a Rollback

 When i was using the ORA_* functions, some times works well, but other
times not work correctly...
Now using the OCI* functions dont work.
What im doing wrong?
Can somebody help me?

Avanced thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

I'm on PHP/4.0.2

i'm getting 
Fatal error: Call to undefined function: is_uploaded_file() 

how can i emulate the function 

will also nag my host but...


Paul Roberts
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 28 Dec 2001 12:45:30 -0000 Issue 1078

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


php-general Digest 28 Dec 2001 12:45:30 - Issue 1078

Topics (messages 78882 through 78928):

generalized environment for pages
78882 by: Dennis Gearon

oracle 8i stored procedures + php access
78883 by: Robert Mena

Re: Exec as user
78884 by: charlesk
78890 by: Mike Eheler

crack lib
78885 by: Dennis Gearon
78886 by: Billy Harvey
78887 by: David Piasecki
78892 by: Bogdan Stancescu
78893 by: Michael A. Peters

php code beautifier
7 by: George Nicolae
78889 by: Mike Eheler
78922 by: Jerry Verhoef (UGBI)

MySql and /var/lib/mysql/mysql.sock Problem !!!
78891 by: ger

hotmail settings POP and SMTP under Mozilla
78894 by: ger
78897 by: Bogdan Stancescu
78899 by: Rambo Amadeus
78905 by: James Cox
78911 by: James Cox
78920 by: Jerry

Can you fake a onClick?
78895 by: Douglas Harter
78896 by: Bogdan Stancescu
78900 by: Douglas Harter
78902 by: Matt Friedman
78903 by: Bogdan Stancescu

Re: Metabse and ODBC Blobs, was [Re: Store Image in Access Database]
78898 by: Manuel Lemos

Modify someone else's session register
78901 by: Alex Vargas
78919 by: Dave Brotherstone
78924 by: Jerry Verhoef (UGBI)
78926 by: Jerry Verhoef (UGBI)

FOLLOW UP:[PHP] Warning: Cannot send session cookie
78904 by: David Jackson

RESOLVED(maybe):Warning: Cannot send session cookie
78906 by: David Jackson
78921 by: Jerry Verhoef (UGBI)
78925 by: Daniel Grace

--enable-trans-sid
78907 by: phantom
78909 by: phantom

Question about using libraries without ./compile --with-library
78908 by: Joelmon2001.aol.com

PHP-4.1.1 released
78910 by: Pumar

Not PHP but MYSQL
78912 by: Steve Maroney
78913 by: Alex Vargas

Call another page after the menu had been selected
78914 by: Jack

Re: Generate Alphabet
78915 by: Philip Olson

Re: Sending out mass mail without having timeout problems ..
78916 by: Paul Roberts

Re: session class
78917 by: Chris Hall

Re: Translating email to (real) plain text...
78918 by: David Bouw

Re: MsSQL from FreeBSD
78923 by: Valentin V. Petruchek

Persistent connection to Oracle with OCI
78927 by: Berlina

is_uploaded_file
78928 by: Paul Roberts

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

Would all you experts please advise me on additions to this list? It's a list of
resources a page may need to do its job.

--
Attributes:
URL - implicit from server
Referring page - implicit from server
Target Template page(s)
Page_Security_Level
Security Object
Authentication_Server/DataBase
Name
Password
Secure_Submit (y/n)
Secure_Required(y/n)
User
Name
Secure_Submit (y/n)
Secure_Required(y/n)
Password
Name
Secure_Submit (y/n)
Secure_Required(y/n)
CreditCardServer
User
Name
Secure_Submit (y/n)
Secure_Required(y/n)
Password
Name
Secure_Submit (y/n)
Secure_Required(y/n)
MainDataBase
Authentication_Server/DataBase
Name
Password
Secure_Submit (y/n)
Secure_Required(y/n)
User
Name
Secure_Submit (y/n)
Secure_Required(y/n)
Password
Name
Secure_Submit (y/n)
Secure_Required(y/n)
GraphicsDirectory
ScriptIncludeDirectory - implict from server
EmailServer
Authentication_Server/DataBase
Name
Password
Secure_Submit (y/n)
Secure_Required(y/n)
User
Name
Secure_Submit (y/n)
Secure_Required(y/n)
Password
Name
Secure_Submit (y/n)
Secure_Required(y/n)

--- E

Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov

Read the docs about copy_uploaded_file() (this is the function with some more docs, as 
I remember).


HTH

Andrey Hristov
- Original Message - 
From: "Paul Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 2:41 PM
Subject: [PHP] is_uploaded_file


> I'm on PHP/4.0.2
> 
> i'm getting 
> Fatal error: Call to undefined function: is_uploaded_file() 
> 
> how can i emulate the function 
> 
> will also nag my host but...
> 
> 
> Paul Roberts
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Links

2001-12-28 Thread Niklas Saers Mailinglistaccount

Hi. I've got the following problem. I've taken over a website of about
1200 static pages. Yes, that's right, 1200 static pages. Containing
roundabout a zillion working and broken links. I've done my job and made a
system that actually works, importing each page (manually with a
publishing tool written for the occation in PHP), adding the metadata
needed for nice searching and presenting in the three languages I need to
support, and actually got the system working. (yes, I will probably be
writing an article about the lot, because it contained multiple fun
challenges (and of course the bit about 1200 pages routine work :-/ ) ) To
finish off, I've got one last barrier. All these pages contained links.
Because I've actually categorized the information, in addition to the
already broken links, most are now totally broken. I've set up a handler
that takes care of the most 'duh'-style breaks (like index.html now being
index.php), but I've still go to go through all these funny links and
change them. Because I'm a user at the box, not root, and the webserver
owns most of the documents that I've only got read-access to, I need to
make a script that reads the document, extracts all the links (a href and
img src mainly) and lets me edit them. Does anyone have a decent regex
string that would allow me to get all the links and then do a
search-replace through the document to put in the correct ones?

Cheers

Nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] backtracing of includes

2001-12-28 Thread Henning Sprang

Hy,
I would like to know if there is a way to get information on the include
hierarchy of files in php, especially to find out where which file is
included and trace back the line from some file until the first called
php file.

My special case here and now is that I get an error that some function
is already declared and cannot be declared again because of this.
I know i must have included the file with that function somewhere
already, but as i have lots of nested includes I have trouble right now
to find the place where ist already happens.
I know I can prevent those things in future by using things as
require_once and so on, and i can search through all the code, making
yself a map on paper to see which file includes what, but what i really
want to know is, if i can ask some function to tell me where the
function which makes the error stated above and from where the file is
included, and from where this file again is include, going as far back
until i have my first-called php file.



I hope you can understand what i mean,

henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] backtracing of includes

2001-12-28 Thread Jerry Verhoef (UGBI)

Don't think that a option like this exists.

But maybe you should consider using 

include_once or 
require_once

Also before you define the function use the function_exist("") and if the
function already exists don't redecleare it.

Jerry Verhoef

-Original Message-
From: Henning Sprang [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 2:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] backtracing of includes


Hy,
I would like to know if there is a way to get information on the include
hierarchy of files in php, especially to find out where which file is
included and trace back the line from some file until the first called
php file.

My special case here and now is that I get an error that some function
is already declared and cannot be declared again because of this.
I know i must have included the file with that function somewhere
already, but as i have lots of nested includes I have trouble right now
to find the place where ist already happens.
I know I can prevent those things in future by using things as
require_once and so on, and i can search through all the code, making
yself a map on paper to see which file includes what, but what i really
want to know is, if i can ask some function to tell me where the
function which makes the error stated above and from where the file is
included, and from where this file again is include, going as far back
until i have my first-called php file.



I hope you can understand what i mean,

henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Generate Alphabet

2001-12-28 Thread Bogdan Stancescu

Philip Olson wrote:

> > I seriously doubt your code works -- have you tested it? I think the code
> > you submitted will most probably output "1 2 3 4...24 25 26" (spaces are
> > actually \n's). I never tested it though, so I may be mistaken.
>
> Yes, it works.  Test it before posting such doubts :)
>
> Regards,
> Philip Olson

Ok, tested it and to my surprize it does work. But why?!

Questions:
1. $letter++ -- why doesn't this evaluate $letter as integer before
incrementing?
2. print $letter++ -- why doesn't this evaluate to "b" at the first loop when
it's already 'a'? Ok, this I may be able to explain because it's neither "print
++$letter" nor "print ($letter++)", but I wouldn't have trusted this syntax to
work this way a million years!

Nice, elegant code indeed! Apologies for doubting it! :-)

Bogdan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] backtracing of includes

2001-12-28 Thread Henning Sprang

Hy,

Am 28 Dec 2001 14:27:50 +0100 schrieb Jerry Verhoef (UGBI):
> Don't think that a option like this exists.
> 
> But maybe you should consider using 
> 
> include_once or 
> require_once
> 
> Also before you define the function use the function_exist("") and if the
> function already exists don't redecleare it.

That's what I wrote - I know I can use things like that, but I am
curious if there are other ways to find out which file is included by
what and which function is defined in which file - i didn't find answers
about that in the manual.

Meanwhile I found out what the real problem was, namely that a function
was declared inside a function, and the parent function was called
twice, resulting in an error. I think it's generally not recommended to
declare functions inside functions as I see no obvious reason now when
this should be useful, only that it can make things complicated as i saw
right now.(btw: this code does not come from myself, i am just making
additions to it)

So, I am still curious if and how one can trace function definitions and
includes in a convenient way.

henning


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] backtracing of includes

2001-12-28 Thread Paul Burney

on 12/28/01 8:53 AM, Henning Sprang at [EMAIL PROTECTED] wrote:

> That's what I wrote - I know I can use things like that, but I am
> curious if there are other ways to find out which file is included by
> what and which function is defined in which file - i didn't find answers
> about that in the manual.

I'm not sure if there is anything built in that you can use, but you
probably should start with the:

__FILE__ and __LINE__

constants.  The __FILE__ constant is the name of the script file being
executed.  If it's in an include file, it will be the name of the include
file, not the parent file.  The __LINE__ is the current line within the file
(include).

HTH.

Paul Burney





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Only one instance of a script at a time !

2001-12-28 Thread Nicolas Guilhot

Running a php script with a cron job, how can I do to have only one instance
of the script running ?

Thanks for any answer.


Nicolas


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Jerry Verhoef (UGBI)

Pseudo code:

check if pid file exists
yes -> DIE
no -> write pid file

At end of script
delete pid file

Jerry Verhoef

-Original Message-
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 3:32 PM
To: Php General MailingList
Subject: [PHP] Only one instance of a script at a time !


Running a php script with a cron job, how can I do to have only one instance
of the script running ?

Thanks for any answer.


Nicolas


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Julio Nobrega Trabalhando

  Another idea, run a script that opens a file and flocks it until it's
executed. I am sorry if this is dumb as I have little experience on locking
files, but, I guess if it's locked it won't get opened again and executed
(via include() or eval());

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Jerry Verhoef" <[EMAIL PROTECTED]> wrote in message
1CDA86C6527BD311B91F0008C784121003D551DF@ugbiex1">news:1CDA86C6527BD311B91F0008C784121003D551DF@ugbiex1...
> Pseudo code:
>
> check if pid file exists
> yes -> DIE
> no -> write pid file
>
> At end of script
> delete pid file
>
> Jerry Verhoef
>
> -Original Message-
> From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 28, 2001 3:32 PM
> To: Php General MailingList
> Subject: [PHP] Only one instance of a script at a time !
>
>
> Running a php script with a cron job, how can I do to have only one
instance
> of the script running ?
>
> Thanks for any answer.
>
>
> Nicolas
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> The information contained in this email is confidential and
> may be legally privileged. It is intended solely for the
> addressee. Access to this email by anyone else is
> unauthorized. If you are not the intended recipient, any
> form of disclosure, production, distribution or any action
> taken or refrained from in reliance on it, is prohibited and
> may be unlawful. Please notify the sender immediately.
>
> The content of the email is not legally binding unless
> confirmed by letter bearing two authorized signatures.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Gerard Onorato

There may be a much easier method however why not write a file and then check for it's 
existence on the next execution. Delete the file at the end of 
execution to clear the way  for the next pass.

Quick and dirty so probably at least on typo

On Fri, 28 Dec 2001 15:31:33 +0100, Nicolas Guilhot wrote:

>Running a php script with a cron job, how can I do to have only one instance
>of the script running ?
>
>Thanks for any answer.
>
>
>Nicolas
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Only one instance of a script at a time !

2001-12-28 Thread akul

Hello Jerry,

Friday, December 28, 2001, 5:37:39 PM, you wrote:

JVU> Pseudo code:

JVU> check if pid file exists
yes ->> DIE
no ->> write pid file

JVU> At end of script
JVU> delete pid file

  This code can't guarantee the result. Use file locking instead.
  

JVU> -Original Message-
JVU> From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
JVU> Sent: Friday, December 28, 2001 3:32 PM
JVU> To: Php General MailingList
JVU> Subject: [PHP] Only one instance of a script at a time !


JVU> Running a php script with a cron job, how can I do to have only one instance
JVU> of the script running ?






-- 
Best regards,
 akulmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Exec as user

2001-12-28 Thread charlesk

I tried echo %PATH% > test.txt and both the webpage and the dos prompt echo the 
correct path information.  This shows that a batch file executed by php can access the 
system vars. They have a diffence only in accessing the %USERNAME% variable.  Could 
this be indicative that it is running as the system user?  If so how do I change that?

Charles Killmer

-- Original Message --
From: Mike Eheler <[EMAIL PROTECTED]>
Date: Thu, 27 Dec 2001 16:56:21 -0800

Try doing this

';
 print_r(array($HTTP_SERVER_VARS,$HTTP_ENV_VARS));
 echo '';
?>

And see if the information you want is in there anywhere.

Mike

> I don't believe that the system variables are available to php.  I work on
> *nix mostly, but I have a windows machine at home running php and I can't
> access any of my system var's.
> - Original Message -
> From: "charlesk " <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 27, 2001 11:33 AM
> Subject: [PHP] Exec as user
> 
> 
> 
>>I have been looking through the docs and found no help on either finding
>>
> which user the EXEC'ed commands run as, or how to specify which user they
> should run as.  I tried exec, system, and passthru running a batch file that
> would write %USERNAME% to a file.  And all three functions wrote nothing.
> They would however write "hello world".  Has anybody else run into this.
> 
>>I tried exec("test.bat");
>>test.bat:
>>echo %USERNAME% > test.txt
>>
>>when run from a command line it resulting in "Charles"
>>when run from a webpage it resulted in "ECHO is on."
>>if I added a line "echo off" above the echo username it resulted in "ECHO
>>
> is off." again only from the webpage.
> 
>>In essense I need to update a DNS server through a web page.  It works if
>>
> the script is local but not if it has to update a different server.
> 
>>Charles Killmer
>>Windows 2000 Server, IIS 5.0, PHP 4.1.0
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>>
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Andrey Hristov

Under *nix - SysV semaphores

HTH

Regards,
Andrey Hristov
- Original Message - 
From: "Nicolas Guilhot" <[EMAIL PROTECTED]>
To: "Php General MailingList" <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 4:31 PM
Subject: [PHP] Only one instance of a script at a time !


> Running a php script with a cron job, how can I do to have only one instance
> of the script running ?
> 
> Thanks for any answer.
> 
> 
> Nicolas
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP + GD + IIS -=-=-=-=-=- I solved the problem -=-=-=-=-=-=-

2001-12-28 Thread EMIN CALIKLI


Hi Brian ,
I 've solved the problem :)... :)... :)... :)... :)... :)... :)... :)... :)... :)... 
:)... :)...
:)... :)... :)
I installed version of php 4.0.7 (php-4.0.7rc1-win32.zip) ;

1- I extracted zip package ,
2- I copied (also configured) php.ini file to my \winnt folder. (with php_gd.dll and 
php_mssql.dll)
3- I copied php4ts.dll to /winnt/system32 driver (it's important for isapi)
4- I copied ntwdblib.php to /winnt/system32 driver (it's important for MsSQL 7.0 
extension)
5- I configured IIS to run php extensions with isapi .
6- I started the IIS service and I tested with my basic code which uses GD library .
7- And...Dadaa Everything is worked

I think php 4.0.6 (which makes me crazy) have a problem with GD library.
Sincerely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Nicolas Guilhot

I was thinking about this solution, but what can I do if the script ends
prematurely. The file will never be deleted ??
Anybody has an example of how to use flock ?

Nicolas

"Gerard Onorato" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> There may be a much easier method however why not write a file and then
check for it's existence on the next execution. Delete the file at the end
of
> execution to clear the way  for the next pass.
>
> Quick and dirty so probably at least on typo
>  $pidFile = "path/to/file/filename";
> if (!is_file ($pidFile)) {
> touch ($pidFile);
> // code to execute
> unlink ($pidFile);
> }
> ?>
> On Fri, 28 Dec 2001 15:31:33 +0100, Nicolas Guilhot wrote:
>
> >Running a php script with a cron job, how can I do to have only one
instance
> >of the script running ?
> >
> >Thanks for any answer.
> >
> >
> >Nicolas
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MsSQL from FreeBSD

2001-12-28 Thread Brian Clark

* Valentin V. Petruchek ([EMAIL PROTECTED]) [Dec 28. 2001 04:51]:

> > OK, we're talking about Linux, right?

> No ;) FreeBsd 4.x don't know exactly about x

Duh, that was stupid of me. It's right there in the subject.

> > I'll bet `cat /proc/sys/fs/file-max` gives you 4096

OK, then give this a try:

sysctl -w kern.maxfiles=8192
sysctl -w kern.maxfilesperproc=8192

(or however high you want to go)

And it may need a reboot; I dont know if that would take effect
immediately (check it with ulimit -n after you do it). If it works, 
you might have to stick that in rc.local in order to get it to stick 
whenever you reboot. 

Again, I don't know if that'll have any effect.. 

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
One World, One Web, One Program.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

no it's move_uploaded_file and it's 4.03 or greater as well.

i'm using empty() as i just want to see if i uploaded a file or not


Paul Roberts
[EMAIL PROTECTED]

- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 12:48 PM
Subject: Re: [PHP] is_uploaded_file


> Read the docs about copy_uploaded_file() (this is the function with some
more docs, as I remember).
>
>
> HTH
>
> Andrey Hristov
> - Original Message -
> From: "Paul Roberts" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 28, 2001 2:41 PM
> Subject: [PHP] is_uploaded_file
>
>
> > I'm on PHP/4.0.2
> >
> > i'm getting
> > Fatal error: Call to undefined function: is_uploaded_file()
> >
> > how can i emulate the function
> >
> > will also nag my host but...
> >
> >
> > Paul Roberts
> > [EMAIL PROTECTED]
> > 
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov

>From : http://www.php.net/manual/en/features.file-upload.php


HTH

Regards,
Andrey Hristov

- Original Message - 
From: "Paul Roberts" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 5:13 PM
Subject: Re: [PHP] is_uploaded_file


> no it's move_uploaded_file and it's 4.03 or greater as well.
> 
> i'm using empty() as i just want to see if i uploaded a file or not
> 
> 
> Paul Roberts
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Andrey Hristov" <[EMAIL PROTECTED]>
> To: "Paul Roberts" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, December 28, 2001 12:48 PM
> Subject: Re: [PHP] is_uploaded_file
> 
> 
> > Read the docs about copy_uploaded_file() (this is the function with some
> more docs, as I remember).
> >
> >
> > HTH
> >
> > Andrey Hristov
> > - Original Message -
> > From: "Paul Roberts" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, December 28, 2001 2:41 PM
> > Subject: [PHP] is_uploaded_file
> >
> >
> > > I'm on PHP/4.0.2
> > >
> > > i'm getting
> > > Fatal error: Call to undefined function: is_uploaded_file()
> > >
> > > how can i emulate the function
> > >
> > > will also nag my host but...
> > >
> > >
> > > Paul Roberts
> > > [EMAIL PROTECTED]
> > > 
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

yep it all works on my dev server but the host only has 4.02 installed these
functions are php 4.03+


- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 3:26 PM
Subject: Re: [PHP] is_uploaded_file


> From : http://www.php.net/manual/en/features.file-upload.php
>  /* Userland test for uploaded file. */
> function is_uploaded_file($filename) {
> if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
> $tmp_file = dirname(tempnam('', ''));
> }
> $tmp_file .= '/' . basename($filename);
> /* User might have trailing slash in php.ini... */
> return (ereg_replace('/+', '/', $tmp_file) == $filename);
> } if (is_uploaded_file($userfile)) {
> copy($userfile, "/place/to/put/uploaded/file");
> } else {
> echo "Possible file upload attack: filename '$userfile'.";
> }
> ?>
>
> HTH
>
> Regards,
> Andrey Hristov
>
> - Original Message -
> From: "Paul Roberts" <[EMAIL PROTECTED]>
> To: "Andrey Hristov" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, December 28, 2001 5:13 PM
> Subject: Re: [PHP] is_uploaded_file
>
>
> > no it's move_uploaded_file and it's 4.03 or greater as well.
> >
> > i'm using empty() as i just want to see if i uploaded a file or not
> >
> >
> > Paul Roberts
> > [EMAIL PROTECTED]
> > 
> > - Original Message -
> > From: "Andrey Hristov" <[EMAIL PROTECTED]>
> > To: "Paul Roberts" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, December 28, 2001 12:48 PM
> > Subject: Re: [PHP] is_uploaded_file
> >
> >
> > > Read the docs about copy_uploaded_file() (this is the function with
some
> > more docs, as I remember).
> > >
> > >
> > > HTH
> > >
> > > Andrey Hristov
> > > - Original Message -
> > > From: "Paul Roberts" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, December 28, 2001 2:41 PM
> > > Subject: [PHP] is_uploaded_file
> > >
> > >
> > > > I'm on PHP/4.0.2
> > > >
> > > > i'm getting
> > > > Fatal error: Call to undefined function: is_uploaded_file()
> > > >
> > > > how can i emulate the function
> > > >
> > > > will also nag my host but...
> > > >
> > > >
> > > > Paul Roberts
> > > > [EMAIL PROTECTED]
> > > > 
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Andrey Hristov

I had 4.0.0 for a year or more and used that stuff quite well.
And the docs says :
"For earlier versions of PHP, you'll need to do something like
  the following.

Note: This will not work in versions of PHP 4
after 4.0.2. It depends on internal functionality of PHP which
changed after that version."


If one of your boxes is 4.0.2 and the other 4.0.3 use the output of phpinfo() with 
some kind of hack to determine wich one of the
function to use, or just write a wrapper which decides pipe to which function to make.


Regards,
Andrey Hristov


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] crack lib

2001-12-28 Thread Johnson, Kirk


Hey, what is everyone talking about? What is the new crack lib
functionality? Is it in the docs yet?

TIA

Kirk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySql and /var/lib/mysql/mysql.sock Problem !!!

2001-12-28 Thread Brian Clark

* ger ([EMAIL PROTECTED]) [Dec 27. 2001 20:05]:

>Does anybody know what is my problem ?

> I try to access to my mysql database and I get the next errror :

> " Can't connect trough /var/lib/mysql/mysql.sock "  

I'm sure you've checked to see if the mysql server is running..

The socket should be owner:group mysql (or whatever user you set up to
run the mysql server).

Are you trying to access it via PHP or just the command line?

If it's PHP, you could try altering mysql.default_socket in your
php.ini to what mysql expects. Run mysqladmin and check to see where the
socket is:

mysqladmin -u root -p[password] variables

Replace [password] with your real password.

Otherwise, you can set it by altering $MYSQL_UNIX_PORT in your
safe_mysqld script, or in whatever file you're using to start mysqld, to
please PHP, but it may break other applications that depend on it being
somewhere else. Check those scripts, they're probably defining the socket 
in there somewhere.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
UNIX: measuring in inconvenient units since 57,974,400!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] crack lib

2001-12-28 Thread Brian Clark

* Johnson, Kirk ([EMAIL PROTECTED]) [Dec 28. 2001 10:54]:


> Hey, what is everyone talking about? What is the new crack lib
> functionality? Is it in the docs yet?




-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
STATUS QUO is Latin for the mess we're in.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Gerard Onorato

Nicolas,

You could try something like

Anybody has an example of how to use flock ?




Re: [PHP] Only one instance of a script at a time !

2001-12-28 Thread Brian Clark

* Nicolas Guilhot ([EMAIL PROTECTED]) [Dec 28. 2001 10:00]:

> I was thinking about this solution, but what can I do if the script ends
> prematurely. The file will never be deleted ??

It's a nasty hack, but you chould run a separate shell script to 
check for the existance of the running script, then call the script 
if it's not running.

something like (/bin/sh):

PID=`ps aux | grep [program] | grep -v grep | awk {'print $2'}` 

Replace [program] with the program name.

That'll get you the PID if the script is already running. You can kill
it, or just exit instead, for example. That's one way..

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
$ mount -t neuro /dev/brain /mnt/head


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] redirect phpinfo output

2001-12-28 Thread charlesk

How can I redirect the output from phpinfo to a file.
If I try 
error_log(phpinfo(),3,"z:\\".date("YmdHis").".html");

all that is in the file is the number 1.

The output gets sent to the user.

Charles Killmer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help on JavaScript Windows with PHP

2001-12-28 Thread Carlos Fernando Scheidecker Antunes

Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

\n");
print("\n");
//print("\n");
print("