[PHP] HTTP || FTP Upload? Wich one?

2003-01-31 Thread Evan
Hi to all!
I'm working at a simple script that let me upload files in a Intranet.
The problem is that these files are videos, so really big (in the order of
Gbytes).
I think that HTTP upload doesn't fit to solve this problem so I thought
about FTP.
Can you tell me what do you think about this?
What are the maxsizes given for HTTP and FTP in the RFC (don't care about
php.ini)?
HTTP maxfilesize == 2Gb is it correct?
Do you think is better developing a simple application with C++Builder?

Thanks for your attention,
Evan



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




[PHP] Strange problem with objects

2002-07-24 Thread Evan

Hey all,

I'm having a strange problem with objects that I'm hoping someone out there can 
help me track down. I'll give a run down of the setup here, please note that 
register_globals is off.

A page creates two objects.

$document - this is always a new object and uses the ob_ functions to control 
the output. ob_start is called with a customer callback that writes the output 
to a file based on $_SERVER variables.

$session - this is an object that gets serialized whenever a request finishes 
and unserialized when the request begins.

Each object uses register_shutdown_function(array($this, "desconstructor")) to 
set a hook to clean up after itself which works without problems.

The following is then set.
$document->session =& $session;
$session->document =& $document;

Everything works fine through out the page all properties of the session can be 
accessed and set via $session->whatever or $document->session->whatever and vice 
versa for the $document object.

The problem arises when the $document->deconstructor function is called. As 
described above the ob_ callback fires and properly writes the captured output 
to a file then calls ob_end_clean() to dump the buffer and returns nothing, then 
right after the deconstructor function is called which does the following:
include("a header file.php");
include("the temp file from ob_");
include("a footer file.php");
unlink("the temp file from ob_");

Now this works beautifully, except that some of the object properties get 
destoryed. For instance since the includes are called from 
$document->deconstructor it makes sense that $this should reference the document 
object and that $this->session should reference the session object, but the 
following happens. In the file I have this:

$this is a 
$tihs->session is a session)?>

Which returns:

$this is a rj_document
$this->session is a


Now I thought that it might be because the session object is destroyed before 
the document object fires its deconstructor call so when the objects are 
associated I changed the document line to be:
$document->session = $session
But I get the same results.


Anyone have any insight?


Thanks,
Evan

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




Re: [PHP] Strange problem with objects

2002-07-24 Thread Evan

Never mind, I just found and exceptable work around.
$GLOBALS["session"] & $GLOBALS["document"] contain the objects.

(and after all that typing :)

-Evan

On Wed, Jul 24, 2002 at 10:21:32PM -0400, Evan said:


> Hey all,
> 
> I'm having a strange problem with objects that I'm hoping someone out there can 
> help me track down. I'll give a run down of the setup here, please note that 
> register_globals is off.
> 
> A page creates two objects.
> 
> $document - this is always a new object and uses the ob_ functions to control 
> the output. ob_start is called with a customer callback that writes the output 
> to a file based on $_SERVER variables.
> 
> $session - this is an object that gets serialized whenever a request finishes 
> and unserialized when the request begins.
> 
> Each object uses register_shutdown_function(array($this, "desconstructor")) to 
> set a hook to clean up after itself which works without problems.
> 
> The following is then set.
> $document->session =& $session;
> $session->document =& $document;
> 
> Everything works fine through out the page all properties of the session can be 
> accessed and set via $session->whatever or $document->session->whatever and vice 
> versa for the $document object.
> 
> The problem arises when the $document->deconstructor function is called. As 
> described above the ob_ callback fires and properly writes the captured output 
> to a file then calls ob_end_clean() to dump the buffer and returns nothing, then 
> right after the deconstructor function is called which does the following:
> include("a header file.php");
> include("the temp file from ob_");
> include("a footer file.php");
> unlink("the temp file from ob_");
> 
> Now this works beautifully, except that some of the object properties get 
> destoryed. For instance since the includes are called from 
> $document->deconstructor it makes sense that $this should reference the document 
> object and that $this->session should reference the session object, but the 
> following happens. In the file I have this:
> 
> $this is a 
> $tihs->session is a session)?>
> 
> Which returns:
> 
> $this is a rj_document
> $this->session is a
> 
> 
> Now I thought that it might be because the session object is destroyed before 
> the document object fires its deconstructor call so when the objects are 
> associated I changed the document line to be:
> $document->session = $session
> But I get the same results.
> 
> 
> Anyone have any insight?
> 
> 
> Thanks,
> Evan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




[PHP] php.exe from command line

2002-07-29 Thread Evan

I've made a simple php file that creates a file named 'agent_1.txt' where
the number is taken from $_GET["num"].

I've tried to run it in this way:
http://localhost/agent.php?num=1
And it works perfectly

I thought that from from command line it would work so i tried this (WinXP +
PHP 4.1.2):

c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1

BUT IT DOESN'T WORK! ?

Can someone help, please?
Thenks in advance,
Evan



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




Re: [PHP] php.exe from command line

2002-07-29 Thread Evan

I didn't thought about this, but it's logic (as always).

However I solved my problem:
I've developed a really simple program with C++Builder6 (only ~15 lines of
code :-P) that every X seconds calls the php file (agent.php).
And finally it works!

Thanks for your help,
Evan

<[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Simple.  Parameters of the type you described, with the ?, = and &, etc. are
specific to URLs and are handled by CGI, common gateway interface, i.e. the
web server.  See the PHP documentation on $argc[] and $argv[] if you want to
pass parameters on the command line.

http://us2.php.net/manual/en/features.commandline.php

Your question mark directly after the file name is confusing DOS.
Parameters on the DOS command line need to be separated from the file name
by a space.

Essentially, $argc is your argument count and $argv is an array of the
values of the arguments.

You won't be able to use $_GET when working with variables from the command
line.  It wouldn't be wise to design one script that works from either the
command line or the web browser, plus it would be a major pain in the ass.

Luck,
Colin Teubner

-Original Message-
From: Evan [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 1:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php.exe from command line


I've made a simple php file that creates a file named 'agent_1.txt' where
the number is taken from $_GET["num"].

I've tried to run it in this way:
http://localhost/agent.php?num=1
And it works perfectly

I thought that from from command line it would work so i tried this (WinXP +
PHP 4.1.2):

c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1

BUT IT DOESN'T WORK! ?

Can someone help, please?
Thenks in advance,
Evan



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




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




Re: [PHP] Is there an ISP that supports GD Library 2.0?

2002-10-31 Thread evan
Sorry... hurricane electric- www.he.net

On Thursday 31 October 2002 08:37 am, Evan Nemerson wrote:
> Hurrican Electric does... here's a php -m from them:
>
> Running PHP 4.1.2
> Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
>
> [PHP Modules]
> xml
> standard
> session
> posix
> pcre
> mysql
> imap
> gd
> ftp
> db
> zlib
>
> [Zend Modules]
> Not Implemented
>
>
> I had to use pdflib once, and after talking to them for a bit they
> configured it so i could use dl()... They have no problems with security
> audits (as long as you give them a heads-up), servers are quick and
> dependable, they implemented privsep in OpenSSH in just a few hours back
> when there was that remote-root hole (chrooted jail w/ privsep)...
> Basically, I highly reccomend.
>
> On Thursday 31 October 2002 08:10 am, René Fournier wrote:
> > I'm going to need it for a site I'm working on
> > Any suggestions are much appreciated.
> >
> >
> > ---
> > René Fournier,
> > [EMAIL PROTECTED]
> >
> > Toll-free +1.888.886.2754
> > Tel +1.403.291.3601
> > Fax +1.403.250.5228
> > www.smartslitters.com
> >
> > SmartSlitters International
> > #33, 1339 - 40th Ave NE
> > Calgary AB  T2E 8N6
> > Canada

-- 


-


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




[PHP] [mail] quetion

2002-06-28 Thread Evan

What is best:
1) calling n-times the function mail() [with n = numer of emails] or
2) calling 1 time mail() and use CC
?
Or it it is the same thing?

Thanks,
Evan



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




[PHP] debugger

2002-04-20 Thread Evan

Hi to all!!!
Can anyone tell me how to debug in PHP?
When I use ASP simply I write "stop" (VB) or "debugger" (JSCRIPT) to set a
breakpoint and open the Microsoft Script Debugger.
With PHP I can't find a way to do a similar thing.
I downloaded the DBG PHP debugger but I don't understand how to use it like
MSD.
My config is:
PHP 4.1.2 + IIS5 + WinXPpro

I'm bored to use echo "$something" for debug :-(

Thanks in advance for your help,
Evan



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




[PHP] Re: debugger

2002-04-20 Thread Evan

I need PHP because I made a site for my course at university and they use
only Linux so I learned PHP.
>> Seems that you´re lucky with M$ and their ek$pen$ive environments.
Zend Studio 2.0 ==> 195$
NusPhere ==> 299$

I used PHP Edit but if I need to test a script that get values from POST or
GET parameters I need first to recreate them within the IDE.

Does exists something to debug PHP within the browser, just like M$ Script
Debugger?
DBG listen some port and some host but I didn't found instructions that
explain to use it.

Thanks again,
Evan

<[EMAIL PROTECTED]> ha scritto nel messaggio
news:<[EMAIL PROTECTED]>...
At 20.04.2002  21:15, you wrote:
>Hi to all!!!
>Can anyone tell me how to debug in PHP?
>When I use ASP simply I write "stop" (VB) or "debugger" (JSCRIPT) to set a
>breakpoint and open the Microsoft Script Debugger.
>With PHP I can't find a way to do a similar thing.
>I downloaded the DBG PHP debugger but I don't understand how to use it like
>MSD.
>My config is:
>PHP 4.1.2 + IIS5 + WinXPpro
>
>I'm bored to use echo "$something" for debug :-(
>
>Thanks in advance for your help,
>Evan
I´m not shure, but ZEND offers some kind of IDE and nusphere has an IDE
which has a debugger built in , but who needs this??
Use an editor with macro functionality so u can set a macro which makes
something like if($debug){ echo something}, then you can set one var
to turn debugging on/off.
Are you shure you need PHP for your problems? Seems that you´re lucky
with M$ and their ek$pen$ive environments.

Oliver

--




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




[PHP] GET question

2002-04-28 Thread Evan

Hi to all.

I pass parameters via querystring in this way:
page.php?ID=5&ID=6&ID=23

In $_GET["ID"] I get only the value 23 
I am surprised 'cause in ASP I get 5,6,23.

Is there a way to make things working to have a sequence of values separated
by commas?
Am I doing something wrong in PHP?

Thanks for your help,
Evan



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




[PHP] Re: GET question

2002-04-29 Thread Evan

Thanks to all for your kind attention.
What I need is exactly what Miguel Cruz wrote.
What I wanted to do was a multidelete, eg:
I show the content of a table in a php page and near every row I put a
checkbox binding its checked value with ID column.
When I submit a form I send the form vars to the script that deletes the
rows checked from the DB.
Till now I used the escamotage described by David Freeman with this variant:
ID_N (where N is integer).
Then I split("_", "ID_N"), got the second elemnt of the array and then build
the string "ID=5 OR ID=6 ..."
But I didn't like it, it seemed not very "elegant" to me.

By the way does someone know where can I find some technical information on
how GET or POST parameters are passed (HTTP specs?) and handled by various
scripting languages (APIs?) ?

Bye,
Evanghelos

> PS nice name ;)

:-)

"Evan Nemerson" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]...
> Thats because that query string is like saying:
>
> $ID = 5;
> $ID = 6;
> $ID = 23;
>
> If this is a form that you can't change the ID field names to ID1, ID2,
ID3,
> etc. (which would probably be best) you could try something like:



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




[PHP] PHP+MySQL -> Excel ?

2002-05-17 Thread Evan

Is it possible to create an excel file with some data from mySQL, using PHP
?

Thanks,
Evan



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




[PHP] Re: PHP+MySQL -> Excel ?

2002-05-17 Thread Evan

Thanks to all :-)

Bye,
Evan

"Evan" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it possible to create an excel file with some data from mySQL, using
PHP
> ?
>
> Thanks,
> Evan
>
>



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




[PHP] imagecopy() no errors, but does nothing :-(

2002-05-20 Thread Evan

What I'm planning to do is to add the logo of the site over every image
uploaded.
Here is the code after upload:

  $dst_im = @ImageCreateFromJPEG ("../".$pathImg.$NomeFile);
  $src_im = @ImageCreateFromJPEG ("../imgsite/logo.jpg");
  $dst_size = GetImageSize("../".$pathImg.$NomeFile);//800x600
  $src_size = GetImageSize("../imgsite/logo.jpg");//50x50
  ImageCopy( $dst_im, $src_im, 150, 150, 0, 0, 50, 50);

I don't get errors but it happens nothing to the original img ($dst_im).
The image logo.jpg is 50x50 and the $dst_img is 800x600.

Thanks for your help,
Evan



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




[PHP] Re: PHP & Excel

2002-05-20 Thread Evan

Have a look at my post of 17/05/2002, I got a lot of help from there.

Bye,
Evan


"Jean-Louis Letortorec" <[EMAIL PROTECTED]> ha scritto nel
messaggio 615315231286D21182E40008C7B1EED241EDF7@COMPAQ3000">news:615315231286D21182E40008C7B1EED241EDF7@COMPAQ3000...
> Hello every one:
>
> I'm trying to create XLS files on the fly.
> I found BiffWriter. Looks great for adding texts and numbers, but not
> formulas.
>
> Has anyone implemented something about formulas?
>
> Thanks.



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




[PHP] Re: imagecopy() no errors, but does nothing :-(

2002-05-20 Thread Evan

Here is how i fixed the problem:

//Adding logo
  $dst_im = @ImageCreateFromJPEG("../".$pathImg.$NomeFile);
  $src_im = @ImageCreateFromPNG("../imgsite/logoxmail.png");
  $dst_size = GetImageSize("../".$pathImg.$NomeFile);
  $src_size = GetImageSize("../imgsite/logoxmail.png");
  ImageCopy( $dst_im, $src_im, 0, $dst_size[1] - $src_size[1], 0, 0,
$src_size[0], $src_size[1]);
//***this makes the difference!
  ImageJPEG($dst_im,"../".$pathImg.$NomeFile);
  ImageDestroy($dst_im);

But now I have another question:
how to mantain the transparency of the png (src_im)?

Evan

"Evan" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What I'm planning to do is to add the logo of the site over every image
> uploaded.
> Here is the code after upload:
>
>   $dst_im = @ImageCreateFromJPEG ("../".$pathImg.$NomeFile);
>   $src_im = @ImageCreateFromJPEG ("../imgsite/logo.jpg");
>   $dst_size = GetImageSize("../".$pathImg.$NomeFile);//800x600
>   $src_size = GetImageSize("../imgsite/logo.jpg");//50x50
>   ImageCopy( $dst_im, $src_im, 150, 150, 0, 0, 50, 50);
>
> I don't get errors but it happens nothing to the original img ($dst_im).
> The image logo.jpg is 50x50 and the $dst_img is 800x600.
>
> Thanks for your help,
> Evan
>
>



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




[PHP] GD + modify image

2002-05-24 Thread Evan

Hi to all!!!
1) phpinfo() return: GD version 1.6.2 or higher
What does this mean exactly? What's the correct  version of my GD?

2) I made a script that upload an image and paste the site logo in the
bottom-left corner.
The problem is that I get the error:
" gd-png warning: alpha channel not supported "
The img logo is a PNG32 with transparent background.
Someone told me that I need GD 2.x.x (to work in truecolor) but is it
possible to make it working with my version of GD?

