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: Thu Aug 15 2002 - 04:41:59 CDT

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

    php-general Digest 15 Aug 2002 09:41:59 -0000 Issue 1526

    Topics (messages 112609 through 112725):

    P.S. html parsing from html file through php
            112609 by: victor.argilent.com
            112633 by: vic

    PHP and Samba
            112610 by: Erich Kolb

    Re: [Class] "global" again, not working?
            112611 by: Bas Jobsen

    Re: html parsing from html file through php
            112612 by: vic

    file_get_contents ( string filename [, int use_include_path])
            112613 by: victor.argilent.com
            112614 by: Bas Jobsen

    Re: mysql statement (still a semi newbie)
            112615 by: Sascha Braun

    SESSION Security
            112616 by: Sascha Braun
            112618 by: Ilia A.
            112619 by: Sascha Braun
            112620 by: Ilia A.
            112621 by: Sascha Braun
            112622 by: Ilia A.
            112624 by: Bas Jobsen
            112625 by: Sascha Braun

    Re: Two version of php in the same system
            112617 by: Breno Cardoso Perucchi

    mysql_num_rows($Result)
            112623 by: Sascha Braun
            112626 by: Bas Jobsen

    Include/require and the HTML Code
            112627 by: Mike Eales
            112629 by: Sascha Braun
            112630 by: Bas Jobsen
            112639 by: Peter Houchin
            112678 by: Mike Eales
            112683 by: Chris Shiflett

    mysql_num_rows();
            112628 by: Sascha Braun
            112641 by: Jason Wong

    Batch E-Mail Problem
            112631 by: Daren Cotter
            112663 by: Bogdan Stancescu
            112685 by: Mirek Novak
            112688 by: Manuel Lemos
            112706 by: Daren Cotter
            112707 by: Daren Cotter
            112713 by: Justin French

    LIB PHP V4.0.3 - Construction of GIF that the versions recent PHP doesn't have
            112632 by: Breno Cardoso Perucchi

    Re: Session, error occurs
            112634 by: Daniel Canil
            112720 by: David Robley

    Re: ldap_rename refused to work
            112635 by: Roger Thomas

    CURLing to authorize.net
            112636 by: Mike Mannakee
            112648 by: Jonathan Rosenberg

    Re: ADVANCED PHP (SOCKETS)
            112637 by: Ninety-Nine Ways To Die

    Global asa
            112638 by: Cokis

    PHP native session
            112640 by: Mattia
            112700 by: Lars Olsson

    Strange session id problem - code is issuing a new one randomly
            112642 by: Thoenen, Peter Mr. EPS
            112643 by: Dan Harrington
            112646 by: Chris Shiflett

    Php.ini on Solaris?
            112644 by: Randall Perry
            112645 by: Justin French
            112647 by: Peter Houchin

    SSL and sessions: is same session valid across SSL and non-SSL
            112649 by: Jean-Christian Imbeault

    Re: PHP - class question
            112650 by: Tom Rogers

    how do i continue with ereg replace?
            112651 by: victor.argilent.com
            112652 by: Rasmus Lerdorf

    ereg_replace()
            112653 by: Liam MacKenzie
            112690 by: Philip Hallstrom

    stupid question
            112654 by: Liam MacKenzie
            112655 by: César Aracena
            112656 by: Adam Williams
            112657 by: Chris Shiflett
            112658 by: Jean-Christian Imbeault
            112659 by: Liam MacKenzie
            112660 by: Chris Shiflett
            112664 by: César Aracena

    Automatically send email on special day
            112661 by: NoWhErEMan
            112668 by: Bogdan Stancescu
            112670 by: César Aracena
            112672 by: Liam MacKenzie
            112676 by: César Aracena
            112686 by: NoWhErEMan
            112689 by: Liam MacKenzie
            112691 by: Chris Shiflett
            112699 by: David Buerer

    Another stupid one...
            112662 by: Liam MacKenzie
            112665 by: Bogdan Stancescu
            112667 by: NoWhErEMan
            112669 by: Liam MacKenzie
            112673 by: Justin French

    md5() ...
            112666 by: Reymond
            112671 by: Chris Shiflett
            112674 by: Reymond
            112675 by: Reymond
            112679 by: Chris Shiflett
            112681 by: Reymond

    frames and variables
            112677 by: victor.argilent.com
            112680 by: Justin French
            112684 by: vic
            112687 by: . Edwin

    Re: how to make it use blowfish?
            112682 by: Jean-Christian Imbeault

    Got another ripper for you all ;-)
            112692 by: Liam MacKenzie
            112693 by: Justin French
            112694 by: Liam MacKenzie
            112695 by: Liam MacKenzie
            112696 by: Tom Rogers
            112697 by: Liam MacKenzie
            112698 by: Liam MacKenzie
            112709 by: Luke Welling
            112710 by: Liam MacKenzie
            112711 by: Liam MacKenzie
            112721 by: David Robley

    MySQL vs Session?
            112701 by: Tino Didriksen
            112702 by: Bob Irwin
            112704 by: Jean-Christian Imbeault
            112705 by: Rasmus Lerdorf
            112712 by: Jean-Christian Imbeault

    Help please
            112703 by: paul
            112716 by: Sebastian Tomasino
            112722 by: David Robley

    Stumped: vars not passed!!!
            112708 by: Petre Agenbag

    Use mail()
            112714 by: Christian Ista

    Is voice Over Ip posible in PHP
            112715 by: usha

    Re: Destroy session variable when IE close
            112717 by: Tim Ward

    trans-sid not working
            112718 by: Jean-Christian Imbeault
            112719 by: Jason Wong
            112723 by: Jean-Christian Imbeault

    How do I customize the User-Agent when opening a remote file?
            112724 by: Dallas Thunder

    Header and Target
            112725 by: Christian Ista

    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:


    Actually I think there is even less work to be done, the paragraph
    spacing problem I talked about earlier can be avoided if I leave all
    that foobar tags and erase only:

    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 10">
    <meta name=Originator content="Microsoft Word 10">
    <link rel=File-List href="community_files/filelist.xml">
    <title>Community</title>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="City"/>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="place"/>

    <--------------[Need everything here]-------------> <- in there, not the
    following tags ;)

    </head>

    <body lang=EN-US style='tab-interval:.5in'>

    <---------------[Need everything in here]--------------> <- in there,
    not the following tags ;)

    </body>

    </html>

    Thanks, maybe if someone can tell me how to learn to work with some
    search and replace function that would be neat0

    - Vic

    -----Original Message-----
    From: victorargilent.com [mailto:victorargilent.com]
    Sent: Wednesday, August 14, 2002 5:10 PM
    To: 'php-generallists.php.net'
    Subject: html parsing from html file through php

    Hello, I am making an app that read from an html file outputted by MS
    word (ya its for those people that need to make webpages but don't know
    how o write html) anyway, using MS word is a requirement; After the user
    saves their .doc file as a web page (now and htm file) the php will take
    that html file from a dir on the server, open it, read it, and ignore
    anything that is from the beginning of the file up to and right after
    the body tag ends, then it must ignore anything at the end of the page
    up and including the body tags and the closing html tag. So basically
    after its done doing its thing I would have all the content of the page
    ready to be echoed inside another page that would be a sort of shell or
    template.

    I am loocking right now at regular expressions and file_open etc, but
    just to give you an idea and to see if anybody has any helpful pointers,
    this (yes, can u believe it?) is the beginning of the word2html
    translation that MS word does: (BAH!) (i have to get rid of this
    remember?)

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

    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 10">
    <meta name=Originator content="Microsoft Word 10">
    <link rel=File-List href="community_files/filelist.xml">
    <title>Community</title>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="City"/>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="place"/>
    <!--[if gte mso 9]><xml>
     <o:DocumentProperties>
      <o:Author>Jim Weathers</o:Author>
      <o:LastAuthor>vic</o:LastAuthor>
      <o:Revision>2</o:Revision>
      <o:TotalTime>1</o:TotalTime>
      <o:Created>2002-08-14T19:54:00Z</o:Created>
      <o:LastSaved>2002-08-14T19:54:00Z</o:LastSaved>
      <o:Pages>1</o:Pages>
      <o:Words>79</o:Words>
      <o:Characters>451</o:Characters>
      <o:Company>x-core</o:Company>
      <o:Lines>3</o:Lines>
      <o:Paragraphs>1</o:Paragraphs>
      <o:CharactersWithSpaces>529</o:CharactersWithSpaces>
      <o:Version>10.2625</o:Version>
     </o:DocumentProperties>
    </xml><![endif]--><!--[if gte mso 9]><xml>
     <w:WordDocument>
      <w:SpellingState>Clean</w:SpellingState>
      <w:GrammarState>Clean</w:GrammarState>
     
    <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEv
    ery>
     
    <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
      <w:UseMarginsForDrawingGridOrigin/>
      <w:Compatibility>
       <w:FootnoteLayoutLikeWW8/>
       <w:ShapeLayoutLikeWW8/>
       <w:AlignTablesRowByRow/>
       <w:ForgetLastTabAlignment/>
       <w:LayoutRawTableWidth/>
       <w:LayoutTableRowsApart/>
       <w:UseWord97LineBreakingRules/>
      </w:Compatibility>
      <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
     </w:WordDocument>
    </xml><![endif]--><!--[if !mso]><object
     classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D"
    id=ieooui></object>
    <style>
    st1\:*{behavior:url(#ieooui) }
    </style>
    <![endif]-->
    <style>
    <!--
     /* Font Definitions */
     font-face
            {font-family:Times;
            panose-1:2 2 6 3 5 4 5 2 3 4;
            mso-font-charset:0;
            mso-generic-font-family:roman;
            mso-font-pitch:variable;
            mso-font-signature:536902279 -2147483648 8 0 511 0;}
    font-face
            {font-family:Verdana;
            panose-1:2 11 6 4 3 5 4 4 2 4;
            mso-font-charset:0;
            mso-generic-font-family:swiss;
            mso-font-pitch:variable;
            mso-font-signature:536871559 0 0 0 415 0;}
     /* Style Definitions */
     p.MsoNormal, li.MsoNormal, div.MsoNormal
            {mso-style-parent:"";
            margin:0in;
            margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:12.0pt;
            mso-bidi-font-size:10.0pt;
            font-family:Times;
            mso-fareast-font-family:Times;
            mso-bidi-font-family:"Times New Roman";}
    p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
            {margin:0in;
            margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:12.0pt;
            mso-bidi-font-size:10.0pt;
            font-family:Verdana;
            mso-fareast-font-family:"Times New Roman";
            mso-bidi-font-family:"Times New Roman";
            mso-ansi-language:EN-AU;
            mso-fareast-language:EN-US;}
    span.SpellE
            {mso-style-name:"";
            mso-spl-e:yes;}
    page Section1
            {size:8.5in 11.0in;
            margin:1.0in 1.25in 1.0in 1.25in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;
            mso-paper-source:0;}
    div.Section1
            {page:Section1;}
    -->
    </style>
    <!--[if gte mso 10]>
    <style>
     /* Style Definitions */
     table.MsoNormalTable
            {mso-style-name:"Table Normal";
            mso-tstyle-rowband-size:0;
            mso-tstyle-colband-size:0;
            mso-style-noshow:yes;
            mso-style-parent:"";
            mso-padding-alt:0in 5.4pt 0in 5.4pt;
            mso-para-margin:0in;
            mso-para-margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:10.0pt;
            font-family:Times;
            mso-bidi-font-family:"Times New Roman";}
    </style>
    <![endif]-->
    </head>

    <body lang=EN-US style='tab-interval:.5in'>

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

    Right after this tag comes:
    (Everything before this tag must go)

    <div class=Section1>

    And I observed that this is pretty much constant in the other html
    pages, so I guess the script could take this as a stopping queue.

    And the very end is

    </div>

    So after this tag, everything must go.

    Erasing these tags, and previewing the document in the browser I saw
    that for some reason all paragraphs had a huge spage between them
    (perhaps 3 par spans) so it would be kewl if someone could also tell me
    how I could get rid of tags inside the document and replace them with
    "NORMAL" html tags.

    Yes, if you just tell me to RTFM it's all cool, but tell me where at
    least!

    THANQOOMAGIG!

    - Vic

    ______________________________________________________________________
    Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    Why is this giving me no results? (blank page with this source:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html;
    charset=windows-1252"></HEAD>
    <BODY></BODY></HTML>

    this is the code -----------------------------------

    <?php

    $path = '../html_pages/';
    $file_name = 'contact.htm';

    $dirty_html = file ($path.$file_name);
    $dirty_html = implode('', file ($path.$file_name));
    //echo $dirty_html;

    preg_match("/<div
    class=Section1>(.*)<\/div>/i",$dirty_html,$clean_html);
    $clean_html = implode('', $clean_html);
    echo $clean_html;

    //$html_text = $dirty_html;
    //preg_match("/<div class=Section1>(.*)<\/body>/i",$html_text,$matches);
    //$matches = implode('', $matches);
    //echo $matches;
    ?>
    -------------------------------------------------------
    - Vic

    -----Original Message-----
    From: victorargilent.com [mailto:victorargilent.com]
    Sent: Wednesday, August 14, 2002 5:48 PM
    To: php-generallists.php.net
    Subject: [PHP] P.S. html parsing from html file through php

    Actually I think there is even less work to be done, the paragraph
    spacing problem I talked about earlier can be avoided if I leave all
    that foobar tags and erase only:

    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 10">
    <meta name=Originator content="Microsoft Word 10">
    <link rel=File-List href="community_files/filelist.xml">
    <title>Community</title>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="City"/>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="place"/>

    <--------------[Need everything here]-------------> <- in there, not the
    following tags ;)

    </head>

    <body lang=EN-US style='tab-interval:.5in'>

    <---------------[Need everything in here]--------------> <- in there,
    not the following tags ;)

    </body>

    </html>

    Thanks, maybe if someone can tell me how to learn to work with some
    search and replace function that would be neat0

    - Vic

    -----Original Message-----
    From: victorargilent.com [mailto:victorargilent.com]
    Sent: Wednesday, August 14, 2002 5:10 PM
    To: 'php-generallists.php.net'
    Subject: html parsing from html file through php

    Hello, I am making an app that read from an html file outputted by MS
    word (ya its for those people that need to make webpages but don't know
    how o write html) anyway, using MS word is a requirement; After the user
    saves their .doc file as a web page (now and htm file) the php will take
    that html file from a dir on the server, open it, read it, and ignore
    anything that is from the beginning of the file up to and right after
    the body tag ends, then it must ignore anything at the end of the page
    up and including the body tags and the closing html tag. So basically
    after its done doing its thing I would have all the content of the page
    ready to be echoed inside another page that would be a sort of shell or
    template.

    I am loocking right now at regular expressions and file_open etc, but
    just to give you an idea and to see if anybody has any helpful pointers,
    this (yes, can u believe it?) is the beginning of the word2html
    translation that MS word does: (BAH!) (i have to get rid of this
    remember?)

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

    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 10">
    <meta name=Originator content="Microsoft Word 10">
    <link rel=File-List href="community_files/filelist.xml">
    <title>Community</title>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="City"/>
    <o:SmartTagType
    namespaceuri="urn:schemas-microsoft-com:office:smarttags"
     name="place"/>
    <!--[if gte mso 9]><xml>
     <o:DocumentProperties>
      <o:Author>Jim Weathers</o:Author>
      <o:LastAuthor>vic</o:LastAuthor>
      <o:Revision>2</o:Revision>
      <o:TotalTime>1</o:TotalTime>
      <o:Created>2002-08-14T19:54:00Z</o:Created>
      <o:LastSaved>2002-08-14T19:54:00Z</o:LastSaved>
      <o:Pages>1</o:Pages>
      <o:Words>79</o:Words>
      <o:Characters>451</o:Characters>
      <o:Company>x-core</o:Company>
      <o:Lines>3</o:Lines>
      <o:Paragraphs>1</o:Paragraphs>
      <o:CharactersWithSpaces>529</o:CharactersWithSpaces>
      <o:Version>10.2625</o:Version>
     </o:DocumentProperties>
    </xml><![endif]--><!--[if gte mso 9]><xml>
     <w:WordDocument>
      <w:SpellingState>Clean</w:SpellingState>
      <w:GrammarState>Clean</w:GrammarState>
     
    <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEv
    ery>
     
    <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
      <w:UseMarginsForDrawingGridOrigin/>
      <w:Compatibility>
       <w:FootnoteLayoutLikeWW8/>
       <w:ShapeLayoutLikeWW8/>
       <w:AlignTablesRowByRow/>
       <w:ForgetLastTabAlignment/>
       <w:LayoutRawTableWidth/>
       <w:LayoutTableRowsApart/>
       <w:UseWord97LineBreakingRules/>
      </w:Compatibility>
      <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
     </w:WordDocument>
    </xml><![endif]--><!--[if !mso]><object
     classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D"
    id=ieooui></object>
    <style>
    st1\:*{behavior:url(#ieooui) }
    </style>
    <![endif]-->
    <style>
    <!--
     /* Font Definitions */
     font-face
            {font-family:Times;
            panose-1:2 2 6 3 5 4 5 2 3 4;
            mso-font-charset:0;
            mso-generic-font-family:roman;
            mso-font-pitch:variable;
            mso-font-signature:536902279 -2147483648 8 0 511 0;}
    font-face
            {font-family:Verdana;
            panose-1:2 11 6 4 3 5 4 4 2 4;
            mso-font-charset:0;
            mso-generic-font-family:swiss;
            mso-font-pitch:variable;
            mso-font-signature:536871559 0 0 0 415 0;}
     /* Style Definitions */
     p.MsoNormal, li.MsoNormal, div.MsoNormal
            {mso-style-parent:"";
            margin:0in;
            margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:12.0pt;
            mso-bidi-font-size:10.0pt;
            font-family:Times;
            mso-fareast-font-family:Times;
            mso-bidi-font-family:"Times New Roman";}
    p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
            {margin:0in;
            margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:12.0pt;
            mso-bidi-font-size:10.0pt;
            font-family:Verdana;
            mso-fareast-font-family:"Times New Roman";
            mso-bidi-font-family:"Times New Roman";
            mso-ansi-language:EN-AU;
            mso-fareast-language:EN-US;}
    span.SpellE
            {mso-style-name:"";
            mso-spl-e:yes;}
    page Section1
            {size:8.5in 11.0in;
            margin:1.0in 1.25in 1.0in 1.25in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;
            mso-paper-source:0;}
    div.Section1
            {page:Section1;}
    -->
    </style>
    <!--[if gte mso 10]>
    <style>
     /* Style Definitions */
     table.MsoNormalTable
            {mso-style-name:"Table Normal";
            mso-tstyle-rowband-size:0;
            mso-tstyle-colband-size:0;
            mso-style-noshow:yes;
            mso-style-parent:"";
            mso-padding-alt:0in 5.4pt 0in 5.4pt;
            mso-para-margin:0in;
            mso-para-margin-bottom:.0001pt;
            mso-pagination:widow-orphan;
            font-size:10.0pt;
            font-family:Times;
            mso-bidi-font-family:"Times New Roman";}
    </style>
    <![endif]-->
    </head>

    <body lang=EN-US style='tab-interval:.5in'>

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

    Right after this tag comes:
    (Everything before this tag must go)

    <div class=Section1>

    And I observed that this is pretty much constant in the other html
    pages, so I guess the script could take this as a stopping queue.

    And the very end is

    </div>

    So after this tag, everything must go.

    Erasing these tags, and previewing the document in the browser I saw
    that for some reason all paragraphs had a huge spage between them
    (perhaps 3 par spans) so it would be kewl if someone could also tell me
    how I could get rid of tags inside the document and replace them with
    "NORMAL" html tags.

    Yes, if you just tell me to RTFM it's all cool, but tell me where at
    least!

    THANQOOMAGIG!

    - Vic

    ______________________________________________________________________
    Post your ad for free now! http://personals.yahoo.ca

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

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    Is there any way to determine if someone is logged in to a Samba Domain using PHP? If so, how?

    attached mail follows:


    Hi, do

    --
    echo $data[0]*$data[1]);
    return ($data[0]*$data[1]);
    --
    i think its empty.
    

    In the first place, i thought it was maybe impossible to call a class-functions in your constructor. (Cause the class function don't exists at the moment you call your constructor).

    But the code below showed it isn't that: <? class test { var $limiet;

    function test() { $this->limiet=$this->test2(); }

    function test2() { return 5; }

    function test3() { echo 'Limiet:'.$this->limiet; return $this->limiet; } }

    $TEST= new test(); echo 'Limiet:'.$TEST->test3(); ?>

    >global $WORKDIR; NOTE: You should prefer $GLOBALS['WORKDIR']; read: http://www.php.net/manual/en/migration4.variables.php

    Op woensdag 14 augustus 2002 22:53, schreef Tim Stoop: > Hi people, > > Again, a problem with "global". Maybe you can shed a light on this one... > > Consider this part of a class (with [...] I marks things I left out, which > aren't important for the problem, FAFAIK): > > class FotoView > { > [...] > var $fotos; > var $cats; > var $start; > var $limiet; > [...] > > /** > * Constructor > */ > function FotoView($start,$cats=NULL,$admin=FALSE) > { > $this->limiet = $this->getLimit(); > > [...] > > $this->start = $start; > > [...] > > echo("1:".$this->start." ".$this->limiet); > > $this->fotos = $this->findFotos(); > } > > function getLimit() > { > global $WORKDIR; > include_once($WORKDIR."obj/dbconnection.obj.php"); > > $db = new DBConnection(); > $result = $db->query("SELECT lijst_x, lijst_y FROM > config"); $data = mysql_fetch_row($result); > return ($data[0]*$data[1]); > } > > [...] > > function findFotos() > { > global $start, $cats, $limiet, $urlfotoview, $WORKDIR; > > echo("2:".$this->start." ".$this->limiet); > > echo("3:".$start." ".$limiet); > [...] > > Okay, $WORKDIR is set in the page that calls this class, it works (checked > it). You can see three echo's in there. The result from those are: > 1: 0 20 > 2: 0 20 > 3: 0 > > Can anyone explain to me why in findFotos() the defining of $limiet doesn't > work correctly? Why isn't a reference made to $this->limiet? I'm really at > a lost, here... Any help is appreciated!

    attached mail follows:


    Thanks, I will try to adapt this to my needs.

    - Vic

    -----Original Message----- From: JJ Harrison [mailto:webmastertececo.com] Sent: Wednesday, August 14, 2002 5:44 PM To: php-generallists.php.net Subject: [PHP] Re: html parsing from html file through php

    > Hello, I am making an app that read from an html file outputted by MS > word (ya its for those people that need to make webpages but don't know > how o write html) anyway, using MS word is a requirement; After the user > saves their .doc file as a web page (now and htm file) the php will take > that html file from a dir on the server, open it, read it, and ignore > anything that is from the beginning of the file up to and right after > the body tag ends, then it must ignore anything at the end of the page > up and including the body tags and the closing html tag. So basically > after its done doing its thing I would have all the content of the page > ready to be echoed inside another page that would be a sort of shell or > template. > > I am loocking right now at regular expressions and file_open etc, but > just to give you an idea and to see if anybody has any helpful pointers, > this (yes, can u believe it?) is the beginning of the word2html > translation that MS word does: (BAH!) (i have to get rid of this > remember?)

    Here is an example regular expression that someone on this group gave me. It gives everything between the body tags. <?php $html_text = ' <html> <head> <title>Untitled</title> </head> <body> Blah Blah Blah Blah </body> </html> '; preg_match("/<body>(.*)<\/body>/i",$html_text,$matches); echo $html_text; ?>

    Here is a class that removes un-needed word 2000 HTML tags: http://www.phpclasses.org/browse.html/package/277.html

    If you need the styling you will need to do an extra regular expression to get out of the head and perhaps put it into a file. If you don't need styling I would recomment parsing the document itself and removing all the class="" and style="" attributes

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    -- Please reply on the list/newsgroup unless the reply it OT.

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

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    Can someone explain me more abou the usage of this code:

    file_get_contents ( string filename [, int use_include_path])

    I just got it from the annual, and I still don't get what they mean by

    string filename

    and

    int use_include_path

    Thanks,

    This has to do with the other question I posted earlier, yes

    - Vic

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    > string filename The name of the file. b.e test.html or $_SERVER['DOCUMENT_ROOT'].'test.html' > int use_include_path Optional 1 true or 0 (or nothing) false the file above is in my default include path. Manual: you can use the optional second parameter and set it to "1", if you want to search for the file in the include_path, too.

    The default include path is defined in your php.ini: Specifies a list of directories where the require(), include() and fopen_with_path() functions look for files.

    So call it like: $string_with_file_contents=('file_with_the_wanted_content.ext');

    Op donderdag 15 augustus 2002 00:06, schreef victorargilent.com: > Can someone explain me more abou the usage of this code: > > file_get_contents ( string filename [, int use_include_path]) > > I just got it from the annual, and I still don't get what they mean by > > string filename > > and > > int use_include_path > > Thanks, > > This has to do with the other question I posted earlier, yes > > - Vic > > > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    I'm always making my inserts like this:

    $Insert = "INSERT INTO basket_db (name, image_id, customer_id, session_id) "; $Insert .= "VALUES ('$name', '$image_id', '$customer_id', '$PHPSESSID')";

    ...and I'm using the SET Field = '$Value' in the Update Querys like this:

    $UpdateQuery = "UPDATE produkt "; $UpdateQuery .= "SET produkt_name = '$produkt_name', "; $UpdateQuery .= "size = '$size', kategorie = '$kategorie' "; $UpdateQuery .= "WHERE produkt_key = '$produkt_key'";

    hope it helps someone out ;o)

    Schura

    ----- Original Message ----- From: "Tim Stoop" <timcidev.nl> To: <php-generallists.php.net> Sent: Wednesday, August 14, 2002 11:00 PM Subject: [PHP] Re: mysql statement (still a semi newbie)

    > Alexander Ross wrote: > > > That first column is an auto_incrementing column so i don't want any data > > INSERT INTO cast VALUES(DEFAULT, 'Rick', 'Blaine', 'Humphrey', 'Bogart', > > 'male'); > > I think you need to use NULL instead of DEFAULT... I'm not 100% sure. Just > try it :) > > -- > Kind regards, > Tim > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Is it possible that someone from outside can read the session stored on my webserver for getting unencrypted password and usernames?

    Schura

    attached mail follows:


    If a person 'somehow' gains read access to the directory where the sessions are stored on your server, then yes it is possible for them to get the session id.

    Ilia

    On August 14, 2002 06:41 pm, Sascha Braun wrote: > Is it possible that someone from outside can read the session stored > on my webserver for getting unencrypted password and usernames? > > Schura

    attached mail follows:


    So, if somebody gets an ftp account somehow, he will be able to get session vars via a system() command?

    ----- Original Message ----- From: "Ilia A." <iliaprohost.org> To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" <php-generallists.php.net> Sent: Thursday, August 15, 2002 1:27 AM Subject: Re: [PHP] SESSION Security

    > If a person 'somehow' gains read access to the directory where the sessions > are stored on your server, then yes it is possible for them to get the > session id. > > Ilia > > On August 14, 2002 06:41 pm, Sascha Braun wrote: > > Is it possible that someone from outside can read the session stored > > on my webserver for getting unencrypted password and usernames? > > > > Schura > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On August 14, 2002 07:03 pm, Sascha Braun wrote: > So, if somebody gets an ftp account somehow, he will be able to get session > vars via a system() command?

    If their FTP client allows them to go into the directory where session ids are stored, then that user will be able to see current session ids. On most servers FTP clients are setup to only allow user access to their own home directory.

    Ilia

    > > > ----- Original Message ----- > From: "Ilia A." <iliaprohost.org> > To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" > <php-generallists.php.net> > Sent: Thursday, August 15, 2002 1:27 AM > Subject: Re: [PHP] SESSION Security > > > If a person 'somehow' gains read access to the directory where the > > sessions > > > are stored on your server, then yes it is possible for them to get the > > session id. > > > > Ilia > > > > On August 14, 2002 06:41 pm, Sascha Braun wrote: > > > Is it possible that someone from outside can read the session stored > > > on my webserver for getting unencrypted password and usernames? > > > > > > Schura > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    So, the system() command allows a user only to start services in his own home direktory?

    ----- Original Message ----- From: "Ilia A." <iliaprohost.org> To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" <php-generallists.php.net> Sent: Thursday, August 15, 2002 1:36 AM Subject: Re: [PHP] SESSION Security

    > On August 14, 2002 07:03 pm, Sascha Braun wrote: > > So, if somebody gets an ftp account somehow, he will be able to get session > > vars via a system() command? > > If their FTP client allows them to go into the directory where session ids are > stored, then that user will be able to see current session ids. On most > servers FTP clients are setup to only allow user access to their own home > directory. > > Ilia > > > > > > > ----- Original Message ----- > > From: "Ilia A." <iliaprohost.org> > > To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" > > <php-generallists.php.net> > > Sent: Thursday, August 15, 2002 1:27 AM > > Subject: Re: [PHP] SESSION Security > > > > > If a person 'somehow' gains read access to the directory where the > > > > sessions > > > > > are stored on your server, then yes it is possible for them to get the > > > session id. > > > > > > Ilia > > > > > > On August 14, 2002 06:41 pm, Sascha Braun wrote: > > > > Is it possible that someone from outside can read the session stored > > > > on my webserver for getting unencrypted password and usernames? > > > > > > > > Schura > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On August 14, 2002 07:12 pm, Sascha Braun wrote: > So, the system() command allows a user only to start services in his own > home direktory? >

    Uhm... I am a little confused, how does system() command relate to FTP access?

    Ilia

    > > > > ----- Original Message ----- > From: "Ilia A." <iliaprohost.org> > To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" > <php-generallists.php.net> > Sent: Thursday, August 15, 2002 1:36 AM > Subject: Re: [PHP] SESSION Security > > > On August 14, 2002 07:03 pm, Sascha Braun wrote: > > > So, if somebody gets an ftp account somehow, he will be able to get > > session > > > > vars via a system() command? > > > > If their FTP client allows them to go into the directory where session > > ids > > are > > > stored, then that user will be able to see current session ids. On most > > servers FTP clients are setup to only allow user access to their own home > > directory. > > > > Ilia > > > > > ----- Original Message ----- > > > From: "Ilia A." <iliaprohost.org> > > > To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" > > > <php-generallists.php.net> > > > Sent: Thursday, August 15, 2002 1:27 AM > > > Subject: Re: [PHP] SESSION Security > > > > > > > If a person 'somehow' gains read access to the directory where the > > > > > > sessions > > > > > > > are stored on your server, then yes it is possible for them to get > > > > the session id. > > > > > > > > Ilia > > > > > > > > On August 14, 2002 06:41 pm, Sascha Braun wrote: > > > > > Is it possible that someone from outside can read the session > > > > > stored on my webserver for getting unencrypted password and > > > > > usernames? > > > > > > > > > > Schura > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Op donderdag 15 augustus 2002 01:03, schreef u: > So, if somebody gets an ftp account somehow, he will be able to get session > vars via a system() command?

    You holds him in its own dir by the chroot setting of you ftpserver. > via a system(); you mean if they upload a php file? prevent that with your php.ini settings:

    open_basedir string: Limit the files that can be opened by PHP to the specified directory-tree. or safe_mode boolean Whether to enable PHP's safe mode. Read the Security and Safe Mode chapters for more information.

    if you allow cgi, you must built the same sort restrictions for that too.

    >

    attached mail follows:


    Yeah,

    I guess I meant that! - The Attacker just needs to upload a nice PHP Script wich is able to spy all serverpathes, maybe via phpinfo() and then open each file stored in the session tmp path via dir_list() funktion, hope this was the right funktion, but there are some, with php it's easy to browse the hole server i think, via the file funktions.

    Puh, I'm sweating to much...

    hard to write.

    Schura

    > ----- Original Message ----- > From: "Bas Jobsen" <basstartpunt.cc> > To: "Sascha Braun" <saschabraungmx.de>; "PHP Mailingliste" > <php-generallists.php.net>; <iliaprohost.org> > Sent: Thursday, August 15, 2002 12:30 AM > Subject: Re: [PHP] SESSION Security > > > > > > Op donderdag 15 augustus 2002 01:03, schreef u: > > > So, if somebody gets an ftp account somehow, he will be able to get > session > > > vars via a system() command? > > > > You holds him in its own dir by the chroot setting of you ftpserver. > > > via a system(); > > you mean if they upload a php file? > > prevent that with your php.ini settings: > > > > open_basedir string: Limit the files that can be opened by PHP to the > > specified directory-tree. > > or > > safe_mode boolean > > Whether to enable PHP's safe mode. Read the Security and Safe Mode > chapters > > for more information. > > > > if you allow cgi, you must built the same sort restrictions for that too. > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I did all things that you talked. I put below in my httpd.conf those lines. Thanks

    AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps

    Action application/x-httpd-php403 "/ver403/php" ScriptAlias /ver403/ "/usr/local/php/ver403/bin"

    AddType application/x-httpd-php403 .php3 AddType application/x-httpd-php .php

    Not Found The requested URL /ver403/php/index.php3 was not found on this server.

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

    ----
    

    Apache/1.3.26 Server at

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020806052945.GA14628panix.com... > Hi Breno: > > On Tue, Aug 06, 2002 at 02:20:19AM -0300, Breno Cardoso Perucchi wrote: > > Exists some way of to have 2 different versions in the same system ? > > I am trying to running the version 4.2.2 and 4.0.3 . > > Sure. Install them in separate directories. In this example, > /usr/local/bin/php has two sub directories, ver403 and ver422. > > Then, in httpd.conf, put: > > Action application/x-httpd-php403 "/php403/php.exe" > ScriptAlias /php403/ "/usr/local/bin/php/ver403" > > Action application/x-httpd-php "/php422/php.exe" > ScriptAlias /php422/ "/usr/local/bin/php/ver422" > > > Now, in your various directories, use .htaccess files to control which > version is to be called: > > AddType application/x-httpd-php403 .html > AddType application/x-httpd-php .php > > Modify everything above to suit your real needs. > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    Mh,

    right yet I have another problem. I want to select a username an a = password from a database. The Values for tghe select are stored in a = session variable.

    And my problem is, that when I run the Query there is no difference in = the mysql_num_rows($Result)

    it both time (When the User is in the Database, or the Username is = emtpy) 0.

    How am i able to ckeck the value to do some branching?

    Schura

    attached mail follows:


    In your database design you need the following every username/pass comb is unique. so a query like ....... WHERE username='$testvalue' AND password='$testvalue2' Have to give you one row for a good user/passcombination ALWAYS. And 0 rows for a wrong combination. If NOT your design doesn;t fit your needs!!

    Op donderdag 15 augustus 2002 01:18, schreef Sascha Braun: > Mh, > > right yet I have another problem. I want to select a username an a = > password from a database. The Values for tghe select are stored in a = > session variable. > > And my problem is, that when I run the Query there is no difference in = > the mysql_num_rows($Result) > > it both time (When the User is in the Database, or the Username is = > emtpy) 0. > > How am i able to ckeck the value to do some branching? > > Schura

    attached mail follows:


    Hi,

    Can anybody tell me why I get a "Parse error: parse error, unexpected '}' in /usr/local/apache/htdocs/logbook/Functions.inc on line 17 " for the following code:

    Appreciate any help.

    Using PHP 4.2.2 and Apache 1.3.26 on Redhat 7.3 x86

    (The "--------" stuff is not part of the code. index.php and Functions.inc exists in the same dir)

    ---------------------------- File: index.php ---------------------------- <? require('./Functions.inc');

    HtmlHeader();

    # Do things

    HtmlFooter();

    ?>

    ---------------------------- End of file ----------------------------

    ---------------------------- File: Functions.inc ---------------------------- function HtmlHeader() { ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>LogBook</title> </head>

    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#000080" alink="#FF0000">

    <?

    return; } ----------- This is line 17, the error point......

    function HtmlFooter() { ?> </body> </html>

    <?

    return; }

    ---------------------------- End of file ----------------------------

    Thanks Mike.

    attached mail follows:


    Maybe something wrong with the return?

    I was thinking about return "What?". (U understand me?)

    in Javascript a simple return does nothing. maybe you can just leave the return out of your script.

    ----- Original Message ----- From: "Mike Eales" <mealesims.telstra.com.au> To: <php-generallists.php.net> Sent: Wednesday, August 14, 2002 10:44 AM Subject: [PHP] Include/require and the HTML Code

    > Hi, > > Can anybody tell me why I get a "Parse error: parse error, > unexpected '}' in /usr/local/apache/htdocs/logbook/Functions.inc on line > 17 " > for the following code: > > Appreciate any help. > > Using PHP 4.2.2 and Apache 1.3.26 on Redhat 7.3 x86 > > (The "--------" stuff is not part of the code. index.php and > Functions.inc exists in the same dir) > > ---------------------------- File: index.php ---------------------------- > <? > require('./Functions.inc'); > > HtmlHeader(); > > # Do things > > HtmlFooter(); > > ?> > > ---------------------------- End of file ---------------------------- > > > ---------------------------- File: Functions.inc > ---------------------------- > function HtmlHeader() > { > ?> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> > <html><head> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > <title>LogBook</title> > </head> > > <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" > vlink="#000080" alink="#FF0000"> > > <? > > return; > } ----------- This is line 17, the error point...... > > > function HtmlFooter() > { > ?> > </body> </html> > > <? > > return; > } > > ---------------------------- End of file ---------------------------- > > > Thanks > Mike. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > Can anybody tell me why I get a "Parse error: parse error, > unexpected '}' in /usr/local/apache/htdocs/logbook/Functions.inc on line

    begin and end your include files with <? and ?> <? function HtmlHeader() { ?> bllaalla

    <? return; } ?>

    attached mail follows:


    Mike,

    i had no problems with this..

    <!-- index.php --> <? include('Functions.inc');

    HtmlHeader(); ?> # Do things <? HtmlFooter();

    ?>

    <!-- Functions.inc--> <? function HtmlHeader() { ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>LogBook</title> </head>

    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#000080" alink="#FF0000">

    <?

    return; } ?> <? function HtmlFooter() { ?> </body> </html>

    <?

    return; }

    cheers Peter

    attached mail follows:


    This did indeed fix the problem, thanks for the advise.

    A question though: Why is this necessary, the include/require is called from index.php while in "PHP mode" ? The functions work fine as if I remain in "PHP mode" within the functions. It is only when I go in and out of "HTML mode" within the function that this problem arises.

    Thanks again Mike.

    -----Original Message----- From: Bas Jobsen [mailto:basstartpunt.cc] Sent: Thursday, 15 August 2002 6:52 AM To: Mike Eales; php-generallists.php.net Subject: Re: [PHP] Include/require and the HTML Code

    > Can anybody tell me why I get a "Parse error: parse error, > unexpected '}' in /usr/local/apache/htdocs/logbook/Functions.inc on line

    begin and end your include files with <? and ?> <? function HtmlHeader() { ?> bllaalla

    <? return; } ?>

    attached mail follows:


    I'm not sure about others, but I am glad this behavior is like this.

    It is very nice for modules to "stand on their own" so to speak, so that you don't have to worry about what context they are used in. If the file you are including is plain HTML, would you want it to be parsed as if it were PHP? No, but if you had to include PHP in it (the closing ?> for example), it wouldn't be a plain HTML file anymore. You might have other applications in different languages using the same module that would now have to interpret PHP.

    On the other hand, what about a PHP script that you want to include. Wouldn't it be annoying to get a parse error when you include it because of the double opening tags?

    Those are just a few thoughts.

    Happy hacking.

    Chris

    Michael Eales wrote:

    >This did indeed fix the problem, thanks for the advise. > >A question though: >Why is this necessary, the include/require is called from index.php while in >"PHP mode" ? >The functions work fine as if I remain in "PHP mode" within the functions. >It is only when I go in and out of "HTML mode" within the function that this >problem arises. >

    attached mail follows:


    This is my query with some dummy loginformations:

    SELECT * FROM benutzer_db where Benutzername = 'Herbert' AND Passwort = 'hals'

    and this is the code i use for the database transaction:

    $Query = "SELECT * FROM benutzer_db where Benutzername = '".$SESSION['nickname']."' "; $Query .= "AND Passwort = '".$SESSION['password']."'"; $Result = mysql_query($Query, $connect); if(mysql_num_rows($Result)>'0') { while(...)... } else { ... }

    But the branching don't work?

    attached mail follows:


    On Thursday 15 August 2002 07:35, Sascha Braun wrote: > This is my query with some dummy loginformations: > > SELECT * FROM benutzer_db where Benutzername = 'Herbert' AND Passwort = > 'hals' > > and this is the code i use for the database transaction: > > $Query = "SELECT * FROM benutzer_db where Benutzername = > '".$SESSION['nickname']."' "; $Query .= "AND Passwort = > '".$SESSION['password']."'"; > $Result = mysql_query($Query, $connect); > if(mysql_num_rows($Result)>'0') {

    Try:

    if (mysql_num_rows($Result) > 0) {

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

    /* I tell them to turn to the study of mathematics, for it is only there that they might escape the lusts of the flesh. -- Thomas Mann, "The Magic Mountain" */

    attached mail follows:


    I have a PHP script that queries a MySQL database, retrieves email addresses, and sends an email to all members of a website.

    The problem is this: the PHP script times out after sending about 5,000 mailings, and I have to restart it 10 times in order to mail the entire list!

    This is an ongoing problem I have had for almost a year now. I have tried MANY things to make this work better, which I have outlined below:

    1) Upped the Max Excecution Time in PHP from 30 to a ridiculously high 300 (is this a security issue?) 2) Upped the Max amount of memory a PHP script can have from 8mb to 16mb 3) Running sendmail in "deferred" mode instead of "background" mode, and processing the mail queue ever 5 minutes instead of the default 1 hour.

    Results:

    1) The script runs much longer, but still times out. (One thing I want to make clear, even when max execution time is 30 seconds, the script does not stop after 30 seconds, maybe it just means 30 seconds of inactivity?)

    2) I have no idea if this is making a difference or not, does anyone know?

    3) Since this means mailings get sent right into the queue, and not sent right away, the HTTP interface runs 10 times faster. This would be a GREAT solution for me, but it has one drawback: when a user signs up for the site, their confirmation email must be sent immediately...it cannot sit in the queue until the next time the queue is processed (at most 5 minutes).

    So, I figure I have two options. Leave sendmail as set to deferred, process the queue every so often, but find a way to have the confirmation emails sent immediately. This is really the option I want to do. The sendmail version I have (latest version), has 4 separate mail queues. Does anyone know how to use PHP to stipulate that some mailings get sent immediately, while others are just queued until the next queue run?

    Otherwise, I have to set the delivery method of sendmail back to background, have mailings take 10 times as long from the HTTP interface, and try and find some way from keeping the script from timing out and having to restart the mailing.

    ANY HELP is greatly appreciated!

    BTW, the server is loaded, dual proc, gig of ram, etc...more hardware has not helped the problem.

    __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com

    attached mail follows:


    Ok, I'm not positive I'm right here, but have you thought about the browser timing out - and not PHP? You may try doing an echo(" "); and a flush(); every 100 e-mails or so - and reset max exec time to a reasonable duration while you're at it - that *might* fix it. Please note that executing set_time_limit() also resets the timer, so set_time_limit(20) every 100 e-mails should be more than enough.

    HTH

    Bogdan

    Daren Cotter wrote: > I have a PHP script that queries a MySQL database, > retrieves email addresses, and sends an email to all > members of a website. > > The problem is this: the PHP script times out after > sending about 5,000 mailings, and I have to restart it > 10 times in order to mail the entire list! > > This is an ongoing problem I have had for almost a > year now. I have tried MANY things to make this work > better, which I have outlined below: > > 1) Upped the Max Excecution Time in PHP from 30 to a > ridiculously high 300 (is this a security issue?) > 2) Upped the Max amount of memory a PHP script can > have from 8mb to 16mb > 3) Running sendmail in "deferred" mode instead of > "background" mode, and processing the mail queue ever > 5 minutes instead of the default 1 hour. > > Results: > > 1) The script runs much longer, but still times out. > (One thing I want to make clear, even when max > execution time is 30 seconds, the script does not stop > after 30 seconds, maybe it just means 30 seconds of > inactivity?) > > 2) I have no idea if this is making a difference or > not, does anyone know? > > 3) Since this means mailings get sent right into the > queue, and not sent right away, the HTTP interface > runs 10 times faster. This would be a GREAT solution > for me, but it has one drawback: when a user signs up > for the site, their confirmation email must be sent > immediately...it cannot sit in the queue until the > next time the queue is processed (at most 5 minutes). > > So, I figure I have two options. Leave sendmail as set > to deferred, process the queue every so often, but > find a way to have the confirmation emails sent > immediately. This is really the option I want to do. > The sendmail version I have (latest version), has 4 > separate mail queues. Does anyone know how to use PHP > to stipulate that some mailings get sent immediately, > while others are just queued until the next queue run? > > Otherwise, I have to set the delivery method of > sendmail back to background, have mailings take 10 > times as long from the HTTP interface, and try and > find some way from keeping the script from timing out > and having to restart the mailing. > > ANY HELP is greatly appreciated! > > BTW, the server is loaded, dual proc, gig of ram, > etc...more hardware has not helped the problem. > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com

    attached mail follows:


    Hi, I've solved this problem, if u have cgi version of PHP compiled on your box I can offer simple solution: All e-mails are completely stored into database (MySQL) and are sent using little daemon, also written in PHP, emails can be automaticaly generated or written through web interface, can have attachements or can be html-formated. So your script shouldn't send them directly, but only store them into db - what's much more faster.

    Daren Cotter wrote: > I have a PHP script that queries a MySQL database, > retrieves email addresses, and sends an email to all > members of a website. > > The problem is this: the PHP script times out after > sending about 5,000 mailings, and I have to restart it > 10 times in order to mail the entire list! > > This is an ongoing problem I have had for almost a > year now. I have tried MANY things to make this work > better, which I have outlined below: > > 1) Upped the Max Excecution Time in PHP from 30 to a > ridiculously high 300 (is this a security issue?) > 2) Upped the Max amount of memory a PHP script can > have from 8mb to 16mb > 3) Running sendmail in "deferred" mode instead of > "background" mode, and processing the mail queue ever > 5 minutes instead of the default 1 hour. > > Results: > > 1) The script runs much longer, but still times out. > (One thing I want to make clear, even when max > execution time is 30 seconds, the script does not stop > after 30 seconds, maybe it just means 30 seconds of > inactivity?) > > 2) I have no idea if this is making a difference or > not, does anyone know? > > 3) Since this means mailings get sent right into the > queue, and not sent right away, the HTTP interface > runs 10 times faster. This would be a GREAT solution > for me, but it has one drawback: when a user signs up > for the site, their confirmation email must be sent > immediately...it cannot sit in the queue until the > next time the queue is processed (at most 5 minutes). > > So, I figure I have two options. Leave sendmail as set > to deferred, process the queue every so often, but > find a way to have the confirmation emails sent > immediately. This is really the option I want to do. > The sendmail version I have (latest version), has 4 > separate mail queues. Does anyone know how to use PHP > to stipulate that some mailings get sent immediately, > while others are just queued until the next queue run? > > Otherwise, I have to set the delivery method of > sendmail back to background, have mailings take 10 > times as long from the HTTP interface, and try and > find some way from keeping the script from timing out > and having to restart the mailing. > > ANY HELP is greatly appreciated! > > BTW, the server is loaded, dual proc, gig of ram, > etc...more hardware has not helped the problem. > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com >

    -- 
    --
    Mirek Novak
    CMS Development dept.
    

    Anima Publishers, s.r.o. Prilucka 360, Zlin 760 01 tel/fax: 067/721 91 32 jabber:mirekjabber.cz ICQ:119499448 GSM:+420603807838

    AUTO.CZ http://www.auto.cz

    NEWS.AUTO.CZ http://news.auto.cz

    FORMULE1.CZ http://www.formule1.cz

    attached mail follows:


    Hello,

    On 08/14/2002 08:54 PM, Daren Cotter wrote: > I have a PHP script that queries a MySQL database, > retrieves email addresses, and sends an email to all > members of a website. > > The problem is this: the PHP script times out after > sending about 5,000 mailings, and I have to restart it > 10 times in order to mail the entire list! > > This is an ongoing problem I have had for almost a > year now. I have tried MANY things to make this work > better, which I have outlined below: > > 1) Upped the Max Excecution Time in PHP from 30 to a > ridiculously high 300 (is this a security issue?) > 2) Upped the Max amount of memory a PHP script can > have from 8mb to 16mb > 3) Running sendmail in "deferred" mode instead of > "background" mode, and processing the mail queue ever > 5 minutes instead of the default 1 hour.

    Your problem is that your solution does not scale well. A much more scalable solution is to put all recipients in BCC: and just send one message. It just takes a few seconds to run that.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Actually, the browser outputs every email sent, and runs the following commands every 3,000 mailings:

    print "pausing...<br><br>"; flush(); sleep(15); print "resuming<br><br>"; flush(); // continue

    so it's not the browser timing out

    --- Bogdan Stancescu <mgvcanad.ro> wrote: > Ok, I'm not positive I'm right here, but have you > thought about the > browser timing out - and not PHP? You may try doing > an echo(" "); and a > flush(); every 100 e-mails or so - and reset max > exec time to a > reasonable duration while you're at it - that > *might* fix it. Please > note that executing set_time_limit() also resets the > timer, so > set_time_limit(20) every 100 e-mails should be more > than enough. > > HTH > > Bogdan > > Daren Cotter wrote: > > I have a PHP script that queries a MySQL database, > > retrieves email addresses, and sends an email to > all > > members of a website. > > > > The problem is this: the PHP script times out > after > > sending about 5,000 mailings, and I have to > restart it > > 10 times in order to mail the entire list! > > > > This is an ongoing problem I have had for almost a > > year now. I have tried MANY things to make this > work > > better, which I have outlined below: > > > > 1) Upped the Max Excecution Time in PHP from 30 to > a > > ridiculously high 300 (is this a security issue?) > > 2) Upped the Max amount of memory a PHP script can > > have from 8mb to 16mb > > 3) Running sendmail in "deferred" mode instead of > > "background" mode, and processing the mail queue > ever > > 5 minutes instead of the default 1 hour. > > > > Results: > > > > 1) The script runs much longer, but still times > out. > > (One thing I want to make clear, even when max > > execution time is 30 seconds, the script does not > stop > > after 30 seconds, maybe it just means 30 seconds > of > > inactivity?) > > > > 2) I have no idea if this is making a difference > or > > not, does anyone know? > > > > 3) Since this means mailings get sent right into > the > > queue, and not sent right away, the HTTP interface > > runs 10 times faster. This would be a GREAT > solution > > for me, but it has one drawback: when a user signs > up > > for the site, their confirmation email must be > sent > > immediately...it cannot sit in the queue until the > > next time the queue is processed (at most 5 > minutes). > > > > So, I figure I have two options. Leave sendmail as > set > > to deferred, process the queue every so often, but > > find a way to have the confirmation emails sent > > immediately. This is really the option I want to > do. > > The sendmail version I have (latest version), has > 4 > > separate mail queues. Does anyone know how to use > PHP > > to stipulate that some mailings get sent > immediately, > > while others are just queued until the next queue > run? > > > > Otherwise, I have to set the delivery method of > > sendmail back to background, have mailings take 10 > > times as long from the HTTP interface, and try and > > find some way from keeping the script from timing > out > > and having to restart the mailing. > > > > ANY HELP is greatly appreciated! > > > > BTW, the server is loaded, dual proc, gig of ram, > > etc...more hardware has not helped the problem. > > > > __________________________________________________ > > Do You Yahoo!? > > HotJobs - Search Thousands of New Jobs > > http://www.hotjobs.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com

    attached mail follows:


    I understand this solution, but are you telling me that companies that send millions of emails per day simply use the BCC line in the email? I can't imagine this is the "proper" way of doing things...I do, after all, need to send 50,000 emails at a time.

    Can anyone else verify this?

    --- Manuel Lemos <mlemosacm.org> wrote: > Hello, > > On 08/14/2002 08:54 PM, Daren Cotter wrote: > > I have a PHP script that queries a MySQL database, > > retrieves email addresses, and sends an email to > all > > members of a website. > > > > The problem is this: the PHP script times out > after > > sending about 5,000 mailings, and I have to > restart it > > 10 times in order to mail the entire list! > > > > This is an ongoing problem I have had for almost a > > year now. I have tried MANY things to make this > work > > better, which I have outlined below: > > > > 1) Upped the Max Excecution Time in PHP from 30 to > a > > ridiculously high 300 (is this a security issue?) > > 2) Upped the Max amount of memory a PHP script can > > have from 8mb to 16mb > > 3) Running sendmail in "deferred" mode instead of > > "background" mode, and processing the mail queue > ever > > 5 minutes instead of the default 1 hour. > > Your problem is that your solution does not scale > well. A much more > scalable solution is to put all recipients in BCC: > and just send one > message. It just takes a few seconds to run that. > > > -- > > Regards, > Manuel Lemos > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com

    attached mail follows:


    on 15/08/02 5:17 PM, Daren Cotter (daren_cotteryahoo.com) wrote:

    > I understand this solution, but are you telling me > that companies that send millions of emails per day > simply use the BCC line in the email? I can't imagine > this is the "proper" way of doing things...I do, after > all, need to send 50,000 emails at a time. > > Can anyone else verify this?

    There are two schools of thought. One is the Bcc approach where nothing is personalised. The second is the sending of personalised emails one at a time.

    This approach has given me heaps of grief, and I'm thinking about returning to the Bcc approach, but some ideas include:

    a) running the script as a command line script, hence ruling out the browser problems

    b) running the script via a browser in batches of 100 or 'n', with a 5sec-5min interval between, set-up with meta refresh tags... this is ultimately slower, but has more guarantees.

    c) running the script using a dedicated mailing list application like ezmlm, taking php out of the equation completely.

    d) talking to a dedicated mailing-list company, like sparklist.com -- it's not effective for small lists, but for 50,000 people once a month, you get charged the base price of US$50/month. For once a week, it's around $200.

    Cheers,

    Justin

    attached mail follows:


    Hello,

    In the version 4.0.3 a library that made construction gif existed. You were able to to manipulate or to create a gif. In them version superiors that Lib stopped doing part of PHP.

    Somebody could tell me that could do to solve my problem with the version of most recent Php.

    thanks

    Breno Cardoso Perucchi brenoomegatec.net

    attached mail follows:


    "Per" <per_hekanssonhermes.ics.lu.se> wrote in message news:3D5A31FE.8070406hermes.ics.lu.se... > Daniel Canil wrote: > > I have jsut recently installed a php development kit on my windows platform. > > Im interested in using the session functions but I am recieving this error > > when I use session_start(): > > > > Warning: open(/tmp\sess_540ded508edf231c47fe85bd970f936a, O_RDWR) failed: m > > (2) in d:\phpdev\www\phpdev4\samples\samp13.htm on line 4 > > Run a phpinfo() to see what session.save_path you have registred. It > seems like php tries to open from the default directory /tmp. > Maybe you have not restarted the web server after altering the php.ini. > > /Per >

    Hi,

    Yeh I did restart apache every time i changed the php.ini file, and it still has session_save_path = /tmp.

    I check through both php.ini and httpd.cong file for the string tmp but there where no matches.

    I also checked there error log and there wasn't any help in that.

    ???

    Dan

    attached mail follows:


    In article <20020815001712.42350.qmailpb1.pair.com>, caniljustinternet.com.au says... > "Per" <per_hekanssonhermes.ics.lu.se> wrote in message > news:3D5A31FE.8070406hermes.ics.lu.se... > > Daniel Canil wrote: > > > I have jsut recently installed a php development kit on my windows > platform. > > > Im interested in using the session functions but I am recieving this > error > > > when I use session_start(): > > > > > > Warning: open(/tmp\sess_540ded508edf231c47fe85bd970f936a, O_RDWR) > failed: m > > > (2) in d:\phpdev\www\phpdev4\samples\samp13.htm on line 4 > > > > Run a phpinfo() to see what session.save_path you have registred. It > > seems like php tries to open from the default directory /tmp. > > Maybe you have not restarted the web server after altering the php.ini. > > > > /Per > > > > Hi, > > Yeh I did restart apache every time i changed the php.ini file, and it still > has session_save_path = /tmp. > > I check through both php.ini and httpd.cong file for the string tmp but > there where no matches. > > I also checked there error log and there wasn't any help in that. > > ???

    It's possible you have more than one php.ini and the one you are editing is not the one php is reading? Again, look in phpinfo() for where php expects to find php.ini.

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    --- Stig Venaas <venaasnvg.ntnu.no> wrote: > > But you're not doing what I wrote...

    :) or else i won't be asking hehehe

    > > The third parameter should be the new rdn (which is the same as the old), > and the fourth should be new parent. So it should look like this: > > $r=ldap_rename($ds, > "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", > "uid=roger", > "ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", TRUE); > > Stig

    Great, it works. Stig, you saved my day. I owe you my eternal gratitude.

    --
    roger
    

    __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com

    attached mail follows:


    The server I'm on has php compiled with curl and with ssl, so that's not an issue. I cannot seem to connect to authorize.net, however, using https://. If I use http://, it works fine. Below is the code I'm using. I know someone out there has tackled this problem before and I'm hoping you can tell me where my code is off, or share what you do to make it work. Any help will be appreciated.

    $ch = curl_init ("https://secure.authorize.net/gateway/transact.dll"); # Initialize the session curl_setopt($ch, CURLOPT_HEADER, 1); # Make the headers part of the output curl_setopt($ch, CURLOPT_FILE, $return_data); # $return_data is a file pointer curl_setopt($ch, CURLOPT_STDERR, $error); # $error is a file pointer $post_fields = "x_Login=mylogon&x_ADC_URL=False&x_ADC_Delim_Data=True&x_Amount=$grand_total &x_Card_Num=$cc_num&x_Exp_Date=$month/$year"; curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_fields);

    $result = curl_exec ($ch); curl_close ($ch);

    It's not that I'm getting goofy data back - I just get nothing at all back. Nada. No connection, in other words. Do I need to specify the path to my SSL Cert with CURLOPT_SSLCERT?

    Mike

    attached mail follows:


    I bet that your copy of CURL was built without SSL support, despite the fact that PHP has SSL compiled in.

    To test this, see if you have the "curl" shell command installed & try

    curl https://secure.authorize.net/gateway/transact.dll

    It will probably say something like

    curl built without SSL support

    If this is what you get, let me know & we'll take it from there.

    > -----Original Message----- > From: Mike Mannakee [mailto:mikebasementideas.com] > Sent: Wednesday, August 14, 2002 20:44 PM > To: php-generallists.php.net > Subject: [PHP] CURLing to authorize.net > > > The server I'm on has php compiled with curl and with ssl, so > that's not an > issue. I cannot seem to connect to authorize.net, however, using > https://. > If I use http://, it works fine. Below is the code I'm using. I know > someone out there has tackled this problem before and I'm hoping you can > tell me where my code is off, or share what you do to make it work. Any > help will be appreciated. > > $ch = curl_init > ("https://secure.authorize.net/gateway/transact.dll"); # > Initialize the session > curl_setopt($ch, CURLOPT_HEADER, 1); > # > Make the headers part of the output > curl_setopt($ch, CURLOPT_FILE, $return_data); # > $return_data is a file pointer > curl_setopt($ch, CURLOPT_STDERR, $error); # $error > is a file pointer > $post_fields = > "x_Login=mylogon&x_ADC_URL=False&x_ADC_Delim_Data=True&x_Amount=$g > rand_total > &x_Card_Num=$cc_num&x_Exp_Date=$month/$year"; > curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_fields); > > $result = curl_exec ($ch); > curl_close ($ch); > > It's not that I'm getting goofy data back - I just get nothing at > all back. > Nada. No connection, in other words. Do I need to specify the path to my > SSL Cert with CURLOPT_SSLCERT? > > Mike > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I've got a fully functioning socket server that I use for monitoring written in PHP... email if you want the full script, too big to waste peoples time with here.

    ---
    /* Neunzig neun Möglichkeiten zu sterben
    

    // Ich bin nur ein anderer Zahn in der Maschine. */

    On Wed, 14 Aug 2002 15:09:09 Gustavo Almeida wrote: > > >I would like to know, what I have to do to make my application handle >multiple connections? > >My current application only handle one user per time. > >Sorry about my English, but i live in Brazil, if anybody could help me >answer me gustavomedsys.com.br . > >Thanky you > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >

    __________________________________________________________ Outgrown your current e-mail service? Get a 25MB Inbox, POP3 Access, No Ads and No Taglines with LYCOS MAIL PLUS. http://login.mail.lycos.com/brandPage.shtml?pageId=plus

    attached mail follows:


    Hi news,

    Is there any similarity "global.asa" in ASP at PHP ?

    thank's Hotma MS

    attached mail follows:


    I'm looking for a way to have a list of the users logged in my site (with a session_start() ). Is it possible to do it with the php4 api?

    thanks Mattia

    attached mail follows:


    Hi!

    There are several ways. You could use a database or a text file. If your server comes with dba support, I'd try that.

    Manual reference http://www.php.net/manual/en/ref.dba.php

    /lasso (lassolassoweb.nu)

    Mattia wrote: > I'm looking for a way to have a list of the users logged in my site (with a > session_start() ). Is it possible to do it with the php4 api? > > thanks > Mattia > >

    attached mail follows:


    # START CODE SNIPPET ... COMMENTS BELOW (and yes I am not a db guru by anymeans, might be easier ways to do this)

    <?php session_start(); $tsid=session_id(); echo $tsig; # <--------debug $date=date("ymdHi"); $connect=mysql_pconnect('localhost', 'user', 'pass'); mysql_select_db('db', $connect); $queryexe=mysql_query("SELECT user, ip, dtg FROM tmp WHERE sid='$tsid'"); $row=mysql_fetch_array($queryexe); extract($row); $id=''; $status=''; mysql_select_db('a_db', $connect); $queryexe=mysql_query("SELECT site, camp FROM users WHERE user='$user'"); $row=mysql_fetch_array($queryexe); extract($row); mysql_select_db('cbs_tech', $connect); extract($_GET); extract($_POST); switch ($site){ case 'cbs': switch ($_SERVER['REQUEST_METHOD']){ case 'POST': switch ($user){ case 'allenr': break; default: switch ($status){ case 1: $queryexe=mysql_query("SELECT event FROM log WHERE id=$id"); $row=mysql_fetch_array($queryexe); extract($row); $queryexe=mysql_query("UPDATE log SET event='$event' WHERE id=$id"); header('Location: https://example.org'); die; } break;

    Now this is where I have issues. The header ('Location: https://example.org') works as it is suppose to BUT!!! a new SID is issued. Thought the SID stayed w/ the browser until it was closed. When I loop back through I of course can not find the previous SID as a new one was created. Is it because I am going POST-->GET (seems to work with GET-->GET or GET-->POST)

    Any ideas why a new one is being created? (and don't say start_session() ... this is a long script and the ONLY place it has issues is when I am processing a $POST (works fine for all the $GETS))

    Thank in advance,

    -Peter

    ################################## Peter Thoenen - Systems Programmer Commercial Communications Camp Bondsteel, Kosovo ##################################

    attached mail follows:


    I'm having the same problem from time to time as well. Just straight up out of the blue it gives you a new SESSION id.

    --I'm interested to know what version of PHP you are using and what web server and its version too.

    Thanks Dan

    > -----Original Message----- > From: Thoenen, Peter Mr. EPS > [mailto:Peter.Thoenenbondsteel2.areur.army.mil] > Sent: Wednesday, August 14, 2002 7:34 PM > To: php-generallists.php.net > Subject: [PHP] Strange session id problem - code is issuing a new one > randomly > > > > > # START CODE SNIPPET ... COMMENTS BELOW (and yes I am not a db guru by > anymeans, might be easier ways to do this) > > <?php > session_start(); > $tsid=session_id(); > echo $tsig; # <--------debug > $date=date("ymdHi"); > $connect=mysql_pconnect('localhost', 'user', 'pass'); > mysql_select_db('db', $connect); > $queryexe=mysql_query("SELECT user, ip, dtg FROM tmp WHERE sid='$tsid'"); > $row=mysql_fetch_array($queryexe); > extract($row); > $id=''; > $status=''; > mysql_select_db('a_db', $connect); > $queryexe=mysql_query("SELECT site, camp FROM users WHERE user='$user'"); > $row=mysql_fetch_array($queryexe); > extract($row); > mysql_select_db('cbs_tech', $connect); > extract($_GET); > extract($_POST); > switch ($site){ > case 'cbs': > switch ($_SERVER['REQUEST_METHOD']){ > case 'POST': > switch ($user){ > case 'allenr': > break; > default: > switch ($status){ > case 1: > $queryexe=mysql_query("SELECT event FROM log WHERE > id=$id"); > $row=mysql_fetch_array($queryexe); > extract($row); > $queryexe=mysql_query("UPDATE log SET event='$event' WHERE > id=$id"); > header('Location: https://example.org'); > die; > } > break; > > Now this is where I have issues. The header ('Location: > https://example.org') works as it is suppose to BUT!!! a new SID is issued. > Thought the SID stayed w/ the browser until it was closed. When I loop back > through I of course can not find the previous SID as a new one was created. > Is it because I am going POST-->GET (seems to work with GET-->GET or > GET-->POST) > > Any ideas why a new one is being created? (and don't say start_session() ... > this is a long script and the ONLY place it has issues is when I am > processing a $POST (works fine for all the $GETS)) > > Thank in advance, > > -Peter > > > ################################## > Peter Thoenen - Systems Programmer > Commercial Communications > Camp Bondsteel, Kosovo > ################################## > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Dan Harrington wrote:

    >I'm having the same problem from time to time as well. >Just straight up out of the blue it gives you a new SESSION id. >

    As a general rule, the reason that you will find yourself with a new session ID is that the old session ID was not properly communicated back to the Web server. It would probably be worth your time to log the value of the session ID on each page request prior to you actually starting the session or registering any session variables and then log the value of it immediately afterward.

    Since, as you say, this is difficult to reproduce, try to give yourself as much information for the next time that you can reproduce it. The next time it happens, you should have a log that you can look to to see detailed information about the last HTTP transaction - log everything you can. If you have a way to log the HTTP transactions themselves, this would be the best. Even if you still can't solve your problem, you can paste your HTTP transaction into a message to this list, and people will be able to help you more.

    Hope that gives you some ideas. Happy hacking.

    Chris

    attached mail follows:


    Just compiled Apache 1.3.26 with latest php and discovered my form variables weren't getting thru to php scripts.

    Looked through archives and found ref to register_globals setting in php.ini. Only trouble is, I can't find php.ini on my server (except in the php source code folder).

    Where should it be?

    -- 
    Randy Perry
    sysTame
    Mac Consulting/Sales
    

    phn 772.589.6449 mobile email helpsystame.com

    attached mail follows:


    Run a script with phpinfo() in it, and it should tell u the path to the php.ini file for your installation. It will be different for everyone.

    For what it's worth, you should look to having register globals OFF in your scripts as a short term goal, using the $_POST, $_GET, $_COOKIE, $_SESSION etc etc global arrays.

    It will ensure safer, more reliable scripts.

    Justin French

    on 15/08/02 11:58 AM, Randall Perry (rgpsystame.com) wrote:

    > Just compiled Apache 1.3.26 with latest php and discovered my form variables > weren't getting thru to php scripts. > > Looked through archives and found ref to register_globals setting in > php.ini. Only trouble is, I can't find php.ini on my server (except in the > php source code folder). > > Where should it be?

    attached mail follows:


    is usually in /usr/local/lib

    > -----Original Message----- > From: Randall Perry [mailto:rgpsystame.com] > Sent: Thursday, 15 August 2002 11:58 AM > To: php-generallists.php.net > Subject: [PHP] Php.ini on Solaris? > > > Just compiled Apache 1.3.26 with latest php and discovered my > form variables > weren't getting thru to php scripts. > > Looked through archives and found ref to register_globals setting in > php.ini. Only trouble is, I can't find php.ini on my server (except in the > php source code folder). > > Where should it be? > > -- > Randy Perry > sysTame > Mac Consulting/Sales > > phn 772.589.6449 > mobile email helpsystame.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I start a session under an SSL connection (https), do some work, and then register some variables. I then do a header("location: http:/somepage.php"). the page is loated on the same server that was doing the SSL work.

    My question is are the session variable I registered under the SSL connection still valid under the regular connection?

    jc

    attached mail follows:


    Hi,

    Thursday, August 15, 2002, 5:17:00 AM, you wrote: MA> Well, I actually have a full db class which has a connect and close method MA> as well as query, fetch_array, etc... What I really want to know is how to MA> use the methods in my db class from another class (myclass for example)..

    MA> Do I include the db class from the myclass constructor and then set a MA> myclass variable = to the db object?

    MA> ie.

    MA> class my_class { MA> var $db;

    MA> function my_class() { MA> include('class_database.php');

    MA> $this->db = new database; MA> }

    MA> ... MA> }

    MA> or is there a differnet or better way?

    I set up interclass communication by having a global array for references like this: <? class a { var $t = 'Empty'; //constructor function a(){ global $classes; $classes['a'] =& $this; } function test(){ echo $this->t; } }

    class b { var $a; //class a holder //constructor function b(){ global $classes; //if the class already exists use it... if(is_object($classes['a'])){ $this->a =& $classes['a']; } //otherwise create it... else{ $this->a = new a(); } $this->a->test(); } } $a1 =& new a(); $a1->t = 'This is a test'; $b1 = new b(); ?> whether it is better depends on usage, but it should be good for a db class so you only make the one connection :)

    -- 
    regards,
    Tom
    

    attached mail follows:


    I want to have the ereg_replace action happen many times before the result is echoed, how do I do this? The following is the code that I have that obviously is flawed because the later variable as afar as ai know cancels out the first one...

    $good = ereg_replace("<o:p></o:p>", " ", $str); $good = ereg_replace("</head>", " ", $str);

    //echo ereg_replace("</o:p>", " ", $str); echo $good;

    help appreciated.

    - Vic

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    So pass $good into the second call instead of $str

    On Wed, 14 Aug 2002 victorargilent.com wrote:

    > I want to have the ereg_replace action happen many times before the > result is echoed, how do I do this? The following is the code that I > have that obviously is flawed because the later variable as afar as ai > know cancels out the first one... > > $good = ereg_replace("<o:p></o:p>", " ", $str); > $good = ereg_replace("</head>", " ", $str); > > //echo ereg_replace("</o:p>", " ", $str); > echo $good; > > help appreciated. > > - Vic > > > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi guys,

    I'm looking to get a specific bit of data out of a slightly complex amount of data. Ok, I have this in a variable:

    User : liami-redlands.net Dir : /home/eXtremail/mbox/i-redlands.net/3/1/liam Forward : Copy : Account mapping : User Disk Quota : 0 Disk Space Used : 0 Max In Mail Size : 0 Max Out Mail Size : 0 Autoreply : No Mailbox Access : POP,IMAP Created : Sat Jul 6 09:21:23 2002 Status : Enabled

    This is different for every user as you can see. For instance, the Dir is different for everyone, such is the Created date. I need to extract the User Disk Quota and the Disk Space Used variables out of this. How would I go about doing that?

    Is there an easier function to use than ereg_replace?

    Thanks in advance! Liam

    attached mail follows:


    I'd do something like this:

    $str = " User : liami-redlands.net Dir : /home/eXtremail/mbox/i-redlands.net/3/1/liam Forward : Copy : Account mapping : User Disk Quota : 0 Disk Space Used : 0 Max In Mail Size : 0 Max Out Mail Size : 0 Autoreply : No Mailbox Access : POP,IMAP Created : Sat Jul 6 09:21:23 2002 Status : Enabled ";

    $ary = explode("\n", $str);

    foreach( $ary as $line ) { list($k, $v) = split(" : ", $line); $data[$k] = $v; }

    print($data["User Disk Quota"] . "\n"); print($data["Dir"] . "\n");

    On Thu, 15 Aug 2002, Liam MacKenzie wrote:

    > Hi guys, > > I'm looking to get a specific bit of data out of a slightly complex amount > of data. > Ok, I have this in a variable: > > User : liami-redlands.net > Dir : /home/eXtremail/mbox/i-redlands.net/3/1/liam > Forward : > Copy : > Account mapping : > User Disk Quota : 0 > Disk Space Used : 0 > Max In Mail Size : 0 > Max Out Mail Size : 0 > Autoreply : No > Mailbox Access : POP,IMAP > Created : Sat Jul 6 09:21:23 2002 > Status : Enabled > > > This is different for every user as you can see. For instance, the Dir is > different for everyone, such is the Created date. > I need to extract the User Disk Quota and the Disk Space Used variables out > of this. How would I go about doing that? > > Is there an easier function to use than ereg_replace? > > Thanks in advance! > Liam > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Ok, I'm having a blonde day...

    If $idx == 1, 4 or 9 I don't want it to echo $results. I have this, what's the syntax to put multiple values in there?

    if ($idx != "1") { echo"$results"; }

    Thanks, Liam

    attached mail follows:


    Just usa an OR concatenator like:

    If ($idx != '1' OR $idx != '4' OR $idx != '9'){ echo $results; }

    Remember that if you are echoing just $result, it should not be enclosed into double quotes... just a tip.

    > -----Original Message----- > From: Liam MacKenzie [mailto:phplistoperationenigma.com] > Sent: Thursday, August 15, 2002 12:42 AM > To: php-generallists.php.net > Subject: [PHP] stupid question > > Ok, I'm having a blonde day... > > If $idx == 1, 4 or 9 I don't want it to echo $results. > I have this, what's the syntax to put multiple values in there? > > > if ($idx != "1") { > echo"$results"; > } > > > Thanks, > Liam > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    if ( ($idx != "1") || ($idx != "4") || ($idx != "9") ) { echo "$results"; }

    Adam

    On Thu, 15 Aug 2002, Liam MacKenzie wrote:

    > Ok, I'm having a blonde day... > > If $idx == 1, 4 or 9 I don't want it to echo $results. > I have this, what's the syntax to put multiple values in there? > > > if ($idx != "1") { > echo"$results"; > } > > > Thanks, > Liam > > > > >

    attached mail follows:


    There are other ways of doing this, but I think you might be looking for the logical AND operator (&&).

    if ($idx != "1" && $idx != "4" && $idx != "9")

    Happy hacking.

    Chris

    Liam MacKenzie wrote:

    >Ok, I'm having a blonde day... > >If $idx == 1, 4 or 9 I don't want it to echo $results. >I have this, what's the syntax to put multiple values in there? > > >if ($idx != "1") { >echo"$results"; >} >

    attached mail follows:


    Liam, when you want to post a new message to the list don't just hit the reply button and change the subject. If you do that you message appears in the thread of the message you replied to.

    It really messes things up for people who follow message threads. And worse you might not get any answers to your question since your question has nothing to do with the thread your posting now becomes part of.

    To answer you question though:

    I don't know of any short-hand for what you want to do. But this should work.

    if ( ($idx != "1") && ($idx == "4") && ($idx == "9") ) { echo"$results"; }

    You could also look into using a regexp.

    Jc

    Liam Mackenzie wrote: > Ok, I'm having a blonde day... > > If $idx == 1, 4 or 9 I don't want it to echo $results. > I have this, what's the syntax to put multiple values in there? > > > if ($idx != "1") { > echo"$results"; > } > > > Thanks, > Liam > > >

    attached mail follows:


    Ok, point taken. Sorry, I didn't know.

    Also, thanks for the help, I got it :-)

    ----- Original Message ----- From: "Jean-Christian Imbeault" <jean_christianmyrealbox.com> To: <php-generallists.php.net> Sent: Thursday, August 15, 2002 1:52 PM Subject: [PHP] Re: stupid question

    Liam, when you want to post a new message to the list don't just hit the reply button and change the subject. If you do that you message appears in the thread of the message you replied to.

    It really messes things up for people who follow message threads. And worse you might not get any answers to your question since your question has nothing to do with the thread your posting now becomes part of.

    To answer you question though:

    I don't know of any short-hand for what you want to do. But this should work.

    if ( ($idx != "1") && ($idx == "4") && ($idx == "9") ) { echo"$results"; }

    You could also look into using a regexp.

    Jc

    Liam Mackenzie wrote: > Ok, I'm having a blonde day... > > If $idx == 1, 4 or 9 I don't want it to echo $results. > I have this, what's the syntax to put multiple values in there? > > > if ($idx != "1") { > echo"$results"; > } > > > Thanks, > Liam > > >

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

    attached mail follows:


    César Aracena wrote:

    >Just usa an OR concatenator like: > >If ($idx != '1' OR $idx != '4' OR $idx != '9'){ >echo $results; >} >

    Actually, this statement will always evaluate to true. I think you mean to use &&.

    Chris

    attached mail follows:


    You got a point there... unless you change the operator from != to == right? Missed that.

    > -----Original Message----- > From: Chris Shiflett [mailto:shiflettphp.net] > Sent: Thursday, August 15, 2002 1:00 AM > To: César Aracena > Cc: 'Liam MacKenzie'; php-generallists.php.net > Subject: Re: [PHP] stupid question > > César Aracena wrote: > > >Just usa an OR concatenator like: > > > >If ($idx != '1' OR $idx != '4' OR $idx != '9'){ > >echo $results; > >} > > > > Actually, this statement will always evaluate to true. I think you mean > to use &&. > > Chris > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi all, My site maintain a list of members, which i knew their birthday, and i want to send a email greeting to them on their birthday, of course, automatically.

    How can i do that?

    Thanks in advance Nowhereman

    attached mail follows:


    I suppose you want to use PHP - just set a cron job to run wget or lynx on that page every day. Alternatively, set a cron job to run a command-line php every day (it's somewhat faster) - but I think there are a couple of restrictions on the configuration, so if that doesn't work, just fall back to the first solution.

    Bogdan

    Nowhereman wrote: > Hi all, > My site maintain a list of members, which i knew their birthday, and i want > to send a email greeting to them on their birthday, of course, > automatically. > > How can i do that? > > Thanks in advance > Nowhereman > >

    attached mail follows:


    This have been very much discussed in this list, and the only logical way of doing this through PHP would be to have a script that reads the actual date of the server's system once a day, but that would be just impossible without having that script (page) reloaded at least once a day.

    I think there are two way of doing this. First, would be to setup a cron job under unix (which I don't know so I'm guessing here) and second, which is the easiest, would be to have that script in a page with refreshing META tags, so it would refresh itself every 24 or 12 hours.

    Does this make any sense? C.

    > -----Original Message----- > From: NoWhErEMan [mailto:vckhyahoo.com] > Sent: Thursday, August 15, 2002 1:03 AM > To: php-generallists.php.net > Subject: [PHP] Automatically send email on special day > > Hi all, > My site maintain a list of members, which i knew their birthday, and i > want > to send a email greeting to them on their birthday, of course, > automatically. > > How can i do that? > > Thanks in advance > Nowhereman > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows: