OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Wed Jan 22 2003 - 13:19:56 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 22 Jan 2003 19:19:56 -0000 Issue 1838

    Topics (messages 132553 through 132663):

    referer keywords
            132553 by: Dhaval Desai
            132554 by: Jason Wong

    Mohawk Software session handler functions
            132555 by: Heo, Jungsu
            132560 by: Tom Rogers
            132569 by: Tom Rogers

    Re: forking scripts
            132556 by: Mirek Novak

    create executable from php script
            132557 by: Hatem Ben
            132570 by: Marek Kilimajer
            132583 by: Hatem Ben
            132615 by: Chris Shiflett
            132634 by: Hatem Ben

    Re: Measuring Query Times
            132558 by: Clarkson, Nick
            132565 by: John W. Holmes

    which is better? PHP's Session handler or Mohawk's Session handler
            132559 by: Heo, Jungsu
            132562 by: Jason k Larson

    Solaris 8 "Bus Error" from PHP ldap functions
            132561 by: Piotr Rybok

    Re: Multi-Byte String Functions
            132563 by: Foong

    Why PHP doesn't work with Apache2?
            132564 by: Jean-Christian Imbeault
            132566 by: Henry
            132572 by: Jean-Christian Imbeault
            132573 by: Henry
            132575 by: Jean-Christian Imbeault
            132576 by: yasin inat
            132578 by: Jean-Christian Imbeault
            132581 by: Rasmus Lerdorf

    Re: dreading OOP
            132567 by: rush

    Image opendialog function
            132568 by: Steven Seijmonsbergen
            132648 by: Rick Emery

    getting database connection to fail gracefully
            132571 by: Andy Clarke
            132574 by: Jason Wong
            132577 by: Andy Clarke
            132579 by: neko

    HELP please quickly
            132580 by: Didier McGillis
            132582 by: Timothy Hitchens \(HiTCHO\)
            132584 by: Rick Emery
            132585 by: Didier McGillis
            132588 by: Clarkson, Nick
            132589 by: Thomas Seifert
            132590 by: Didier McGillis
            132592 by: Marek Kilimajer
            132606 by: Clarkson, Nick
            132641 by: Didier McGillis
            132647 by: Rick Emery

    Re: setcooke(...) before header("Location: XYZ") - Cookie doesn't set!
            132586 by: Mike Potter

    Re: $header = "Location:........" being ignored!
            132587 by: Peter Hutnick
            132598 by: Thomas Seifert

    Re: Is this just not possible?? ..create new odbc connection..please help
            132591 by: Edward Peloke
            132593 by: Jason k Larson
            132594 by: Edward Peloke
            132595 by: Jason k Larson
            132597 by: Edward Peloke
            132618 by: Edward Peloke

    PHP Variable Declare
            132596 by: Stephen Goehler
            132600 by: Adam Voigt
            132601 by: Thomas Seifert
            132617 by: Stephen Goehler
            132625 by: Stephen Goehler
            132642 by: Thomas Seifert
            132650 by: Stephen Goehler

    Simple E-mail Question
            132599 by: Scott Saraniero
            132602 by: Tom Ray
            132603 by: Rick Emery
            132639 by: Sean Burlington

    Cookies problem
            132604 by: Sabina Alejandr Schneider
            132623 by: Sabina Alejandr Schneider
            132631 by: Jason Wong
            132637 by: Sabina Alejandr Schneider

    How to implement this by php Session
            132605 by: Henry
            132633 by: Chris Shiflett
            132635 by: Jason Wong
            132640 by: Henry
            132660 by: Chris Shiflett

    A simple question please.
            132607 by: Denis L. Menezes
            132609 by: Henry
            132612 by: Clarkson, Nick

    Need help.
            132608 by: thkiat
            132610 by: Matt Schroebel
            132611 by: Edward Peloke

    Re: changing a key in an array
            132613 by: Brent Baisley
            132656 by: David T-G

    Re: No data being found
            132614 by: Marek Kilimajer

    Re: fscanf
            132616 by: Brian T. Allen

    How can I get infor from tasm manager.
            132619 by: Thomas Wessel Svensson
            132632 by: Chris Hewitt

    How can I get info from task manager...?
            132620 by: Thomas Wessel Svensson

    Get command line output
            132621 by: Greg Chagnon
            132624 by: Jason Wong

    PHP App Frameworks
            132622 by: John Wells
            132627 by: Jason Wong

    A Licensing Question
            132626 by: John Wells
            132638 by: Peter Hutnick
            132646 by: Chris Hayes
            132654 by: Peter Hutnick
            132655 by: John Wells
            132658 by: Sean Burlington
            132662 by: Peter Hutnick

    Good XML/XSLT mailing list?
            132628 by: Chris Boget

    MySQL 4.0 + PHP 4
            132629 by: Joe Stump
            132643 by: Thomas Seifert
            132649 by: John W. Holmes

    Re: pop-up problem
            132630 by: -<[ Rene Brehmer ]>-

    How do I check if a process is running ?
            132636 by: Thomas Wessel Svensson

    SSL...
            132644 by: Steven Kallstrom

    Re: Help with e-mail
            132645 by: Manuel Lemos

    Quick Question about Template Parsers
            132651 by: Jim Lucas

    Select value for driopdown box
            132652 by: Ben C.
            132657 by: Michael Sweeney
            132659 by: Jim Lucas

    Re: Something difference betwen php-4.0.3 and php-4.2.3
            132653 by: andre.lagadec.education.gouv.fr

    Re: PHP & Sessions generates Segment Faults
            132661 by: Blaster

    backslash t
            132663 by: Jan Grafström

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


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

    - Dhaval

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

    attached mail follows:


    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. */

    attached mail follows:


    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

    attached mail follows:


    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 another server/domain with session_id set to the session you want start like this:

    include_once('msession_class.inc'); $sessionid = ''; if(isset($_REQUEST['session_id'])){ $sessionid = $_REQUEST['session_id']; } $ms = new msession_class('TESTSESSION','','',$sessionid);

    -- 
    regards,
    Tom
    

    attached mail follows:


    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 $this->Username; TR> elseif($type == "h"): TR> return $this->host; TR> else: TR> return $this->host." ".$this->Username; TR> endif; TR> } TR> } ?>>

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

    TR> if you want to force it to use the same session from another server/domain with TR> session_id set to the session you want start like this:

    TR> include_once('msession_class.inc'); TR> $sessionid = ''; TR> if(isset($_REQUEST['session_id'])){ TR> $sessionid = $_REQUEST['session_id']; TR> } TR> $ms = new msession_class('TESTSESSION','','',$sessionid);

    TR> -- TR> regards, TR> Tom

    Actuall you can uncomment the read section check as that function has been added to the latest php msession.c :)

    function read($key) { $sessiondata = ""; $x = msession_ctl($key,'TTL'); if(!empty($x) && $x < 0): // negative value means session timed out msession_destroy($key); else: $sessiondata = msession_get_data($key); endif; return $sessiondata; }

    -- 
    regards,
    Tom
    

    attached mail follows:


    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:mirekjabber.cz ICQ:119499448 http://www.auto.cz http://news.auto.cz http://www.formule1.cz

    attached mail follows:


    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

    attached mail follows:


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

    attached mail follows:


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

    attached mail follows:


    --- Hatem Ben <reflex_newsyahoo.fr> 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

    attached mail follows:


    I know it also, still related with php-gtk. Thanks anyway

    Hatem ----- Original Message ----- From: "Chris Shiflett" <shiflettphp.net> To: "Hatem Ben" <reflex_newsyahoo.fr>; "Marek Kilimajer" <kilimajerwebglobe.sk> Cc: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 4:42 PM Subject: Re: [PHP] create executable from php script

    > --- Hatem Ben <reflex_newsyahoo.fr> 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

    attached mail follows:


    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:phplistnewmediaone.com] Sent: 22 January 2003 06:46 To: php-generallists.php.net 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 webmasternewmediaone.net (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.

    attached mail follows:


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

    attached mail follows:


    (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

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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" <ssyazd.info> wrote in message news:20030121132224.4451.qmailpb1.pair.com... > 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 > >

    attached mail follows:


    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

    attached mail follows:


    Apache2 now work with php in aspx (PHP is as a module) -----Original Message----- From: Jean-Christian Imbeault [mailto:jcmega-bucks.co.jp] Sent: Wednesday, January 22, 2003 6:06 PM To: php-generallists.php.net 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

    attached mail follows:


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

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

    Jc

    attached mail follows:


    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:jcmega-bucks.co.jp] Sent: Wednesday, January 22, 2003 7:11 PM To: php-generallists.php.net 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

    attached mail follows:


    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

    attached mail follows:


    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 performance & security on win32 platform ( should i use 'even' ? : )... )

    attached mail follows:


    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

    attached mail follows:


    > 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

    attached mail follows:


    "Larry Brown" <larry.browndimensionnetworks.com> wrote in message news:CBECIONKKLMDDCIKHALJCEEHFMAA.larry.browndimensionnetworks.com... > 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/
    

    attached mail follows:


    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

    attached mail follows:


    PHP cannot open a dialog on client. PHP is server-side only. Use JavaScript to open a dialog. ----- Original Message ----- From: "Steven Seijmonsbergen" <stevenconcentus.nl> 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
    

    attached mail follows:


    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

    attached mail follows:


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

    attached mail follows:


    This is mostly sorted out now. The mssql commands just needed signs to suppress error and warning messages.

    Thanks anyway,

    Andy Clarke

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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: timhitcho.com.au

    > -----Original Message----- > From: Didier McGillis [mailto:codesmokerhotmail.com] > Sent: Wednesday, 22 January 2003 11:22 PM > To: php-generallists.php.net > 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 >

    attached mail follows:


    In that case, I don't know of any PHP classes to help you. ----- Original Message ----- From: "Didier McGillis" <codesmokerhotmail.com> To: <remeryemeryloftus.com> 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" <remeryemeryloftus.com> >Reply-To: "Rick Emery" <remeryemeryloftus.com> >To: "Didier McGillis" <codesmokerhotmail.com>,<php-generallists.php.net> >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" <codesmokerhotmail.com> >To: <php-generallists.php.net> >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

    attached mail follows:


    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\)" <hitchophp.net> >Reply-To: <hitchophp.net> >To: "'Didier McGillis'" <codesmokerhotmail.com>, ><php-generallists.php.net> >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: timhitcho.com.au > > > -----Original Message----- > > From: Didier McGillis [mailto:codesmokerhotmail.com] > > Sent: Wednesday, 22 January 2003 11:22 PM > > To: php-generallists.php.net > > 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

    attached mail follows:


    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 file....very messy that way tho...I'll keep looking.

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

    Good luck

    Nick

    -----Original Message----- From: Rick Emery [mailto:remeryemeryloftus.com] Sent: 22 January 2003 13:57 To: Didier McGillis Cc: php-generallists.php.net 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" <codesmokerhotmail.com> To: <remeryemeryloftus.com> 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" <remeryemeryloftus.com> >Reply-To: "Rick Emery" <remeryemeryloftus.com> >To: "Didier McGillis" <codesmokerhotmail.com>,<php-generallists.php.net> >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" <codesmokerhotmail.com> >To: <php-generallists.php.net> >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.

    attached mail follows:


    "file" already returns an array so this would be best for that :).

    Thomas

    On Wed, 22 Jan 2003 14:00:09 +0000 codesmokerhotmail.com (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\)" <hitchophp.net> > >Reply-To: <hitchophp.net> > >To: "'Didier McGillis'" <codesmokerhotmail.com>, > ><php-generallists.php.net> > >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: timhitcho.com.au > > > > > -----Original Message----- > > > From: Didier McGillis [mailto:codesmokerhotmail.com] > > > Sent: Wednesday, 22 January 2003 11:22 PM > > > To: php-generallists.php.net > > > 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:thomas.seifertmyphorum.de http://www.MyPhorum.de

    attached mail follows:


    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" <Nick.Clarksonegg.com> >To: php-generallists.php.net >Subject: RE: [PHP] HELP please quickly >Date: Wed, 22 Jan 2003 14:15:32 -0000 > > >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 file....very messy that way >tho...I'll keep looking. > >As an exercise to myself I'll try and recreate it using the 2 example files >below....dunno how long it'll take me tho ;o) > >Good luck > >Nick > > >-----Original Message----- >From: Rick Emery [mailto:remeryemeryloftus.com] >Sent: 22 January 2003 13:57 >To: Didier McGillis >Cc: php-generallists.php.net >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" <codesmokerhotmail.com> >To: <remeryemeryloftus.com> >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" <remeryemeryloftus.com> > >Reply-To: "Rick Emery" <remeryemeryloftus.com> > >To: "Didier McGillis" ><codesmokerhotmail.com>,<php-generallists.php.net> > >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" <codesmokerhotmail.com> > >To: <php-generallists.php.net> > >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

    _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

    attached mail follows:


    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" <Nick.Clarksonegg.com> >> To: php-generallists.php.net >> Subject: RE: [PHP] HELP please quickly >> Date: Wed, 22 Jan 2003 14:15:32 -0000 >> >> >> 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 file....very messy that way >> tho...I'll keep looking. >> >> As an exercise to myself I'll try and recreate it using the 2 example >> files >> below....dunno how long it'll take me tho ;o) >> >> Good luck >> >> Nick >> >> >> -----Original Message----- >> From: Rick Emery [mailto:remeryemeryloftus.com] >> Sent: 22 January 2003 13:57 >> To: Didier McGillis >> Cc: php-generallists.php.net >> 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" <codesmokerhotmail.com> >> To: <remeryemeryloftus.com> >> 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" <remeryemeryloftus.com> >> >Reply-To: "Rick Emery" <remeryemeryloftus.com> >> >To: "Didier McGillis" >> <codesmokerhotmail.com>,<php-generallists.php.net> >> >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" <codesmokerhotmail.com> >> >To: <php-generallists.php.net> >> >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 > > > > _________________________________________________________________ > Protect your PC - get McAfee.com VirusScan Online > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > >

    attached mail follows:


    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:codesmokerhotmail.com] Sent: 22 January 2003 14:33 To: php-generallists.php.net 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" <Nick.Clarksonegg.com> >To: php-generallists.php.net >Subject: RE: [PHP] HELP please quickly >Date: Wed, 22 Jan 2003 14:15:32 -0000 > > >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 file....very messy that way >tho...I'll keep looking. > >As an exercise to myself I'll try and recreate it using the 2 example files >below....dunno how long it'll take me tho ;o) > >Good luck > >Nick > > >-----Original Message----- >From: Rick Emery [mailto:remeryemeryloftus.com] >Sent: 22 January 2003 13:57 >To: Didier McGillis >Cc: php-generallists.php.net >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" <codesmokerhotmail.com> >To: <remeryemeryloftus.com> >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" <remeryemeryloftus.com> > >Reply-To: "Rick Emery" <remeryemeryloftus.com> > >To: "Didier McGillis" ><codesmokerhotmail.com>,<php-generallists.php.net> > >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" <codesmokerhotmail.com> > >To: <php-generallists.php.net> > >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

    _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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

    attached mail follows:


    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" <Nick.Clarksonegg.com> >To: php-generallists.php.net >Subject: RE: [PHP] HELP please quickly >Date: Wed, 22 Jan 2003 15:21:32 -0000 > > >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:codesmokerhotmail.com] >Sent: 22 January 2003 14:33 >To: php-generallists.php.net >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" <Nick.Clarksonegg.com> > >To: php-generallists.php.net > >Subject: RE: [PHP] HELP please quickly > >Date: Wed, 22 Jan 2003 14:15:32 -0000 > > > > > >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 file....very messy that way > >tho...I'll keep looking. > > > >As an exercise to myself I'll try and recreate it using the 2 example >files > >below....dunno how long it'll take me tho ;o) > > > >Good luck > > > >Nick > > > > > >-----Original Message----- > >From: Rick Emery [mailto:remeryemeryloftus.com] > >Sent: 22 January 2003 13:57 > >To: Didier McGillis > >Cc: php-generallists.php.net > >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" <codesmokerhotmail.com> > >To: <remeryemeryloftus.com> > >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" <remeryemeryloftus.com> > > >Reply-To: "Rick Emery" <remeryemeryloftus.com> > > >To: "Didier McGillis" > ><codesmokerhotmail.com>,<php-generallists.php.net> > > >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" <codesmokerhotmail.com> > > >To: <php-generallists.php.net> > > >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 > > >_________________________________________________________________ >Protect your PC - get McAfee.com VirusScan Online >http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > >-- >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

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

    attached mail follows:


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

    ----- Original Message ----- From: "Didier McGillis" <codesmokerhotmail.com> To: <php-generallists.php.net> 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
    

    attached mail follows:


    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" <mhsimsmidsouth.rr.com> wrote in message news:csas2vks46gqo69mk1rub62mbfrc4gqf3t4ax.com... 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 "returns"....is 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...

    attached mail follows:


    Rick Emery said: > if ( $_POST['passwd'] != $db['password'] ) > { header("Location: loginfailed.html"); exit; > } > ----- Original Message ----- > From: "Shams" <shamskhanmalikhotmail.com> > 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

    attached mail follows:


    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 remeryemeryloftus.com (Rick Emery) wrote:

    > if ( $_POST['passwd'] != $db['password'] ) > { header("Location: loginfailed.html"); exit; > } > ----- Original Message ----- > From: "Shams" <shamskhanmalikhotmail.com> > 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:thomas.seifertmyphorum.de http://www.MyPhorum.de

    attached mail follows:


    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:epelokeechoman.com] Sent: Tuesday, January 21, 2003 3:32 PM To: php-generallists.php.net 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 panel>etc, 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
    

    attached mail follows:


    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:epelokeechoman.com] > Sent: Tuesday, January 21, 2003 3:32 PM > To: php-generallists.php.net > 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 panel>etc, just don't know how to create one using > php. > > Thanks, > Eddie

    attached mail follows:


    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:jlarsoncandlefire.org] Sent: Wednesday, January 22, 2003 9:38 AM To: Edward Peloke Cc: php-generallists.php.net 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:epelokeechoman.com] > Sent: Tuesday, January 21, 2003 3:32 PM > To: php-generallists.php.net > 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 panel>etc, just don't know how to create one using > php. > > Thanks, > Eddie

    attached mail follows:


    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:jlarsoncandlefire.org] > Sent: Wednesday, January 22, 2003 9:38 AM > To: Edward Peloke > Cc: php-generallists.php.net > 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

    attached mail follows:


    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:jlarsoncandlefire.org] Sent: Wednesday, January 22, 2003 9:47 AM To: Edward Peloke Cc: php-generallists.php.net 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:jlarsoncandlefire.org] > Sent: Wednesday, January 22, 2003 9:38 AM > To: Edward Peloke > Cc: php-generallists.php.net > 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

    attached mail follows:


    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:epelokeechoman.com] Sent: Wednesday, January 22, 2003 10:20 AM To: php-generallists.php.net 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:jlarsoncandlefire.org] Sent: Wednesday, January 22, 2003 9:47 AM To: Edward Peloke Cc: php-generallists.php.net 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:jlarsoncandlefire.org] > Sent: Wednesday, January 22, 2003 9:38 AM > To: Edward Peloke > Cc: php-generallists.php.net > 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
    

    attached mail follows:


    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 = "mecompanyname.com"; $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"> <option>Select Info Source</option> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 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>

    attached mail follows:


    You are infact not getting a error, your getting a warning, it's perfectly normal for a very-debugged PHP page to complain about undefined variables and most people just set the error reporting in there php.ini to "E_ERROR & ~E_NOTICE" which should remove the warning.

    On Wed, 2003-01-22 at 09:47, 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 = "mecompanyname.com"; $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"> <option>Select Info Source</option> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 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

    -- 
    Adam Voigt (adamcryptocomm.com)
    The Cryptocomm Group
    My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
    

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

    iD8DBQA+LrFPF9k9BmZXCWYRAlkkAJ0WcJROweoEbMElI0L4lZWRDetfpwCgnA0f P2xUo+TgvyWW4P2dia/rxugïad -----END PGP SIGNATURE-----

    attached mail follows:


    try: if (isset($_POST['frmAction']) && $_POST['frmAction'] == "formmail")

    instead of your line.

    Thomas

    On Wed, 22 Jan 2003 09:47:46 -0500 stevebriartek.com (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 = "mecompanyname.com"; > $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"> > <option>Select Info Source</option> > <option value="Option 1">Option 1</option> > <option value="Option 2">Option 2</option> > <option value="Option 3">Option 3</option> > <option value="Option 4">Option 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:thomas.seifertmyphorum.de http://www.MyPhorum.de

    attached mail follows:


    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" <thomas.seifertmyphorum.de> wrote in message news:20030122160009.3f395b32.thomas.seifertmyphorum.de... > try: > if (isset($_POST['frmAction']) && $_POST['frmAction'] == "formmail") > > instead of your line. > > > > Thomas > > On Wed, 22 Jan 2003 09:47:46 -0500 stevebriartek.com (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 = "mecompanyname.com"; > > $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"> > > <option>Select Info Source</option> > > <option value="Option 1">Option 1</option> > > <option value="Option 2">Option 2</option> > > <option value="Option 3">Option 3</option> > > <option value="Option 4">Option 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:thomas.seifertmyphorum.de > http://www.MyPhorum.de

    attached mail follows:


    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" <stevebriartek.com> wrote in message news:20030122155653.86936.qmailpb1.pair.com... > 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" <thomas.seifertmyphorum.de> wrote in message > news:20030122160009.3f395b32.thomas.seifertmyphorum.de... > > try: > > if (isset($_POST['frmAction']) && $_POST['frmAction'] == "formmail") > > > > instead of your line. > > > > > > > > Thomas > > > > On Wed, 22 Jan 2003 09:47:46 -0500 stevebriartek.com (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 = "mecompanyname.com"; > > > $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"> > > > <option>Select Info Source</option> > > > <option value="Option 1">Option 1</option> > > > <option value="Option 2">Option 2</option> > > > <option value="Option 3">Option 3</option> > > > <option value="Option 4">Option 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:thomas.seifertmyphorum.de > > http://www.MyPhorum.de > >

    attached mail follows:


    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 stevebriartek.com (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" <stevebriartek.com> wrote in message > news:20030122155653.86936.qmailpb1.pair.com... > > 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" <thomas.seifertmyphorum.de> wrote in message > > news:20030122160009.3f395b32.thomas.seifertmyphorum.de... > > > try: > > > if (isset($_POST['frmAction']) && $_POST['frmAction'] == "formmail") > > > > > > instead of your line. > > > > > > > > > > > > Thomas > > > > > > On Wed, 22 Jan 2003 09:47:46 -0500 stevebriartek.com (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 = "mecompanyname.com"; > > > > $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"> > > > > <option>Select Info Source</option> > > > > <option value="Option 1">Option 1</option> > > > > <option value="Option 2">Option 2</option> > > > > <option value="Option 3">Option 3</option> > > > > <option value="Option 4">Option 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:thomas.seifertmyphorum.de > > > http://www.MyPhorum.de > > > > > >

    -- 
    Thomas Seifert
    

    mailto:thomas.seifertmyphorum.de http://www.MyPhorum.de

    attached mail follows:


    Thanks guys for helping out. I got it working now!

    "Thomas Seifert" <thomas.seifertmyphorum.de> wrote in message news:20030122180627.33da95de.thomas.seifertmyphorum.de... > 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 stevebriartek.com (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" <stevebriartek.com> wrote in message > > news:20030122155653.86936.qmailpb1.pair.com... > > > 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" <thomas.seifertmyphorum.de> wrote in message > > > news:20030122160009.3f395b32.thomas.seifertmyphorum.de... > > > > try: > > > > if (isset($_POST['frmAction']) && $_POST['frmAction'] == "formmail") > > > > > > > > instead of your line. > > > > > > > > > > > > > > > > Thomas > > > > > > > > On Wed, 22 Jan 2003 09:47:46 -0500 stevebriartek.com (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 = "mecompanyname.com"; > > > > > $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"> > > > > > <option>Select Info Source</option> > > > > > <option value="Option 1">Option 1</option> > > > > > <option value="Option 2">Option 2</option> > > > > > <option value="Option 3">Option 3</option> > > > > > <option value="Option 4">Option 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:thomas.seifertmyphorum.de > > > > http://www.MyPhorum.de > > > > > > > > > > > > > -- > Thomas Seifert > > mailto:thomas.seifertmyphorum.de > http://www.MyPhorum.de

    attached mail follows:


    Hi,

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

    mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders);

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

    Thanks, Scott

    attached mail follows:


    you would put that in the $mailheaders variable. Something like

    $mailheaders = "From: Joe Bloe <joeblowwhatever.com>\r\n"; $mailheaders .= "Cc: Some Dude <somedudewhatever.com>\r\n"; $mailheaders .= "Bcc: Some Other Guy <someothergutwhatever.com>\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 <Scottsaroptonline.net> To: php-generallists.php.net 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("abcdomain.com", "$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

    attached mail follows:


    $mailheaders = "From: meqwerty.com\r\nCc: joeyahoo.com,suemsn.net,frankcommie.com\r\nBcc: hiddenqwerty.com,bobsecretdomain.net";

    mail("abcdomain.com", "$Event Ticket Form", $msg, $mailheaders);

    ----- Original Message ----- From: "Scott Saraniero" <Scottsaroptonline.net> 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("abcdomain.com", "$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
    

    attached mail follows:


    Scott Saraniero wrote: > Hi, > > I'm using this line to send an e-mail with info: > > mail("abcdomain.com", "$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 <maryexample.com>" . ", " ; // note the comma $to .= "Kelly <kellyexample.com>";

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

    /* message */ $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</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 <birthdayexample.com>\r\n";

    $headers .= "Cc: birthdayarchiveexample.com\r\n"; $headers .= "Bcc: birthdaycheckexample.com\r\n";

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

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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. */

    attached mail follows:


    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 <php-generalgremlins.biz> 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

    attached mail follows:


    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

    attached mail follows:


    --- Henry <henrycafelab.com> 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

    attached mail follows:


    On Thursday 23 January 2003 00:26, Chris Shiflett wrote: > --- Henry <henrycafelab.com> 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. */

    attached mail follows:


    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" <php-generalgremlins.biz> To: <php-generallists.php.net> 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 <henrycafelab.com> 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

    attached mail follows:


    --- Henry <henrycafelab.com> wrote: > what I want to do is make sure one account can login > in at the same time

    I understand now, with Jason's help.

    > is there any mechanism in PHP can slove it?

    Well, not exactly. You see, this is a rather strange restriction (or seems strange to me at least).

    There are two different data stores in a typical session management environment:

    1. Session data store. This is all of those /tmp/sess* files if you are using the default setup. 2. User (or client) data store. This is where you would keep persistent data, such as username and password.

    You could store a login indicator in the user data store, so that when a user logs in, you make sure this flag is not set (else deny their login) and set it if it is not. This would work for a lot of cases, but it has a few notable problems:

    1. It is not atomic. Under heavy load, you can experience synchronization problems where multiple clients check the flag, see that it is not set, and all try to set it. This is a rather unlikely prolem, but it is something to consider.

    2. How do you know that someone is logged in? For example, if I login to your site (and you set my login flag to 1), how much inactivity will you tolerate before you consider me no longer logged in? Do you consider me logged in as long as I have a session record? What if I accidentally close my browser and go back to your site (and am not recognized due to my cookie being lost). Will you not allow me to log back in to your site until my login flag times out?

    I think this seems like a bad idea, but you might try this idea to see if it works well enough for you.

    Good luck.

    Chris

    attached mail follows:


    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

    attached mail follows:


    it doesn't matter before<body> or after <body> as I know

    ----- Original Message ----- From: "Denis L. Menezes" <menezesdsingnet.com.sg> To: "PHP general list" <php-generallists.php.net> 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

    attached mail follows:


    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:menezesdsingnet.com.sg] 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.

    attached mail follows:


    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

    attached mail follows:


    > -----Original Message----- > From: thkiat [mailto:thkiatpd.jaring.my] > Sent: Wednesday, January 22, 2003 10:23 AM > To: php-generallists.php.net; php-langlists.php.net > 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.

    attached mail follows:


    can you post some code?

    -----Original Message----- From: thkiat [mailto:thkiatpd.jaring.my] Sent: Wednesday, January 22, 2003 10:23 AM To: php-generallists.php.net; php-langlists.php.net 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
    

    attached mail follows:


    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
    

    attached mail follows:


    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) davidtgjustpickone.org * society and not sufficient moral courage.
    (work) davidtgworkjustpickone.org  -- Mary Baker Eddy, "Science and Health"
    http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)

    iD8DBQE+LuGCGb7uCXufRwARAjXDAJ9+V9iNMlxoFxObUwixHxeakETjxgCgvZ3i ZjWgH4wiw9ihnk33Ka+1uWY= =ZK+p -----END PGP SIGNATURE-----

    attached mail follows:


    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:$pswd127.0.0.1/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 "<tr><td>".($row[0])."</td></tr>"; > } >?> ></table> > >Roddie Grant >roddiemyword.co.uk > > > >

    attached mail follows:


    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:kreid2bigpond.net.au] > Sent: Tuesday, January 21, 2003 6:29 PM > To: Brian T. Allen; 'Jason k Larson' > Cc: php-generallists.php.net > 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" <briangzmarketing.com> > To: "'Kris'" <kreid2bigpond.net.au>; "'Jason k Larson'" > <jlarsoncandlefire.org> > Cc: <php-generallists.php.net> > 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:kreid2bigpond.net.au] > > > Sent: Tuesday, January 21, 2003 5:02 PM > > > To: Jason k Larson > > > Cc: php-generallists.php.net > > > 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" <jlarsoncandlefire.org> > > > To: "Kris" <kreid2bigpond.net.au> > > > Cc: <php-generallists.php.net> > > > 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 > > > > > > >

    attached mail follows:


    Anyone ?

    regards Thomas Svensson, Oslo

    attached mail follows:


    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

    attached mail follows:


    regards Thomas Svensson in Oslo.

    attached mail follows:


    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:

    [rootLunar]:~> 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/0 brpt-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

    attached mail follows:


    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: > > [rootLunar]:~> 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/0 brpt-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. */

    attached mail follows:


    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

    attached mail follows:


    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" */

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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.

    attached mail follows:


    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

    attached mail follows:


    > 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

    attached mail follows:


    Chris Hayes wrote: > 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.

    you absolutely *may* sell gpl'd code - that's why you see boxed sets of Linux distributions on the shelves.

    It's just that if you take gpl'd code and modify it - then when you release it to a third party (whether you charge money or not) you must release this new version also under the gpl.

    The GPL is incompatible with per-seat licenses and the third party is free to copy and if they wish, resell your code.

    So traditional models of selling computer software don't all work with gpl'd code.

    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.

    I'm sorry if that fails to give a clear cut answer - this sort of thing does not seem to have been testing in the courts yet ...

    -- 
    

    Sean

    attached mail follows:


    John Wells said: >> 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.

    I know I read this somewhere, but now I can't find a reference. The deal is that if you are accessing the capabilities of a GPLed program via a programmatic interface you are linking. If you are doing it by a system call, then you are not.

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

    In a word, yes.

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

    That FAQ applies the interpreters, not interpreted programs. Which is to say that the fact that an interpreter is GPLed doesn't mean users can only interpret GPLed scripts with it. IOW, interpretation != linking.

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

    No. Use is not restricted in any way by the GPL. In fact, you needn't even /agree/ to the GPL in order to use GPLed software in any way you'd like, only to (re)distribute it.

    attached mail follows:


    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

    attached mail follows:


    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 <joejoestump.net>
    http://www.joestump.net
    

    attached mail follows:


    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 jstumpaa.acinc.com (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 <joejoestump.net> > http://www.joestump.net > >

    -- 
    Thomas Seifert
    

    mailto:thomas.seifertmyphorum.de http://www.MyPhorum.de

    attached mail follows:


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

    There's really no change from the PHP side. PHP just sends the data and receives something back The only change in PHP is that mysql_connect() now supports additional flags to connect over SSL.

    ---John Holmes...

    attached mail follows:


    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="_new">Will 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

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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

    attached mail follows:


    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="21">State</td> <td width="259" height="21"><? echo $display_block; ?></td> </tr> --------------------------------

    attached mail follows:


    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="21">State</td> > <td width="259" height="21"><? echo $display_block; ?></td> > </tr> > > --------------------------------

    -- 
    Michael Sweeney <sweeneyverisity.com>
    Verisity Design, Inc
    

    attached mail follows:


    function DrawOptions($options, $active='') { $str = ''; foreach($options AS $key=>$value) { $sel = ($active==$key?" SELECTED":""); $str .= "<option value='".$key."'".$sel.">".$value."</option>\n"; } return($str); }

    Try this

    <select name='something'> <?=DrawOptions($array, $active)?> </select>

    array needs to be a key-value pair that has the value that you are looking for as the key and if it matches it will make that key - value assoc the selected one.

    that should work for you

    ----- Original Message ----- From: "Ben C." <benccox.net> To: <php-generallists.php.net> Sent: Wednesday, January 22, 2003 10:14 AM Subject: [PHP] Select value for driopdown box

    > 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="21">State</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 > >

    attached mail follows:


    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 > > andre.lagadeceducation.gouv.fr 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 > > > > > > > >

    attached mail follows:


    Hey, I'm back =)

    I was unable to get it to run, I've setup the most basic session handler i could think of, a simple counter, if any of you could test it, I'd be very thankful, the URL is http://fatboy.blaster.nu/~blaster/sess_test/

    Now, it does not "cut" the content, not sure why it doesn't do that, but I'm pretty sure it generates segment faults, cause at several occations when you click Destroy Session and then return, it will display "Cannot find server" in MSIE, and I've checked with my sniffer, Apache simply closes the TCP connection as soon as my request is sent which probably means the child handling my request segment faulted.

    Still, if ANYONE has ANYTHING on Segment faults with PHP session, I'd like to hear about it, I'm willing to try pretty much anything!

    I've already tried several different DB libs and Session handler libs, I'm aware of the "MM" lib which many have had problems with before, I don't use that.

    One thing that really bugs me though, is that if I don't touch the "session.save_handler" option and leave it to "files", EVERYTHING works just great! This kinda makes me think all the DB libs I have tried is invalid, but that cannot possible be the case, I've even tried PEAR sessionlib, which is coded by a team supported by the PHP group (?). Is it possible that the way PHP handles the "files" session and "user" sessions is different? Like, they patched one of the methods but forgot to fix the "user" mode? :)

    Also, while searching google, I came across a very interesting URL, http://www.phpbuilder.com/mail/php-developer-list/200001/0600.php

    However, the BUG description ID to http://bugs.php.net/ seems to be invalid, it only takes me to the frontpage, and searching for it gives me nothing, is this bug fixed? If so, in what version?

    Thanks for your time, again, anything related to PHP session and possible segment faults is MUCH appreciated!

    At 21:15 2003-01-21 +1100, you wrote: >I don't really have an answer... try to get the REALLY basic session example >from the manual to work... this will ruke out your save handler and all >sorts of other stuff, if you're still getting the errors with basic code and >default handlers. > >Justin > > >on 21/01/03 9:01 PM, Blaster (blasterblaster.nu) wrote: > > > Okay, I'm not using "mm" as my session handler, in PHP.ini, I still have > > "files", > > but in my script, I temporariliy modify this with > > > > if (!ini_set("session.save_handler", "user")) > > echo("Unable to switch to Session User mode."); > > > > if (!session_set_save_handler("db_session_open", "db_session_close", > > "db_session_read", "db_session_write", "db_session_destroy", > > "db_session_garbage")) > > echo("Unable to init custom session handlers!"); > > > > These are my own handlers, working with MySQL. > > > > I have however also tried setting it to user and only doing the > > "session_set_save_handler()" part, but gives me random segment faults > > either way. The strange part > > is that it doesn't always crash, i can view the same page 10 times, and it > > only segment faults on one of the views,.. how is this possible? > > > > Please advice =) > > > > At 12:51 2003-01-21 +1100, you wrote: > >> Hi, > >> > >> I had this problem a few weeks back. The host changed the sessions from > >> 'mm' to 'files' in php.ini and restarted, and all was ok... > >> > >> not sure of the reasons behind the faults, but I had this EXACT problem > >> (with standard session stuff). > >> > >> > >> Justin > >> > >> > >> on 21/01/03 2:29 AM, Blaster (blasterblaster.nu) wrote: > >> > >>> Hi > >>> > >>> OS: Debian Linux (Woody), kernel 2.2.20 > >>> PHP: v4.1.2 > >>> > >>> I'm having some troubles with my sessions, when the page is sent to the > >>> visitor, it sometimes stops after ½ the page or so. 90% of the times, it > >>> works perfectly > >>> to visit the page, so this appears to be totally random. However, I have > >>> reason to believe it has something to do with my sessions, I have > written a > >>> custom session > >>> lib which works with MySQL, and then set it up with > >> session_set_save_handler() > >>> > >>> Now, I checked the error logs of my Apache HTTP, and it's filled with > >>> [Mon Jan 20 15:20:54 2003] [notice] child pid 19500 exit signal > >>> Segmentation fault (11) > >>> [Mon Jan 20 15:20:54 2003] [notice] child pid 19399 exit signal > >>> Segmentation fault (11) > >>> FATAL: emalloc(): Unable to allocate -916562933 bytes > >>> [Mon Jan 20 15:21:02 2003] [notice] child pid 19499 exit signal > >>> Segmentation fault (11) > >>> [Mon Jan 20 15:21:20 2003] [notice] child pid 19401 exit signal > >>> Segmentation fault (11) > >>> [Mon Jan 20 15:21:32 2003] [notice] child pid 19514 exit signal > >>> Segmentation fault (11) > >>> [Mon Jan 20 15:21:35 2003] [notice] child pid 19403 exit signal > >>> Segmentation fault (11) > >>> > >>> The reason to why I'm sure it's PHP is the "emalloc()" line, which > I'm told > >>> only can be generated by PHP. Now, I'm wondering if this is a know > bug, or > >>> am I doing > >>> something wrong? > >>> > >>> In short: > >>> The content stream (HTML stream) is interrupted, probably because of a > >>> segment fault caused by PHP Session functions. Is there a way to work > >>> around this bug > >>> without performing a complete upgrade? If this has already been fixed > in a > >>> newer version, which version do I need to get? 4.3.0 is not really an > >>> option to me, since > >>> I'm running APT-GET, their latest version is 4.1.2 (stable) and 4.2.6 > >>> (unstable) (or something) > >>> > >>> Code I use to setup the sessions: > >>> session_start(); > >>> session_register("SESSION"); > >>> > >>> if (!isset($SESSION)) { > >>> $SESSION = array(); > >>> $SESSION["submitdata"] = array(); > >>> $SESSION["addr"] = $REMOTE_ADDR; > >>> $SESSION["user"] = user_auth($_COOKIE['replayuser'], > >>> $_COOKIE['replaypass']); > >>> } > >>> > >>> # Prevent Session hi-jacking, only allow people from the IP who > created the > >>> session, or else > >>> # re-auth user > >>> if ($SESSION["addr"] != $REMOTE_ADDR) { > >>> $SESSION["user"] = user_auth($_COOKIE['replayuser'], > >> $_COOKIE['replaypass']); > >>> $SESSION["addr"] = $REMOTE_ADDR; > >>> } > >>> > >>> A quick reply is appreciated! Thanks in advance > >>> > >>> > >>> -- > >>> PHP General Mailing List (http://www.php.net/) > >>> To unsubscribe, visit: http://www.php.net/unsub.php > >>> > >>> --- > >>> [This E-mail scanned for viruses] > >>> > >>> > > > > --- > > [This E-mail scanned for viruses] > > > >

    attached mail follows:


    Hi,

    I want php to print " \tab" but when I do, I only get "ab" as output. How do I keep the \t?

    Thanks in advance.

    Jan Grafström