Here is the script:
  //Adding logo
  $logo = "filigrana.png";
  $dst_im = @ImageCreateFromJPEG("../".$pathImg.$NomeFile);
  $src_im = @ImageCreateFromPNG($logo);
  $dst_size = GetImageSize("../".$pathImg.$NomeFile);
  $src_size = GetImageSize($logo);
  ImageCopy( $dst_im, $src_im, 0, $dst_size[1] - $src_size[1], 0, 0,
$src_size[0], $src_size[1]);
  ImageJPEG($dst_im,"../".$pathImg.$NomeFile);
  ImageDestroy($dst_im);

Thanks for your help,
Evan





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




[PHP] Re: SMARTCARDS - PHP + MySQL

2002-05-24 Thread Evan

If you know Italian check this:
http://aladdin.it.net/
To tell the truth the company that developed the software if in south africa
(not sure).

Simply, it makes your cell phone became a smartcard:
if you try calling the number showed in the next page you'll see the state
of the text changing in "receiving the calling" and after a while "logon in
progress" and at the end you'll be prompted in your personal web page (in
this case a banking system).
So you don't need a smartcard, you simply use yours cell phone smartcard.
I don't know if calling from abroad the demo still works if you try tell
me, please

If this solution doesn't meet your reurements try to have a look at
JavaCards from http://java.sun.com/products/javacard/
Maybe the "write once run anywhere" statement would really help you
(regarding windows clients /linux servers )

I hope this is what you need,
Evan


"Phpcoder" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> HI
> I would like to hear from anyone who have possibly worked on
> implementing a smartcard solution to controll access to a website.
> I am looking into possibilities for a proposal, and one of the
> requirements of the client is that the system data has to be accessible
> via the web, and that the access to the information has to be extremely
> secure.
> The administrators of the site as well as the clients will need to be
> verified with ( ideally ) smartcards.
> Obviously, you can deduct from this that the system will not
> neccessarily be implemented on the internet, but most probably WAN. It
> looks like the clients or "users" of the system will be physically
> required to be in front of a terminal connected to the system ( and it
> will have a smartcard reader)
> I have never worked with smartcards before, and am not sure how one
> would ( if possible) integrate or pass the "access" signal through to
> the php/mysql pages.
> Also, the "user" stations will most probably be Microsoft machines, but
> the servers will most definately be Linux, and if possible, I would like
> to have a smartcard verification solution on the servers as well ( this
> is not THAT, important, but seeing that the administrators might also
> want to work from Linux boxes, I would like to know if it can be done on
> a Linux platform).
>
> So, in a nutshell, it's almost like a normal "postoffice" scenario.
> People will come to visit the establishment and produce their smartcard
> to verify their identity to the "clerks" who will then be able to
> transact via a webinterface with the servers.
>
> Hope this is clear enough??
> PS, I'm not trying to be cryptic, it's really all I know and most are
> deductions I made myself from reading the initial drafts.
>
> Thanks for any help.
>
>



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




[PHP] Re: NewBie-UPLOADING IMAGE

2002-05-26 Thread Evan

This works for me (WinXPpro, IIS, PHP 4.1.2):



Hope it will help

bye,
evan

"Dani" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I want to upload image file into a folder in webserver using HTML form.
> What function do I use fo this purpose?
>
> Thank you,
>
> Dani
>



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




[PHP] [PHP Upload] problem

2002-03-26 Thread Evan

When running this code:


..









..
I got this:

Warning: Unable to create 'C:\Inetpub\webpub\PHP\upload': Permission denied
in c:\Inetpub\webpub\PHP\upload.php on line 3
Warning: Unable to create 'C:\Inetpub\webpub\PHP\upload': Permission denied
in c:\Inetpub\webpub\PHP\upload.php on line 4
Warning: Unable to move 'C:\WINDOWS\TEMP\php187.tmp' to
'C:\Inetpub\webpub\PHP\upload' in c:\Inetpub\webpub\PHP\upload.php on line 4

I must leave "register_globals=Off" !!!
Can anyone help?
Thanks,
Evan



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




[PHP] [Session]

2002-03-26 Thread Evan

Hi !!
I can't make this work:
PAGE 1:



SESSION 1





Variabile settata? --

link to next



In page 1 I create the session var and I check if it exists. The if stat
returns YES so it seems everything's ok.

PAGE 2:


SESSION 2








In page 2 I simply read the session var but it doesn't return anything.

I must leave register_globals = Off !
What's wrong?

Thanks,
Evan



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




Re: [PHP] [Session]

2002-03-26 Thread Evan

> Try using the same session variable.  Right now it looks like the first
one
> is "v_s" and the second is "s_v".  HTH.
Ops

I changed it butit doesn't work! :-((
:_(

Evan

"Brian Drexler" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try using the same session variable.  Right now it looks like the first
one
> is "v_s" and the second is "s_v".  HTH.
>
> Brian
>
> -Original Message-
> From: Evan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] [Session]
>
>
> Hi !!
> I can't make this work:
> PAGE 1:
>  $HTTP_SESSION_VARS["v_s"]=500;
> ?>
> 
> 
> SESSION 1
> 
> 
>
> 
>
> Variabile settata? --
>  if (isset($HTTP_SESSION_VARS["v_s"])){
>  echo "si";
> }else{
>  echo "no";
> }
> ?>
> link to next
> 
> 
>
> In page 1 I create the session var and I check if it exists. The if stat
> returns YES so it seems everything's ok.
>
> PAGE 2:
> 
> 
> SESSION 2
> 
> 
>
> 
>  echo $HTTP_SESSION_VARS["s_v"];
> ?>
> 
> 
>
> In page 2 I simply read the session var but it doesn't return anything.
>
> I must leave register_globals = Off !
> What's wrong?
>
> Thanks,
> Evan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




Re: [PHP] [Session]

2002-03-26 Thread Evan

I have PHP 4.1.2 (the latest, I downloaded it a week ago).
The manual says that:
*
If track_vars is enabled and register_globals is disabled, only members of
the global associative array $HTTP_SESSION_VARS can be registered as session
variables. The restored session variables will only be available in the
array $HTTP_SESSION_VARS.
*

I won't use $_SESSION cause it seems that is a bit buggy have a search
with google->user group "$_SESSION".

Anyway thanks for your interest,
Evan

"Erik Price" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Tuesday, March 26, 2002, at 02:14  PM, Evan wrote:
>
> > Hi !!
> > I can't make this work:
> > PAGE 1:
> >  > $HTTP_SESSION_VARS["v_s"]=500;
> > ?>
> >
>
> I am probably wrong about this, but I thought that you could register
> session variables using this technique only if you are using PHP 4.1.x
> and you use the format:
>
> $_SESSION['v_s'] = 500;
>
>
>
>
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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




[PHP] Re: ASP vs PHP

2002-03-29 Thread Evan

Hope this will help you:

1) Macromedia Ultradev + PHAkt extension (www.macromedia.com) $$
2) www.phpide.de
3) www.phpedit.com
4) http://dd.cron.ru/dbg (debugger)


Evan


"Ciro Martins" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi!
>
>
> I've been programming in PHP for long. But one question that always is
> coming to my mind is to know if there exists some kind of tools (like
> for SP. It exists a tool called ASPWebTools for wich it is possible to
> develop applications written in ASP and connecting with DB like SQL
> Server in an automatic way) that can help in the development of
> applications using PHP and databases. For instance, that could allow to
> develop automatically forms to connect to databases using PHP.
>
> Does anyone know any related application or tools.
> Because in ASP with that tool is more easy to develop code.
>
> Thanks in advance
>
> Ciro Martins
>



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




[PHP] How do I check if apache processes php?

2001-10-27 Thread evan

I try the simplest script and it just shows in Netscape 6.0 and it just 
shows the php code, it does not process the information. How do I check 
to see it apache processes the information?

Thanks,
Evan P.


-- 
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] ereg checking if its only numbers

2001-10-04 Thread Evan

try:



There is a great book on regular expressions by o'reily.

Evan

*** REPLY SEPARATOR  ***

On 10/5/01 at 11:33 AM Chris Aitken wrote:

>Ive been playing around with ereg for about half an hour and having no
>joy
>because I dont really understand the medhod behind it and how it all
>works.
>But what im trying to do is check to see if a 9 digit string is all
>numbers
>and nothing else
>
>$string1 = "123456789"
>$string2 = "123456abc"
>
>
>how would I check either string with an IF statement and make it continue
>on string 1 (ie, all numbers) and error on string 2 (not all numbers).
>
>
>Any suggestions ?
>
>
>
>Thanks
>
>
>Chris
>
>--
> Chris Aitken - Administration/Database Designer - IDEAL Internet
>  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
>  __-__
>It is said that if you line up all the cars in the world end to end,
>  some moron in a rotary will still to try and pass them
>
>
>--
>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] ignoring client supplied session data

2002-11-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm setting up a site using sessions right now, and I was just wondering if 
there is a way to ignore anything from the client side- I want them to POST a 
username and password, from there all data should be handled on the server.

I'm already using the query string to avoid cookies, but I want to make sure 
that if the user _does_ have cookies on, any change in the data will be 
ignored by the server. Any suggestions?

Basically, I think it would be a lot more efficient for me to set a 
_SESSION['logged_in'] variable once than query the database for every page, 
but I don't know if it would be secure or not- I don't want someone setting 
the logged_in variable in their cookie, then getting full access to the 
site...


Thanks,
Evan


- -- 
If you would be a real seeker after truth, you must at least once in your life 
doubt, as far as possible, all things.

- -Rene Descartes
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE95S1W/rncFku1MdIRAqdUAJ478Q5xFn7vDDE7RFXUI1aQnaZWBACgmN55
VNdAnVIliDD6eNwRm3R2SMQ=
=61VE
-END PGP SIGNATURE-


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




Re: [PHP] ignoring client supplied session data

2002-11-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I was thinking about doing that, but I was hoping to avoid superfluous 
database queries. It is my fallback method, but i _really_ want to use 
sessions, but limit them to server-side modification.


On Wednesday 27 November 2002 12:51 pm, Van Andel, Robert wrote:
> What I do on my pages is perhaps a convoluted way of doing it but it works.
>  I set a username and password session variables. Every time the page loads
> the script verifies the username and password are correct.  If not, they
> don't get to see the rest.  This, in my mind, pervents someone from
> supplying a key variable like $_session['logged_in'].  This way they have
> to know the username and password.
>
> Robbert van Andel
>
>
> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 27, 2002 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] ignoring client supplied session data
>
>
> I'm setting up a site using sessions right now, and I was just wondering if
> there is a way to ignore anything from the client side- I want them to POST
> a username and password, from there all data should be handled on the
> server.
>
> I'm already using the query string to avoid cookies, but I want to make
> sure that if the user _does_ have cookies on, any change in the data will
> be ignored by the server. Any suggestions?
>
> Basically, I think it would be a lot more efficient for me to set a
> _SESSION['logged_in'] variable once than query the database for every page,
> but I don't know if it would be secure or not- I don't want someone setting
> the logged_in variable in their cookie, then getting full access to the
> site...
>
>
> Thanks,
> Evan

- -- 
If anyone can show me, and prove to me, that I am wrong in thought or deed, I 
will gladly change. I seek the truth, hich never yet hurt anybody. It is only 
persistence in delusion and ignorance which does harm.

- -Marcus Aurelius
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE95TIp/rncFku1MdIRAgGdAKCQCNMUL+OuTomXQH07zr6tjn7cUwCcDMrU
Ucup8rpk4c3jS2w+5Ej6yNo=
=el8E
-END PGP SIGNATURE-


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




Re: [PHP] ignoring client supplied session data

2002-11-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm not worried about them using the query string for malicious purposes- I 
have register_globals off... I'm worried about someone messing with their 
cookie and sedding authorized to true- that _will_ change my $_SESSION 
variable, unless I can find some way to ignore cookies, which brings us back 
to my original question- how do i ignore all client input, _especially_ 
cookies???


On Wednesday 27 November 2002 01:28 pm, you wrote:
> At 22:17 27.11.2002, Van Andel, Robert said:
> [snip]
>
> >On the other hand, I use only one query, searching for the username.  I
> > had experimented with other methods but did not find anything that I felt
> > gave me great security.  Using a session variable that says the person is
> > logged in can be placed into a query string therefore bypassing the
> > authentication process
>
> [snip]
>
> That's the main issue why register_globals is off by default since 4.2. If
> you don't use register_globals, your $_SESSION array is safe from
> intruders; only your script can set it from within your session. If any
> malicious guy passes a query variable ?$_SESSION['authorized']=true, this
> will only show up in the $_GET array, nowhere else. A print_r() of $_GET
> with this query string gives:
>
> $_GET = Array (
> [$_SESSION] = Array (
> ['authorized'] = 1
> )
> )
>
> You might want to check out
>
> http://www.php.net/manual/en/security.registerglobals.php
>
> to read about the security issues involved. Basically having
> register_globals set to on allows an arbitrary user to implant variables of
> their choice into PHP, making any script more than unsafe. Having it
> switched off allows YOU to control the data that you work with - an
> absolute MUST unless you're begging for trouble, IMHO.

