Re: [PHP] referer keywords

2003-01-22 Thread Jason Wong
On Wednesday 22 January 2003 15:41, Dhaval Desai wrote:
 Hello ppl,

 I want to find out what keywords are people exactly using to get to my
 website and from where are they coming(Which search engine?)...I want to
 make a custom script, I don't want to use my web server logs or anything...
 Is it possible..??

Yes, parse $_SERVER['HTTP_REFERER'] (which may or may not be available 
depending on user's browser settings).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Abraham Lincoln didn't die in vain.  He died in Washington, D.C.
*/


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




[PHP] Mohawk Software session handler functions

2003-01-22 Thread Heo, Jungsu
Hello, there.

I'm Looking for 'Mohawk Software session handler functions' examples.

PHP Manual describes it http://www.php.net/manual/en/ref.msession.php .

But, There are no descriptions and examples.

Anybody has one?

Thanks in advanced answer!

##
Heo, Jungsu Mr.

SimpleX Internet. http://www.simplexi.com



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




Re: [PHP] Re: forking scripts

2003-01-22 Thread Mirek Novak
J Smith wrote:

PHP can fork scripts. Refer to the pcntl extension.

http://www.php.net/manual/en/ref.pcntl.php

You'll be wanting to use pcntl_fork()...

J

Senn wrote:



Hi,

Since php does not have child - parent forking methods, can anybody
suggest a method to achieve this.

Thanks.

Senn






 I can recommend it, daemon I wrote in PHP is running for 3 months 
now w/o restarting and sends approx 10k personalized emails/day. pcntl 
rocks. thanx for it.

--
Mirek Novak
Anima Publishers, s.r.o.

jabber:[EMAIL PROTECTED]
ICQ:119499448
http://www.auto.cz
http://news.auto.cz
http://www.formule1.cz


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



[PHP] create executable from php script

2003-01-22 Thread Hatem Ben
heya all,

I remember that some developers started a project to create stand-alone
application from php script, can someone guide me to find it again ? I
haven't found any url talking about it.

Regards,
Hatem


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




RE: [PHP] Measuring Query Times

2003-01-22 Thread Clarkson, Nick

There's exactly the code you're looking for I think over on Evilwalrus -
http://www.evilwalrus.com/viewcode/632.php

Hope it helps,

Nick


-Original Message-
From: Peter Janett [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 06:46
To: [EMAIL PROTECTED]
Subject: [PHP] Measuring Query Times


I'm trying to figure out if there is an easy way to measure how long my
queries in PHP/MySQL are taking to execute.

Any tips or code examples most appreciated.

Thanks,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] which is better? PHP's Session handler or Mohawk's Session handler

2003-01-22 Thread Heo, Jungsu
(Sorry for disturb you if this kind of message posted earlier.
but I can't find answers on mailint list archive)

Hello, there!

I'm developing web service.
There are several web servers for one Service.
(Linux virtual server manages load banlance)

Php's original session handling function save session information on Hard disk.
So, To share Session file, each web server mount NFS partition and
set session.save_path to NFS partition.

But, I wonder that this way solves Session Sync. and Performance even if
there are so many sessions.

I found another session handler Mohawk Software session handler
(http://www.php.net/manual/en/ref.msession.php)

Manual says :
msession is an interface to a high speed session daemon which can run
either locally or remotely.
It is designed to provide consistent session management for a PHP web farm.

Um. but if session server goes down, the entire service will be stop.
And manual has a insufficent information about msession api.
I don't know how to use msession api exactly ;-(

Do you have any suggestion?

Php's Session handler with NFS or msession?

Is there somebody who work with any of two?

Thank you for advanced answer!


##
Heo, Jungsu Mr.

SimpleX Internet. http://www.simplexi.com



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




Re: [PHP] Mohawk Software session handler functions

2003-01-22 Thread Tom Rogers
Hi,

Wednesday, January 22, 2003, 6:15:36 PM, you wrote:
HJ Hello, there.

HJ I'm Looking for 'Mohawk Software session handler functions' examples.

HJ PHP Manual describes it http://www.php.net/manual/en/ref.msession.php .

HJ But, There are no descriptions and examples.

HJ Anybody has one?

HJ Thanks in advanced answer!

HJ ##
HJ Heo, Jungsu Mr.

HJ SimpleX Internet. http://www.simplexi.com

here is a class I made for msession it may give you some pointers :)

?php
class msession_class{
var $ses;   //session on flag
var $sessionname;   //current name of session
var $message;   //error message holder
var $modulename;//type of module, should be user
var $sessionid; //
var $sessionlife;   //how long inactive before the session should 
time out
var $host;  //client host
var $Username;  //username
function msession_class($sessionname=,$lifetime=,$maxgc=,$sessionid=''){
global $class_ref;  //a reference array for access by 
buried functions
$class_ref[msession_class] = $this;
ini_set( session.save_handler, user ); 
function open($save_path, $session_name) {
return msession_connect('localhost','8086');
}
function close() {
msession_disconnect();
return true;
}
function read($key) {
$sessiondata = ;
//This bit won't work on standard msession install it checks 
for a timed out session
//$x = msession_ctl($key,'TTL');
//if(!empty($x)  $x  0):
//  msession_destroy($key);
//else:
$sessiondata = msession_get_data($key);
//endif;
return $sessiondata;
}
function write($key, $val) {
global $class_ref;
msession_set_data($key,$val);
msession_timeout($key, 
$class_ref['msession_class']-sessionlife);
return true;
}
function destroy($key) {
global $class_ref;
$result = msession_destroy($key);
$class_ref[msession_class]-ses = 0;
$class_ref[msession_class]-sessionid = ;
return $result;
}
function gc($maxlifetime) {
return true;
}
session_set_save_handler(open, close, read, write, destroy, 
gc);
//set up some defaults
$this-sessionname = $sessionname;
$this-sessionlife = $lifetime;
if($this-sessionname == ):
$this-sessionname = PHPSESSID;
endif;
session_name($this-sessionname);
if($lifetime == ):
$this-sessionlife = get_cfg_var(session.gc_maxlifetime);
endif;
if(!empty($sessionid)){
session_id($sessionid);
}
//ok go for it
session_start();
$this-modulename = session_module_name();
$this-sessionid = session_id();
$this-ses = 1;
}
//oddball functions
function session_restart(){
session_destroy();
$url = http://.$_SERVER[HTTP_HOST];//.$_SERVER[PHP_SELF;];
header(Location: $url); 
exit;
}
function addmessage($mess){
$this-message .= $mess;
}
function getmessage(){
return $this-message;
}
function getmodulename(){
return $this-modulename;
}
function getid(){
return $this-sessionid;
}
function getlifetime(){
return $this-sessionlife;
}
function setuser($host,$user){
$this-host = $host;
$this-Username = $user;
}
function getuser($type = ){
if($type == u):
return $this-Username;
elseif($type == h):
return $this-host;
else:
return $this-host. .$this-Username;
endif;
}
}
?

usage
?
include_once('msession_class.inc');
$ms = new msession_class('TESTSESSION');
..thats it

if you want to force it to use the same session from 

[PHP] Solaris 8 Bus Error from PHP ldap functions

2003-01-22 Thread Piotr Rybok
Hello,

I recieve this error from every PHP ldap function on Solaris 8 :

Apache error_log:
...
child pid 666 exit signal Bus Error (10)
...

My box::
SunOS 5.8   Sun-Fire15K
Apache 1.3.27 + mod_ssl 2.8.12
PHP 4.2.3 ( 4.3.0 crashes too)
OpenLDAP 2.1.12 ( i've checked every release since 2.1.5 ...)

I tried the same config on different machine with SunOS 5.6 and it worked
fine so it looks like Solaris 8 problem but I got no clue.
Any tips or clues most appreciated.

Thanks,

Piotr Rybok








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




Re: [PHP] which is better? PHP's Session handler or Mohawk's Sessionhandler

2003-01-22 Thread Jason k Larson
I can't say which or what is better, but something else to add to the 
picture is that you can define your own session handlers.  This would 
allow you to store all the session data in a high speed database or 
something similar to suit your liking (especially from a load balancing 
or high availability point of view).

HTH,
Jason k Larson


Heo, Jungsu wrote:

(Sorry for disturb you if this kind of message posted earlier.
but I can't find answers on mailint list archive)

Hello, there!

I'm developing web service.
There are several web servers for one Service.
(Linux virtual server manages load banlance)

Php's original session handling function save session information on 
Hard disk.
So, To share Session file, each web server mount NFS partition and
set session.save_path to NFS partition.

But, I wonder that this way solves Session Sync. and Performance even if
there are so many sessions.

I found another session handler Mohawk Software session handler
(http://www.php.net/manual/en/ref.msession.php)

Manual says :
msession is an interface to a high speed session daemon which can run
either locally or remotely.
It is designed to provide consistent session management for a PHP 
web farm.

Um. but if session server goes down, the entire service will be stop.
And manual has a insufficent information about msession api.
I don't know how to use msession api exactly ;-(

Do you have any suggestion?

Php's Session handler with NFS or msession?

Is there somebody who work with any of two?

Thank you for advanced answer!


##
Heo, Jungsu Mr.

SimpleX Internet. http://www.simplexi.com


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




[PHP] Re: Multi-Byte String Functions

2003-01-22 Thread Foong
I never use mg_* function b4.

You should try post you question on php.i18n. bcos it is the newsgroup
dedicated for localization


Foong

Sadeq Naqashzade [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,
 I'm newbie of PHP. Can any one help me and explain how can use Multi-Byte
 String Functions?
 My national language is Farsi and I force to use UTF-8 for my works. but I
 have several problem when I need use it in PHP. I think Multi-Byte String
 Functions are designed for some ones like me. but I can not use it :-(

 I'm using Windows 2000 and Apache 1.3 plus PHP installed as module on my
PC.

 -Sadeq





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




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

2003-01-22 Thread Jean-Christian Imbeault
I don't want to start a flame-war here, just asking for specifics on a 
question I have :)

I know that PHP and Apache 2 (on Linux anyway) have some problems 
working together. I was just wondering, for my own education, why is that?

Is it a problem in Apache 2 or in PHP? (Not that I want to lay blame, 
just wondering).

Can someone point me to some ressource explaining the main points of why 
PHP won't work with Apache 2 just yet?

Thanks.

Jc


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



RE: [PHP] Measuring Query Times

2003-01-22 Thread John W. Holmes
 On Wednesday 22 January 2003 14:45, Peter Janett wrote:
  I'm trying to figure out if there is an easy way to measure how long
my
  queries in PHP/MySQL are taking to execute.
 
 Using microtime() before and after your query will give you an rough
idea.

Yeah, unfortunately, that's the best way right now. I really wish
someone would hack the MySQL API and include a function that returns the
time MySQL actually used to execute the query I wish I knew how to
do it, actually.

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




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

2003-01-22 Thread Henry
Apache2 now work with php in aspx (PHP is as a module)

-Original Message-
From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 6:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Why PHP doesn't work with Apache2?


I don't want to start a flame-war here, just asking for specifics on a 
question I have :)

I know that PHP and Apache 2 (on Linux anyway) have some problems 
working together. I was just wondering, for my own education, why is that?

Is it a problem in Apache 2 or in PHP? (Not that I want to lay blame, 
just wondering).

Can someone point me to some ressource explaining the main points of why 
PHP won't work with Apache 2 just yet?

Thanks.

Jc


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


[PHP] Re: dreading OOP

2003-01-22 Thread rush
Larry Brown [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 OOP in a couple of different places.  However, my mind apparently works
 different and I keep trying to relate the OOP structure to what I already
 know which equates an object to a function.  I am resolving to purchase a
 book dedicated to instruction in the inns and outs of OOP.  Specifically
at
 it relates to PHP would be great but my emphasis is towards something that
 teaches someone that is stubborn in his reliance on previously learned
 methods.  I hope this makes sense and I'm not alone on this. :)  Any
 suggestions would be greatly appreciated!

My advice is somewhat radical: learn Smalltalk. Since it is a very pure OO
language, you will barely be able to do anything until it snaps to you.
But when it does, it will becomme cristally clear, and you will learn to use
OO very well in languages that let you get away with non OO. The
disadvantages of this approach is that you will have to invest considerable
effort, and that you might like Smalltalk too much in the and ;) . For some
Smalltalk resources see: www.whysmalltalk.com

rush
--
http://www.templatetamer.org/




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




[PHP] Image opendialog function

2003-01-22 Thread Steven Seijmonsbergen
Hi

I'm looking for a Opendialog function in php, With a thumb function where I
can see examples of the selected photes?
Does anyone Know that??

Greetz Steven



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




Re[2]: [PHP] Mohawk Software session handler functions

2003-01-22 Thread Tom Rogers
Hi,

Wednesday, January 22, 2003, 6:34:45 PM, you wrote:
TR Hi,

TR Wednesday, January 22, 2003, 6:15:36 PM, you wrote:
HJ Hello, there.

HJ I'm Looking for 'Mohawk Software session handler functions' examples.

HJ PHP Manual describes it http://www.php.net/manual/en/ref.msession.php .

HJ But, There are no descriptions and examples.

HJ Anybody has one?

HJ Thanks in advanced answer!

HJ ##
HJ Heo, Jungsu Mr.

HJ SimpleX Internet. http://www.simplexi.com

TR here is a class I made for msession it may give you some pointers :)

TR ?php
TR class msession_class{
TR var $ses;   //session on flag
TR var $sessionname;   //current name of session
TR var $message;   //error message holder
TR var $modulename;//type of module, should be user
TR var $sessionid; //
TR var $sessionlife;   //how long inactive before the session 
should time out
TR var $host;  //client host
TR var $Username;  //username
TR function 
msession_class($sessionname=,$lifetime=,$maxgc=,$sessionid=''){
TR global $class_ref;  //a reference array for access by 
buried functions
TR $class_ref[msession_class] = $this;
TR ini_set( session.save_handler, user ); 
TR function open($save_path, $session_name) {
TR return msession_connect('localhost','8086');
TR }
TR function close() {
TR msession_disconnect();
TR return true;
TR }
TR function read($key) {
TR $sessiondata = ;
TR //This bit won't work on standard msession install it 
checks for a timed out session
TR //$x = msession_ctl($key,'TTL');
TR //if(!empty($x)  $x  0):
TR //  msession_destroy($key);
TR //else:
TR $sessiondata = msession_get_data($key);
TR //endif;
TR return $sessiondata;
TR }
TR function write($key, $val) {
TR global $class_ref;
TR msession_set_data($key,$val);
TR msession_timeout($key, 
$class_ref['msession_class']-sessionlife);
TR return true;
TR }
TR function destroy($key) {
TR global $class_ref;
TR $result = msession_destroy($key);
TR $class_ref[msession_class]-ses = 0;
TR $class_ref[msession_class]-sessionid = ;
TR return $result;
TR }
TR function gc($maxlifetime) {
TR return true;
TR }
TR session_set_save_handler(open, close, read, write, 
destroy, gc);
TR //set up some defaults
TR $this-sessionname = $sessionname;
TR $this-sessionlife = $lifetime;
TR if($this-sessionname == ):
TR $this-sessionname = PHPSESSID;
TR endif;
TR session_name($this-sessionname);
TR if($lifetime == ):
TR $this-sessionlife = get_cfg_var(session.gc_maxlifetime);
TR endif;
TR if(!empty($sessionid)){
TR session_id($sessionid);
TR }
TR //ok go for it
TR session_start();
TR $this-modulename = session_module_name();
TR $this-sessionid = session_id();
TR $this-ses = 1;
TR }
TR //oddball functions
TR function session_restart(){
TR session_destroy();
TR $url = http://.$_SERVER[HTTP_HOST];//.$_SERVER[PHP_SELF;];
TR header(Location: $url); 
TR exit;
TR }
TR function addmessage($mess){
TR $this-message .= $mess;
TR }
TR function getmessage(){
TR return $this-message;
TR }
TR function getmodulename(){
TR return $this-modulename;
TR }
TR function getid(){
TR return $this-sessionid;
TR }
TR function getlifetime(){
TR return $this-sessionlife;
TR }
TR function setuser($host,$user){
TR $this-host = $host;
TR $this-Username = $user;
TR }
TR function getuser($type = ){
TR if($type == u):
TR return 

Re: [PHP] create executable from php script

2003-01-22 Thread Marek Kilimajer
Do you mean gtk.php.net?

Hatem Ben wrote:


heya all,

I remember that some developers started a project to create stand-alone
application from php script, can someone guide me to find it again ? I
haven't found any url talking about it.

Regards,
Hatem


 



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




[PHP] getting database connection to fail gracefully

2003-01-22 Thread Andy Clarke
Is there a way to get a database query to fail gracefully, so that rather
than calling Die(), it can work around the problem? In other words, to do
something like:

if (mssql_connect($sDBhostname,$sDBusername,$sDBpassword)) {
// connection ok - work with it
} else {
// database down - work around it
}
// continue with rest of page

Rather than using the following, which causes the page to quit in mid flow:

mssql_connect($sDBhostname,$sDBusername,$sDBpassword) or die(DATABASE
FAILED TO RESPOND.);


Thanks

Andy Clarke



-- 
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-22 Thread Jean-Christian Imbeault
Henry wrote:

Apache2 now work with php in aspx (PHP is as a module)


Really!? I was sure there were still some issues ...

Jc


--
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-22 Thread Henry
what issues for example?
I do know I can successful install php in module with apache2.0.43 without error 
messages, also execution was successful
can you tell me what issues did you see?

-Original Message-
From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 7:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Why PHP doesn't work with Apache2?


Henry wrote:
 Apache2 now work with php in aspx (PHP is as a module)

Really!? I was sure there were still some issues ...

Jc


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


Re: [PHP] getting database connection to fail gracefully

2003-01-22 Thread Jason Wong
On Wednesday 22 January 2003 19:11, Andy Clarke wrote:
 Is there a way to get a database query to fail gracefully, so that rather
 than calling Die(), it can work around the problem? In other words, to do
 something like:

 if (mssql_connect($sDBhostname,$sDBusername,$sDBpassword)) {
 // connection ok - work with it
 } else {
 // database down - work around it
 }
 // continue with rest of page

 Rather than using the following, which causes the page to quit in mid flow:

 mssql_connect($sDBhostname,$sDBusername,$sDBpassword) or die(DATABASE
 FAILED TO RESPOND.);

Obviously, quite simply, don't use die(). Instead call a function which can 
handle it:

It really depends on what your needs are and what the page does. The most 
simple case is print a message informing the user that the database is down 
please try again later (or words to that effect). At the same time you would 
log this failure (to a log file) and/or email someone responsible who can 
deal with it.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Traveling through hyperspace isn't like dusting crops, boy.
-- Han Solo
*/


-- 
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-22 Thread Jean-Christian Imbeault
Henry wrote:

what issues for example?
I do know I can successful install php in module with apache2.0.43 without error messages, also execution was successful
can you tell me what issues did you see?


A successful install means nothing.

My question is basically, does Apache2 work with PHP 100% or is it still 
recommend to use Apache 1.3.27?

If it is still not recommended to use Apache2, why?

If you think Apache2 and PHP work perfectly well together can you point 
me to some info that says so? I can't see anywhere on the PHP web site 
that recommends using Apache2.

Jc


--
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-22 Thread yasin inat
it  depends  on  you   your aim  

u  can  consider  your criterias  between  php with apache 1.3X   apache 2

if  u  try  to  use  pragmatism  about  it ...

maybe  u  can  find  the  result  that  php with apache 2  is  better ?
so  don't you need  more argument ?

 one more  .
now  i'm  pleasure  of  apache2's  performancesecurity  on  win32
platform   ( should i use 'even' ?  : )...  )



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




Re: [PHP] getting database connection to fail gracefully

2003-01-22 Thread Andy Clarke
This is mostly sorted out now. The mssql commands just needed @ signs to
suppress error and warning messages.

Thanks anyway,

Andy Clarke



-- 
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-22 Thread Jean-Christian Imbeault
Yasin Inat wrote:


it  depends  on  you   your aim  


Ok, to put it more simply,

Are there cases where something would work in Apache 1.3.27 + PHP that 
would break in Apache2 + PHP??

A simple yes or no will suffice.

If the answer is no, I am curious as to why not ...

Thanks,

Jc


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



[PHP] Re: getting database connection to fail gracefully

2003-01-22 Thread neko
Andy Clarke wrote:

Is there a way to get a database query to fail gracefully, so that rather
than calling Die(), it can work around the problem? In other words, to do
something like:


Another option is to make use of PEAR's DB support in your code, rather 
than using the mysql_ functions directly. This will provide a much 
better framework for database connectivity/use in general.

http://pear.php.net - check out the manual.

neko


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



[PHP] HELP please quickly

2003-01-22 Thread Didier McGillis
Here is a brief description of what I want to do.  I want to use PHP to grab 
a list of numbers in one file.  Check it against a bigger file and strip the 
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need one so I 
need to ignore the rest, rip out the time stamp, which is a seperate line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


--
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-22 Thread Rasmus Lerdorf
 Henry wrote:
  what issues for example?
  I do know I can successful install php in module with apache2.0.43 without error 
messages, also execution was successful
  can you tell me what issues did you see?
 
 A successful install means nothing.
 
 My question is basically, does Apache2 work with PHP 100% or is it still 
 recommend to use Apache 1.3.27?
 
 If it is still not recommended to use Apache2, why?

Because the server doesn't work very well yet.  There are issues in the 
filter api and you can't really uses a threaded mpm as many of the 
3rd-party libraries that are commonly linked into PHP are simply not 
threadsafe.  The first issue can be fixed, the second issue is handled by 
only running Apache2 in prefork mode which makes the server look like 
Apache1.  If you have to run Apache2 looking like Apache1 the benefits are 
minor, so the motivation for people to put a whole lot of effort into 
fixing issue #1 is minimal.

-Rasmus


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




RE: [PHP] HELP please quickly

2003-01-22 Thread Timothy Hitchens \(HiTCHO\)
You first file just requires loading into an array and you can use
unique array functions to remove
duplicates etc..

The other files simply load into an array and use preg to strip out what
you want and follow the same
checking and removal of duplicates.

Checkout: preg_match and array functions in the www.php.net manual.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Didier McGillis [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, 22 January 2003 11:22 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] HELP please quickly
 
 
 Here is a brief description of what I want to do.  I want to 
 use PHP to grab 
 a list of numbers in one file.  Check it against a bigger 
 file and strip the 
 ones that match out of the bigger file, into a holding file.
 
 
 so here is what it might look like.
 
 file1.txt
 456789
 456790
 456791
 456792
 456793
 456794
 .
 
 file2.log
 some time stamp code=001;number=456784;name=blahblah;date=012403;
 some time stamp code=001;number=456785;name=blahblah;date=012403;
 some time stamp code=001;number=456786;name=blahblah;date=012303;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456790;name=blahblah;date=012603;
 some time stamp code=001;number=456791;name=blahblah;date=012703;
 
 notice there might be more then one of the same number, I 
 only need one so I 
 need to ignore the rest, rip out the time stamp, which is a 
 seperate line.
 
 file3.txt
 code=001;number=456789;name=blahblah;date=012503;
 code=001;number=456790;name=blahblah;date=012603;
 code=001;number=456791;name=blahblah;date=012703;
 
 can anyone help, any suggestions?
 
 
 
 
 
 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
 http://join.msn.com/?page=features/virus
 
 
 -- 
 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] create executable from php script

2003-01-22 Thread Hatem Ben
nop, not the php-gtk , but something that can create binary executable code
from any php script.

 Do you mean gtk.php.net?

 Hatem Ben wrote:

 heya all,
 
 I remember that some developers started a project to create stand-alone
 application from php script, can someone guide me to find it again ? I
 haven't found any url talking about it.
 
 Regards,
 Hatem
 


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




Re: [PHP] HELP please quickly

2003-01-22 Thread Rick Emery
In that case, I don't know of any PHP classes to help you.
- Original Message - 
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is the 
file that I need to compare against the second file, and if I find one match 
in the second file, I need to move it to the third file.






From: Rick Emery [EMAIL PROTECTED]
Reply-To: Rick Emery [EMAIL PROTECTED]
To: Didier McGillis [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 07:45:20 -0600

Are the numbers coming from a mysql database? If so, mysql can handle this 
chore.

- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:21 AM
Subject: [PHP] HELP please quickly


Here is a brief description of what I want to do.  I want to use PHP to 
grab
a list of numbers in one file.  Check it against a bigger file and strip 
the
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need one so 
I
need to ignore the rest, rip out the time stamp, which is a seperate line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus


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


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=features/junkmail




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




RE: [PHP] HELP please quickly

2003-01-22 Thread Didier McGillis

Cool I'll report back what I have found.  Question.  I have tried fopen and 
file and was wondering for opening the file and loading it into an array 
which one is better?






From: Timothy Hitchens \(HiTCHO\) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: 'Didier McGillis' [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 23:26:10 +1000

You first file just requires loading into an array and you can use
unique array functions to remove
duplicates etc..

The other files simply load into an array and use preg to strip out what
you want and follow the same
checking and removal of duplicates.

Checkout: preg_match and array functions in the www.php.net manual.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Didier McGillis [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, 22 January 2003 11:22 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] HELP please quickly


 Here is a brief description of what I want to do.  I want to
 use PHP to grab
 a list of numbers in one file.  Check it against a bigger
 file and strip the
 ones that match out of the bigger file, into a holding file.


 so here is what it might look like.

 file1.txt
 456789
 456790
 456791
 456792
 456793
 456794
 .

 file2.log
 some time stamp code=001;number=456784;name=blahblah;date=012403;
 some time stamp code=001;number=456785;name=blahblah;date=012403;
 some time stamp code=001;number=456786;name=blahblah;date=012303;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456789;name=blahblah;date=012503;
 some time stamp code=001;number=456790;name=blahblah;date=012603;
 some time stamp code=001;number=456791;name=blahblah;date=012703;

 notice there might be more then one of the same number, I
 only need one so I
 need to ignore the rest, rip out the time stamp, which is a
 seperate line.

 file3.txt
 code=001;number=456789;name=blahblah;date=012503;
 code=001;number=456790;name=blahblah;date=012603;
 code=001;number=456791;name=blahblah;date=012703;

 can anyone help, any suggestions?





 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
 http://join.msn.com/?page=features/virus


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



_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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



Re: [PHP] setcooke(...) before header(Location: XYZ) - Cookie doesn't set!

2003-01-22 Thread Mike Potter
Sorry, that message it what is in the body of the response, so it's not
working, I think.  Unless that's what it's supposed to do.  In that case, it
won't work for what I want.  I simply want the form to send to the php file,
which then processes the information, and redirects the user to the next
screen.  I would like the transition to be invisible.


On a related question, I guess I could use global variables instead of
cookies.  Is there a benefit or detriment to that, other than it doesn't
persist like a cookie would?
Thanks,

Mike


Michael Sims [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tue, 21 Jan 2003 20:17:40 -0700, you wrote:

I tried a test file with this, and the form is sent, and the nph-test2.php
file returns this

Status: 302
Content-type: text/html
X-Powered-By: PHP/4.3.0
Location: test.php
Set-Cookie: testcookie=test

I'm a bit confused.  Is it working for you now, or not?  What do you
mean by returnsis the above sent as an HTTP response header?  Or
does this show up in the body of the response?  Since the above
contains the 'Set-Cookie' directive (which IIS would normally strip
out) it should be working...



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




Fw: [PHP] $header = Location:........ being ignored!

2003-01-22 Thread Peter Hutnick

Rick Emery said:
 if ( $_POST['passwd'] != $db['password'] )
 {header(Location: loginfailed.html); exit;
 }
 - Original Message -
 From: Shams [EMAIL PROTECTED]
 To: 
 Sent: Tuesday, January 21, 2003 3:48 AM
 Subject: [PHP] $header = Location: being ignored!


 Hi Group,

 I basically have some simple code such as:

 ==

 if ( $_POST['passwd'] != $db['password']
 {header(Location: loginfailed.html);
 }

 //else

 $header = Location: success.html;

 ==

 however, when I run this code, using a FORM to submit password,
 username, etc.. if the passwords do not match, the page is forwarded
 to
 success.html !

 Is there anything obvious that I am doing wrong?

 Thanks,
 Shams

 p.s. I don't want to use else{} because I have lots of if() checks!

Well, semantically not using an else there is causing your problem.  Using
the exit as above should work, but is not a very good practice.  Using the
else will allow the rest of the script to run, which might be nice, or
necessary.

If you have a lot of if statements consider using the case/switch construct.

-Peter



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




RE: [PHP] HELP please quickly

2003-01-22 Thread Clarkson, Nick

I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from the 2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here - http://www.php.net/manual/en/ref.filesystem.php -
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message - 
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is the

file that I need to compare against the second file, and if I find one match

in the second file, I need to move it to the third file.






From: Rick Emery [EMAIL PROTECTED]
Reply-To: Rick Emery [EMAIL PROTECTED]
To: Didier McGillis [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 07:45:20 -0600

Are the numbers coming from a mysql database? If so, mysql can handle this 
chore.

- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:21 AM
Subject: [PHP] HELP please quickly


Here is a brief description of what I want to do.  I want to use PHP to 
grab
a list of numbers in one file.  Check it against a bigger file and strip 
the
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need one so 
I
need to ignore the rest, rip out the time stamp, which is a seperate line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus


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


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=features/junkmail




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




Re: [PHP] HELP please quickly

2003-01-22 Thread Thomas Seifert
file already returns an array so this would be best for that :).


Thomas

On Wed, 22 Jan 2003 14:00:09 + [EMAIL PROTECTED] (Didier McGillis) wrote:

 
 Cool I'll report back what I have found.  Question.  I have tried fopen and 
 file and was wondering for opening the file and loading it into an array 
 which one is better?
 
 
 
 
 
 
 From: Timothy Hitchens \(HiTCHO\) [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: 'Didier McGillis' [EMAIL PROTECTED], 
 [EMAIL PROTECTED]
 Subject: RE: [PHP] HELP please quickly
 Date: Wed, 22 Jan 2003 23:26:10 +1000
 
 You first file just requires loading into an array and you can use
 unique array functions to remove
 duplicates etc..
 
 The other files simply load into an array and use preg to strip out what
 you want and follow the same
 checking and removal of duplicates.
 
 Checkout: preg_match and array functions in the www.php.net manual.
 
 
 
 Timothy Hitchens (HiTCHO)
 Open Source Consulting
 e-mail: [EMAIL PROTECTED]
 
   -Original Message-
   From: Didier McGillis [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, 22 January 2003 11:22 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] HELP please quickly
  
  
   Here is a brief description of what I want to do.  I want to
   use PHP to grab
   a list of numbers in one file.  Check it against a bigger
   file and strip the
   ones that match out of the bigger file, into a holding file.
  
  
   so here is what it might look like.
  
   file1.txt
   456789
   456790
   456791
   456792
   456793
   456794
   .
  
   file2.log
   some time stamp code=001;number=456784;name=blahblah;date=012403;
   some time stamp code=001;number=456785;name=blahblah;date=012403;
   some time stamp code=001;number=456786;name=blahblah;date=012303;
   some time stamp code=001;number=456789;name=blahblah;date=012503;
   some time stamp code=001;number=456789;name=blahblah;date=012503;
   some time stamp code=001;number=456789;name=blahblah;date=012503;
   some time stamp code=001;number=456789;name=blahblah;date=012503;
   some time stamp code=001;number=456789;name=blahblah;date=012503;
   some time stamp code=001;number=456790;name=blahblah;date=012603;
   some time stamp code=001;number=456791;name=blahblah;date=012703;
  
   notice there might be more then one of the same number, I
   only need one so I
   need to ignore the rest, rip out the time stamp, which is a
   seperate line.
  
   file3.txt
   code=001;number=456789;name=blahblah;date=012503;
   code=001;number=456790;name=blahblah;date=012603;
   code=001;number=456791;name=blahblah;date=012703;
  
   can anyone help, any suggestions?
  
  
  
  
  
   _
   MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
   http://join.msn.com/?page=features/virus
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 _
 Add photos to your messages with MSN 8. Get 2 months FREE*.  
 http://join.msn.com/?page=features/featuredemail
 


-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




RE: [PHP] HELP please quickly

2003-01-22 Thread Didier McGillis
Cool.  Thanks for the information.  I try and organize my thoughts like that 
as well.  I dont really need to delete anything, mostly move and copy.

One problem I have run into is my second file seems to be too big.  In just 
doing a simple count the first file was fine, found my 470 lines.  The 
second file is 7.1MB and seems to fail telling me Fatal error: Allowed 
memory size of 8388608 bytes exhausted (tried to allocate 81 bytes)

So it seems to be on hurrdle at a time.




From: Clarkson, Nick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 14:15:32 -


I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from the 
2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here - http://www.php.net/manual/en/ref.filesystem.php 
-
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is 
the

file that I need to compare against the second file, and if I find one 
match

in the second file, I need to move it to the third file.






From: Rick Emery [EMAIL PROTECTED]
Reply-To: Rick Emery [EMAIL PROTECTED]
To: Didier McGillis 
[EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 07:45:20 -0600

Are the numbers coming from a mysql database? If so, mysql can handle 
this
chore.

- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:21 AM
Subject: [PHP] HELP please quickly


Here is a brief description of what I want to do.  I want to use PHP to
grab
a list of numbers in one file.  Check it against a bigger file and strip
the
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need one 
so
I
need to ignore the rest, rip out the time stamp, which is a seperate 
line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus


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


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then 

RE: [PHP] Is this just not possible?? ..create new odbc connection..please help

2003-01-22 Thread Edward Peloke
Haven't had a single response so I am not sure if this isn't possible or
just really easy and something I should already know.

Thanks,
Eddie

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 3:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] create new odbc connection..please help


Can someone point me in the right direction on how to create a new odbc
connection?  I need to use php to actually set up the connection.  I know
how to use php to connect once the connection is created and know how to
create on using control paneletc, just don't know how to create one using
php.

Thanks,
Eddie


--
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] HELP please quickly

2003-01-22 Thread Marek Kilimajer
You need to use fopen + fgets instead of file

Didier McGillis wrote:


Cool.  Thanks for the information.  I try and organize my thoughts 
like that as well.  I dont really need to delete anything, mostly move 
and copy.

One problem I have run into is my second file seems to be too big.  In 
just doing a simple count the first file was fine, found my 470 
lines.  The second file is 7.1MB and seems to fail telling me Fatal 
error: Allowed memory size of 8388608 bytes exhausted (tried to 
allocate 81 bytes)

So it seems to be on hurrdle at a time.




From: Clarkson, Nick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 14:15:32 -


I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from 
the 2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here - 
http://www.php.net/manual/en/ref.filesystem.php -
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example 
files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file 
is the

file that I need to compare against the second file, and if I find 
one match

in the second file, I need to move it to the third file.






From: Rick Emery [EMAIL PROTECTED]
Reply-To: Rick Emery [EMAIL PROTECTED]
To: Didier McGillis 
[EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 07:45:20 -0600

Are the numbers coming from a mysql database? If so, mysql can 
handle this
chore.

- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:21 AM
Subject: [PHP] HELP please quickly


Here is a brief description of what I want to do.  I want to use PHP to
grab
a list of numbers in one file.  Check it against a bigger file and 
strip
the
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need 
one so
I
need to ignore the rest, rip out the time stamp, which is a seperate 
line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus


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


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.
Registered in England and Wales. Registered offices: 1 Waterhouse 
Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify 

Re: [PHP] Is this just not possible?? ..create new odbc connection..pleasehelp

2003-01-22 Thread Jason k Larson
http://www.php.net/manual/en/function.odbc-connect.php

Edward Peloke wrote:

Haven't had a single response so I am not sure if this isn't possible or
just really easy and something I should already know.

Thanks,
Eddie

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 3:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] create new odbc connection..please help


Can someone point me in the right direction on how to create a new odbc
connection?  I need to use php to actually set up the connection.  I know
how to use php to connect once the connection is created and know how to
create on using control paneletc, just don't know how to create one using
php.

Thanks,
Eddie




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




RE: [PHP] Is this just not possible?? ..create new odbc connection..please help

2003-01-22 Thread Edward Peloke
Thanks Jason,

I know how to connect to an odbc datasource but will this function also
allow me to create one?

Thanks,
Eddie

-Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 9:38 AM
To: Edward Peloke
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Is this just not possible?? ..create new odbc
connection..please help


http://www.php.net/manual/en/function.odbc-connect.php

Edward Peloke wrote:
 Haven't had a single response so I am not sure if this isn't possible or
 just really easy and something I should already know.

 Thanks,
 Eddie

 -Original Message-
 From: Edward Peloke [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 3:32 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] create new odbc connection..please help


 Can someone point me in the right direction on how to create a new odbc
 connection?  I need to use php to actually set up the connection.  I know
 how to use php to connect once the connection is created and know how to
 create on using control paneletc, just don't know how to create one using
 php.

 Thanks,
 Eddie




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




Re: [PHP] Is this just not possible?? ..create new odbc connection..pleasehelp

2003-01-22 Thread Jason k Larson
Are you wanting to have PHP dynamically create ODBC datasources instead 
of creating them via the typical Control Panel method?

If so, and if possible, would be tricky, but I'll bet it can be done.

Regards,
Jason k Larson


Edward Peloke wrote:
Thanks Jason,

I know how to connect to an odbc datasource but will this function also
allow me to create one?

Thanks,
Eddie

-Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 9:38 AM
To: Edward Peloke
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Is this just not possible?? ..create new odbc
connection..please help


http://www.php.net/manual/en/function.odbc-connect.php

Edward Peloke wrote:


Haven't had a single response so I am not sure if this isn't possible or
just really easy and something I should already know.

Thanks,
Eddie





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




[PHP] PHP Variable Declare

2003-01-22 Thread Stephen Goehler
Hey guys,

Thanks in advance for your help.

I'm working on emailing the contents of a form using php.  It worked fine,
until I turned global_variables off in an attempt to secure the form (I
still have yet to write the data validation part).

Anyway, I have an IF statement that fires depending on a hidden variable in
the form.  If the
variable is empty, it loads the form.  If the variable contains the hidden
value I give it during form creation, then it emails the contents on the
form and displays a thank you msg instead of displaying the form.

The problem I have run into, involves the hidden value for the form.  I
didn't have to declare it before when I had global_variables turned on, but
now I have to.  I searched the manual and tried statements like global
$variablename but the code wouldn't run properly.  I've searched through
the newsgroups as well, but I'm new to PHP so it was tough to figure out
what to search for.  I'm sure all I'm missing is one line of code.  I
included my code below.  The problem exists in this line:

if ($_POST['frmAction'] == formmail)

which is before where the form is created so the $frmAction variable isn't
declared yet.  I'm
getting a variable not declared error, which I know, but if I declare the
variable earlier in the document, then it resets the value that I give it
before I submit the form.  How do I make this work?

Thanks so very much!!

Steve

html
head
/head
body
**HTML stuff here**
?php

// error handler
function e($type, $msg, $file, $line)
{
 $errorLog = error.log;
**Error Handler code here**
}

error_reporting(E_ERROR | E_WARNING);
set_error_handler(e);

$TO = [EMAIL PROTECTED];
$MP = mail.mailserver.com;
?

?php
if ($_POST['frmAction'] == formmail)
{


$fd = popen($MP,w);
fputs($fd, To: $TO\n);
fputs($fd, From: $_POST['name'] $_POST['email']\n);
fputs($fd, Subject: $_POST['inforequest']\n);
fputs($fd, X-Mailer: PHP3\n);
fputs($fd, Name: $_POST['name']\n);
fputs($fd, Business: $_POST['business']\n);
fputs($fd, Phone: $_POST['phone']\n);
fputs($fd, Email: $_POST['email']\n);
fputs($fd, Details: $_POST['details']);
pclose($fd);

?

**HTML thank you msg here**

?php

exit;
} else {

?
 table
   form action=test.php method=POST
select name=inforequest
  optionSelect Info Source/option
  option value=Option 1Option 1/option
  option value=Option 2Option 2/option
  option value=Option 3Option 3/option
  option value=Option 4Option 4/option
/select
  /td
/tr
tr
input type=text name=name
  /td
/tr
tr
input type=text name=business
  /td
/tr
tr
input type=text name=phone
  /td
/tr
tr
input type=text name=email
  /td
/tr
tr
textarea name=details wrap=PHYSICAL cols=35
rows=8/textarea
  /td
/tr
tr
  td
  input type=hidden name=frmAction value=formmail
  input type=submit name=Submit value=Submit
  input type=reset name=Reset value=Reset
  /td
/tr
  /form
/table
?php
}
?

**last bit of HTML here**
/body
/html



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




RE: [PHP] Is this just not possible?? ..create new odbc connection..please help

2003-01-22 Thread Edward Peloke
yep, I am trying to come up with a way to get data out of an access db on
the users machine and load it into the mysql db on the server.  The only
thing I can think of is have the user upload their db, php then creates a
datasource, pumps over the data, deletes the db and datasource.  My only
problem with this method is if the db is large it may take them a while to
upload it.  Any other suggestions are greatly welcomed.  I want it to be a
'one click' for the users so I don't want to ask them to export it to
another format before uploading.

Thanks,
Eddie

-Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 9:47 AM
To: Edward Peloke
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Is this just not possible?? ..create new odbc
connection..please help


Are you wanting to have PHP dynamically create ODBC datasources instead
of creating them via the typical Control Panel method?

If so, and if possible, would be tricky, but I'll bet it can be done.

Regards,
Jason k Larson


Edward Peloke wrote:
 Thanks Jason,

 I know how to connect to an odbc datasource but will this function also
 allow me to create one?

 Thanks,
 Eddie

 -Original Message-
 From: Jason k Larson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 9:38 AM
 To: Edward Peloke
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Is this just not possible?? ..create new odbc
 connection..please help


 http://www.php.net/manual/en/function.odbc-connect.php

 Edward Peloke wrote:

Haven't had a single response so I am not sure if this isn't possible or
just really easy and something I should already know.

Thanks,
Eddie




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




Re: Fw: [PHP] $header = Location:........ being ignored!

2003-01-22 Thread Thomas Seifert
give some output in the if-construct to see if it even matches.
I believe there is some problem with the variables used in there,
the location should work though.

On Tue, 21 Jan 2003 06:09:01 -0600 [EMAIL PROTECTED] (Rick Emery) wrote:

 if ( $_POST['passwd'] != $db['password'] )
 {header(Location: loginfailed.html); exit;
 }
 - Original Message - 
 From: Shams [EMAIL PROTECTED]
 To: 
 Sent: Tuesday, January 21, 2003 3:48 AM
 Subject: [PHP] $header = Location: being ignored!
 
 
 Hi Group,
 
 I basically have some simple code such as:
 
 ==
 
 if ( $_POST['passwd'] != $db['password']
 {header(Location: loginfailed.html);
 }
 
 //else
 
 $header = Location: success.html;
 
 ==
 
 however, when I run this code, using a FORM to submit password, username,
 etc.. if the passwords do not match, the page is forwarded to
 success.html !
 
 Is there anything obvious that I am doing wrong?
 
 Thanks,
 Shams
 
 p.s. I don't want to use else{} because I have lots of if() checks!
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




[PHP] Simple E-mail Question

2003-01-22 Thread Scott Saraniero
Hi,

I'm using this line to send an e-mail with info:

mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders);

If I want to add mail recipients, or cc, or bcc, how would I do this?

Thanks,
Scott


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




[PHP] Re: PHP Variable Declare

2003-01-22 Thread Thomas Seifert
try:
if (isset($_POST['frmAction'])  $_POST['frmAction'] == formmail)

instead of your line.



Thomas

On Wed, 22 Jan 2003 09:47:46 -0500 [EMAIL PROTECTED] (Stephen Goehler) wrote:

 Hey guys,
 
 Thanks in advance for your help.
 
 I'm working on emailing the contents of a form using php.  It worked fine,
 until I turned global_variables off in an attempt to secure the form (I
 still have yet to write the data validation part).
 
 Anyway, I have an IF statement that fires depending on a hidden variable in
 the form.  If the
 variable is empty, it loads the form.  If the variable contains the hidden
 value I give it during form creation, then it emails the contents on the
 form and displays a thank you msg instead of displaying the form.
 
 The problem I have run into, involves the hidden value for the form.  I
 didn't have to declare it before when I had global_variables turned on, but
 now I have to.  I searched the manual and tried statements like global
 $variablename but the code wouldn't run properly.  I've searched through
 the newsgroups as well, but I'm new to PHP so it was tough to figure out
 what to search for.  I'm sure all I'm missing is one line of code.  I
 included my code below.  The problem exists in this line:
 
 if ($_POST['frmAction'] == formmail)
 
 which is before where the form is created so the $frmAction variable isn't
 declared yet.  I'm
 getting a variable not declared error, which I know, but if I declare the
 variable earlier in the document, then it resets the value that I give it
 before I submit the form.  How do I make this work?
 
 Thanks so very much!!
 
 Steve
 
 html
 head
 /head
 body
 **HTML stuff here**
 ?php
 
 // error handler
 function e($type, $msg, $file, $line)
 {
  $errorLog = error.log;
 **Error Handler code here**
 }
 
 error_reporting(E_ERROR | E_WARNING);
 set_error_handler(e);
 
 $TO = [EMAIL PROTECTED];
 $MP = mail.mailserver.com;
 ?
 
 ?php
 if ($_POST['frmAction'] == formmail)
 {
 
 
 $fd = popen($MP,w);
 fputs($fd, To: $TO\n);
 fputs($fd, From: $_POST['name'] $_POST['email']\n);
 fputs($fd, Subject: $_POST['inforequest']\n);
 fputs($fd, X-Mailer: PHP3\n);
 fputs($fd, Name: $_POST['name']\n);
 fputs($fd, Business: $_POST['business']\n);
 fputs($fd, Phone: $_POST['phone']\n);
 fputs($fd, Email: $_POST['email']\n);
 fputs($fd, Details: $_POST['details']);
 pclose($fd);
 
 ?
 
 **HTML thank you msg here**
 
 ?php
 
 exit;
 } else {
 
 ?
  table
form action=test.php method=POST
 select name=inforequest
   optionSelect Info Source/option
   option value=Option 1Option 1/option
   option value=Option 2Option 2/option
   option value=Option 3Option 3/option
   option value=Option 4Option 4/option
 /select
   /td
 /tr
 tr
 input type=text name=name
   /td
 /tr
 tr
 input type=text name=business
   /td
 /tr
 tr
 input type=text name=phone
   /td
 /tr
 tr
 input type=text name=email
   /td
 /tr
 tr
 textarea name=details wrap=PHYSICAL cols=35
 rows=8/textarea
   /td
 /tr
 tr
   td
   input type=hidden name=frmAction value=formmail
   input type=submit name=Submit value=Submit
   input type=reset name=Reset value=Reset
   /td
 /tr
   /form
 /table
 ?php
 }
 ?
 
 **last bit of HTML here**
 /body
 /html
 
 


-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




Re: [PHP] Simple E-mail Question

2003-01-22 Thread Tom Ray
you would put that in the $mailheaders variable. Something like

$mailheaders = From: Joe Bloe [EMAIL PROTECTED]\r\n;
$mailheaders .= Cc: Some Dude [EMAIL PROTECTED]\r\n;
$mailheaders .= Bcc: Some Other Guy [EMAIL PROTECTED]\r\n;


That should work for you. Just do this for whatever other headers you want
to add to the mail


-Original Message-
From: Scott Saraniero [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Wed, 22 Jan 2003 09:47:52 -0500
Subject: [PHP] Simple E-mail Question

 Hi,
 
 I'm using this line to send an e-mail with info:
 
 mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders);
 
 If I want to add mail recipients, or cc, or bcc, how would I do this?
 
 Thanks,
 Scott
 
 
 -- 
 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] Simple E-mail Question

2003-01-22 Thread Rick Emery
$mailheaders = From: [EMAIL PROTECTED]\r\nCc: 
[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]\r\nBcc:
[EMAIL PROTECTED],[EMAIL PROTECTED];

mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders);

- Original Message -
From: Scott Saraniero [EMAIL PROTECTED]
To: 
Sent: Wednesday, January 22, 2003 8:47 AM
Subject: [PHP] Simple E-mail Question


Hi,

I'm using this line to send an e-mail with info:

mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders);

If I want to add mail recipients, or cc, or bcc, how would I do this?

Thanks,
Scott


--
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] Cookies problem

2003-01-22 Thread Sabina Alejandr Schneider
 Hello people!!! This time I have a problem with cookies. 
I
 tried to send a cookie from one page with the function
 sendcookie(chat,$mail) to a page in another directory,
 but when I tried to prine echo($chat) or
 echo($_COOKIE[chat]) I got notheing. So I put the 
second
 page where it was the page that sent the cookie and 
tried
 again. This last time I got the cookie in the 
echo($chat)
 but not in the echo($_COOKIE[chat]) I need to send a
 cookie to a page in another path and I need that the
 cookie stays in the client browser so I can see if I can
 recognize him/ her next time he/she enters the chat. Was 
I
 clear? Thank you very much for all of your help and
 time!!! I really appreciate your help in times I'm
 desesperated like this time :-)






_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com

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



[PHP] How to implement this by php Session

2003-01-22 Thread Henry
I'd like to implement ONE USER SIGNIN at the same time, the way I consider about is 
below:
1 record the sessionId and userId in some media(db), then we'll know who is login 
  and who is not
2 use a demon program to determine whole sessionId which is live and correspond to 
db's 
  data if some session is dead then demon program will remove from db

that's what I think, does it work? or anybody has real exprience about it?
if my idea work, how to get whole live sessionId from webserver(apache+php)?

thanks

RDS


RE: [PHP] HELP please quickly

2003-01-22 Thread Clarkson, Nick

I managed this bit of code, but I doubt it does exactly what you want, but
it's a start. And just to add to it I couldn't get the preg_match to work -
so that needs sorting. I'm at work, so I'm afraid I can't spend any more
time right now on this. If anyone can help on the preg_match bit (it just
needs to compare/match 2 strings) then could you add to this ? I looked at
the preg_match function on the php site, but I couldn't make head nor tail
of it :o/

Good luck with it

Nick


?php
// load file1.txt into array
$file1 = file ('./file1.txt');

// open file2.log for read only
$file2 = fopen (./file2.log, r);

// open results.txt for write
$results = fopen (./results.txt, w);

while (!feof($file2)) {
$buffer = fgets($file2, 4096);
foreach ($file1 as $line_num = $line) {
//if (preg_match (/$line/, $buffer)) - CAN'T GET THIS
TO WORK ;o(
{ fwrite ($results, $buffer); }
}
}
?


-Original Message-
From: Didier McGillis [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 14:33
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly


Cool.  Thanks for the information.  I try and organize my thoughts like that

as well.  I dont really need to delete anything, mostly move and copy.

One problem I have run into is my second file seems to be too big.  In just 
doing a simple count the first file was fine, found my 470 lines.  The 
second file is 7.1MB and seems to fail telling me Fatal error: Allowed 
memory size of 8388608 bytes exhausted (tried to allocate 81 bytes)

So it seems to be on hurrdle at a time.




From: Clarkson, Nick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 14:15:32 -


I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from the 
2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here - http://www.php.net/manual/en/ref.filesystem.php 
-
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is 
the

file that I need to compare against the second file, and if I find one 
match

in the second file, I need to move it to the third file.






 From: Rick Emery [EMAIL PROTECTED]
 Reply-To: Rick Emery [EMAIL PROTECTED]
 To: Didier McGillis 
[EMAIL PROTECTED],[EMAIL PROTECTED]
 Subject: Re: [PHP] HELP please quickly
 Date: Wed, 22 Jan 2003 07:45:20 -0600
 
 Are the numbers coming from a mysql database? If so, mysql can handle 
this
 chore.
 
 - Original Message -
 From: Didier McGillis [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 22, 2003 7:21 AM
 Subject: [PHP] HELP please quickly
 
 
 Here is a brief description of what I want to do.  I want to use PHP to
 grab
 a list of numbers in one file.  Check it against a bigger file and strip
 the
 ones that match out of the bigger file, into a holding file.
 
 
 so here is what it might look like.
 
 file1.txt
 456789
 456790
 456791
 456792
 456793
 456794
 
 
 file2.log
 some time stamp
 code=001;number=456784;name=blahblah;date=012403;
 some time stamp
 code=001;number=456785;name=blahblah;date=012403;
 some time stamp
 code=001;number=456786;name=blahblah;date=012303;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456790;name=blahblah;date=012603;
 some time stamp
 code=001;number=456791;name=blahblah;date=012703;
 
 notice there might be more then one of the same number, I only need one 
so
 I
 need to ignore the rest, rip out the time stamp, which is a seperate 
line.
 
 file3.txt
 code=001;number=456789;name=blahblah;date=012503;
 code=001;number=456790;name=blahblah;date=012603;
 code=001;number=456791;name=blahblah;date=012703;
 
 can anyone help, any suggestions?
 
 

[PHP] A simple question please.

2003-01-22 Thread Denis L. Menezes
Hello friends.

I need to add a part of html (the banner, top menus and the logo) in all pages 
dynamically. I made this part of the html and converted same to php code using Print 
 command.

Now, how do I add this code in the other pages? Should I inclue require or include 
command? if yes? should I include after the body tag itself?

Thanks
denis


[PHP] Need help.

2003-01-22 Thread thkiat
Can someone tell me what should I do to solve this problem?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: chmod failed: Operation not permitted in
/home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php
on line 489

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: chmod failed: Operation not permitted in
/home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php
on line 489
Erreur : Directory /home/epcc/public_html/exoops/modules/PP-News/archives/
Directory , aucune archive n'a été crée
Newsletter sent to 2 users



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




Re: [PHP] A simple question please.

2003-01-22 Thread Henry
it doesn't matter beforebody or after body as I know

- Original Message -
From: Denis L. Menezes [EMAIL PROTECTED]
To: PHP general list [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 11:21 PM
Subject: [PHP] A simple question please.


Hello friends.

I need to add a part of html (the banner, top menus and the logo) in all
pages dynamically. I made this part of the html and converted same to php
code using Print  command.

Now, how do I add this code in the other pages? Should I inclue require or
include command? if yes? should I include after the body tag itself?

Thanks
denis


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




RE: [PHP] Need help.

2003-01-22 Thread Matt Schroebel
 -Original Message-
 From: thkiat [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, January 22, 2003 10:23 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP] Need help.
 
 
 Can someone tell me what should I do to solve this problem?
 
 Warning: mysql_fetch_row(): supplied argument is not a valid 
 MySQL result
 resource in 
 /home/epcc/public_html/exoops/class/database/mysql.php on line
 134

Wherever you're running the query with mysql_query()- you should echo
out the sql statement so you see what you're running, and echo out
mysql_error() to see what mysql doesn't like about it.

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




RE: [PHP] Need help.

2003-01-22 Thread Edward Peloke
can you post some code?

-Original Message-
From: thkiat [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 10:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Need help.


Can someone tell me what should I do to solve this problem?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: chmod failed: Operation not permitted in
/home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php
on line 489

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /home/epcc/public_html/exoops/class/database/mysql.php on line
134

Warning: chmod failed: Operation not permitted in
/home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php
on line 489
Erreur : Directory /home/epcc/public_html/exoops/modules/PP-News/archives/
Directory , aucune archive n'a été crée
Newsletter sent to 2 users



--
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] A simple question please.

2003-01-22 Thread Clarkson, Nick


If the start of EVERY page is the same you could make your php include file
as follows;

?php
echo HTML;
echo TITLE;
echo /TITLE;
echo BODY;
?

Obviously padding it out a bit ;o)

Then at the top of every page put;

?php
require (header.php);
?

Similarly you coud do a footer for every page.

You can basically put it where you like as long as the HTML makes sense.

Nick

Another example, from http://www.php.net/manual/en/function.include.php

html 
?php 
  require($TEMPLATE_DIR/pages.header.inc); 
? 
 body 
 ?php require(content.inc);? 
/body 
/html 

...etc. 




-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 15:21
To: PHP general list
Subject: [PHP] A simple question please.


Hello friends.

I need to add a part of html (the banner, top menus and the logo) in all
pages dynamically. I made this part of the html and converted same to php
code using Print  command.

Now, how do I add this code in the other pages? Should I inclue require or
include command? if yes? should I include after the body tag itself?

Thanks
denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




Re: [PHP] changing a key in an array

2003-01-22 Thread Brent Baisley
I had to do something like this not to long ago. Luckily it hit me that 
I shouldn't be changing keys, you don't do it in a database, so  you 
really shouldn't do it in an array.
I ended up adding a column to my array that contained the name. Then I 
didn't need to change keys and it worked just as well, and easier.

On Tuesday, January 21, 2003, at 08:47 AM, David T-G wrote:

I want to change the key 't' to, say, 'tmp', is there a way to change
it or do I have to use the brute force

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




Re: [PHP] No data being found

2003-01-22 Thread Marek Kilimajer
Are you getting no data from database or the script does not output 
anything (not even html)?

Roddie Grant wrote:

I have a small site in development which takes details of coming church
services from a MySQL database. This bit is at the bottom of
http://www.rugbyurc.org.uk/spirit/spirit_intro.php (hosted by an ISP) and
works fine.

I've just got OSX working on my Mac and want to get the site running on that
so that I can develop it further. I am using the code below (this is a much
reduced version of what's on the live site), but getting no data. Nor am I
getting any error message.

I can access and use the database from Terminal. I can also get the data
from the same query using Lasso (a middleware program similar to php), so I
know the data is there to be found.

Any suggestions about why the data is not showing up in the browser with php
will be much appreciated.

table border=0

?php
 $userName='xxx';
 $pswd='yyy';
 error_reporting(E_ALL);
  
 require_once('DB.php');
 $db =  DB::connect(Mysql://$userName:$[EMAIL PROTECTED]/rurcdb);
   
 if (DB::iserror($db)) {
 die($db-getMessage());
 }
   
 $sql =  SELECT speaker
 FROM rurcdb.diary;
   
 $q = $db-query($sql);
 if (DB::iserror($q)){
 die($q-getMessage());
 }
 while ($q-fetchInto($row)){
 echo trtd.($row[0])./td/tr;
 }
?
/table

Roddie Grant
[EMAIL PROTECTED]


 



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




Re: [PHP] create executable from php script

2003-01-22 Thread Chris Shiflett
--- Hatem Ben [EMAIL PROTECTED] wrote:
 something that can create binary executable code
 from any php script.

See if this can fulfill your needs:

http://pear.php.net/package-info.php?pacid=95

Chris

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




RE: [PHP] Re: fscanf

2003-01-22 Thread Brian T. Allen
As longs as none of the text you are using NEEDS spaces you can just do
this:

?php

$string =text1, te xt2, t e x t 3;
$string = ereg_replace( , , $string);
$array = explode(,, $string);
echo | . $array[0] . | . $array[1] . | . $array[2] . |;

?

If you want to keep the spaces and there is always a space after the
comma you can do:

$string = ereg_replace(, , ,, $string);

Instead of the other ereg_replace above.

Brian 

 -Original Message-
 From: Kris [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, January 21, 2003 6:29 PM
 To: Brian T. Allen; 'Jason k Larson'
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: fscanf
 
 
 Actually found a little problem
 
 I forgot to mention some lines can be
 
 text, t e x t, te xt
 t e xt, text, text
 
 This splits it into more then 3 parts.
 Any ideas on this? Shouldn't I be able to use just fscanf to 
 get the results
 I'm after??
 
 Thanks
 
 K
 
 - Original Message -
 From: Brian T. Allen [EMAIL PROTECTED]
 To: 'Kris' [EMAIL PROTECTED]; 'Jason k Larson'
 [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Wednesday, January 22, 2003 10:58 AM
 Subject: RE: [PHP] Re: fscanf
 
 
  Given the information below this works:
 
  ?php
 
  $string =text1, text2, text3;
  $array = preg_split(/[, ]/, $string, -1, PREG_SPLIT_NO_EMPTY);
  echo | . $array[0] . | . $array[1] . | . $array[2] . |;
 
  ?
 
  I put it between pipes to confirm the absence of spaces...
 
  It may or may not be the best way, but it is one way.
 
  Brian
 
   -Original Message-
   From: Kris [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 21, 2003 5:02 PM
   To: Jason k Larson
   Cc: [EMAIL PROTECTED]
   Subject: Re: [PHP] Re: fscanf
  
  
   I've tried
   $array = fscanf ($fp, %s, %s, %s\n);
   earlier. It picks up
   array[0] == text,
  
   I need
   array[0] == text
   array[1] == text
   array[2] == text
  
   Thanx
  
   K
  
   - Original Message -
   From: Jason k Larson [EMAIL PROTECTED]
   To: Kris [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Wednesday, January 22, 2003 9:52 AM
   Subject: Re: [PHP] Re: fscanf
  
  
I think he is looking more for:
$array = fscanf ($fp, %s, %s, %s\n);
   
But with split, wouldn't that need to be:
   
$array = split(', ', $line);
   
http://www.php.net/manual/en/function.split.php
or
   
$array = preg_split ('/[\s,]+/', $line);
using: http://www.php.net/manual/en/function.preg-split.php
   
HTH,
Jason k Larson
   
   
Philip Hallstrom wrote:
 Why not:

 $array = split([ ,], $line);

 ?

 On Wed, 22 Jan 2003, Kris wrote:


Hi

I'm having dramers with fscanf
I have a line:
text, text, text

I can't work out how to scan removing the comma and 
 whitespace.
the text can be absolutle anything.

at the moment I have
$array = fscanf ($fp, %s%[^,] %s%[^,] %s%[^,]);

Thanks

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


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




RE: [PHP] Is this just not possible?? ..create new odbc connection..please help

2003-01-22 Thread Edward Peloke
If I have to create one datasource and use it for all db's, how do I do
this?  Will hosting providers set this up for you? (I am using ValueWeb)?
Also, is there a general Access username and password that would give me
access to any of the dbs?

Thanks,
Eddie

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 10:20 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Is this just not possible?? ..create new odbc
connection..please help


yep, I am trying to come up with a way to get data out of an access db on
the users machine and load it into the mysql db on the server.  The only
thing I can think of is have the user upload their db, php then creates a
datasource, pumps over the data, deletes the db and datasource.  My only
problem with this method is if the db is large it may take them a while to
upload it.  Any other suggestions are greatly welcomed.  I want it to be a
'one click' for the users so I don't want to ask them to export it to
another format before uploading.

Thanks,
Eddie

-Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 9:47 AM
To: Edward Peloke
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Is this just not possible?? ..create new odbc
connection..please help


Are you wanting to have PHP dynamically create ODBC datasources instead
of creating them via the typical Control Panel method?

If so, and if possible, would be tricky, but I'll bet it can be done.

Regards,
Jason k Larson


Edward Peloke wrote:
 Thanks Jason,

 I know how to connect to an odbc datasource but will this function also
 allow me to create one?

 Thanks,
 Eddie

 -Original Message-
 From: Jason k Larson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 9:38 AM
 To: Edward Peloke
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Is this just not possible?? ..create new odbc
 connection..please help


 http://www.php.net/manual/en/function.odbc-connect.php

 Edward Peloke wrote:

Haven't had a single response so I am not sure if this isn't possible or
just really easy and something I should already know.

Thanks,
Eddie




--
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] How can I get infor from tasm manager.

2003-01-22 Thread Thomas Wessel Svensson
Anyone ?

regards Thomas Svensson, Oslo



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




[PHP] How can I get info from task manager...?

2003-01-22 Thread Thomas Wessel Svensson
regards
Thomas Svensson in Oslo.



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




[PHP] Get command line output

2003-01-22 Thread Greg Chagnon
Does anyone know how to get certain parts of the output from an exec of a
certain command?  For example...if I run w I get this output:

[root@Lunar]:~ w
 11:02am  up 56 days, 17:39,  1 user,  load average: 0.07, 0.02, 0.00
USER TTY  FROM  LOGIN@   IDLE   JCPU   PCPU  WHAT
root pts/0brpt-sh6-port214 11:01am  0.00s  0.27s  0.06s  w

Now what if I just want the infor on the 3rd line, and info about anyone
else who is logged in, such as the username, the host, and the time without
getting all the uptime and the header info?  Thanks!
-Greg



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




[PHP] PHP App Frameworks

2003-01-22 Thread John Wells
Ramping up on a large project and was wondering if there are any freely
(as in speech) available app frameworks or toolkits for PHP that would
save me from recreating the wheel.

I'd prefer something relatively mature and well documented.

Thanks for any input!

John





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




[PHP] Cookies problem

2003-01-22 Thread Sabina Alejandr Schneider
  Hello people!!! This time I have a problem with 
cookies. 
I
  tried to send a cookie from one page with the function
  sendcookie(chat,$mail) to a page in another 
directory,
  but when I tried to prine echo($chat) or
  echo($_COOKIE[chat]) I got notheing. So I put the 
second
  page where it was the page that sent the cookie and 
tried
  again. This last time I got the cookie in the 
echo($chat)
  but not in the echo($_COOKIE[chat]) I need to send a
  cookie to a page in another path and I need that the
  cookie stays in the client browser so I can see if I 
can
  recognize him/ her next time he/she enters the chat. 
Was 
I
  clear? Thank you very much for all of your help and
  time!!! I really appreciate your help in times I'm
  desesperated like this time :-)






_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com

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



Re: [PHP] Get command line output

2003-01-22 Thread Jason Wong
On Thursday 23 January 2003 00:10, Greg Chagnon wrote:
 Does anyone know how to get certain parts of the output from an exec of a
 certain command?  For example...if I run w I get this output:

 [root@Lunar]:~ w
  11:02am  up 56 days, 17:39,  1 user,  load average: 0.07, 0.02, 0.00
 USER TTY  FROM  LOGIN@   IDLE   JCPU   PCPU  WHAT
 root pts/0brpt-sh6-port214 11:01am  0.00s  0.27s  0.06s  w

 Now what if I just want the infor on the 3rd line, and info about anyone
 else who is logged in, such as the username, the host, and the time without
 getting all the uptime and the header info?  Thanks!

exec() 'returns' the output of the command in an array. Just extract from the 
array whatever line(s) you need.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You ain't learning nothing when you're talking.
*/


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




[PHP] Re: PHP Variable Declare

2003-01-22 Thread Stephen Goehler
Now it gets more confusing.I added:

print 'pre';

print_r($_POST);

print '/pre';

to my form and the variables are displayed properly, but only generate
errors when I try to add it to fputs().any ideas?


Stephen Goehler [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks!!  That worked perfectly.  Neat little function there to check if a
 variable exists.  Also I am set to E_ERROR  ~E_NOTICE already.

 The form loads correctly and then when you click submit goes to the thank
 you screen.  The only problem now is that it says that my variables don't
 exist that I pass using the form and as a result, won't email them.  When
it
 gets to the code to email the results the variables like $_POST['name']
 won't exist.  What puzzles me is that the frmAction is passed, but none of
 the textbox...etc. variables are.  Do I need to add in the form name
 somewhere to show where the variables are coming from?



 Thomas Seifert [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  try:
  if (isset($_POST['frmAction'])  $_POST['frmAction'] == formmail)
 
  instead of your line.
 
 
 
  Thomas
 
  On Wed, 22 Jan 2003 09:47:46 -0500 [EMAIL PROTECTED] (Stephen Goehler)
 wrote:
 
   Hey guys,
  
   Thanks in advance for your help.
  
   I'm working on emailing the contents of a form using php.  It worked
 fine,
   until I turned global_variables off in an attempt to secure the form
(I
   still have yet to write the data validation part).
  
   Anyway, I have an IF statement that fires depending on a hidden
variable
 in
   the form.  If the
   variable is empty, it loads the form.  If the variable contains the
 hidden
   value I give it during form creation, then it emails the contents on
the
   form and displays a thank you msg instead of displaying the form.
  
   The problem I have run into, involves the hidden value for the form.
I
   didn't have to declare it before when I had global_variables turned
on,
 but
   now I have to.  I searched the manual and tried statements like
global
   $variablename but the code wouldn't run properly.  I've searched
 through
   the newsgroups as well, but I'm new to PHP so it was tough to figure
out
   what to search for.  I'm sure all I'm missing is one line of code.  I
   included my code below.  The problem exists in this line:
  
   if ($_POST['frmAction'] == formmail)
  
   which is before where the form is created so the $frmAction variable
 isn't
   declared yet.  I'm
   getting a variable not declared error, which I know, but if I declare
 the
   variable earlier in the document, then it resets the value that I give
 it
   before I submit the form.  How do I make this work?
  
   Thanks so very much!!
  
   Steve
  
   html
   head
   /head
   body
   **HTML stuff here**
   ?php
  
   // error handler
   function e($type, $msg, $file, $line)
   {
$errorLog = error.log;
   **Error Handler code here**
   }
  
   error_reporting(E_ERROR | E_WARNING);
   set_error_handler(e);
  
   $TO = [EMAIL PROTECTED];
   $MP = mail.mailserver.com;
   ?
  
   ?php
   if ($_POST['frmAction'] == formmail)
   {
  
  
   $fd = popen($MP,w);
   fputs($fd, To: $TO\n);
   fputs($fd, From: $_POST['name'] $_POST['email']\n);
   fputs($fd, Subject: $_POST['inforequest']\n);
   fputs($fd, X-Mailer: PHP3\n);
   fputs($fd, Name: $_POST['name']\n);
   fputs($fd, Business: $_POST['business']\n);
   fputs($fd, Phone: $_POST['phone']\n);
   fputs($fd, Email: $_POST['email']\n);
   fputs($fd, Details: $_POST['details']);
   pclose($fd);
  
   ?
  
   **HTML thank you msg here**
  
   ?php
  
   exit;
   } else {
  
   ?
table
  form action=test.php method=POST
   select name=inforequest
 optionSelect Info Source/option
 option value=Option 1Option 1/option
 option value=Option 2Option 2/option
 option value=Option 3Option 3/option
 option value=Option 4Option 4/option
   /select
 /td
   /tr
   tr
   input type=text name=name
 /td
   /tr
   tr
   input type=text name=business
 /td
   /tr
   tr
   input type=text name=phone
 /td
   /tr
   tr
   input type=text name=email
 /td
   /tr
   tr
   textarea name=details wrap=PHYSICAL cols=35
   rows=8/textarea
 /td
   /tr
   tr
 td
 input type=hidden name=frmAction
 value=formmail
 input type=submit name=Submit value=Submit
 

[PHP] A Licensing Question

2003-01-22 Thread John Wells
I was wondering what the licensing issues for app frameworks (or any
included PHP classes/libs) are.  I'm creating a rather large PHP
application for a company, and they'd like to potentially resell it to
some of their customers.

Can I safely use GPL'd libraries, classes, etc. (i.e. PearDB) and
resources that fall under other open source licenses when developing the
app and let them redistribute accordingly, or would that be a violation? 
Also, thinking ahead here a bit, if they wanted to use something like Zend
Encoder on the project, what sort of added gotchas could that bring up?

Thanks guys!

John





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




Re: [PHP] PHP App Frameworks

2003-01-22 Thread Jason Wong
On Thursday 23 January 2003 00:13, John Wells wrote:
 Ramping up on a large project and was wondering if there are any freely
 (as in speech) available app frameworks or toolkits for PHP that would
 save me from recreating the wheel.

 I'd prefer something relatively mature and well documented.

The question has been asked within the past month or so. I don't think any 
major/stable new frameworks has appeared since, so the answers in the 
archives should be valid.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
All progress is based upon a universal innate desire of every organism
to live beyond its income.
-- Samuel Butler, Notebooks
*/


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




[PHP] Good XML/XSLT mailing list?

2003-01-22 Thread Chris Boget
Sorry for the OT post but I know many of you use the
above.  I subscribed the the PHP-XML mailing list but
alas, haven't seen activity on it since the middle of last 
year.  Could you guys recommend a good (quality over
quantity) XML/XSLT mailing list?  If it's a list geared more
towards newbies, all the better but that wouldn't be a
requirement.

Thanks for any assistance you can provide.

Chris


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




Re: [PHP] pop-up problem

2003-01-22 Thread -[ Rene Brehmer ]-
Hi Mark McCulligh,

Other than the fact that popups are a work of the devil, there's no way
PHP can help you there.

Except that you can use regular HTML to popup a new window, albeit with
all the dressing:

a href=target.php?loc=popup target=_newWill popup a new window/a

Rene

On Mon, 20 Jan 2003 15:29:26 -0500, you wrote about [PHP] pop-up problem
something that looked like this:

I was wondering if anyone knows of a way to create a pop-up using PHP or
other language to do the same thing as JavaScript window.open method.  I
have an app that uses the JavaScript popup but now with those popup stopper
it will not always work.  For I am looking for another way of creating
popups.  Does anyone know of a way other then window.open to control the
window's size and remove things like the toolbar, address bar, etc..

Is there a way to control is through PHP and the header information? or I am
look for something that doesn't exist.

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




Re: [PHP] Cookies problem

2003-01-22 Thread Jason Wong
On Thursday 23 January 2003 00:13, Sabina Alejandr Schneider wrote:

Please do not repeatedly repost the same question. Allow a reasonable period 
of time for people to reply. A reasonable period of time to allow would be 
one day.

Hello people!!! This time I have a problem with
 cookies.
 I
tried to send a cookie from one page with the function
sendcookie(chat,$mail) to a page in another
 directory,

sendcookie() doesn't seem to be a standard php function. Could you tell us 
where you got it from?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Novinson's Revolutionary Discovery:
When comes the revolution, things will be different --
not better, just different.
*/


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




Re: [PHP] How can I get infor from tasm manager.

2003-01-22 Thread Chris Hewitt
Thomas Wessel Svensson wrote:


Anyone ?


Tasm was the MS 386 assembler. I'm not aware of a tasm manager. Are you 
sure you mean this? It may just be my ignorance :-)

Chris



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



Re: [PHP] How to implement this by php Session

2003-01-22 Thread Chris Shiflett
--- Henry [EMAIL PROTECTED] wrote:
 I'd like to implement ONE USER SIGNIN at the same time,
 the way I consider about is below:
 1 record the sessionId and userId in some media(db),
 then we'll know who is login and who is not
 2 use a demon program to determine whole sessionId
 which is live and correspond to db's data if some
 session is dead then demon program will remove from db
 
 that's what I think, does it work? or anybody has real
 exprience about it? if my idea work, how to get whole
 live sessionId from webserver(apache+php)?

I honestly cannot understand exactly what you are asking,
but are you certain it is different from just using PHP's
sessions?  It sounds to me like it is the same thing.

Chris

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




Re: [PHP] create executable from php script

2003-01-22 Thread Hatem Ben
I know it also, still related with php-gtk. Thanks anyway

Hatem
- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Hatem Ben [EMAIL PROTECTED]; Marek Kilimajer
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 4:42 PM
Subject: Re: [PHP] create executable from php script


 --- Hatem Ben [EMAIL PROTECTED] wrote:
  something that can create binary executable code
  from any php script.

 See if this can fulfill your needs:

 http://pear.php.net/package-info.php?pacid=95

 Chris


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




Re: [PHP] How to implement this by php Session

2003-01-22 Thread Jason Wong
On Thursday 23 January 2003 00:26, Chris Shiflett wrote:
 --- Henry [EMAIL PROTECTED] wrote:
  I'd like to implement ONE USER SIGNIN at the same time,
  the way I consider about is below:
  1 record the sessionId and userId in some media(db),
  then we'll know who is login and who is not
  2 use a demon program to determine whole sessionId
  which is live and correspond to db's data if some
  session is dead then demon program will remove from db
 
  that's what I think, does it work? or anybody has real
  exprience about it? if my idea work, how to get whole
  live sessionId from webserver(apache+php)?

 I honestly cannot understand exactly what you are asking,
 but are you certain it is different from just using PHP's
 sessions?  It sounds to me like it is the same thing.

Sounds as if he wants to ensure that only one (active?) login (per account? or 
per application?) is allowed at any one time. 

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Hug me now, you mad, impetuous fool!!  
Oh wait...
I'm a computer, and you're a person.  It would never work out.
Never mind.
*/


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




[PHP] How do I check if a process is running ?

2003-01-22 Thread Thomas Wessel Svensson
I need som guidance in the correct direction
for som Task Manager-like problems in the
PHP Manual of php.net.

Anyone ?

from
Thomas is Oslo, Norway



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




Re: [PHP] Cookies problem

2003-01-22 Thread Sabina Alejandr Schneider
Sorry for reposting the mail, I thought nobody had 
recieved it. Sorry. The function is setcookie, not send 
cookie what I meant,it was my typing mistake. Thank you 
for your time and help.

On Thu, 23 Jan 2003 00:23:35 +0800
 Jason Wong [EMAIL PROTECTED] wrote:
On Thursday 23 January 2003 00:13, Sabina Alejandr 
Schneider wrote:

Please do not repeatedly repost the same question. Allow 
a reasonable period 
of time for people to reply. A reasonable period of time 
to allow would be 
one day.

   Hello people!!! This time I have a problem with
cookies.
I
   tried to send a cookie from one page with the 
function
   sendcookie(chat,$mail) to a page in another
directory,

sendcookie() doesn't seem to be a standard php function. 
Could you tell us 
where you got it from?

--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications 
Development *

/*
Novinson's Revolutionary Discovery:
	When comes the revolution, things will be different --
	not better, just different.
*/


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








_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com

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




Re: [PHP] A Licensing Question

2003-01-22 Thread Peter Hutnick
John Wells said:

 Can I safely use GPL'd libraries, classes, etc. (i.e. PearDB) and
 resources that fall under other open source licenses when developing the
 app and let them redistribute accordingly, or would that be a violation?

I don't know anything about the licensing terms of PearDB.

Read the GPL at http://www.gnu.org/licenses/gpl.html .  A program that
uses GPL libraries must be distributed under the terms of the GPL.  The
LGPL is primarily for the case when a person writes a library and wants
GPL-like protection for the library itself, but wants to allow linking of
non-Free programs.

It might get a little hazy around what is linking in the case of a
scripting language.  I think the guideline is whether you call the lib
through a language construct or a system call.  I.e. include() vs exec().

  Also, thinking ahead here a bit, if they wanted to use something like
 Zend Encoder on the project, what sort of added gotchas could that bring
 up?

Consider printing out the licenses in question and have the company's
lawyer look at it.

Again, I don't know the specifics of Pear or PHP, but in general core libs
of a language are licensed in such a way that you can put any terms you
want on code that relies on them.

Good Luck!  And seriously, talk to a lawyer.

-Peter



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




Re: [PHP] Simple E-mail Question

2003-01-22 Thread Sean Burlington
Scott Saraniero wrote:

Hi,

I'm using this line to send an e-mail with info:

mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders);

If I want to add mail recipients, or cc, or bcc, how would I do this?

Thanks,
Scott




http://www.php.net/manual/en/function.mail.php

Example 4. Sending complex email.

/* recipients */
$to  = Mary [EMAIL PROTECTED] . ,  ; // note the comma
$to .= Kelly [EMAIL PROTECTED];

/* subject */
$subject = Birthday Reminders for August;

/* message */
$message = '
html
head
 titleBirthday Reminders for August/title
/head
body
pHere are the birthdays upcoming in August!/p
table
 tr
  thPerson/ththDay/ththMonth/ththYear/th
 /tr
 tr
  tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td
 /tr
 tr
  tdSally/tdtd17th/tdtdAugust/tdtd1973/td
 /tr
/table
/body
/html
';

/* To send HTML mail, you can set the Content-type header. */
$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;

/* additional headers */
$headers .= From: Birthday Reminder [EMAIL PROTECTED]\r\n;

$headers .= Cc: [EMAIL PROTECTED]\r\n;
$headers .= Bcc: [EMAIL PROTECTED]\r\n;

/* and now mail it */
mail($to, $subject, $message, $headers);


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




Re: [PHP] How to implement this by php Session

2003-01-22 Thread Henry
absolutely!
Sorry for my english first, what I want to do is make sure one account can
login in at the same time,
is there any mechanism in PHP can slove it? or I have to use external
program (daemon what I develop)
to do so? the way I imagination is list below does that work or you have
smarter solution?

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 12:32 AM
Subject: Re: [PHP] How to implement this by php Session


 On Thursday 23 January 2003 00:26, Chris Shiflett wrote:
  --- Henry [EMAIL PROTECTED] wrote:
   I'd like to implement ONE USER SIGNIN at the same time,
   the way I consider about is below:
   1 record the sessionId and userId in some media(db),
   then we'll know who is login and who is not
   2 use a demon program to determine whole sessionId
   which is live and correspond to db's data if some
   session is dead then demon program will remove from db
  
   that's what I think, does it work? or anybody has real
   exprience about it? if my idea work, how to get whole
   live sessionId from webserver(apache+php)?
 
  I honestly cannot understand exactly what you are asking,
  but are you certain it is different from just using PHP's
  sessions?  It sounds to me like it is the same thing.

 Sounds as if he wants to ensure that only one (active?) login (per
account? or
 per application?) is allowed at any one time.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 Hug me now, you mad, impetuous fool!!
 Oh wait...
 I'm a computer, and you're a person.  It would never work out.
 Never mind.
 */


 --
 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] HELP please quickly

2003-01-22 Thread Didier McGillis

I'm currently looking at this.  This particular code creates a file 10-20 
times the size of the orginial file.  A minor alteration of this code copies 
the file to the results file.

Basically I think the problem is, is in the preg_match, and I can't think of 
why that would die when it is placed back into the code.

Any thoughts.





From: Clarkson, Nick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 15:21:32 -


I managed this bit of code, but I doubt it does exactly what you want, but
it's a start. And just to add to it I couldn't get the preg_match to work -
so that needs sorting. I'm at work, so I'm afraid I can't spend any more
time right now on this. If anyone can help on the preg_match bit (it just
needs to compare/match 2 strings) then could you add to this ? I looked at
the preg_match function on the php site, but I couldn't make head nor tail
of it :o/

Good luck with it

Nick


?php
// load file1.txt into array
$file1 = file ('./file1.txt');

// open file2.log for read only
$file2 = fopen (./file2.log, r);

// open results.txt for write
$results = fopen (./results.txt, w);

while (!feof($file2)) {
	$buffer = fgets($file2, 4096);
	foreach ($file1 as $line_num = $line) {
		//if (preg_match (/$line/, $buffer)) - CAN'T GET THIS
TO WORK ;o(
			{ fwrite ($results, $buffer); }
	}
}
?


-Original Message-
From: Didier McGillis [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 14:33
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly


Cool.  Thanks for the information.  I try and organize my thoughts like 
that

as well.  I dont really need to delete anything, mostly move and copy.

One problem I have run into is my second file seems to be too big.  In just
doing a simple count the first file was fine, found my 470 lines.  The
second file is 7.1MB and seems to fail telling me Fatal error: Allowed
memory size of 8388608 bytes exhausted (tried to allocate 81 bytes)

So it seems to be on hurrdle at a time.




From: Clarkson, Nick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly
Date: Wed, 22 Jan 2003 14:15:32 -


I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from the
2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here - 
http://www.php.net/manual/en/ref.filesystem.php
-
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example 
files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message -
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is
the

file that I need to compare against the second file, and if I find one
match

in the second file, I need to move it to the third file.






 From: Rick Emery [EMAIL PROTECTED]
 Reply-To: Rick Emery [EMAIL PROTECTED]
 To: Didier McGillis
[EMAIL PROTECTED],[EMAIL PROTECTED]
 Subject: Re: [PHP] HELP please quickly
 Date: Wed, 22 Jan 2003 07:45:20 -0600
 
 Are the numbers coming from a mysql database? If so, mysql can handle
this
 chore.
 
 - Original Message -
 From: Didier McGillis [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 22, 2003 7:21 AM
 Subject: [PHP] HELP please quickly
 
 
 Here is a brief description of what I want to do.  I want to use PHP to
 grab
 a list of numbers in one file.  Check it against a bigger file and 
strip
 the
 ones that match out of the bigger file, into a holding file.
 
 
 so here is what it might look like.
 
 file1.txt
 456789
 456790
 456791
 456792
 456793
 456794
 
 
 file2.log
 some time stamp
 code=001;number=456784;name=blahblah;date=012403;
 some time stamp
 code=001;number=456785;name=blahblah;date=012403;
 some time stamp
 code=001;number=456786;name=blahblah;date=012303;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456789;name=blahblah;date=012503;
 some time stamp
 code=001;number=456790;name=blahblah;date=012603;
 some time 

[PHP] Re: PHP Variable Declare

2003-01-22 Thread Thomas Seifert
it won't work the way you are doing this.

Try something like that line (changed from yours):

fputs($fd, From: .$_POST['name']. .$_POST['email'].\n);

Don't ask arrays directly in a string.




Thomas


On Wed, 22 Jan 2003 11:15:35 -0500 [EMAIL PROTECTED] (Stephen Goehler) wrote:

 Now it gets more confusing.I added:
 
 print 'pre';
 
 print_r($_POST);
 
 print '/pre';
 
 to my form and the variables are displayed properly, but only generate
 errors when I try to add it to fputs().any ideas?
 
 
 Stephen Goehler [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Thanks!!  That worked perfectly.  Neat little function there to check if a
  variable exists.  Also I am set to E_ERROR  ~E_NOTICE already.
 
  The form loads correctly and then when you click submit goes to the thank
  you screen.  The only problem now is that it says that my variables don't
  exist that I pass using the form and as a result, won't email them.  When
 it
  gets to the code to email the results the variables like $_POST['name']
  won't exist.  What puzzles me is that the frmAction is passed, but none of
  the textbox...etc. variables are.  Do I need to add in the form name
  somewhere to show where the variables are coming from?
 
 
 
  Thomas Seifert [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   try:
   if (isset($_POST['frmAction'])  $_POST['frmAction'] == formmail)
  
   instead of your line.
  
  
  
   Thomas
  
   On Wed, 22 Jan 2003 09:47:46 -0500 [EMAIL PROTECTED] (Stephen Goehler)
  wrote:
  
Hey guys,
   
Thanks in advance for your help.
   
I'm working on emailing the contents of a form using php.  It worked
  fine,
until I turned global_variables off in an attempt to secure the form
 (I
still have yet to write the data validation part).
   
Anyway, I have an IF statement that fires depending on a hidden
 variable
  in
the form.  If the
variable is empty, it loads the form.  If the variable contains the
  hidden
value I give it during form creation, then it emails the contents on
 the
form and displays a thank you msg instead of displaying the form.
   
The problem I have run into, involves the hidden value for the form.
 I
didn't have to declare it before when I had global_variables turned
 on,
  but
now I have to.  I searched the manual and tried statements like
 global
$variablename but the code wouldn't run properly.  I've searched
  through
the newsgroups as well, but I'm new to PHP so it was tough to figure
 out
what to search for.  I'm sure all I'm missing is one line of code.  I
included my code below.  The problem exists in this line:
   
if ($_POST['frmAction'] == formmail)
   
which is before where the form is created so the $frmAction variable
  isn't
declared yet.  I'm
getting a variable not declared error, which I know, but if I declare
  the
variable earlier in the document, then it resets the value that I give
  it
before I submit the form.  How do I make this work?
   
Thanks so very much!!
   
Steve
   
html
head
/head
body
**HTML stuff here**
?php
   
// error handler
function e($type, $msg, $file, $line)
{
 $errorLog = error.log;
**Error Handler code here**
}
   
error_reporting(E_ERROR | E_WARNING);
set_error_handler(e);
   
$TO = [EMAIL PROTECTED];
$MP = mail.mailserver.com;
?
   
?php
if ($_POST['frmAction'] == formmail)
{
   
   
$fd = popen($MP,w);
fputs($fd, To: $TO\n);
fputs($fd, From: $_POST['name'] $_POST['email']\n);
fputs($fd, Subject: $_POST['inforequest']\n);
fputs($fd, X-Mailer: PHP3\n);
fputs($fd, Name: $_POST['name']\n);
fputs($fd, Business: $_POST['business']\n);
fputs($fd, Phone: $_POST['phone']\n);
fputs($fd, Email: $_POST['email']\n);
fputs($fd, Details: $_POST['details']);
pclose($fd);
   
?
   
**HTML thank you msg here**
   
?php
   
exit;
} else {
   
?
 table
   form action=test.php method=POST
select name=inforequest
  optionSelect Info Source/option
  option value=Option 1Option 1/option
  option value=Option 2Option 2/option
  option value=Option 3Option 3/option
  option value=Option 4Option 4/option
/select
  /td
/tr
tr
input type=text name=name
  /td
/tr
tr
input type=text name=business
  /td
/tr
tr
input type=text name=phone
  /td
/tr
tr
 

[PHP] Re: MySQL 4.0 + PHP 4

2003-01-22 Thread Thomas Seifert
I'm running it in production since MySQL-4.0.2 and without any problems.



Thomas

On Wed, 22 Jan 2003 11:21:40 -0800 [EMAIL PROTECTED] (Joe Stump) wrote:

 Anyone out there have anything to share as to using PHP4+MySQL4. I've been
 hearing good things on the MySQL list about v4.0 and I'm thinking of
 upgrading, since I run a rather small server.
 
 Thanks!
 
 
 --Joe
 
 ps. PHP list responders please respond directly. I'm not currently
 subscribed.
 
 --
 Joe Stump [EMAIL PROTECTED]
 http://www.joestump.net
 
 


-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




[PHP] SSL...

2003-01-22 Thread Steven Kallstrom
Hey,

I'm a newbie looking to secure my site with SSL using PHP.
Currently I am taking orders via e-mail online.  The users fill out a
form and that form is sent to me via e-mail.  The email resides on the
same server though.  Would I need to implement SSL for this.  Also, I
could use some pointers to some good SSL tutorials, or any information
that would be helpful in getting me started learning how this is all
done.  My server runs Apache, and has shared SSL.  Thanks,

Steven 



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




[PHP] Re: Help with e-mail

2003-01-22 Thread Manuel Lemos
Hello,

On 01/21/2003 10:13 AM, Dankshit wrote:

Is there a way to autenticate an SMTP server in my PHP.ini???


No.



In my development site, i need to autenticate a SMTP, but in the
PHP.INI does not have an option to autenticate..does anybody has any
solution for this??


You may want to try this composing and sending class that has a 
sub-class for sending via SMTP with authentication suppport.

http://www.phpclasses.org/mimemessage

If you do not want to change much your program, it comes with a wrapper 
function named smtp_mail() that you can use in replacement of mail() 
calls as smtp_mail() emulates mail() completely with the advantage of 
features like authentication that mail() does not support.

In that case you also need this other class for the actual SMTP delivery:

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos


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



Re: [PHP] A Licensing Question

2003-01-22 Thread Chris Hayes
At 17:17 22-1-03, you wrote:

I was wondering what the licensing issues for app frameworks (or any
included PHP classes/libs) are.  I'm creating a rather large PHP
application for a company, and they'd like to potentially resell it to
some of their customers.

Can I safely use GPL'd libraries, classes, etc. (i.e. PearDB) and
resources that fall under other open source licenses when developing the
app and let them redistribute accordingly, or would that be a violation?
Also, thinking ahead here a bit, if they wanted to use something like Zend
Encoder on the project, what sort of added gotchas could that bring up?

Thanks guys!

John


The GPL can be a headache to figure out when it gets to complicated 
situations.
My uneducated working conclusion is that the GPL prevents you from selling 
GPL-ed code as is, or improved GPL-ed code. Selling GPL-ed code, even if 
you improved it, is dead wrong. Even if you eventually totally rewrote the 
code.

The hazy bit comes when you use a free base and write your own code that 
sits on top of the base. It cannot work without the base but it is a 
package of files you wrote. The Nuke communities are still having the odd 
discussion whether one can charge for a module when the system it fits in 
is GPL-ed.

I think the most polite thing to do is to write the makers of PearDB and 
ask their opinion. The nicest thing to do is to get negotiating, and offer 
them a part of your sales.

There are some pages on this subject to be found on the GPL site.

If all else fails you could sell your hours to get the code working, and 
give the code for free, if needed under a distribution limitation or encoded.



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



Fw: [PHP] Image opendialog function

2003-01-22 Thread Rick Emery
PHP cannot open a dialog on client.  PHP is server-side only.  Use JavaScript to open 
a dialog.
- Original Message - 
From: Steven Seijmonsbergen [EMAIL PROTECTED]
To: 
Sent: Wednesday, January 22, 2003 4:52 AM
Subject: [PHP] Image opendialog function


Hi

I'm looking for a Opendialog function in php, With a thumb function where I
can see examples of the selected photes?
Does anyone Know that??

Greetz Steven



-- 
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] HELP please quickly

2003-01-22 Thread Rick Emery
Are the numbers coming from a mysql database? If so, mysql can handle this chore.

- Original Message - 
From: Didier McGillis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 7:21 AM
Subject: [PHP] HELP please quickly


Here is a brief description of what I want to do.  I want to use PHP to grab 
a list of numbers in one file.  Check it against a bigger file and strip the 
ones that match out of the bigger file, into a holding file.


so here is what it might look like.

file1.txt
456789
456790
456791
456792
456793
456794


file2.log
some time stamp
code=001;number=456784;name=blahblah;date=012403;
some time stamp
code=001;number=456785;name=blahblah;date=012403;
some time stamp
code=001;number=456786;name=blahblah;date=012303;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456789;name=blahblah;date=012503;
some time stamp
code=001;number=456790;name=blahblah;date=012603;
some time stamp
code=001;number=456791;name=blahblah;date=012703;

notice there might be more then one of the same number, I only need one so I 
need to ignore the rest, rip out the time stamp, which is a seperate line.

file3.txt
code=001;number=456789;name=blahblah;date=012503;
code=001;number=456790;name=blahblah;date=012603;
code=001;number=456791;name=blahblah;date=012703;

can anyone help, any suggestions?





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


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




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




[PHP] Re: PHP Variable Declare

2003-01-22 Thread Stephen Goehler
Thanks guys for helping out.  I got it working now!


Thomas Seifert [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 it won't work the way you are doing this.

 Try something like that line (changed from yours):

 fputs($fd, From: .$_POST['name']. .$_POST['email'].\n);

 Don't ask arrays directly in a string.




 Thomas


 On Wed, 22 Jan 2003 11:15:35 -0500 [EMAIL PROTECTED] (Stephen Goehler)
wrote:

  Now it gets more confusing.I added:
 
  print 'pre';
 
  print_r($_POST);
 
  print '/pre';
 
  to my form and the variables are displayed properly, but only generate
  errors when I try to add it to fputs().any ideas?
 
 
  Stephen Goehler [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Thanks!!  That worked perfectly.  Neat little function there to check
if a
   variable exists.  Also I am set to E_ERROR  ~E_NOTICE already.
  
   The form loads correctly and then when you click submit goes to the
thank
   you screen.  The only problem now is that it says that my variables
don't
   exist that I pass using the form and as a result, won't email them.
When
  it
   gets to the code to email the results the variables like
$_POST['name']
   won't exist.  What puzzles me is that the frmAction is passed, but
none of
   the textbox...etc. variables are.  Do I need to add in the form name
   somewhere to show where the variables are coming from?
  
  
  
   Thomas Seifert [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
try:
if (isset($_POST['frmAction'])  $_POST['frmAction'] == formmail)
   
instead of your line.
   
   
   
Thomas
   
On Wed, 22 Jan 2003 09:47:46 -0500 [EMAIL PROTECTED] (Stephen
Goehler)
   wrote:
   
 Hey guys,

 Thanks in advance for your help.

 I'm working on emailing the contents of a form using php.  It
worked
   fine,
 until I turned global_variables off in an attempt to secure the
form
  (I
 still have yet to write the data validation part).

 Anyway, I have an IF statement that fires depending on a hidden
  variable
   in
 the form.  If the
 variable is empty, it loads the form.  If the variable contains
the
   hidden
 value I give it during form creation, then it emails the contents
on
  the
 form and displays a thank you msg instead of displaying the form.

 The problem I have run into, involves the hidden value for the
form.
  I
 didn't have to declare it before when I had global_variables
turned
  on,
   but
 now I have to.  I searched the manual and tried statements like
  global
 $variablename but the code wouldn't run properly.  I've searched
   through
 the newsgroups as well, but I'm new to PHP so it was tough to
figure
  out
 what to search for.  I'm sure all I'm missing is one line of code.
I
 included my code below.  The problem exists in this line:

 if ($_POST['frmAction'] == formmail)

 which is before where the form is created so the $frmAction
variable
   isn't
 declared yet.  I'm
 getting a variable not declared error, which I know, but if I
declare
   the
 variable earlier in the document, then it resets the value that I
give
   it
 before I submit the form.  How do I make this work?

 Thanks so very much!!

 Steve

 html
 head
 /head
 body
 **HTML stuff here**
 ?php

 // error handler
 function e($type, $msg, $file, $line)
 {
  $errorLog = error.log;
 **Error Handler code here**
 }

 error_reporting(E_ERROR | E_WARNING);
 set_error_handler(e);

 $TO = [EMAIL PROTECTED];
 $MP = mail.mailserver.com;
 ?

 ?php
 if ($_POST['frmAction'] == formmail)
 {


 $fd = popen($MP,w);
 fputs($fd, To: $TO\n);
 fputs($fd, From: $_POST['name'] $_POST['email']\n);
 fputs($fd, Subject: $_POST['inforequest']\n);
 fputs($fd, X-Mailer: PHP3\n);
 fputs($fd, Name: $_POST['name']\n);
 fputs($fd, Business: $_POST['business']\n);
 fputs($fd, Phone: $_POST['phone']\n);
 fputs($fd, Email: $_POST['email']\n);
 fputs($fd, Details: $_POST['details']);
 pclose($fd);

 ?

 **HTML thank you msg here**

 ?php

 exit;
 } else {

 ?
  table
form action=test.php method=POST
 select name=inforequest
   optionSelect Info Source/option
   option value=Option 1Option 1/option
   option value=Option 2Option 2/option
   option value=Option 3Option 3/option
   option value=Option 4Option 4/option
 /select
   /td
 /tr
 tr
 input type=text name=name
   /td
   

[PHP] Quick Question about Template Parsers

2003-01-22 Thread Jim Lucas
In general, how do most template parsers work?

do they read the file into a variable and do something 
to the effect of preg_replace() to element that is found?

and if so, could you replace the step of reading the file 
into a variable with getting the template data out of a database?

WARNING... more questions to come...

Jim



[PHP] Select value for driopdown box

2003-01-22 Thread Ben C .
I am using the query below to edit a record. I want to edit the field which has a list 
of states in a dropdown box.   I want to have the state that is in the selected field 
shown as the selected state.  How would I do this?


Query
-
?
$sql = SELECT *
FROM $table_name
WHERE buyerid = \$buyerid\
;

$result = @mysql_query($sql,$connection) or die(mysql_error());


while ($row = mysql_fetch_array($result)) {
 $buyerid = $row['buyerid'];
 $state = $row['state'];

$option_block .= option value=\$state\$state/option;
}

$display_block = 

select name=\state\ class=Pgtext
$option_block
/select
?

tr
td width=258 class=Pgtext height=21State/td
td width=259 height=21? echo $display_block; ?/td
/tr
 



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




Re: [PHP] Something difference betwen php-4.0.3 and php-4.2.3

2003-01-22 Thread andre . lagadec
Hi

There is no error or notice message on the screen and in the log of the web server.
The PHP program stop and don't generate all the HTML code of the page.

Marek Kilimajer a écrit :

 I have never heard of  out of range error, but is it really an error
 or just a notice? If it is a notice, adjust error reporting to not
 display notices

 [EMAIL PROTECTED] wrote:

 Hello,
 
 I try to move an Web application in Php-4.0.3 to php-4.2.3, and some
 programs
 don't work well on some pages. I  make search in the code, and after
 tests, I find that
 the following code doesn't work in php-4.2.3, but works in php-4.0.3pl1
 
 
 html
 body
 form
 ?
 $i = 0;
 while ($i=3) {
   $selected = ;
   $selectTab[$i] = option value='.$i.' .$selected. bla bla
 /option\n;
   $i++;
   }
 printf(select name='filiere' multiple size='%d' class='textNoir'\n,
 ($i-1) );
 $j = 0;
 while ( $j = $i ) {
   printf($selectTab[$j]);
   $j++;
   }
 printf(/select);
 ?
 /body
 /html
 
 
 It's because there is an error in the code : this instruction is wrong
 while ( $j = $i ),
 there is an out of range in the array selectTab[] when $j=$i=4
 the good instruction is while ( $j  $i )
 
 Is there something changed in the gestion of the error out of range in
 an array
 betwen php-4.0.3pl1 and php-4.2.4 ?
 
 Thanks for your help ?
 
 AL
 
 
 
 


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




Re: [PHP] A Licensing Question

2003-01-22 Thread Peter Hutnick
Chris Hayes said:

 The GPL can be a headache to figure out when it gets to complicated
 situations.
 My uneducated working conclusion is that the GPL prevents you from
 selling  GPL-ed code as is, or improved GPL-ed code. Selling GPL-ed
 code, even if  you improved it, is dead wrong. Even if you eventually
 totally rewrote the  code.

This a ABSOLUTELY FALSE.  See http://www.gnu.org/philosophy/selling.html. 
In fact a major part of the FSF's (the authors of the GPL) budget comes
from selling GNU, their Free, GPLed software.

 The hazy bit comes when you use a free base and write your own code that
  sits on top of the base. It cannot work without the base but it is a
 package of files you wrote. The Nuke communities are still having the
 odd  discussion whether one can charge for a module when the system it
 fits in  is GPL-ed.

Not at all.  You can sell anything you write.  (In fact anyone can sell
any GPLed code!)  /But/ you can only sell (or otherwise distribute) code
that links to GPLed code under the terms of the GPL.

The hazy bit comes when you want to distribute proprietary software that
depends on copyleft (GPLed) software.  This is where you should have a
lawyer.

 I think the most polite thing to do is to write the makers of PearDB and
  ask their opinion. The nicest thing to do is to get negotiating, and
 offer  them a part of your sales.

I think this depends very much on the developers.  The GPL is
non-exclusive, so the copyright holders can license their code to you
under any terms they want.  People who hold the philosophy the GPL stands
for dear will likely be un-impressed by offers to take a cut of your sales
to re-license to you.

Additionally, what they think about it is rather less relevant than what
the license(s) in question actually say. 
http://pear.php.net/manual/en/faq.licenses.php indicates to me that Pear
DB is made up of a bunch of contributed modules, so you will have to make
decisions based on the license of the modules in question.

That page states that they recommend the PHP, BSD, or LGPL licenses.  PHP
and BSD are both permissive Free Software licenses.  For our purposes that
means that you can link proprietary programs to them.  The LGPL is a
strong copyleft Free Software license THAT ALLOWS LINKING of any software.
 (As an aside LGPL used to mean Library GPL for that reason, but has
been changed to Lesser GPL because the GPL is perfectly appropriate for
library use, but can't be used for libraries for use with proprietary (or
GPL-incompatible Free) software.)

That is to say that you can use any Pear DB modules that are under the
PHP, BSD or LGPL licenses with a proprietary program; you're in the clear.

 There are some pages on this subject to be found on the GPL site.

Perhaps you mean the GNU site?

 If all else fails you could sell your hours to get the code working, and
  give the code for free, if needed under a distribution limitation or
 encoded.

Now you're talking ;-)

-Peter



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




Re: [PHP] A Licensing Question

2003-01-22 Thread John Wells
 However - if you want to sell software under a closed licence you will
 need to be carefull to avoid 'linking' with gpl'd code.
 The problem is that 'linking' as used in the gpl seems to refer to C
 programming - and is an unclear term when refering to php.


Yeah...that's really what I'm wondering.  If I have my own code, but make
function calls and the like to script libraries licensed under the GPL,
does it mean my code will have to be GPL'd as well?  It's not dynamically
linking binary code in.  I've read the GPL faq and it's very vague here. 
It considers interpreted programs data, but doesn't consider cases the
that data is licensed under the GPL.

Say, for instance, that I use a GPL'd library that provides a class called
myGPLClass.  If I create instances of myGPLClass in my own scripts, does
that make my code in violation of the GPL?

Damn, I need a law degree ;-).

John



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




Re: [PHP] changing a key in an array

2003-01-22 Thread David T-G
Brent, et al --

...and then Brent Baisley said...
% 
% I had to do something like this not to long ago. Luckily it hit me that 
% I shouldn't be changing keys, you don't do it in a database, so  you 
% really shouldn't do it in an array.

Hmmm...  Good point.


% I ended up adding a column to my array that contained the name. Then I 
% didn't need to change keys and it worked just as well, and easier.

Can you show me how?  Currently I have

  Array
(
  [a1] = Array
(
  [k1] = value1
  [k2] = value2
)
  [a2] = Array
(
  [k1] = value1
  [k2] = value2
)
)

and now I'll want to add a 'name' thingie (I daren't call it a column :-)
so that I can change it at will ... but where and how do I add it?


Thanks  TIA  HAND

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




msg93996/pgp0.pgp
Description: PGP signature


Re: [PHP] Select value for driopdown box

2003-01-22 Thread Michael Sweeney
Assuming that you know which state is selected before you build the
select list:

$sel_state = $_REQUEST['state'];

...

while($row = mysql_fetch_array($result)) {
$buyerid = $row['buyerid'];
$state = $row['state'];
$selected = $state == $sel_state ? selected=\selected\ : ;

$option_block .= option value=\$state\ $selected.
 $state/option\n;
}

That will put the string selected=\selected\ (xhtml compliant) into
the option statement for the state that was selected.

..michael..

On Wed, 2003-01-22 at 10:14, Ben C. wrote:
 I am using the query below to edit a record. I want to edit the field which has a 
list of states in a dropdown box.   I want to have the state that is in the selected 
field shown as the selected state.  How would I do this?
 
 
 Query
 -
 ?
 $sql = SELECT *
   FROM $table_name
   WHERE buyerid = \$buyerid\
   ;
 
 $result = @mysql_query($sql,$connection) or die(mysql_error());
 
   
 while ($row = mysql_fetch_array($result)) {
  $buyerid = $row['buyerid'];
  $state = $row['state'];
 
   $option_block .= option value=\$state\$state/option;
 }
 
 $display_block = 
 
 select name=\state\ class=Pgtext
 $option_block
 /select
 ?
 
 tr
 td width=258 class=Pgtext height=21State/td
 td width=259 height=21? echo $display_block; ?/td
 /tr
  
 
-- 
Michael Sweeney [EMAIL PROTECTED]
Verisity Design, Inc


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




  1   2   3   >