- -- 
The public have an insatiable curiosity to know everything. Except what is 
worth knowing. Journalism, conscious of this, and having tradesman-like 
habits, supplies their demands.

- -Oscar Wilde
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE95UXI/rncFku1MdIRAgv/AJoDF1LfkUksKCUKvIniEqgXeBQPQgCaAvWI
1xOcGGd1wWdYu6P9mYtjOlc=
=Dv1o
-END PGP SIGNATURE-


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




Re: [PHP] apache httpd-2.0.40-8 and scanning alternate extensions for php

2002-12-01 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Find the line that looks like "AddType application/x-httpd-php .php", and 
change it to "AddType application/x-httpd-php .php .html"


On Sunday 01 December 2002 01:34 pm, Larry Brown wrote:
> I just moved to a machine with RH8 that has their latest version of apache.
> On prior versions httpd.conf had a section that I could set to have the
> server scan .html extensions for php tags.  There is no longer such a
> section even though the server does appropriately scan .php files.  Does
> anyone know how I can have it scan different extensions?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oTZ/rncFku1MdIRAlXQAJ9lV5cmg2MLXnnSIVsFWW157+puBQCfTzya
TGBEeaXx+9XlBxHbzEtWwos=
=Ajqh
-END PGP SIGNATURE-


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




Re: [PHP] phpMyAdmin : password and user (Help)

2002-12-01 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Try changing the username from "username" to "[EMAIL PROTECTED]"


On Sunday 01 December 2002 01:21 pm, Iguider wrote:
> Hi
> Please I need a help, I used to work with asp and now I am migrating to
> php, my site web works perfectly on my PC (windows). I am runing phpMyAdmin
> 2.2.6,  and easyphp on local machine . when my host give me a username and
> password, I want to change the file "phpMyAdmin/config.inc.php"  from
> user="root" to user="username" and from password= ""  to
> password="password", the phpMyAdmin show me "Host 'localhost' is not
> allowed to connect to this MySQL server" even if i setup the default
> values.
>
>
> the phpMyAdmin/config.inc.php is :
> $cfgServers[$i]['host']  = 'localhost'; // MySQL hostname
> $cfgServers[$i]['port']  = '';  // MySQL port - leave blank
> for default port $cfgServers[$i]['socket']= '';  // Path to
> the socket - leave blank for default socket $cfgServers[$i]['connect_type']
>  = 'tcp';   // How to connect to MySQL server ('tcp' or 'socket')
> $cfgServers[$i]['controluser']   = '';  // MySQL control user
> settings // (this user must have read-only $cfgServers[$i]['controlpass']  
> = '';  // access to the "mysql/user" // and "mysql/db" tables)
> $cfgServers[$i]['auth_type'] = 'config';// Authentication method
> (config, http or cookie based)? $cfgServers[$i]['user']  = 'root'; 
> // MySQL user
> $cfgServers[$i]['password']  = '';  // MySQL password (only
> needed // with 'config' auth_type) $cfgServers[$i]['only_db']   = '';  
>// If set to a db-name, only // this db is displayed // at left
> frame
> // It may also be an array
> // of db-names
> $cfgServers[$i]['verbose']   = '';  // Verbose name for this
> host - leave blank to show the hostname $cfgServers[$i]['bookmarkdb']=
> '';  // Bookmark db - leave blank for no bookmark support
> $cfgServers[$i]['bookmarktable'] = '';  // Bookmark table - leave
> blank for no bookmark support $cfgServers[$i]['relation']  = '';   
>   // table to describe the relation between links (see doc) //   - leave
> blank for no relation-links support
>
> $i++;
> $cfgServers[$i]['host']  = '';
> $cfgServers[$i]['port']  = '';
> $cfgServers[$i]['socket']= '';
> $cfgServers[$i]['connect_type']  = 'tcp';
> $cfgServers[$i]['controluser']   = '';
> $cfgServers[$i]['controlpass']   = '';
> $cfgServers[$i]['auth_type'] = 'config';
> $cfgServers[$i]['user']  = 'root';
> $cfgServers[$i]['password']  = '';
> $cfgServers[$i]['only_db']   = '';
> $cfgServers[$i]['verbose']   = '';
> $cfgServers[$i]['bookmarkdb']= '';
> $cfgServers[$i]['bookmarktable'] = '';
> $cfgServers[$i]['relation']  = '';
>
> $i++;
> $cfgServers[$i]['host']  = '';
> $cfgServers[$i]['port']  = '';
> $cfgServers[$i]['socket']= '';
> $cfgServers[$i]['connect_type']  = 'tcp';
> $cfgServers[$i]['controluser']   = '';
> $cfgServers[$i]['controlpass']   = '';
> $cfgServers[$i]['auth_type'] = 'config';
> $cfgServers[$i]['user']  = 'root';
> $cfgServers[$i]['password']  = '';
> $cfgServers[$i]['only_db']   = '';
> $cfgServers[$i]['verbose']   = '';
> $cfgServers[$i]['bookmarkdb']= '';
> $cfgServers[$i]['bookmarktable'] = '';
> $cfgServers[$i]['relation']  = '';

- -- 
To assert that the earth revolves around the sun is as erroneous as to claim 
that Jesus was not born of a virgin.

- -Cardinal Bellarmino
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96oVe/rncFku1MdIRAlGnAKCCeUAyjFNuM+2iPzxzbH8vgNwRVACfWchW
z5zyWAUzYF4UI89dVFmdv/o=
=AvD/
-END PGP SIGNATURE-


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




Re: [PHP] header gives different results with post

2002-12-09 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Are you trying to attach an additional results.csv, or are you trying to name 
the output (ie "test")???

If you're trying to name the output, changing 

Content-Disposition: attachment;filename="results.csv"
to
Content-Disposition: inline;filename="results.csv"

If that doesn't work, peruse RFC 2183.



On Monday 09 December 2002 08:18 am, Ellen Cyran wrote:
> When I submit a post to the following page rather than a get
> the download screen in IE 5.5SP2 appears twice.  Is there
> any way around this?  I definitely need to use post since the
> length of the string being sent is fairly long.
>
> 
> header("Content-type: application/octet-stream");
> header('Content-Disposition: attachment;filename="results.csv"');// Try
> to name the output file
> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
> header('Last-Modified: '.gmdate("D, d M Y H:i:s").' GMT'); // always
> modified
> header("Cache-Control: no-store, no-cache, must-revalidate");  //
> HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache"); // HTTP/1.0
> /*$nocache = 'Cache-Control: no-cache'; */ // HTTP/1.1
> //header($nocache);
> header('Content-Transfer-Encoding: binary'); // Binary data
>
> echo "test";
>
> ?>
>
> Thanks.

- -- 
Sell a man a fish, he eats for a day, teach a man how to fish, you ruin a 
wonderful business opportunity. 

- -Karl Marx
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE99O8A/rncFku1MdIRAo24AKCy/2Swq6lb6iIOQO96cZWl2lSdvwCdEOBZ
ydQE/q/JZ9CIQNLRoSW3YOE=
=ItM0
-END PGP SIGNATURE-


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




[PHP] SQL: INSERT using subqueries

2002-12-16 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

First off, sorry it's a SQL question not PHP, but I don't subscribe to 
mysql-general (or whatever it's called), and I have a feeling someone on this 
list will be able to help...

Anyways, my question is rather simple- how do I do an INSERT using a subquery? 
I want something like this- only one that works:

INSERT INTO myTable
SET owner=(SELECT id FROM users WHERE username='myUsername');

Actually, I want to set a few more fields too, but not using subqueries. I 
would prefer the ..() VALUES ()... syntax, but I converted to this when I 
suspected that was the problem- it wasn't.

I realize that I _could_ get put the id into a PHP variable, then make another 
query from that (which is what I'll be doing until i get a response ;)), but 
I'd prefer not to.

Any help would be much appreciated, and thanks in advance!


- -Evan



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

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

iD8DBQE9/YiD/rncFku1MdIRAg13AJ0VWveL8D79oMGuD+LVXpliqecbYgCeKlBw
S+j22cnoMS/WNm0Iwbxjzlo=
=EC92
-END PGP SIGNATURE-


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




Re: [PHP] SQL: INSERT using subqueries

2002-12-16 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ohhh you're close. A little tweak, and it works. Here's what I came up with:

INSERT INTO myTable
   (owner, name)
   SELECT id as "owner", 'myName' as "name"
   FROM users where username='myUserName';

I think if you omit the (owner, name), it thinks you want to fill the whole 
table, so by doing it this way you can specify only what you want to change.

Thanks for your help, Ernest!

- -Evan



On Monday 16 December 2002 12:13 am, you wrote:
> At 09:01 16.12.2002, Evan Nemerson said:
> [snip]
>
> >Anyways, my question is rather simple- how do I do an INSERT using a
> >subquery?
> >I want something like this- only one that works:
> >
> >INSERT INTO myTable
> >SET owner=(SELECT id FROM users WHERE username='myUsername');
>
> [snip]
>
> INSERT INTO myTable
>SELECT id as "owner" FROM users where username='myUsername';
>
> other columns, not selected from source table:
>
> INSERT INTO myTable
>SELECT id as "owner", 92 as "data1", 'hello world' as "data2"
>FROM users where username='myUsername';
>
> should do it (untested on mySQL)

- -- 
Cats are intended to teach us that not everything in nature has a function.

- -Garrison Keillor
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9/Y+w/rncFku1MdIRAtjFAJ9k8CaAVyHxe3Rdubo0cXPYMMP14gCfdZoN
/AXg9bAvjtt+xWCJMmY8r3E=
=byql
-END PGP SIGNATURE-


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




[PHP] Disable session cookies

2002-12-20 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Is there any way to disable using cookies in sessions? I haven't found a good 
reason to do this, only my boss's predisposition against cookies ;).

Thanks in advance,
Evan

- -- 
A leader is the wave pushed ahead by the ship.

- -Leo Nikolaevich Tolstoy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+A5nH/rncFku1MdIRAsc2AKCW7GNJo/h36g/sDuUf4RBgcd3uLQCeP1ET
OEoMuKLLQ42w2urky0wtGhU=
=kFkN
-END PGP SIGNATURE-


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




Re: [PHP] Disable session cookies

2002-12-20 Thread Evan Nemerson
Sorry about the double post- I got an error message (which i now realize was 
from a mirror), so i tried again.


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




Re: [PHP] chown()

2003-01-22 Thread Evan Nemerson
what does posix_getlogin() return? perhaps you aren't really running the 
script as root...


On Wednesday 22 January 2003 08:05 pm, Urb LeJeune wrote:
> Has anyone had success in changing the ownership of a directory
> for within a PHP script? I am running as root an have tries
> exec()
> passthru()
> ``back ticks
> system()
>
>   This works fine in a Perl script:
>
> `chown egovdemo:nobody /home/e-govdemo/htdocs`;
>
> They are back ticks. Same line in the PHP script does nothing.
>
>   Any insight would be appreciated.
>
> Urb


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




Re: [PHP] total file size

2003-01-22 Thread Evan Nemerson
I can't think of a way to do this via PHP only- I'm pretty sure the file is 
sent in the POST request, therefore the page has not begun to output 
anything. Perhaps when you saw it done it was a java applet running in the 
browser?



On Wednesday 22 January 2003 08:10 pm, Victor wrote:
> Is there a way to find out total upload file size from a file uploaded
> though an html form? I figure if I know the total size, then I can just
> consistently poke at the file being uploaded and math a progress bar for
> the file being uploaded, of course, this all hangs upon the ability of
> getting the total file size BEFORE it is uploaded. It IS possible I have
> seen it done with JSP; anybody can help me with this? Thanks
>
> - Vic
>
> __
> Post your free ad now! http://personals.yahoo.ca


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




Re: [PHP] Re: Mass Mailing

2003-01-22 Thread Evan Nemerson
Q
If it delivers when possible, won't the server flake if it get's 100,000
emails inject into Qmail? If I was to use your class and loop through
100,000 emails into Qmail, will Qmail attempt all at once?

A
The answer was right above the question... "With qmail you do not have to run 
the queue like sendmail. You just inject the messages and it will deliver 
them when possible." It will build up a queue of everything it needs to send, 
then send them one at a time (or ten, or a hundred- you can configure 
that...) until it's done. It will never DoS itself by trying to send 10K 
eMails at once. Think of the queue as a long line. Mail waits its turn, then 
gets attention when it reaches the front of the line.


Q
BTW, isn't there any overhead associating with opening/closing a connection
to inject each email into Qmail? Or it's very minimal overhead to even worry
about? If 100,000 was looped and injected into Qmail, is Qmail fast enough
that 100,000 emails are not just sitting on the server filling up disk
space?

A
It's more than worth the overhead to use qmail. Basically, qmail does all the 
hard work for you. First of all, it sends multiple messages at once (default 
is 20, but it's configurable), so you're connection is never idle waiting for 
that SYN|ACK, DNS query, SMTP acknowledgement, etc.  Now theoretically 
_could_ do this with PHP (pcntl), but why re-invent the MTA? It probably 
wouldn't be nearly as efficient, and it would take an eternity to develope a 
script that even approaches qmail's functionality.


Now, with regards to a MLM (mailing list manager), you may want to take a look 
at ezmlm. You can find it (and qmail) at http://cr.yp.to/ It doesn't just 
delete addresses from the database automatically, but first sends a little 
probe eMail, threatening to delete the address if the probe bounces. It's a 
pretty cool feature, since it prevents good addresses from being dropped for 
stupid reasons. For instance, I get them sometimes (securityfocus runs ezmlm 
on bugtraq and vuln-dev, prolly their others too, and vulnwatch/vulndev both 
use it) when mail bounces due to MIME types that can be naughty (exe, vbs, 
com, eml, hehe .fon, .ttf, .otf soon?), or when someone uses profanity, or 
even if the DNS was temporarily down. Now personally i don't care about 
profanity or naughty MIME types, but lots of ISPs (like mine) filter them. 
Just something to think about.



On Wednesday 22 January 2003 08:40 pm, Jonathan Chum wrote:
> Hi,
>
> I was surfing through google's archive, and some reason my USENET reader
> didn't catch this reply, so here goes. . .(my comments are embedded below)
>
> "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hello,
> >
> > On 12/22/2002 02:52 PM, Jonathan Chum wrote:
> > >>>I was considering of writing the mass mailing application in PHP
>
> instead
>
> > >>>though.
> > >>>
> > >>>If anyone has eperience writing such applications with this amount of
> > >>>emails, I'd like to know what you've done.
> > >>
> > >>If you do not need to send personalized messages (messages that differ
> > >>for each recipient), just put all recipients in a BCc: header and send
> > >> a single message to the local mailer queue (not via SMTP).
> > >>
> > >>If you do not care for the users that bounce messages, just make the
> > >>return path be black hole email address. OTOH, if you care about
> > >> bounces (you should if you mailing list is large or is not clean),
> > >> consider using ezmlm, which is a mailing list manager than among other
> > >> things takes care of bounce messages thanks to qmail VERP. I was told
> > >> that is the one that eGroups hacked to use in the now known
> > >> YahooGroups site.
> > >>
> > >>Once I built a small Web interface for ezmlm. It was meant just to
> > >>create and edit several mailing lists meant to be used as newsletter
> > >> for a portal with many sites. Is simple but it already comes with a
> > >> SOAP interface to manage the mailing list subscribers remotely.
> > >>
> > >>http://www.phpclasses.org/ezmlmmanager
> > >
> > > I heard that using BCC, it can only handle a certain amount of
>
> receipients.
>
> > No, if you look in the archives of this list you will notice that this
> > was explained several times. What happens is that some ISP of shared
> > hosting limit the number of recipients of the messages you can send
> > because they do not want you to do mass mailing at all. You should check
> > your ISP Acceptable Use Policy before trying to do any mass mailing.
> > Trying to queue individual messages to each recipient may fool the
> > server limitations but you may still be against the AUP.
> >
> > > Also, messages that are BCC'd are also tend to be blocked by mail
>
> servers
>
> > > and clients.
> >
> > Any server owners that do that are dumb because while they think they
> > are blocking spammers, what they get is they are simply blocking opt-in
> > mailing lists for instance like this 

Re: [PHP] htpasswd

2003-01-22 Thread Evan Nemerson
Don't chmod .htpasswd- _huge_ security risk... Will your server allow you to 
have suid scripts??? If so, you can just write a little wrapper and make it 
suid. If you do that, I'd also reccomend using an extension other than PHP, 
and/or placing it outside your web root. Wouldn't want people adding 
themselves...

I'd reccomend not using .htaccess at all, and just whip up a system using a 
real database, wth the real work done in PHP. htaccess just isn't designed to 
be dynamic.



On Wednesday 22 January 2003 06:56 pm, Kris wrote:
> Hi
>
> I've built a secure site. After the user has chosen a valid username and
> password I want my script to run htpasswd on the .htpasswd file in the
> directory. The script can run htpasswd as it doesn't have permission.
> What is the safest way to do this?
> Should I chmod htpasswd or is there a better option for this whole thing??
>
> Thanks
>
> Kris


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




Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-23 Thread Evan Nemerson
Albert Camus. Your sig has a quote attributed to "unknown". It was Albert 
Camus.

Don't walk in front of me, I may not follow, Don't walk behind me, I may not 
lead, Just walk beside me, and be my friend. -Albert Camus



On Thursday 23 January 2003 12:28 pm, Richard Baskett wrote:
> Ok I am hearing a bad rumor that Red Hat 8.0 and the Mac xserve both come
> with Apache 2.. now is this a rumor or is this true?
>
> If it's true.. why?  And does anybody have any experience in uninstalling
> Apache 2 on the xserve and does it break anything?
>
> Cheers!
>
> Rick
>
> Don't walk in front of me, I may not follow, Don't walk behind me, I may
> not lead, Just walk beside me, and be my friend. - Unknown
>
> > From: Tim Thorburn <[EMAIL PROTECTED]>
> > Date: Thu, 23 Jan 2003 05:03:00 -0500
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Why PHP doesn't work with Apache2?
> >
> > Just to add a little fuel to the fire, the only way I've seen or been
> > able to get PHP and Apache 2 working together is by installing each from
> > my Red Hat 8.0 CD's.  When I tried to compile each together, I got many
> > an error.
> >
> > When I start doing some actually web work on my testing server, I imagine
> > I'll uninstall Apache 2, and go with some version of 1.3
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Problems to compile php (cvs)

2003-01-26 Thread Evan Nemerson
I'll bet you're trying to mix v4 and v5... Make sure you're using the latest 
anoncvs instructions, as they have changed recently...



On Sunday 26 January 2003 07:52 am, Robert Mena wrote:
> Hi, I usually fetch php from cvs a couple of times in
> order to try new features etc.
>
> Unfortunately since the beginning of this week I have
> been unable to compile, no matter what I do.
>
> I have been cvsing daily, buildconf and the same
> ./configure settings I have been using for ages.
>
> ./configure --with-apxs2 --enable-gd-native-ttf
> --with-xml --with-openssl --with-zlib --with-dom
> --with-gd --with-ttf
>
> The error :
>
> home/php4/ext/standard/basic_functions.c: In function
> `php_simple_ini_parser_cb':
> /home/php4/ext/standard/basic_functions.c:2827:
> `ZEND_INI_PARSER_POP_ENTRY' undeclared (first use in
> this function)
> /home/php4/ext/standard/basic_functions.c:2827: (Each
> undeclared identifier is reported only once
> /home/php4/ext/standard/basic_functions.c:2827: for
> each function it appears in.)
>
> Any tips ?
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com

-- 
I am convinced that the teaching of the church is in theory a crafty and evil 
lie, and in practice a concoction of gross superstition and witchcraft 

-Leo Nikolaevich Tolstoy


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




Re: [PHP] content type header for downloading files

2003-01-28 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Change
header("Content-Disposition: attachment; filename=".basename($fname).";");
to
header("Content-Disposition: inline; filename=".basename($fname).";");


On Tuesday 28 January 2003 06:27 pm, Dara Dowd wrote:
> I have the following headers in download.php which forces a download dialog
> box to be opened when a user clicks on a desired file:
>
> header("Content-type: application/octet");
> header("Content-Length: $filelength");header("Content-Disposition:
> attachment; filename=".basename($fname).";");
>
> This works fine with IE, but Mozilla adds a '.php' extension to the
> filename if i choose the save option, and asks me to choose which
> application to use if I want to open the file. The files are binary. Do I
> need to change the content-type header? If so, to what? If not, what do I
> do? Thanks, Dara
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+N2aH/rncFku1MdIRAvilAKCn7xrFd+TeIYYCr99xyH59fih16wCfTCHI
+7dGxJJU5ikFk/H+zhkZ9hw=
=bwBj
-END PGP SIGNATURE-


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




Re: [PHP] content type header for downloading files

2003-01-29 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Manually connect and request a page using HTTP
echo -e "GET / HTTP/1.0\r\n\r\n" | nc server 80
works on many boxes... you may have to use telnet and actually type in the 
request instead of piping


On Wednesday 29 January 2003 05:29 pm, Dara Dowd wrote:
> how do i examine the headers sent?
> - Original Message -
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> Date: Wed, 29 Jan 2003 20:06:47 -0500
> To: "''Dara Dowd''" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>,
> <[EMAIL PROTECTED]> Subject: RE: [PHP] content type header for
> downloading files
>
> > > $fname is the name of the file i want to download. It works in IE, as
> >
> > in
> >
> > > the name of the file to be downloaded appears correctly in the dialog
> >
> > box.
> >
> > > I changed 'application/octet' to 'application/octet-stream' and this
> >
> > had
> >
> > > no effect.
> >
> > Maybe find a site that works correctly on the browser in question and
> > examine the headers it sends?
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

- -- 
The greatest mistake is to imagine that the human being is an autonomous 
individual. The secret freedom which you can supposedly enjoy under a 
despotic government is nonsense, because your thoughts are never entirely 
your own. Philosophers, writers, artists, even scientists, not only need 
encouragement and an audience, they need constant stimulation from other 
people. It is almost impossible to think without talking. If Defoe had really 
lived on a desert island, he could not have written Robinson Crusoe, nor 
would he have wanted to. Take away freedom of speech, and the creative 
faculties dry up.

- -George Orwell
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+ONGu/rncFku1MdIRArmpAJ4uI/X4iTe8SsScdX35uYduYzgJEgCbB36d
cNfHRaY/3YMMliv4bqr53Zg=
=cwmo
-END PGP SIGNATURE-


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




Re: [PHP] Base64 Encode

2003-02-01 Thread Evan Nemerson
What about $_GET['goto']??? Sounds like another register_globals issue. Also, 
instead of base64 encoding, you may want to use the rawurlencode and 
rawurldecode functions.



On Saturday 01 February 2003 07:02 pm, Stephen wrote:
> I have a PHP script that works on older versions of PHP but on 4.3, it
> outputs nothing. Here's my code:
>
>  echo ''."\n"
> ."\n".'if (document.location == top.location)'."\n"
> .'  top.location="home.php?goto='
>.base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
> .'';
> ?>
>
> The problem is, when it redirects, the URL variable goto is empty. I'm
> assuming this has something to do with base64_encode. Since this code
> snipet is on every page of my site, it'd be a hard hassle to change it so
> is there a setting in PHP I need to tweak or should I set aside a few hours
> to edit this code? If the latter, what should I change it to?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "What's the point in appearance if your true love, doesn't care about
> it?" -- http://www.melchior.us

-- 
If anyone can show me, and prove to me, that I am wrong in thought or deed, I 
will gladly change. I seek the truth, hich never yet hurt anybody. It is only 
persistence in elf-delusion and ignorance which does harm.

-Marcus Aurelius


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




Re: [PHP] quick echo output

2003-03-03 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

"There are four sets of tags which can be used to denote blocks of PHP code. 
Of these, only two ( and . . .) 
are always available; the others can be turned on or off from the php.ini 
configuration file. While the short- form tags and ASP-style tags may be 
convenient, they are not as portable as the longer versions. Also, if you 
intend to embed PHP code in XML or XHTML, you will need to use the  form to conform to the XML. "

- -php.net/basic-syntax



On Monday 03 March 2003 03:37 pm, Richard Baskett wrote:
> Ok most all programs I see they use  within the
> html. Now I have always used the shortened version  Is there a
> reason why I should not use this?  I've never had any problems with this
> way of doing things, but I just don't see anyone else using that format..
>
> Cheers!
>
> Rick
>
> "As I grow to understand life less and less, I learn to live it more and
> more." - Jules Renard

- -- 
Truth, like gold, is to be obtained not by its growth, but by washing away 
from it all that is not gold. 

- -Leo Nikolaevich Tolstoy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+Y/D+/rncFku1MdIRAp5PAJ98htywb5MBJDYTO38PuzOIB/V1QgCfd43i
3sfE6as6sG5gz4nOyqfNBqs=
=6SeN
-END PGP SIGNATURE-


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



Re: [PHP] query strings(still broken)

2003-03-03 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

// UNTESTED
$tArr = explode('&',$QUERY_STRING);
foreach ( $tArr as $tVar )
{
$a = explode('=',$tVar);
${rawurldecode($a[0])} = rawurldecode($a[1]);
}


???


On Monday 03 March 2003 04:17 pm, Sunfire wrote:
> tried everything except session vars and the query string is still
> broken... no matter what i do for some reason the browser wants to always
> put %20 in the middle of my words (i.e. hello world as one var will come
> out as hello%20world)
>
> any other ideas
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003

- -- 
Blasphemy is a blast for me.

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

iD8DBQE+Y/J1/rncFku1MdIRAvUuAJ93/TtE5JDPHrcDTI/rHJsd5xVMqQCgtVLa
9D28LUJpLVjOiPEbuDl4qhA=
=d68+
-END PGP SIGNATURE-


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



Re: [PHP] XML Array

2003-07-15 Thread Evan Nemerson
I seem to remember seeing something like that on hotscripts.com...


On Tuesday 15 July 2003 03:58 pm, Michael Smith wrote:
> Hey,
>
> I'm looking for a function to take an XML file and turn it into a PHP
> array with the same structure. So if I have:
>
> 
>   #00
>   image.jpg
> 
>
> It would give me an array:
>
> Array (
>   [template] => Array (
>   [color] => #00
>   [background] => image.jpg
>   )
> )
>
> Anyone know of anything like that?
>
> -Michael

-- 
"He's a born-again Christian. The trouble is, he suffered brain damage during 
rebirth."

-Unknown


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



Re: [PHP] Array key names - can they be called as strings?

2003-07-17 Thread Evan Nemerson
I kinda skimmed, but I think what you want is

foreach ( array_keys($SAVEVARS) as $key )
$query = "update table set $key=$SAVEVARS[$key];";



On Thursday 17 July 2003 02:38 pm, Mike Morton wrote:
> Perhaps I was not that clear on the subject :)
>
> I have the following array:
>
> $SAVEVARS[headerimage]=$_POST[headerimage];
> $SAVEVARS[backgroundimage]=$_POST[backgroundimage];
>
> I want to iterate through it to save to a database config:
>
> Forach($SAVEVARS as $whatever) {
> $query="update table set $whatever=$whatever[$whatever]";
> }
>
> Where the 'set $whatever' would become 'set headerimage' and
> '=$whatever[$whatever]' would become the value that was posted through and
> set on the line above.
>
> The question is the - the assigned string key - is there a way to retrieve
> that in a loop?  Foreach, for, while or otherwise?

-- 
"Humanity's first sin was faith; the first virtue was doubt."

-Unknown


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



Re: [PHP] php4apache2.dll

2003-07-17 Thread Evan Nemerson
Well if phpinfo.php looks like , and when you view it 
through the server you get tons of data, PHP is working. If you just get 
, it's not.



On Thursday 17 July 2003 02:28 pm, jsWalter wrote:
> What part of phpinfo.php tells me that mod_php4 is loaded and running on my
> Apache2/PHP 4.3.2 Win 2k system?
>
> php.conf (apache conf):
># Windows Win32 version
>LoadModule php4_module modules/php4apache2.dll
>LoadFile "/etc/php/php4ts.dll"
>
> NOTE: pls, no comments on the lack of volume letter,
>   this works if Apache *and* php are on the same volume.
>
>
> phpinfo - apache2handler: Loaded Modules:
>core  mod_win32mpm_winnt
>http_core mod_so   mod_access
>mod_actions   mod_aliasmod_asis
>mod_auth  mod_autoindexmod_cgi
>mod_dir   mod_env  mod_imap
>mod_include   mod_isapimod_log_config
>mod_mime  mod_negotiation  mod_setenvif
>mod_userdir   sapi_apache2 mod_ssl
>
> thanks
>
> walter

-- 
"Miracles happen to those who believe in them. Otherwise why does not the 
Virgin Mary appear to Lamaists, Mohammedans, or Hindus who have never heard 
of her."

-Bernard Berenson



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



Re: [PHP] The stupidest question of the month.

2003-07-17 Thread Evan Nemerson
Since you don't need to put up a server, you can just use fsockopen. If I 
recall correctly, passing the timeout argument as 0 means no timeout... If 
you use the cli version of php, you can just enter `php -q myscript.php &` on 
the command line (doubt this works w/ m$...). The ampersand tells the os to 
run the process in the background. If feof($connection) is true, just 
fsockopen a new connection.

Odds are, however, that the ISP doesn't have the cli version... If not, check 
to see if pcntl was enabled (if so, php.net/pcntl_fork). Your biggest problem 
will prolly be the ISP's max execution time (which you will probably not be 
able to change)

It is entirely possible that, since you don't really control the box, you 
won't be able to do this via php. You may have to resort to C. If so, my 
advice would be (a) hire someone else to write the program, or (b) buy a 
beginning C book, and get very very cozy with google, and the `man` and 
`info` commands. BSD socket interface is a PITA, but IMHO not as bad as 
winsock... the PHP socket functions are basically the BSD socket interface, 
so learn them first (easier, and it'll help a lot trying to decipher the C 
version)



On Thursday 17 July 2003 02:17 pm, René Fournier wrote:
> (Okay, now you're prepared...)
>
> I need to write a little program that opens and maintains a TCP socket
> connection to a server across the Internet. This little program would
> wait for messages from the server it's connected to, then record those
> messages and send a kinda of acknowledgment "Got it".
>
> I've written a fair amount of PHP scripts for web sites, but nothing
> that would run in the background, independently say of a web browser or
> server. In other words, I don't really know what I'm doing, or where to
> start. I've looked at PHP.net's socket docs, but everything seems to
> scream experimental, use at own risk, etc. This little program, while
> operationally simple, needs to be very reliable. For example, if the
> socket connection dies for some reason, it would know to open a new
> one. Or if the server doesn't acknowledge my little program's periodic
> "Hey, you still there"-type pings, it would close the connection and
> reopen a new one. (In fact, at the end of this message I'll list the
> basic operation and flow of the little program as stated by the company
> running the server to which I would connect.)
>
> In any case, what I want to know is, can this be done with PHP on a
> run-of-the-mill PHP-savvy ISP? Or would I need something more
> configurable? Would I need to learn C and compile a UNIX program to do
> this? Any ideas where to start? Resources, links? Anything would be
> much appreciated Thanks very much in advance.
>
> Here is how the little program should function, according to the
> Company:
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> The following describes the basic operation and flow needed within the
> DC:
>
> Setup and open tcp socket using IP address and port number13
> Send a Password_DS to the DS
> Send a Resend_DS to the DS
> Enter infinite loop:
>   Wait for messages from the DS
>   Upon receipt of a Send_DS from the DS
>   Store message contents appropriately
>   Send a Send_DS_Ack to the DS
>   Send message contents to other CSP applications
>   Upon receipt of a Ping_DS
>   Respond with a Ping_DS_Ack
>   Upon receipt of a Status_DS
>   Respond with a Status_DS_Ack
>   If needed, send message to other CSP process(es)
>   Periodically, send a Ping_DS to the DS
>   If the Ping_DS transmit fails
>   Clean-up and restart the socket connection
>   If a Ping_DS_Ack is not received from the DS
>   Clean-up and restart the socket connection
>
> In this sequence, the data formats for the messages must follow the
> requirements
> shown earlier. I.e., the Startup_DS message must include the correct
> client type;
> the Send_DS_Ack messages must include the hostID and sequenceID data,
> etc. The
> data contents received by the DC will usually be formatted and
> forwarded to
> other CSP-internal procedures for further processing.
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> ...Rene

-- 
"We humans are the species that makes things. So when we find something that 
appears to be beautifully and intricately structured, our almost instinctive 
response is to ask, 'Who made that?' The most important lesson to be learned 
if we are to prepare ourselves to approach the universe scientifically is 
that this is not the right question to ask. It is true that the universe is 
as beautiful as it is intricately structured. But it cannot have been made by 
anything that exists outside it, for by definition the universe is all there 
is, and there can be nothing outside it. And, by definition, neither can 
there have been anythi

Re: [PHP] Session Problems with 4.3.2

2003-07-22 Thread Evan Nemerson
Were you planning on incrementing $_SESSION['count'] anywhere? If not, try







On Tuesday 22 July 2003 09:55 am, Joe Sheehan wrote:
> Just noticed my email was messed up because of the html. Sorry
> about that
>
> I've been using up until a day or so ago version 4.0.6.
> I'm moving everything now to 4.3.2 but
> having problems with sessions. I've tried a basic example
> but can't retrieve session values.
> Can anyone tell me what I'm doing wrong? I see the session file
> is created but can't retrieve its value. What is interesting
> is the script I go to in order to retrieve my value also created
> a file but it's empty. Thanks in advance.
>
> php example
>
>  $title="SESSION_TEST_SESSION_ONE";
>   session_start();
>   $_SESSION['count'] = 15;
>
> ?>
>
> //
> //
> //
> //
> //
> //
> //
> //session_next
> //
>
>
> *session_next.php
> #!/bin/php
>
>  $title="SESSION_NEXT";
>   session_start();
> ?>
>
> //
> //
> /
> //
> //
> //
> //
>
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus

-- 
"Everything has a natural explanation. The moon is not a god but a great rock 
and the sun a hot rock."

-Anaxagorus


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



Re: [PHP] Arrays and Alphabetical order

2003-07-22 Thread Evan Nemerson
/* UNTESTED - and prolly could be more efficient */
$c = $d = '';
natsort($info);
foreach ( $info as $i ) {
$d = substr($i, 0, 1);
if ( $d != $c )
echo "\n";
echo $i;
$c = $d;
}


On Tuesday 22 July 2003 09:40 am, Don Mc Nair wrote:
> Hi folks
>
> I am trying to print out a table of elements in alphabetical order. I have
> an SQL query which sorts out the data in order and am using 'while ($info
> =(mysql_fetch_row...etc)) to read the data array. I need it to echo out a
> table with all the A's first, then a blank line, then all the B's, a blank
> line and so on. I could write 26 different queries, one for each letter of
> the alphabet, but surely there is a tidier way.
>
> Any help is appreciated.
>
> Don
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003

-- 
"He who fights too long against dragons becomes a dragon himself; and if you 
gaze too long into the abyss, the abyss will gaze into you."

-Nietzche


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



Re: [PHP] php weirdness

2003-07-22 Thread Evan Nemerson
Does the cpu spike for all scripts or just this one. If just this one, can you 
narrow it down to a single line?



On Tuesday 22 July 2003 08:50 am, Javier wrote:
> Hi, I'm running PHP 4.3.2 (cgi-fcgi) (win32).
>
> Everytime I run a script from the command line:
> php -q myscript.php
>
> The processor jumps to 100%, on the task manager I see that SERVICES in
> consuming 50% and PHP.exe the rest.
>
> I don't know why this happens, the script connects to a sql server I does
> a query. I think if it were a sql problem the SQLSERVER would be using
> the processor not php not services.
>
> Any ideas?
>
> Thanks.

-- 
"If you would be a real seeker after truth, you must at least once in your 
life doubt, as far as possible, all things."

-Rene Descartes


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



Re: [PHP] Session Problems with 4.3.2

2003-07-22 Thread Evan Nemerson
Try appending  to the url (perhaps cookies are off in 
browser)

If that doesn't work, try the example at php.net/session



On Tuesday 22 July 2003 11:49 am, you wrote:
> It echo No. Have no idea why its not set?
> Even tried using session_register with register_globals on
> but no luck either.
> Anyone have any idea what i'm doing wrong? I'm hoping its just
> a user error.
> Thanks in advance
>
>
>
> From: Evan Nemerson <[EMAIL PROTECTED]>
>
> >To: "Joe Sheehan" <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Session Problems with 4.3.2
> >Date: Tue, 22 Jul 2003 10:01:03 -0700
> >
> >Were you planning on incrementing $_SESSION['count'] anywhere? If not, try
> >
> >
> >
> >On Tuesday 22 July 2003 09:55 am, Joe Sheehan wrote:
> > > Just noticed my email was messed up because of the html. Sorry
> > > about that
> > >
> > > I've been using up until a day or so ago version 4.0.6.
> > > I'm moving everything now to 4.3.2 but
> > > having problems with sessions. I've tried a basic example
> > > but can't retrieve session values.
> > > Can anyone tell me what I'm doing wrong? I see the session file
> > > is created but can't retrieve its value. What is interesting
> > > is the script I go to in order to retrieve my value also created
> > > a file but it's empty. Thanks in advance.
> > >
> > > php example
> > >
> > >  > > $title="SESSION_TEST_SESSION_ONE";
> > >   session_start();
> > >   $_SESSION['count'] = 15;
> > >
> > > ?>
> > >
> > > //
> > > //
> > > //
> > > //
> > > //
> > > //
> > > //
> > > //session_next
> > > //
> > >
> > >
> > > *session_next.php
> > > #!/bin/php
> > >
> > >  > > $title="SESSION_NEXT";
> > >   session_start();
> > > ?>
> > >
> > > //
> > > //
> > > /
> > > //
> > > //
> > > //
> > > //
> > >
> > > _
> > > MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/virus
> >
> >--
> >"Everything has a natural explanation. The moon is not a god but a great
> >rock
> >and the sun a hot rock."
> >
> >-Anaxagorus
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> _
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail

-- 
"If one were to take the bible seriously one would go mad. But to take the 
bible seriously, one must be already mad."

-Aleister Crowley


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



Re: [PHP] Unable to configure PHP5 on Linux

2003-07-28 Thread Evan Nemerson
Ya- you have to have libxml2-devel installed. Possibly 
http://rpmfind.net/linux/RPM/rufus/libxml/libxml2-devel-2.5.1-1.i386.html
but check your distro cd first. Or you could rpm -e libxml2-2.5.1-1, get a 
tarball, and compile it yourself



On Monday 28 July 2003 07:13 pm, Jonathan Villa wrote:
> My current setup is httpd 2.0.47 on a Red Hat 8.
>
> When I try to configure php I do
>
> ./configure --with-apxs2=/etc/httpd/bin/apxs --disable-cgi
>
> it runs for a while until I get
>
> configure: error: libxml2 version 2.5.1 or greater required.
>
> but yet, when I do an rpm search for libxml2
>
> rpm -q libxml2
>
> I get
>
> libxml2-2.5.1-1
>
> Any ideas on this?

-- 
Status: 0
Content-type: text/html

[cgi]
"The missionaries go forth to Christianize the savages- as if the savages 
weren't dangerous enough already."

-Edward Abbey


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



Re: [PHP] foreach help

2003-07-30 Thread Evan Nemerson
Well you could do

foreach ( $_POST as $var )
${$var} = ( isset($_POST[$var]) ? 1 : 0);

but that's really sloppy. If possible, I'd go more for something like

$vars = Array(
'noPlatform',
'littlePlatform',
'lotsaPlatform',
'yoMommasaPlatform');

foreach ( $vars as $v ) {
${$v} = ( isset($_POST[$v]) ? 1 : 0 );
}



On Wednesday 30 July 2003 06:50 pm, Ryan A wrote:
> Hi,
> I have a set of checkboxes (around 38) which will be sent to me via a
> post(eg:  value="1>)...if the checkbox is checked then session "noPlatform" should be
> created...AND only the checked ones should be registered all others should
> be unset.
>
> one way to do this would be to something like this:
> $noPlatform = (isset($_POST['noPlatform'])) ? 1 : 0;
> then set the session or via using a if and isset...
>
> but that would mean doing that for the whole 38 fields...I think I have
> seen something like this done via a loop (for, while or foreach or a
> combination) but cant find it in my old mail or the archive.
>
> Thanks in advance,
> -Ryan


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



Re: [PHP] splitting content into pages

2003-07-30 Thread Evan Nemerson
Is there a reason this can't be solved with a CSS background-repeat: repeat-y; 
? Or is download time of individual pages an issue?

This is really a client-side issue. The math is going to vary depending on 
each user's settings- which font is used, the size of the font, random 
browser stupidity, etc. Even if you try to specify such things, you'll have 
issues. If you try to use a specific font, what if the user doesn't have it? 
What if they have vision problems and have ordered fonts to be larger than 
usual? IMHO it would be better to just use CSS and put everything on the same 
page




On Wednesday 30 July 2003 07:06 pm, [EMAIL PROTECTED] wrote:
> maybe somehow with a substr function that gets the position of the last
> paragraph ??
>
> > ok let me explain , its straight up text content from the database ,
> > say its scrolls for ages , i need to split it into pages , so i get the
> > length of the string up to the last paragraph which fits i need to
> > split it there any idea ?
> >
> >> [EMAIL PROTECTED] 
> >>
> >>on Wednesday, July 30, 2003 6:35 PM said:
> >>> hi there , i have an issue trying to split content into pages , we
> >>> have a popup with content and a background image with a set height ,
> >>> when there is more content the background repeats , theoretically i'd
> >>> want to split the content into pages after a given length or line
> >>> length or where it meets the background image height how can i do
> >>> this ?
> >>
> >> This can be easy.
> >>
> >> 1. Make sure the content does not adjust itself based on the size of
> >> the browser window. That is to say that the space that contains the
> >> content should be a fixed width.
> >>
> >> 2. Then you need to calculate how many words you can legitimately fit
> >> into this fixed space without going over.
> >>
> >> If you 150 words will fit in the space but go right up to the very
> >> edge and are almost spilling into a new "page" you should pull the
> >> number of words back to 120 or something to try and make sure that the
> >> text will not spill over.
> >>
> >> You can be more precise if you use a fixed width font like Courier
> >> New. If you use a variable width font (not sure if that is the
> >> technical term) you'll have to do a little more guessing because 10
> >> i's are not the same width as 10 w's.
> >>
> >>
> >> hth,
> >> chris.
> >>
> >> p.s. There is no space before a comma!
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Status: 0
Content-type: text/html

[cgi]
"To be true to the mythical conception of a God is to be false to the 
interests of mankind."

-E. Haldeman-Julius


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



Re: [PHP] [PHP-WIN] http://www.zend.com/manual/function.memory-get-usage.php (fwd)

2003-07-30 Thread Evan Nemerson
Was php configured with --enable-memory-limit? 
function_exists('memory_get_usage')??? function_exists('get_memory_usage')??? 
Did the function even exist in 4.3.3 RC1?

Why is your address @ unix-systems.net and you're asking about win32?


On Wednesday 30 July 2003 04:36 pm, Miha Nedok wrote:
> I asked this one on php-windoows, can someone here tell the answer.
>
> -Mike
>
> -- Forwarded message --
> Date: Tue, 29 Jul 2003 15:56:25 +0200 (CEST)
> From: Miha Nedok <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] http://www.zend.com/manual/function.memory-get-usage.php
>
>
> Any ideas with this one on Win32 ? I'm running 4.3.3RC1.
>
> -Mike

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



Re: [PHP] tags to lowercase

2003-07-30 Thread Evan Nemerson
Interesting timing...
http://coggeshall.org/archives/e_65.html



On Wednesday 30 July 2003 04:25 pm, Justin French wrote:
> Sounds great, although I doubt my host will install... has anyone
> considered such a beast running as a PHP function/class?
>
> Justin
>
> On Wednesday, July 30, 2003, at 02:53  PM, Jeff Harris wrote:
> > On Jul 30, 2003, "Curt Zirzow" claimed that:
> > |* Thus wrote Justin French ([EMAIL PROTECTED]):
> > |> Hi all,
> > |
> > |hello.
> > |
> > |> has anyone developed or know of a function to convert all tags to
> > |> lowercase, but still preserves the contents of the tags and the
> >
> > content
> >
> > |> of the attributes of the tags?
> > |
> > |nice little tool:
> > |http://tidy.sourceforge.net/
> > |
> > |Some one built a function that uses that tool to filter, you'll
> > |have to search the archives, cause I dont know of it off hand.
> > |
> > |
> > |Curt
> >
> > I use tidy built into my scripts. In your tidy config file you can set
> > covert to lower case, indent, output XHTML or whatever. Curt refers to
> > phpTidyHt which basically does the same thing but with a function call.
> > Most pages come out crisp and clean. The others are inherently wacked
> > and
> > need fixing anyway.
> >
> >  > ob_start();
> > // process stuff
> > print("");
> > $str = addslashes(ob_get_contents());
> > $fp = popen("echo \"" . $str .
> >   "\" | /path/to/tidy -config /path/tidy/config", "r");
> > $newstr = "";
> > do {
> > $data = fread($fp, 99);
> > if (strlen($data) == 0) {
> > break;
> > }
> > $newstr .= $data;
> > }
> > while(true);
> > pclose($fp);
> > ob_end_clean();
> > $modtime = filemtime($_SERVER['PATH_TRANSLATED']);
> > $gmt_modtime = gmdate('D, d M Y H:i:s', $modtime). ' GMT';
> > header("Last-Modified: " . $gmt_modtime);
> > header("Content-length: " . strlen(stripslashes($newstr ) ) );
> > echo stripslashes($newstr);
> > ?>
> >
> > --
> > Registered Linux user #304026.
> > "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg
> > --import"
> > Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
> > Responses to this message should conform to RFC 1855.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > ---
> > [This E-mail scanned for viruses]

-- 
Status: 0
Content-type: text/html

[cgi]
"A leader is the wave pushed ahead by the ship."

-Leo Nikolaevich Tolstoy


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



Re: [PHP] Hash

2003-07-30 Thread Evan Nemerson
do you have something agains php.net/md5? php.net/crc32? php.net/sha1? They're 
all included in 4.3



On Wednesday 30 July 2003 07:40 pm, AECT Listas wrote:
> Hi,
>
> How set up functions hash in php4.3.2
>
> thanks
>
> _
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.yupimsn.com/


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



Re: [PHP] splitting content into pages

2003-07-30 Thread Evan Nemerson
Excellent point. A compromise, then?

How about using the background-repeat: repeat-y; and not trying to do any 
math. Just decide how long the content should be, and wrap the page at the 
next sentence. That way, you make the end users happy, but don't risk an ugly 
page. For 150 characters, (untested)


background-repeat: repeat-y;




Next page";
?>




On Wednesday 30 July 2003 07:44 pm, Chris W. Parker wrote:
> Evan Nemerson <mailto:[EMAIL PROTECTED]>
>
> on Wednesday, July 30, 2003 7:17 PM said:
> > Is there a reason this can't be solved with a CSS background-repeat:
> > repeat-y; ? Or is download time of individual pages an issue?
>
> That can look funny of course if the picture doesn't tile well.
>
> > The math is going to vary
> > depending on each user's settings- which font is used, the size of
> > the font, random browser stupidity, etc. Even if you try to specify
> > such things, you'll have issues.
>
> Too true.
>
> > If you try to use a specific font,
> > what if the user doesn't have it? What if they have vision problems
> > and have ordered fonts to be larger than usual?
>
> Right again.
>
> > IMHO it would be
> > better to just use CSS and put everything on the same page
>
> But the problem with this is that people don't like really long pages.
> It makes them (I've read this in a few places and I know I feel this
> way) feel like it's going to take forever to read a really long article
> instead of maybe five "screen length" pages.
>
> I think pages are a good idea for long articles but I agree that it's a
> sticky situation to try and accomate everyone, especially with the
> original posters requirements (wants more than one page because of the
> background).
>
>
>
> Chris.

-- 
"He died in AD 33. Get over it."



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



Re: [PHP] mcrypt mhash

2003-07-30 Thread Evan Nemerson
http://mcrypt.hellug.gr/
http://mhash.sf.net/


On Wednesday 30 July 2003 08:11 pm, AECT Listas wrote:
> Hi,
>
> What is utility of mcrypt and mhash?
>
> Thanks,
>
> _
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.yupimsn.com/


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



Re: [PHP] System() works on /usr/sbin commands

2003-07-30 Thread Evan Nemerson
You usually need to be root to execute /usr/sbin/*

check the permissions of the file you're trying to execute.



On Wednesday 30 July 2003 11:13 pm, tirumal b wrote:
> hello,
>
>   i was using system function to invoke useradd
> command but it doesn't work. well it works for all the
> commands but not those in /usr/sbin. why is it so.
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com


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



Re: [PHP] Upload scripts timing out

2003-07-31 Thread Evan Nemerson
php.net/set-time-limit


On Thursday 31 July 2003 09:03 pm, Josh Abernathy wrote:
> My current upload script times out too quickly when users are uploading
> large files. How can I stop this from happening?
>
> Thanks!

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



Re: [PHP] Building an XML Parser Class

2003-08-08 Thread Evan Nemerson
Try getting rid of the quotes around $this->startElement, or changing them to 
double quotes.

If you don't understand why, php.net/language.types.string should make for an 
exhilarating read :)



On Thursday 07 August 2003 12:40 pm, Donald Tyler wrote:
> Hi,
>
> I am trying to create a Class that will parse an XML document. It all works
> fine as individual functions but I cant get it to work as a class.
>
> For example, when I do the following in my class:
>
> xml_set_element_handler($this->xml_parser, '$this->startElement',
> "$this->endElement");
> xml_set_character_data_handler($this->xml_parser, "$this->valueHandler");
>
> I get an error message:
>
> Warning: xml_parse(): Unable to call handler $this->startElement() in
> c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
> line 90
>
> Now I presume this is because I am trying to call methods of my class.
>
> Does anyone know a good way around this?
>
>
> Thanks.

-- 
"Why be born again, when you can just grow up?"

-Unknown



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



Re: [PHP] gzip to max 9

2003-08-11 Thread Evan Nemerson
try setting zlib.output_compression_level in your php.ini



On Saturday 09 August 2003 09:42 am, Decapode Azur wrote:
> Dear All,
>
>
>  function wrl2wrz($buffer) { return gzencode ($buffer, 9); }
> ob_start("wrl2wrz");
>
> /* here the file */
>
> ob_end_flush(); # end of the output buffering
> ?>
>
> In this exemple with output beffering it is possible to select the maximum
> compression level,
>
> is it possible to select the maximum compression level too
> when writing in a file like below ??
>
> $gzp = fopen($output_file, 'w');
> gzwrite($gzp, $content);
> gzclose($gzp);
>
>
> I think that the default compression level here is 6,
> and I would like to bring it to the maximum value 9.

-- 
"A leader is the wave pushed ahead by the ship."

-Leo Nikolaevich Tolstoy


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



Re: [PHP] HTML equivalents of accented characters

2003-08-14 Thread Evan Nemerson
I think php.net/htmlentities will do this.


On Monday 11 August 2003 11:18 am, Liam Gibbs wrote:
> I don't think this has been discussed, although I'm not really sure what
> you would call these accented characters, so I haven't been able to do a
> complete search of the archives, so apologies if this has been previously
> discussed.
>
> Is there a function that not only turns & into &, " into ", and
> the like, but also turns é into é and likewise with other accented
> characters? I know I could easily write one, but why if one already exists?


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



[PHP] callback function in class

2003-08-14 Thread Evan Nemerson
Basic problem:

I need to use preg_replace_callback, and would like the callback parameter to 
be a function in a class (the same as that which contains the call to 
preg_replace_callback). "classname::function" doesn't seem to work... Anyone 
have any ideas?

If it helps:

I'm creating a class which will basically parse an enhanced version of phbb2's 
bbcode, and output it to XHTML, PDF, etc. If someone puts [size=small] (I 
won't be using integers like bbcode does), I need to make sure "small" is a 
valid word (rejects [size=foo], [size=bar], but [size=large] is okay)


-Evan

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



[PHP] Large sites running PHP (or Apache, or MySQL, or Linux)

2003-08-14 Thread Evan Nemerson
Hey everyone.

I put a list of sites running LAMP components @ 
http://www.coeusgroup.com/qwik-e-wiki.php/lamp

Could help people convince their boss/professor/friend/jealous 
spouse/whoever...

It's a wiki, so everyone have a good time!


-Evan


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



Re: [PHP] PHP vs ASP.NET "formal opinions" request

2003-08-14 Thread Evan Nemerson
Dunno if it will help, but here's a link to a thread I started a while back:
http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=convince+teh+boss&q=t

Make sure you read the whole thread- a lot of people emailed more info than 
was originally posted. Also, check everything first- it's been a while, 
things may have changed.



On Sunday 10 August 2003 07:45 pm, Douglas Douglas wrote:
> Hello everybody.
>
> I've been doing some research about the PHP vs ASP.NET
> debate, because I need to justify the use of PHP in my
> graduation work.
>
> In my University, people in charge of approving the
> graduation works advocate Microsoft's technologies.
> They don't believe in the free software movement or
> the open source movement. Some guys tried to develop a
> system using PHP and those people made them change to
> ASP.NET. They say because "It's the future". According
> to them it's where the money is.
>
> Well, I only have one year using PHP, but I'll try to
> fight. I've read a lot of opinions that have been very
> useful to me.
>
> I collected a lot of those opinions and printed to
> show them to the authorities, but they said that I
> needed "formal" basis (books, scientific journals,
> etc.) to justify the use of PHP. They said that they'd
> only allow "BIG COMMERCIAL, IMPARTIAL, RECOGNIZED
> WEBSITES" opinions and articles.
>
> I pretend to use this comparison found in the
> Microsoft MSDN website:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/htm
>l/phpvsaspnet.asp
>
> Can you give me some pointers (websites, names, etc)
> where I could find this kind of "formal comparison"
> about both technologies?
>
> I've been looking for some book that covers this
> issue. I've also been looking for some magazine
> article that I could use.
>
> I'd appreciate any kind of help. Thanks.
>
> Regards, Douglas.
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com


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



Re: [PHP] callback function in class

2003-08-14 Thread Evan Nemerson
Never mind. I can create an anonymous function w/ create_function(), and use 
that as the callback. It's not pretty, but it works.

Sorry about wasting everyone's time w/ a brain fart.


-Evan



On Friday 08 August 2003 06:16 pm, Evan Nemerson wrote:
> Basic problem:
>
> I need to use preg_replace_callback, and would like the callback parameter
> to be a function in a class (the same as that which contains the call to
> preg_replace_callback). "classname::function" doesn't seem to work...
> Anyone have any ideas?
>
> If it helps:
>
> I'm creating a class which will basically parse an enhanced version of
> phbb2's bbcode, and output it to XHTML, PDF, etc. If someone puts
> [size=small] (I won't be using integers like bbcode does), I need to make
> sure "small" is a valid word (rejects [size=foo], [size=bar], but
> [size=large] is okay)
>
>
> -Evan


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



Re: [PHP] Not fair: REMOTE_HOST

2003-08-19 Thread Evan Nemerson
$_SERVER['REMOTE_HOST'] = gethostbyaddr($_SERVER['REMOTE_ADDR']);

better?



On Tuesday 19 August 2003 01:18 pm, John Taylor-Johnston wrote:
> Aw gee, $_SERVER['REMOTE_HOST'] (only REMOTE_ADDR) does not exist in PHP?
> Bummer.
> Why is that?

-- 
"Everything has a natural explanation. The moon is not a god but a great rock 
and the sun a hot rock."

-Anaxagorus


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



Re: [PHP] GPL question

2003-08-19 Thread Evan Nemerson
Smarty is LGPL, not GPL. The LGPL allows linking. So no.

PEAR packages typically use the PHP license, but some do use GPL. If you link 
to a GPL'd package, you must GPL your package. Otherwise, no.

So unless you link to a GPL'd PEAR package, the answer is no.

Read:
http://www.gnu.org/licenses/gpl-faq.html



On Tuesday 19 August 2003 10:57 am, Juan Nin wrote:
> If I use Smarty or PEAR on my software, does it make my software GPL?
>
> Thanks in advance,
>
> Juan

-- 
"This job would be great if it weren't for the fucking customers..."

-Unknown


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



Re: [PHP] Object Aggregation - does anyone have experience with it?

2003-03-26 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

my _guess_ would be you compiled w/ default (v1) zend engine. v2 has lots of 
improvements for oop- perhaps this is one of them. Try compiling with v2 of 
the engine and see what happens.




On Tuesday 25 March 2003 02:44 pm, Christopher E. Welton wrote:
> I am using php 4.2.2 with Apache 2.0 on Red Hat 8.0
>
> When I attempt to dynamically aggregate two objects using the
> aggregate() call, I get the following message:
>
> Fatal error: Call to undefined function: aggregate()
>
> the man page for aggregate() lists  the following info:
> aggregate
> (PHP 4 >= 4.2.0)
> void aggregate ( object object, string class_name)
>
> Though I realize this module is experimental, I'm curious if it has been
> pulled out from PHP, moved to a different name/section or if there is
> just something weird going on here with my installation.
>
> Any help would be appreciated

- -- 
Whenever I think of how religion started, I picture some frustrated old man 
making out a list of all the ways he could gain power, until he finally came 
up with the great solution of constant fear and guilt, then he leaped up and 
started planning a new wardrobe.

- -Steve Blake
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+gXTT/rncFku1MdIRAo6KAKCawqDo7zo6nt/IZl3ySqVVicLnsgCfUODU
3BAoXnYmZFA/Dc+a9jxtAFc=
=t3Sb
-END PGP SIGNATURE-


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



Re: [PHP] Uploading Files Via PHP

2003-03-26 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Are you getting any errors through PHP? Set error reporting to E_ALL then try.






On Wednesday 26 March 2003 04:41 pm, Vernon wrote:
> Is there some thing that needs to be turned on in the php.ini in order to
> be able to upload photos VIA php? I have the same script on one machine
> with the right permissions on the upload dirs on one machine and am moving
> to another machine which is not being uploaded. Funny thing is I'm not
> getting any errors in the Apache logs.
>
> Thanks

- -- 
All religions are founded on the fear of the many and the cleverness of the 
few.

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

iD8DBQE+glMF/rncFku1MdIRAlN5AJ9n6jN4N8dLQg8OVLZZClgSEJ+qEwCffq6f
XRmpe/CK1i1ecaHRh7t+eLQ=
=snmO
-END PGP SIGNATURE-


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



Re: [PHP] Return Character in a Text File?

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

If you use \r\n instead of \n notepad should be fine. Winblows uses CRLF for 
everything...


On Thursday 27 March 2003 10:07 am, Jay Paulson wrote:
> I have a slight problem.  Is there anyway to make a text file with a return
> character that doesn't show up in windows notepad as a gibberish character
> and actually puts a return in it?  Right now I'm using the "\n" for the
> return but it doesn't get read in notepad as a return so the string data is
> one long line instead of multiple lines.  Is there any other way of doing
> this?
>
> Code I am using:
> $data = "";
> //loop
> $data .= "$firstName, $lastName, $email, $gender, $bday, $phone, $zip,\n";
> //end of loop
>
> Thanks!

- -- 
Cats are intended to teach us that not everything in nature has a function.

- -Garrison Keillor
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0BH/rncFku1MdIRAnwKAKCftHhBGBiE/1dyv4DqmX+wEEDgHwCeNF4a
vISgVvWe+vKX5M7AzrSAeV4=
=uWAU
-END PGP SIGNATURE-


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



Re: [PHP] logging ip address when submitting a form

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

You might wanna move ipaddr.log outside your server root... or at least use 
some .htaccess... wouldn't want someone to just browse to the file...


$fp = fopen("ipaddr.log", "a+");
fputs($fp, $_SERVER['REMOTE_ADDR']."\n");
fclose($fp);


On Thursday 27 March 2003 10:04 am, Joakim Larsson wrote:
> Hello,
>
> Is there a command in php that would logg the ip address of the user
> viewing the php file.
> I need someway of finding out who posted the form.
>
> thanx

- -- 
Cats are intended to teach us that not everything in nature has a function.

- -Garrison Keillor
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0Kk/rncFku1MdIRAv9gAKCsYSQ6SVXitFxAOBnbYap3/15VmgCgjwYz
41qDV2J1Ba647Nt74z4SOYY=
=7017
-END PGP SIGNATURE-


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



Re: [PHP] character set problem

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

can you do a rawurlencode() on the data before you put it in the DB, and a 
rawurldecode when you suck it out? It's a hack, but it would prolly work 
fine.


On Thursday 27 March 2003 09:46 am, Filip De Graeve wrote:
> Hello,
>
> Using PHP 4.3.1 on a Windows 2k/Apache,
> i am trying to insert some text  like"Test é à ë" into a
> MS SQL database.
>
> The result I get using the query analyzer :
> Test Ú Þ Ù
>
> is not the same as you can see for yourself.
> However; ms sql supports those characters when
> i insert them directly into the query analyzer.
>
> My locales support those characters (.be locals),
> and i configured the php.ini to support the iso-8859-1 charset
> (and use the mssql dll extension).
>
> What's also weird, is that the function   htmlspecialchars has
> no effect on the result, whilst htmlentities does have one; but then the
> textfield looks like " Test é è ë "
> which wasn't exactly the point.
>
> I used an older version of php once;
> ( i believe it was 4.1.1 or something) and there wasn't any bug
> regarding charsets etc (on a ms sql database).
>
> Can anybody give me any clue where to look
> or what to do?
>
> thank you,
> regards
>
> Filip
> [EMAIL PROTECTED]

- -- 
Prisons are built with stones of Law, Brothels with bricks of Religion.

- -William Blake
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0SB/rncFku1MdIRAofUAJ0TbYKVYZ+tPski2l8QNT6dkDkh8wCdEjux
8jW37HvPuBZg5aZbZywOF+0=
=qVVT
-END PGP SIGNATURE-


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



Re: [PHP] Excel

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Not exactly, but http://pear.php.net/package-info.php?pacid=156


On Thursday 27 March 2003 05:47 am, Gabi Moise wrote:
> Hi,
> Can someone point me to a php and Excel tutorial?
>
> tnx.

- -- 
First they came for the Communists, and I didn't speak up, because I wasn't a 
Communist. Then they came for the Jews, and I didn't speak up, because I 
wasn't a Jew. Then they came for the Catholics, and I didn't speak up, 
because I was a Protestant. Then they came for me, and by that time there was 
no one left to speak up for me.

- -Martin Niemoller
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0c3/rncFku1MdIRApbWAKCyeYSh+AxzuBoqz73H7lMTbnBnQwCggdvv
ZmDL1xWz1fdxvvrVJM+YLmU=
=wm4h
-END PGP SIGNATURE-


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



Re: [PHP] character set problem

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

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

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



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

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

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

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


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



Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

register globals is of in newer versions of php. you can re-enable it in the 
php.ini.. See 
http://www.php.net/manual/en/configuration.directives.php#ini.register-globals


On Thursday 27 March 2003 10:57 am, Tom Tsongas wrote:
> I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
> previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
> PHP website that I had been developing on for some time.
> After I upgraded, the entire website is virtually non-functional. I keep
> receiving 'Page cannot Display' or 'Document contains no data' errors.
>
> I am not sure if this is a configuration issue on Apache or PHP. phpinfo
> seems to work fine and I don't encounter issues accessing pure HTML
> pages directly. Just the PHP ones?
>
> Any ideas folks?
>
> - Tom

- -- 
Businesses may come and go, but religion will last forever, for in no other 
endeavor does the consumer blame himself for product failure.

- -Harvard Lamphoon
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0xM/rncFku1MdIRArx/AJ9HYhHbEQRTWwz3+qqFibKKubOmZACgp9yh
KqCV12CJR4Td92mAITOn6vw=
=F145
-END PGP SIGNATURE-


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



Re: [PHP] logging ip address when submitting a form

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Not true- $_SERVER['REMOTE_ADDR'] doesn't rely on anything sent by the 
browser. Load up a phpinfo() on your server, then request it by hand...

echo -e "GET /phpinfo.php HTTP/1.0\r\n\r\n" | nc www.yourserver.com 80

You'll see it has your IP address even though you never supplied it. It's 
pointless to send IP protocol data over HTTP. $_SERVER['REMOTE_ADDR'] is 
always there, although you are right about not always being able to trust it.





On Thursday 27 March 2003 02:52 pm, Justin French wrote:
> $_SERVER['REMOTE_ADDR'] will contain the remote user's IP address IF it is
> set by the user agent (browser).
>
> It's also worth noting that this IP address could be faked, could be
> rotated by their ISP on a request-by-request basis (eg all AOL users),
> could be that of their firewall or network gateway, etc etc.
>
> It's fine to log it, but don't rely on it for future visits, or anything
> like that :)
>
>
> Justin
>
> on 28/03/03 5:04 AM, Joakim Larsson ([EMAIL PROTECTED]) wrote:
> > Hello,
> >
> > Is there a command in php that would logg the ip address of the user
> > viewing the php file.
> > I need someway of finding out who posted the form.
> >
> > thanx

- -- 
The greatest mistake is to imagine that the human being is an autonomous 
individual. The secret freedom which you can supposedly enjoy under a 
despotic government is nonsense, because your thoughts are never entirely 
your own. Philosophers, writers, artists, even scientists, not only need 
encouragement and an audience, they need constant stimulation from other 
people. It is almost impossible to think without talking. If Defoe had really 
lived on a desert island, he could not have written Robinson Crusoe, nor 
would he have wanted to. Take away freedom of speech, and the creative 
faculties dry up.

- -George Orwell
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g6wm/rncFku1MdIRArjPAJ46kEGkzIeZCSGiEMQEJ5d7SZd/RQCfaVgH
LfbocrxUHMpgbcLL4boIxI8=
=RG1G
-END PGP SIGNATURE-


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



Re: [PHP] Redirec.t

2003-03-28 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

header("Location: http://www.domain.com/admin.php";);

if you _really_ need to use your syntax, you could

function redirect($uri) { header("Location: ".$uri); }



On Friday 28 March 2003 03:28 pm, Johnny Martinez wrote:
> Hi all,
> Can someone tell me the function to redirect a browser to a specific page?
>
> Johnny
>
> For example:
> 
> code...
> code...
> code finished.
>
> redirect("http://www.domain.com/admin.php";);
>
> ?>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+hNv3/rncFku1MdIRAuMUAJoD4F3qD2BNWncsbh4pPDmmG2+avACeKwNz
Y71/WUPqjCfWR43xrW553FQ=
=k0ku
-END PGP SIGNATURE-


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



Re: [PHP] Re: What program do you use to Create PHP Application?

2003-05-27 Thread Evan Nemerson
Nothing, except for the keyboard shortcuts are so damn addictive. I get out of 
emacs and it pisses me off that every application doesn't have that kind of 
power that easily accessible. Just like Opera & mouse gestures...



On Tuesday 27 May 2003 06:56 am, David Grant wrote:
> Joe Stump wrote:
> > And I thought everyone used Vim and CVS :)
>
> What the hell is wrong with EMACS?
>
> > /flame
>
> Oh...
>
> Regards,
>
> David


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



Re: [PHP] Anyone know of a php script to extract files from a zip file.

2003-05-27 Thread Evan Nemerson
http://dev.maxg.info/projets/projet.ziplib.en.maxg maybe??? haven't tried it


On Tuesday 27 May 2003 12:16 pm, Al wrote:
> I doing a little photos album application and I'd like my, non-techie,
> users to be able to zip together their photos and upload them to a
> folder on the site.  I've got everything going nicely except the unzipper.
>
> I would not like to teach them to use ftp, even with a browser.
>
> I'm on a virtual host that doesn't have the ZZIPLIB.
>
> Thanks

-- 

The greatest mistake is to imagine that the human being is an autonomous 
individual. The secret freedom which you can supposedly enjoy under a 
despotic government is nonsense, because your thoughts are never entirely 
your own. Philosophers, writers, artists, even scientists, not only need 
encouragement and an audience, they need constant stimulation from other 
people. It is almost impossible to think without talking. If Defoe had really 
lived on a desert island, he could not have written Robinson Crusoe, nor 
would he have wanted to. Take away freedom of speech, and the creative 
faculties dry up.

-George Orwell


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



Re: [PHP] secure code

2003-05-27 Thread Evan Nemerson
Good question! I rarely see this type of question here.

http://www.dwheeler.com/secure-programs/ is a good one- even has a small 
section dedicated specifically to PHP

The Shmoo Group has a good list at http://www.shmoo.com/securecode/

And if you're one of the learn by example of how not to do it, take a look at 
the bugtraq and vuln-dev lists @ securityfocus



On Tuesday 27 May 2003 04:52 pm, Tim Burgan wrote:
> Hello,
>
> I'm wondering if you can recommend any resources that discuss writing
> secure code and how to put the best methods in place to prevent hackers.
>
> I'm particularly looking at resources from the web coding perspective, not
> securing a server.
>
> Or, what things to you do to 'block' hackers.
>
> Thanks
> Tim Burgan

-- 

The people are the only sure reliance for preservation of our liberty.

-Thomas Jefferson


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



RE: [PHP] Variables don't pass... *sniff*

2003-05-29 Thread Evan Nemerson
Deprecated means that it has fallen out of favor, and is
_in_the_process_of_being_phased_out_ You should not rely on this code in
new applications. Go look it up in a dictionary.

If you have to be backward compatible with < 4.1.0 (which was released
on 10-Dec-2001!) I suggest something like this:

=')) ?
$_GET[$v] : $HTTP_GET_VARS[$v];
}

get('desired_var');
echo $desired_var;

?>

However, I don't think it's at all unreasonable to request that they use
a version of PHP less than 2 years old (i think 4.0.6, the last version
before 4.1.0, was released 27-Jun-2001). At that point, I would be more
concerned with compatibility with _future_ releases than 'absolute
compatibility' with past releases.





On Wed, 2003-05-28 at 04:46, Jay Blanchard wrote:
> [snip]
> To maintain absolute compatibility, just use $HTTP_GET_VARS.  It's 
> availalable in all PHP versions, just deprectaed in versions here $_GET 
> is available.
> [/snip]
> 
> Just to be perfectly clear on this. Let's say that I am writing an
> application that I am going to release to the public (for free of
> course!). In order that the application be as compatible with the many
> installed versions of PHP as possible I should always use $HTTP_GET_VARS
> or $HTTP_POST_VARS ? Or is there a point at which the formation of the
> variable call changes (like the $_GET and $_POST in the latest
> versions)? If there is a point at which it changes how can I account for
> that in code, other than telling the potential use that "you must be
> running PHP 4.x.x"?
> 
> Thanks!
> 
> Jay
> 


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



Re: [PHP] Decrypting data with GnuPG

2003-05-29 Thread Evan Nemerson
GnuPG doesn't use stdin to read the password, which is where you're
sending it. It uses a more low-level interface (check out the below link
if you're interested) where they interact directly with the virtual
console.

Try piping to your command- that won't work either

echo $PASSPHRASE | \
/usr/bin/gpg \
--homedir=/path/to/.gnupg \
--no-secmem-warning \
--always-trust \
--yes \
--output /path/to/output.txt \
--decrypt /path/to/testtext.asc

GnuPG source code for TTY I/O:
http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?rev=1.28&content-type=text/plain



On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:
> Hi,
> 
> I would like to decrypt data encoded with GnuPG without including the 
> private key passphrase in the command to prevent people from viewing it 
> with "ps".
> 
> Here is the code I wrote:
> 
> 
> $command = "/usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning 
> --always-trust --yes --output /path/to/output.txt --decrypt 
> /path/to/testtext.asc";
> $passphrase = '***';
> 
> $fp = popen($command, 'w+');
> fputs($fp, $passphrase);
> pclose($fp);
> 
> print "Done";
> exit;
> ==
> 
> I assumed that the fputs() function would write the passphrase at the 
> prompt, but that doesn't seem to be the case - the command does not 
> create the output.txt file when ran by the PHP program (which is running 
> as a CGI under my user BTW) while it works when ran from the shell.
> 
> Any idea why?
> 
> Thanks!
> 
> Pierre-Luc Soucy
> 


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



Re: [PHP] Decrypting data with GnuPG

2003-05-30 Thread Evan Nemerson
Are you appending a newline to your passphrase?

$passphrase = "my gnupg passphrase\n";



On Thursday 29 May 2003 06:56 am, you wrote:
>  From the GnuPG docs:
>
> --passphrase-fd n
>
>  Read the passphrase from file descriptor n. If you use 0 for n, the
> passphrase will be read from stdin. This can only be used if only one
> passphrase is supplied. Don't use this option if you can avoid it.
>
> I added --passphrase-fd 0 to my command so the passphrase should
> normally be read from stdin (according to the docs), but it still does
> not work. Any idea? I am unfortunately not familiar with C code, so I
> can difficultly find solutions to my problems by reading the GnuPG source.
>
> Thanks!
>
> Pierre-Luc
>
> Evan Nemerson wrote:
> > GnuPG doesn't use stdin to read the password, which is where you're
> > sending it. It uses a more low-level interface (check out the below link
> > if you're interested) where they interact directly with the virtual
> > console.
> >
> > Try piping to your command- that won't work either
> >
> > echo $PASSPHRASE | \
> > /usr/bin/gpg \
> > --homedir=/path/to/.gnupg \
> > --no-secmem-warning \
> > --always-trust \
> > --yes \
> > --output /path/to/output.txt \
> > --decrypt /path/to/testtext.asc
> >
> > GnuPG source code for TTY I/O:
> > http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?re
> >v=1.28&content-type=text/plain
> >
> > On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:
> >>Hi,
> >>
> >>I would like to decrypt data encoded with GnuPG without including the
> >>private key passphrase in the command to prevent people from viewing it
> >>with "ps".
> >>
> >>Here is the code I wrote:
> >>
> >>
> >>$command = "/usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning
> >>--always-trust --yes --output /path/to/output.txt --decrypt
> >>/path/to/testtext.asc";
> >>$passphrase = '***';
> >>
> >>$fp = popen($command, 'w+');
> >>fputs($fp, $passphrase);
> >>pclose($fp);
> >>
> >>print "Done";
> >>exit;
> >>==
> >>
> >>I assumed that the fputs() function would write the passphrase at the
> >>prompt, but that doesn't seem to be the case - the command does not
> >>create the output.txt file when ran by the PHP program (which is running
> >>as a CGI under my user BTW) while it works when ran from the shell.
> >>
> >>Any idea why?
> >>
> >>Thanks!
> >>
> >>Pierre-Luc Soucy

-- 

Cats are intended to teach us that not everything in nature has a function.

-Garrison Keillor


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



Re: [PHP] request

2003-05-30 Thread Evan Nemerson



On Thursday 29 May 2003 01:24 pm, Marius wrote:
>  $random = gmp_random(10);
> echo "$random";
> ?>
> how to do that it echoes a random number and not a
> Resource id #1,

-- 

Happy shall he be, that taketh and dasheth thy little ones against the stones.

-Psalms 137:9


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



Re: [PHP] random

2003-05-30 Thread Evan Nemerson
"limiter" is the maximum number of limbs, not the max random number. A limb, 
according to the GMP documentation, is " the part of a multi-precision number 
that fits in a single word. (We chose this word because a limb of the human 
body is analogous to a digit, only larger, and containing several digits.) 
Normally a limb contains 32 or 64 bits."

There's a comment on php.net/gmp_random about this



On Friday 30 May 2003 12:10 am, Marius wrote:
>   I tried
>  $random = gmp_intval(gmp_random(10));
>   echo $random;
>   ?>
>  $random = gmp_random(10);
>   $random = gmp_strval($random);
>   echo $random;
>   ?>
>
>   but it echoes realy big numbers like 36324613454671

-- 

The people are the only sure reliance for preservation of our liberty.

-Thomas Jefferson


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



Re: [PHP] general question

2003-05-30 Thread Evan Nemerson
"The php-gtk-general list is meant for general discussion about using PHP-GTK. 
To subscribe, send blank email to [EMAIL PROTECTED] 
The address of the list itself is [EMAIL PROTECTED] The list is 
archived at MARC. " - http://gtk.php.net/resources.php

Try there- you'll prolly get a better answer than you would here.




On Thursday 29 May 2003 11:22 pm, laurent hermann wrote:
> hello
>
> i need to make a standalone application from a web php site.
>
> how can i use php-gtk ?
>
> how can i package this application ?
>
>
>
> thanks

-- 

Cats are intended to teach us that not everything in nature has a function.

-Garrison Keillor


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



Re: [PHP] How to secure a download ?

2003-05-31 Thread Evan Nemerson
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=yourfilename.zip");
readfile("/path/to/yourfilename.zip");




On Friday 30 May 2003 03:34 pm, Vincent M. wrote:
> Hello,
>
> Is there any way to launch a download of a Zip file to the user without
> a link. The user must not know where the file is on the server.
>
> The transfert of the file must be made by a php file with special
> headers, no ?
>
>header("Content-type: zip"); or something...
>
>
> Thanks.

-- 

Ocean: A body of water occupying 2/3 of a world made for man -- who has no 
gills.

-Ambrose Bierce


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



Re: [PHP] Function result is an array

2003-05-31 Thread Evan Nemerson
IMHO the function()[] syntax should be allowed, but it isn't.

You could use list() or extract(), but then you'd wind up with a lot more date 
than you want. What I've been doing is creating a function, then calling when 
needed. For example:

function array_get_value($array, $index) {
return $array[$index];
}

array_get_value(getdate($timestamp), 'year');

If you'd like to fill out a bug report (use 'feature request' for the type of 
bug), http://bugs.php.net/




On Friday 30 May 2003 06:52 pm, Dustin Mitchell wrote:
> I briefly tried searching the archives for this, but there aren't any handy
> keywords, so I didn't find anything.  Why can't I do this:
>
> $year = getdate($timestamp)['year'];
>
> (syntax error) while I can do this:
>
> $temp = getdate($timestamp);
> $year = $temp['year'];
>
> and is there a way to combine the above into one statement, however
> ungainly?
>
> This doesn't just happen with getdate -- it happens with any function
> returning an array.  I'm using PHP 4.1.2.
>
> Dustin

-- 

All religions are founded on the fear of the many and the cleverness of the 
few.

-Stendhal


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



Re: [PHP] Using Cookies Securely

2003-05-31 Thread Evan Nemerson
Send a session ID to the user in a cookie, then lookup that ID in a database 
on the server. It's extremely difficult to guess random session ID's (don't 
just increment them!), and if you have a session timeout, you're pretty much 
set.

It's not perfect, but I don't think anyone has come up with a better way

The way it's been explained to me, this is how PHP's sessions work, but I have 
not personally verified this. So I think it's okay to put semi-sensitive data 
in the session array (you shouldn't ever store really sensitive data). Check 
first though.




On Friday 30 May 2003 10:29 pm, Monty wrote:
> I see some posts here that say storing a username or encrypted password in
> a cookie is not secure. If so, then what's a more secure way to allow users
> to be "remembered" using a cookie so that they don't have to log in every
> time they come to the site? What do you store in the cookie to authenticate
> against?
>
> Monty

-- 

Perl - the only language that looks the same before and after RSA encryption.

-Keith Bostic


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



Re: [PHP] Using Cookies Securely

2003-06-01 Thread Evan Nemerson
Again, "It's not perfect, but I don't think anyone has come up with a better 
way."

It's called session hijacking, and it is a great reason to use SSL. However, 
there's still the issue of cross-site scripting, which can really only be 
prevented by smarter coding.

Even then there are issues. For example, holes in ie's SSL capabilities 
(including a current, unpatched vulnerability- well okay it was patched but 
M$ managed to re-introduce it in more recent patches...), permit undeteted 
MITM attacks.


On Saturday 31 May 2003 05:56 am, Dustin Mitchell wrote:
> On Fri, May 30, 2003 at 11:01:26PM -0700, Evan Nemerson wrote:
> > Send a session ID to the user in a cookie, then lookup that ID in a
> > database on the server. It's extremely difficult to guess random session
> > ID's (don't just increment them!), and if you have a session timeout,
> > you're pretty much set.
>
> That's true, and it is what most people do, but if you think about it the
> session ID is then functionally equivalent to a crypt'd password for the
> duration of your session; that is, either one allows you access to the
> site. So if you were worried about folks sniffing an encrypted password and
> using it to log in, you should be equally worried about folks sniffing a
> session ID and using *it* to log in.
>
> Dustin


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



Re: [PHP] Compile 4.3.2 Errors.

2003-06-01 Thread Evan Nemerson
Don't know about 4.3.2, but at the end of 5.0-dev make, the following message 
is output:

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).




On Saturday 31 May 2003 06:29 am, Volker Augustin wrote:
> hi,
> this sounds like a warning not like an error, your php is successfully
> compiled...(most software i know an compile got this message.)
> can you post a little bit more debug information?
>
> volker
>
> - Original Message -
> From: "Alberto Ferrer" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, May 31, 2003 3:16 PM
> Subject: [PHP] Compile 4.3.2 Errors.
>
> > Im compiling the last vercion of PHP 4.3.2 and says this after finish of
> > compile.
> > The system is a Redhat 7.3, Apache 1.3.27.
> >
> > ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
> > /root/php-4.3.2/ext/mysql/libmysql/my_tempnam.c:115: the use of `tempnam'
>
> is
>
> > dangerous, better use `mkstemp'
> >
> >
> >
> > --
> > --
> > Alberto Ferrer
> > [EMAIL PROTECTED]
> >   http://www.barrahome.org
> > --
> > Syntax Error in KITCHEN.H: COFFEE not found.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 

Know me? Know me??? What the hell does that mean, know me, you want to know 
me? Well you don't know me, and you'll never know me. Nobody knows me, or 
you, or eachother. Nobody in this world knows anybody else. You'll never know 
me. Ever.

-Rules of Attraction


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



Re: [PHP] reading binary data

2003-06-01 Thread Evan Nemerson
file_get_contents() is binary safe.

$binary_data = file_get_contents("/path/to/file");

php.net/file_get_contents


On Saturday 31 May 2003 12:42 pm, Ferhat BINGOL wrote:
> Hi,
>
> I have binary data. I know the format but I do not know how to read it with
> PHP. I saw some articles and comments on the manual but it seems taht it is
> not enough for me.
>
> Anyone to haelp, please?
>
> I just nedd a good documentation about it.
>
> TIA

-- 

Everything has a natural explanation. The moon is not a god but a great rock 
and the sun a hot rock.

-Anaxagorus


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



Re: [PHP] get modification date of remote page

2003-06-01 Thread Evan Nemerson
/* UNTESTED. */
function get_http_lm_date($url) {
$d = parse_url($url);
if ( !$fp = fsockopen ($d['host'], (isset($d['port'])) ? $d['port'] : '80') )
return FALSE;
fputs($fp, "HEAD ".$d['path']." HTTP/1.0\r\n\r\n");
while ( !feof($fp) ) {
if (  ereg ("^Last-Modified: ", $buf = fgets($fp, 256)) ) {
$retval = substr($buf, 15);
fclose($fp);
}
}
if ( !isset($retval) )
return FALSE;
else
return $retval
}


On Saturday 31 May 2003 12:09 pm, chris wrote:
> I have a database full of links. I need to write a script to go to each one
> and check the modification date of the file.  My plan is, once that is
> logged, to do this every week and indicate which pages have "changed."
>
> What is the simplest approach to this? Do I need to use CURL functions or
> remotely open the page with fopen? A pointer to the right place in the
> manual would be great...

-- 

The world holds two classes of men -- intelligent men without religion, and 
religious men without intelligence.

-Abu'l-Ala-Al-Ma'arri


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



  1   2   3   4   5   >