OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Mon Jul 01 2002 - 22:32:08 CDT

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

    php-general Digest 2 Jul 2002 03:32:08 -0000 Issue 1439

    Topics (messages 104662 through 104825):

    Re: strip_tags
            104662 by: Analysis & Solutions
            104672 by: BB
            104677 by: Erik Price
            104687 by: Analysis & Solutions
            104690 by: BB
            104795 by: Richard Lynch

    cURL in an exec()
            104663 by: Jay Blanchard
            104669 by: Jason Wong
            104673 by: Jay Blanchard
            104682 by: Jason Wong
            104685 by: Jay Blanchard
            104802 by: Richard Lynch

    php & SMS (or phone contact)
            104664 by: Duncan
            104668 by: Jason Wong
            104670 by: Cal Evans
            104676 by: Duncan

    Re: need to change $ char in string
            104665 by: Beverly Steiner
            104667 by: Jason Wong
            104708 by: Beverly Steiner
            104725 by: Uli B

    Re: help with preg_replace()
            104666 by: Analysis & Solutions

    Re: creating multidimensional arrays
            104671 by: Analysis & Solutions
            104799 by: Richard Lynch

    Re: Javascript to PHP?
            104674 by: Jed Verity

    Strange url include problem
            104675 by: Leon Mergen
            104678 by: Jason Wong

    Reading MSWORD Doc File Comments
            104679 by: Crane, Christopher
            104714 by: 1LT John W. Holmes
            104801 by: Richard Lynch

    MCRYPT anybody anybody???
            104680 by: charlesk
            104684 by: Jason Wong

    Re: cURL in an exec() MORE...
            104681 by: Jay Blanchard
            104750 by: Jason Wong
            104751 by: Jay Blanchard

    Encripted download
            104683 by: Pedro Garre
            104689 by: Pedro Garre
            104697 by: Lazor, Ed
            104805 by: Richard Lynch

    PHP and PDF
            104686 by: Gregory Hernandez
            104688 by: Brian McGarvie
            104692 by: Mirza Muharemagic
            104709 by: Gregory Hernandez
            104712 by: Mirza Muharemagic
            104723 by: Anson Smith
            104748 by: Jason Wong
            104789 by: Mirza Muharemagic
            104803 by: Richard Lynch
            104804 by: Richard Lynch

    Searching for string in text file help?
            104691 by: Tim Loepp
            104706 by: Cosby, Christopher

    Re: blob versus file
            104693 by: Lazor, Ed
            104698 by: Mirza Muharemagic
            104796 by: Richard Lynch
            104825 by: Andy

    Register globals off
            104694 by: Adrian Greeman
            104699 by: Julie Meloni
            104701 by: Erik Price

    SMS Again, UK
            104695 by: Andy Whittlestone
            104716 by: Simon Ritchie
            104722 by: Simon Ritchie

    Handling of constants in strings
            104696 by: Uwe Birkenhain
            104806 by: Richard Lynch

    Re: Win98, Apache, PHP Config Problem
            104700 by: Uwe Birkenhain
            104800 by: Richard Lynch

    Re: Keeping "Secrets" in PHP Files
            104702 by: Lazor, Ed
            104717 by: Dan Vande More

    Re: Page rendering speed: PostNuke or PHP-Nuke
            104703 by: Lazor, Ed
            104713 by: Dan Vande More

    uploading a file
            104704 by: Phil Schwarzmann
            104707 by: Jay Blanchard
            104710 by: Mirza Muharemagic
            104711 by: Balaji Ankem

    register_global, need some feedback
            104705 by: Scott Fletcher
            104720 by: Uwe Birkenhain
            104807 by: Richard Lynch

    Re: Gradients in PHP & GD
            104715 by: Bogdan Stancescu

    Re: [PHP-DB] blob versus file
            104718 by: Lazor, Ed
            104739 by: Pierre-Alain Joye
            104746 by: Lazor, Ed
            104749 by: Pierre-Alain Joye

    mySQL time = year 2038 [HELP]
            104719 by: Shane
            104727 by: Kevin Stone
            104732 by: Mirza Muharemagic
            104754 by: 1LT John W. Holmes
            104810 by: Richard Lynch

    mcrypt again...
            104721 by: charlesk

    Security in phpmyadmin
            104724 by: The Doctor
            104809 by: Richard Lynch

    M$-SQL Access from RH7.3
            104726 by: David Busby

    uploading a file - here is the error message...
            104728 by: Phil Schwarzmann
            104729 by: Lazor, Ed
            104730 by: Kevin Stone
            104731 by: Mirza Muharemagic
            104735 by: Phil Schwarzmann
            104813 by: Richard Lynch

    help with regex in preg_match();
            104733 by: php.net.co.cr
            104736 by: Mirza Muharemagic
            104743 by: Erik Price

    Re: XML Problem
            104734 by: Sebastian A.
            104745 by: Analysis & Solutions

    viewing php predefined fucntions
            104737 by: Anil Garg
            104740 by: Jim lucas

    Query String...
            104738 by: Tim Nields
            104741 by: Jason Wong
            104742 by: Dan Vande More
            104744 by: Tim Nields
            104747 by: Chris Hewitt

    Where do I specify a DSN?
            104752 by: David Busby
            104753 by: Jay Blanchard
            104755 by: Lazor, Ed

    Where do I specify a DSN? v0.2
            104756 by: David Busby
            104772 by: Jay Blanchard

    Re: Incrementing a table cell
            104757 by: Richard Lynch

    Re: File Upload
            104758 by: Richard Lynch

    Re: Writing a GIF/JPG Image
            104759 by: Richard Lynch

    Re: Why isn't this working?
            104760 by: Richard Lynch

    Re: PHP include_path
            104761 by: Richard Lynch

    Re: is php free?
            104762 by: Richard Lynch

    Re: gdlib list or galleries?
            104763 by: Richard Lynch

    Re: Yet another session problem, with a twist.
            104764 by: Richard Lynch

    Re: Display Records in Multiple Pages
            104765 by: Richard Lynch

    Re: MySQL fetch data
            104766 by: Richard Lynch
            104773 by: Cal Evans

    Re: Accessing cookies in required files
            104767 by: Richard Lynch

    Re: checking
            104768 by: Richard Lynch
            104781 by: Uli B

    Re: fsockopen and HTTP/1.1???
            104769 by: Richard Lynch
            104794 by: Chris Shiflett

    Re: help pls!
            104770 by: Richard Lynch

    Re: Generating Barcodes and printing
            104771 by: Richard Lynch

    Re: Populate Popup Menu from Database
            104774 by: Mike Tuller
            104782 by: Erik Price
            104808 by: Mike Tuller

    Re: Getting all letters not in a string?
            104775 by: Richard Lynch

    Re: Easier way to seperate variables?
            104776 by: Richard Lynch

    Re: ZIP combinaton in PHP?
            104777 by: Richard Lynch

    Re: [mail] quetion
            104778 by: Richard Lynch

    Re: Help adding variables from MySQL query
            104779 by: Richard Lynch

    str_replace() not accepting arrays?
            104780 by: Peter

    extracting data from text file
            104783 by: rdkurth.starband.net
            104784 by: Erik Price
            104785 by: Pushkar Pradhan
            104788 by: Beverly Steiner
            104815 by: Richard Lynch

    ODBC Failures
            104786 by: David Busby
            104812 by: Richard Lynch

    odbc_fetch_into, broken???
            104787 by: Scott Fletcher

    How to use Session Variables
            104790 by: Brandon
            104817 by: Johnson, Kirk

    Re: mySQL time = year 2038 [SOLVED]
            104791 by: Shane
            104793 by: David Freeman

    [leepiclab.com: Re: [PHP] Re: Drop connection, keep running?]
            104792 by: Lee Daniel Crocker

    Re: php install
            104797 by: Richard Lynch

    Re: Problem with menu
            104798 by: Richard Lynch
            104818 by: Analysis & Solutions
            104820 by: Analysis & Solutions

    Re: Constants
            104811 by: Richard Lynch

    Re: Web Printing
            104814 by: Richard Lynch

    Compiling PHP with INFORMIX howto?
            104816 by: Emile Bosch

    session dropping data
            104819 by: dietrich

    session duration
            104821 by: Ivan Voras

    Re: Globals bug??
            104822 by: troy.recipezaar.com

    preg help (regexp newbie) whitespace
            104823 by: Justin French
            104824 by: Jason Wong

    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:


    On Mon, Jul 01, 2002 at 12:35:53PM +0100, BB wrote:
    > I'm having a problem using strip_tags.

    Sounds like you're using it wrong. Re-read
    http://www.php.net/manual/en/function.strip-tags.php. Then fix your code
    accordingly.

    If that doesn't work, post a _sample_ of your HTML and PHP that don't
    work.

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


    OK, this is a 3x3 table pasted in from word! This is the raw HTML

    <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 142pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">this<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">is<o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">A<o:p></o:p></FONT></FONT></P></TD></TR> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 142pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">table<o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">pasted<o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">From<o:p></o:p></FONT></FONT></P></TD></TR> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 142pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">a<o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; m so-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">word<o:p></o:p></FONT></FONT></P></TD> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #bfbfbf; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #bfbfbf; WIDTH: 142.05pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">document<o:p></o:p></FONT></FONT></P></TD></TR></TBODY></TABLE>

    This is what happens to it after $txt = strip_tags($txt,"<STRONG><B><P><BR><TABLE><TR><TD><OL><UL><LI><IMG><A>");

    <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 142pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=189> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">this

    Cut off after the first cell

    Help

    Thanks in advance

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020701143645.GA19623panix.com... > On Mon, Jul 01, 2002 at 12:35:53PM +0100, BB wrote: > > I'm having a problem using strip_tags. > > Sounds like you're using it wrong. Re-read > http://www.php.net/manual/en/function.strip-tags.php. Then fix your code > accordingly. > > If that doesn't work, post a _sample_ of your HTML and PHP that don't > work. > > --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:


    On Monday, July 1, 2002, at 11:09 AM, BB wrote:

    > OK, this is a 3x3 table pasted in from word!

    It is against the rules to post HTML code generated by Microsoft Word.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    On Mon, Jul 01, 2002 at 04:09:04PM +0100, BB wrote:

    Dude, c'mon! I asked for a "_sample_" for a reason. First, I didn't want to have to wade through a ton of HTML. Second, it'd help you isolate the problem so you could formulate an accurate question and/or figure out the answer for yourself.

    If you examined where the string got cut off, you'd be able to come up with a short sample like this:

    #! /usr/local/bin/php -q <?php

    $txt = <<<sample <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">this<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P> sample;

    echo "$txt\n"; echo strip_tags($txt,"<STRONG><B><P><BR><TABLE><TR><TD><OL><UL><LI><IMG><A>"); echo "\n";

    ?>

    The output from the sample is...

    <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT face="Times New Roman">this<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P>

    <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">this

    So, clearly, the <?xml tag is throwing things off. The problem doesn't arise in the setting of $txt because echoing $txt comes through fine. Therefore the problem is with strip_tags().

    Do you want to keep the XML or strip the XML? I'm guessing you want it taken out. Now, it's time to ask the rest of the folks on the list:

    "strip_tags() is being tripped up by <?xml tags in my strings. Those tags cause strip_tags() to stop processing the rest of the string. I want the XML tags, along with all of the other unwanted HTML tags, ripped out. Is this a bug in strip_tags() or do I need to go about this in anther way?"

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


    Well, this is the solution we are providing, I found the error to be because word is such a wonderful program it puts XML in the middle of HTML, so I preg'd that out and all was good again!

    Thanks anyway peeps

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020701153337.GA5219panix.com... > On Mon, Jul 01, 2002 at 04:09:04PM +0100, BB wrote: > > Dude, c'mon! I asked for a "_sample_" for a reason. First, I didn't want > to have to wade through a ton of HTML. Second, it'd help you isolate the > problem so you could formulate an accurate question and/or figure out the > answer for yourself. > > If you examined where the string got cut off, you'd be able to come up > with a short sample like this: > > #! /usr/local/bin/php -q > <?php > > $txt = <<<sample > <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT > color=#000000><FONT face="Times New Roman">this<?xml:namespace prefix = o ns > = "urn:schemas-microsoft-com:office:office" > /><o:p></o:p></FONT></FONT></P> > sample; > > echo "$txt\n"; > echo strip_tags($txt,"<STRONG><B><P><BR><TABLE><TR><TD><OL><UL><LI><IMG><A>"); > echo "\n"; > > ?> > > > The output from the sample is... > > <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000><FONT > face="Times New Roman">this<?xml:namespace prefix = o ns = > "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P> > > <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">this > > > So, clearly, the <?xml tag is throwing things off. The problem doesn't > arise in the setting of $txt because echoing $txt comes through fine. > Therefore the problem is with strip_tags(). > > Do you want to keep the XML or strip the XML? I'm guessing you want it > taken out. Now, it's time to ask the rest of the folks on the list: > > "strip_tags() is being tripped up by <?xml tags in my strings. Those tags > cause strip_tags() to stop processing the rest of the string. I want the > XML tags, along with all of the other unwanted HTML tags, ripped out. Is > this a bug in strip_tags() or do I need to go about this in anther way?" > > --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:


    In article <20020701113631.10791.qmailpb1.pair.com> , benthemidwestgroup.com (Bb) wrote:

    >I'm having a problem using strip_tags. > >When I try and run a table through strip_tags with the following vars, it >looses everything after the first cell with content in, i.e: nothing after >the first cell is returned, not even a </td> > >can anyone help? > >is this a PHP bug?

    Post sample HTML source that does this...

    My best guess is that your TD tag is missing the > or some other tag is messed up...

    Or a missing quote could do this as well.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    I can do this;

    exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html https://theserver.com/list.html");

    but why can't I do this

    exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o ".$listline." https://theserver.com/download/ ".$listline."");

    The only change is that I have now made the variable $listline available as there is a routine that steps through each file from the list. I can print the line out and it looks correct. Am I missing something?

    Thanks!

    Jay

    attached mail follows:


    On Monday 01 July 2002 22:37, Jay Blanchard wrote: > I can do this; > > exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o > cdrlist.html https://theserver.com/list.html"); > > but why can't I do this > > exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o > ".$listline." https://theserver.com/download/ ".$listline.""); extra space here? ----------------------------^

    > The only change is that I have now made the variable $listline available as > there is a routine that steps through each file from the list. I can print > the line out and it looks correct. Am I missing something?

    I think you've got something extra rather than missing :)

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

    /* Do you think that illiterate people get the full effect of alphabet soup? */

    attached mail follows:


    [snip] > but why can't I do this > > exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o > ".$listline." https://theserver.com/download/ ".$listline.""); extra space here? ----------------------------^

    I think you've got something extra rather than missing :) [/snip]

    Thanks Jason, I fixed that and still does not work. So I am trying this; $curlline("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o ".$listline." https://theserver.com/download/".$listline.""); print($curlline); <----this looks fine exec($curline);

    Sill no joy in Mudville. ;^( Maybe this is why I am going grey up top...

    Thanks!

    Jay

    attached mail follows:


    On Monday 01 July 2002 23:10, Jay Blanchard wrote:

    > print($curlline); <----this looks fine > exec($curline);

    Have you tried executing $curlline directly from a shell/command-line? This will determine whether it is a PHP problem or a cURL problem.

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

    /* Jenkinson's Law: It won't work. */

    attached mail follows:


    [snip] > print($curlline); <----this looks fine > exec($curline);

    Have you tried executing $curlline directly from a shell/command-line? This will determine whether it is a PHP problem or a cURL problem. [/snip]

    That was the first thing I did, and I have gone back a couple of times now to make sure.

    Jay

    attached mail follows:


    >[snip] >> print($curlline); <----this looks fine >> exec($curline); > >Have you tried executing $curlline directly from a shell/command-line? This >will determine whether it is a PHP problem or a cURL problem. >[/snip] > >That was the first thing I did, and I have gone back a couple of times now >to make sure.

    Post an example $curlline with the iteration value plugged in...

    Any chance it has, say, quotes or apostrophes in it? How about unprintable control characters? Spaces that don't show up in the browser but that you can see in "View Source" ? :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi,

    i want to make a script, that monitors my server and if its down, sends an SMS, pager message, or rings the phone (lol) to contact me. Is it possible to send a message to a pager or an SMS to a handy with php? Or are there any scripts already out there? I tried to take a look around, but most scripts i found relied on services, which don't exist anymore, of who changed their service, so that its not possible to use from the outside.

    Regards,

    Hendrik

    attached mail follows:


    On Monday 01 July 2002 22:46, Duncan wrote: > Hi, > > i want to make a script, that monitors my server and if its down, sends an > SMS, pager message, or rings the phone (lol) to contact me. Is it possible > to send a message to a pager or an SMS to a handy with php? Or are there > any scripts already out there? > I tried to take a look around, but most scripts i found relied on services, > which don't exist anymore, of who changed their service, so that its not > possible to use from the outside.

    Your service provider (pager or mobile) must provide a gateway. Do they? If not, you can't expect PHP (versatile as it may be) to magically interface to their network :)

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

    /* The bug stops here. */

    attached mail follows:


    don't reinvent the wheel. (Unless you jsut REALLY want to) Try www.nagios.org It has support for SMS. (Be prepared to spend about 3-4 hours setting it up) =C=

    * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com *

    -----Original Message----- From: Duncan [mailto:php-generalring-wraith.com] Sent: Monday, July 01, 2002 9:47 AM To: php-generallists.php.net Subject: [PHP] php & SMS (or phone contact)

    Hi,

    i want to make a script, that monitors my server and if its down, sends an SMS, pager message, or rings the phone (lol) to contact me. Is it possible to send a message to a pager or an SMS to a handy with php? Or are there any scripts already out there? I tried to take a look around, but most scripts i found relied on services, which don't exist anymore, of who changed their service, so that its not possible to use from the outside.

    Regards,

    Hendrik

    attached mail follows:


    Hi again,

    thx for the replies. Well, nagios ... quite a story ... anyway, i spent more than 3-4 hours and still didn't get it to work. Maybe i should look into it again, if it supports that kind of stuff, which really would be just what i need :)

    Thanks a lot,

    Duncan

    attached mail follows:


    Uli & others,

    Thanx for the suggestions. This works as stated but the data already exists in this format from an old database and I'm trying to parse it into logical fields. Originally the data in the field looked something like 1$General/ms1.zip#12$Another/xqy.zip#. I deleted the ending # then used explode to separate the information on the # and now I need to separate the info before the $ from what comes after it. I've tried everyone's suggestions but they only work if I'm testing and can define the string using single quotes.

    How can I split on a $ or change the $ to something else if I'm getting the information from a database (MySQL), not defining it using single quotes like in your example?

    Bev

    -----Original Message----- From: Uli B [mailto:ubo1gmx.de] Sent: Saturday, June 29, 2002 11:56 AM To: PHP List Subject: Re: [PHP] need to change $ char in string

    use single quotes: double quotes would confuse php with variable names. it thinks that $General is a variable and replace it by it's empty content. single quotes prevent php from evaluating the string:

    $test_string = '1.2$General/ms1.zip';

    single quotes on regex too (same reason). the backslash in this case (\$) refers to perl regular expression syntax but does not take care of php !

    $new_string = preg_replace('/\$/', "%", $test_string);

    ub

    At 10:58 29.06.02 -0400, Beverly Steiner wrote: >I've tried everything I can think of to change a dallar sign in a string to >something else or to split the string on the $ but I can't the the >information that comes after the $. > >Typical string contains: 1.2$General/ms1.zip > >when I try: > $new_string = preg_replace("/\$/", "%", $test_string); > >or (trying to avoid specifying the $): > $new_string = preg_replace("/(\d\.\d{1,2})\D(\w.*$)/", "\1%\2", >$test_string); > >echo "new_string is $new_string"; prints new_string is 1.2 > >Has anyone solved this problem? > >Thanx, > >Bev > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    --
    -----------------------------------------------
     Ulrich Borchers
     Brandenberger Straße 18, 41065 Mönchengladbach
     fon +49-2161-175883
     icq 1282868
    -----------------------------------------------
    

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

    attached mail follows:


    On Monday 01 July 2002 22:47, Beverly Steiner wrote: > Uli & others, > > Thanx for the suggestions. This works as stated but the data already > exists in this format from an old database and I'm trying to parse it into > logical fields. Originally the data in the field looked something like > 1$General/ms1.zip#12$Another/xqy.zip#. I deleted the ending # then used > explode to separate the information on the # and now I need to separate the > info before the $ from what comes after it. I've tried everyone's > suggestions but they only work if I'm testing and can define the string > using single quotes. > > How can I split on a $

    <? # split string on '$' $doo = '1$General/ms1.zip'; $dah = explode('$', $doo); print_r($dah); ?>

    >or change the $ to something else if I'm getting the > information from a database (MySQL), not defining it using single quotes > like in your example?

    I think you're confused. There is nothing in MySQL which dictates strings as single-quoted or double-quoted. I think you had best post some code. Show us how you're retrieving the data from MySQL.

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

    /* Two heads are better than one. -- John Heywood */

    attached mail follows:


    Jason,

    Thank you, explode using single quotes and no backslashes works!

    Bev

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Monday, July 01, 2002 10:57 AM To: php-generallists.php.net Subject: Re: [PHP] need to change $ char in string

    On Monday 01 July 2002 22:47, Beverly Steiner wrote: > Uli & others, > > Thanx for the suggestions. This works as stated but the data already > exists in this format from an old database and I'm trying to parse it into > logical fields. Originally the data in the field looked something like > 1$General/ms1.zip#12$Another/xqy.zip#. I deleted the ending # then used > explode to separate the information on the # and now I need to separate the > info before the $ from what comes after it. I've tried everyone's > suggestions but they only work if I'm testing and can define the string > using single quotes. > > How can I split on a $

    <? # split string on '$' $doo = '1$General/ms1.zip'; $dah = explode('$', $doo); print_r($dah); ?>

    >or change the $ to something else if I'm getting the > information from a database (MySQL), not defining it using single quotes > like in your example?

    I think you're confused. There is nothing in MySQL which dictates strings as single-quoted or double-quoted. I think you had best post some code. Show us how you're retrieving the data from MySQL.

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

    /* Two heads are better than one. -- John Heywood */

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

    attached mail follows:


    (After typing I see that the problem is solved. I send it anyway - hope you people don't mind the redundancy :-)

    Why don't you use explode() again on the $ like Jason suggested ? This does not even require single quotes :-) You might also want to have a look at split() and preg_split().

    It should make no difference that the data comes from a database. The $ probably requires no quoting (\) then. So I don't think this will help but you might try to apply quotemeta() before splitting or replacing.

    I suggest that you take a close look at the data in you old database. Are there any additional special characters that might ruin the effort ? The preg_* functions can make use of pattern modifiers that change the way these functions handle newlines for example (see regular expressions).

    If all of the above does not help you can have MySQL handle it:

    select replace(str,'$','%') from table

    ...but that is not a preferable option imho because there seems to be a problem elsewhere.

    Uli

    At 10:47 01.07.02 -0400, Beverly Steiner wrote: >Uli & others, > >Thanx for the suggestions. This works as stated but the data already exists >in this format from an old database and I'm trying to parse it into logical >fields. Originally the data in the field looked something like >1$General/ms1.zip#12$Another/xqy.zip#. I deleted the ending # then used >explode to separate the information on the # and now I need to separate the >info before the $ from what comes after it. I've tried everyone's >suggestions but they only work if I'm testing and can define the string >using single quotes. > >How can I split on a $ or change the $ to something else if I'm getting the >information from a database (MySQL), not defining it using single quotes >like in your example? > >Bev > > >-----Original Message----- >From: Uli B [mailto:ubo1gmx.de] >Sent: Saturday, June 29, 2002 11:56 AM >To: PHP List >Subject: Re: [PHP] need to change $ char in string > > >use single quotes: double quotes would confuse php with variable names. >it thinks that $General is a variable and replace it by it's empty content. >single quotes prevent php from evaluating the string: > >$test_string = '1.2$General/ms1.zip'; > >single quotes on regex too (same reason). the backslash in this case >(\$) refers to perl regular expression syntax but does not take care of php >! > >$new_string = preg_replace('/\$/', "%", $test_string); > >ub > > >At 10:58 29.06.02 -0400, Beverly Steiner wrote: >>I've tried everything I can think of to change a dallar sign in a string to >>something else or to split the string on the $ but I can't the the >>information that comes after the $. >> >>Typical string contains: 1.2$General/ms1.zip >> >>when I try: >> $new_string = preg_replace("/\$/", "%", $test_string); >> >>or (trying to avoid specifying the $): >> $new_string = preg_replace("/(\d\.\d{1,2})\D(\w.*$)/", "\1%\2", >>$test_string); >> >>echo "new_string is $new_string"; prints new_string is 1.2 >> >>Has anyone solved this problem? >> >>Thanx, >> >>Bev >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php > >-- >----------------------------------------------- > Ulrich Borchers > Brandenberger Straße 18, 41065 Mönchengladbach > fon +49-2161-175883 > icq 1282868 >----------------------------------------------- > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Mon, Jul 01, 2002 at 01:50:31PM +0200, Gregor Jak¹a wrote: > > "word" = "word" > >word = >| word | > <word = <| word | > >"word = >|word | > <word" = <| word| > > preg_replace("#^[<|>]?[^\"](.*?)[^\"]$#i", "| \\0 |", $string);

    preg_replace('/^(<|>)+"?([^"]*)"?$/', '\\1| \\2 |', $string);

    I noticed that when there are quotes, you don't have a space between the " and the word. I didn't deal with that.

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


    On Mon, Jul 01, 2002 at 09:38:50PM +0800, DoL wrote: > Hi All > > I want to create a multi dimensional arrays as below > > $result[$something]['$key_string_01] = value_01 ^ Two things: | You didn't put a closing ' here ----- BUT, you probably don't want one, since it looks like you want that key to be a variable. Things between '' don't get evaluated. So the key would wind up literally being "$key_string_01" rather than the value of $key_string_01.

    Of course, this could be a typo as it looks like you retyped your code rather than direclty copying/pasting or importing the file into the email you were composing. If you want an accurate answer, provide an accurate example.

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


    >Hi All > >I want to create a multi dimensional arrays as below > >$result[$something]['$key_string_01] = value_01 >$result[$something]['$key_string_02] = value_02 >$result[$something]['$key_string_03] = value_03 >$result[$something]['$key_string_04] = value_04 >$result[$something][0] = value_06 >$result[$something][1] = value_07 >$result[$something][2] = value_08 >. >. >. > >Here is what I did >1. use some assign statement $result[$something]['$key_string_0n'] = >value_0n for the first four elements >2. for the fifth elements onward, I used this >$result[$something] = preg_split(....); > >However, as I test it with foreach loop, I am only getting > >$result[$something][0] = value_06 >$result[$something][1] = value_07 >$result[$something][2] = value_08 >. >. >. > >I lost the first four elements!! Can anyone help on this please?

    What you are doing seems pretty weird to me...

    Did you do reset($result) before you looped through the values to display them? If not, it *could* be the case that the assignment with the preg is somehow mis-managing the iteration pointer. This seems highly unlikely, but it's the cheapest and easiest answer I have for you.

    Just for fun, try using $result[$something][] = preg_split(...); and see what it does...

    Finally, if all else fails, it's really not worth beating your head against a wall on this: $result1[...][...] = 01; $result1[...][...] = 02; $result1[...][...] = 03; $result1[...][...] = 04;

    $result2[...] = preg_split(...);

    $result = array_merge($result1, $result2);

    http://php.net/array_merge

    It might still be a bug worth reporting, but it ain't worth waiting for the PHP Dev team to fix it when you can move on to bigger problems :-)

    Actually, I'm not sure it's a bug at all...

    The semantics of what an assignment should mean in a situation like this are not at all clear...

    Somebody else could be equally disconcerted that their "old" values are *NOT* getting wiped out when they do the assignments like that.

    I believe that unless you are assigning a SINGLE element into an array, this issue would be germane.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Thanks for the response, Erik! I think I will try passing the data in a cookie to a "hidden" frame, refreshing the frame, and then reading the data back. Many thanks to all for the suggestions!

    Cheers, Jed

    I liked it when Erik Price wrote this to me:

    > > On Saturday, June 29, 2002, at 03:13 PM, Jed Verity wrote: > >> I can't find any information on passing JavaScript variables to PHP on >> the >> same page (i.e. not through the POST information of a submitted form). >> Is >> this because it's not possible? >> >> To take the load off the server, I'm trying to do a bunch of string >> manipulations and loops in JavaScript and then hand that info off to PHP >> once it's done. > > How will you communicate with PHP without submitting an HTTP request of > some sort? So, really, you will need to submit -something-, though it > could be GET data, POST data, or COOKIE data. > > You can't have JavaScript talk to PHP "within the same page" since the > webserver/PHP "forgets" all information related to that page as soon as > it shoots it to the user-agent. > > I'm assuming you know how to use JavaScript to set a cookie, and/or make > a new request with GET or POST data attached. If not, let me know. > > > Erik > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > >

    attached mail follows:


    Hello,

    I'm having a little bit problems with including an url into my page...

    When I do this:

    include ("http://www.google.com/search?q=test&ie=UTF-8&oe=UTF8&hl=nl&lr=");

    PHP returns an error:

    Warning: Failed opening 'http://www.google.com/search?q=test&ie=UTF-8&oe=UTF8&hl=nl&lr=' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site6/fst/var/www/html/search/reply.php on line 64

    This certainly makes me wonder, since that page loads perfectly in my browser, and http://www.google.com/ works perfectly... anyone knows what I'm doing wrong?

    Thanks in advance,

    Leon Mergen

    attached mail follows:


    On Monday 01 July 2002 23:14, Leon Mergen wrote:

    > When I do this: > > include ("http://www.google.com/search?q=test&ie=UTF-8&oe=UTF8&hl=nl&lr="); > > PHP returns an error: > > Warning: Failed opening > 'http://www.google.com/search?q=test&ie=UTF-8&oe=UTF8&hl=nl&lr=' for > inclusion (include_path='.:/php/includes:/usr/share/php') in > /home/virtual/site6/fst/var/www/html/search/reply.php on line 64 > > This certainly makes me wonder, since that page loads perfectly in my > browser, and http://www.google.com/ works perfectly... anyone knows what > I'm doing wrong?

    Probably choking on the cookie that Google is trying to send you. Try using cURL or similar.

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

    /* Schshschshchsch. -- The Gorn, "Arena", stardate 3046.2 */

    attached mail follows:


    Is there a way to read the comments of a MSWord Doc file. I would like to get a directory listing of file in a directory that are mostly MSWORD docs. I would like to list the files with a description after each one. With HTML files I just read the file into a string and split it just after <title> and then again before </title> and display that. I am not sure if something can be done with a MSWORD doc. Thanks in advance to anyone that can help me or chooses to comment.

    Christopher J. Crane Network Operations Manager IKON Office Solutions 860.659.6464

    attached mail follows:


    There are some programs out there that'll take a word document and extract all of the text from it. Good for indexing database or making summaries. I can't remember the name of any, but search the usual Google, sourceforge, hotscripts.com, etc..

    ---John Holmes...

    ----- Original Message ----- From: "Crane, Christopher" <CCraneIKON.com> To: <php-generallists.php.net> Sent: Monday, July 01, 2002 11:20 AM Subject: [PHP] Reading MSWORD Doc File Comments

    > Is there a way to read the comments of a MSWord Doc file. I would like to > get a directory listing of file in a directory that are mostly MSWORD docs. > I would like to list the files with a description after each one. With HTML > files I just read the file into a string and split it just after <title> and > then again before </title> and display that. I am not sure if something can > be done with a MSWORD doc. Thanks in advance to anyone that can help me or > chooses to comment. > > Christopher J. Crane > Network Operations Manager > IKON Office Solutions > 860.659.6464 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    >Is there a way to read the comments of a MSWord Doc file. I would like to >get a directory listing of file in a directory that are mostly MSWORD docs. >I would like to list the files with a description after each one. With HTML >files I just read the file into a string and split it just after <title> and >then again before </title> and display that. I am not sure if something can >be done with a MSWORD doc. Thanks in advance to anyone that can help me or >chooses to comment.

    Perhaps you could use doc2html to convert them on-the-fly?...

    There are almost for sure other doc2XXX choices that might get better results...

    I suspect that the meta-data about who wrote the file, when they wrote it, etc that Word has been keeping for several versions now might also be something that has public accessors...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Does anybody know anything about mcrypt for windows???

    attached mail follows:


    On Monday 01 July 2002 23:09, charlesk wrote: > Does anybody know anything about mcrypt for windows???

    http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html

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

    /* Then there was the Formosan bartender named Taiwan-On. */

    attached mail follows:


    [snip] Thanks Jason, I fixed that and still does not work. So I am trying this; $curlline("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o ".$listline." https://theserver.com/download/".$listline.""); print($curlline); <----this looks fine exec($curline); [/snip]

    The cURL statement has to be on one line, when I view the source the statement appears to be broken up, i.e. curl -d "name=myname&password=mypassword&btnsubmit=submit" -s -o 2002060704.zip https://theserver/download/2002060704.zip

    OK, so how do I keep a long line from breaking up without inserting special characters? Maybe this why cURL is failing.

    Jay

    attached mail follows:


    On Monday 01 July 2002 23:25, Jay Blanchard wrote: > [snip] > Thanks Jason, I fixed that and still does not work. So I am trying this; > $curlline("curl -d > \"name=myname&password=mypassword&btnsubmit=submit\" -s -o ".$listline." > https://theserver.com/download/".$listline.""); > print($curlline); <----this looks fine > exec($curline); > [/snip] > > The cURL statement has to be on one line, when I view the source the > statement appears to be broken up, i.e. > curl -d "name=myname&password=mypassword&btnsubmit=submit" -s -o > 2002060704.zip > https://theserver/download/2002060704.zip > > OK, so how do I keep a long line from breaking up without inserting special > characters? Maybe this why cURL is failing.

    Is the line in which you are assigning $curlline, all on one line? If not, make it so.

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

    /* Conquering Russia should be done steppe by steppe. */

    attached mail follows:


    Yes it is...a, well. Time to compile PHP with cURL I guess. Thanks!

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Monday, July 01, 2002 1:46 PM To: php-generallists.php.net Subject: Re: [PHP] cURL in an exec() MORE...

    On Monday 01 July 2002 23:25, Jay Blanchard wrote: > [snip] > Thanks Jason, I fixed that and still does not work. So I am trying this; > $curlline("curl -d > \"name=myname&password=mypassword&btnsubmit=submit\" -s -o ".$listline." > https://theserver.com/download/".$listline.""); > print($curlline); <----this looks fine > exec($curline); > [/snip] > > The cURL statement has to be on one line, when I view the source the > statement appears to be broken up, i.e. > curl -d "name=myname&password=mypassword&btnsubmit=submit" -s -o > 2002060704.zip > https://theserver/download/2002060704.zip > > OK, so how do I keep a long line from breaking up without inserting special > characters? Maybe this why cURL is failing.

    Is the line in which you are assigning $curlline, all on one line? If not, make it so.

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

    /* Conquering Russia should be done steppe by steppe. */

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

    attached mail follows:


    *This message was transferred with a trial version of CommuniGate(tm) Pro*

    Hi,

    My Apache is under SSL. Everything works Ok but when the user chooses to download a file or view a PDF document, the browser states that you are about to leave the secure conexion, so I guess the files are travelling withno encription.

    Questions: 1. Are the files actually travelling with no encription ? 2. How can I encript them but making it transparent to the user ?

    Thanks.

    Pedro.

    attached mail follows:


    *This message was transferred with a trial version of CommuniGate(tm) Pro*

    Hi,

    My Apache is under SSL. Everything works Ok but when the user chooses to download a file or view a PDF document, the browser states that you are about to leave the secure conexion, so I guess the files are travelling withno encription.

    Questions: 1. Are the files actually travelling with no encription ? 2. How can I encript them but making it transparent to the user ?

    Thanks.

    Pedro.

    attached mail follows:


    Everything going through https is encrypted. Update links to download files and everything should go smoothly.

    -----Original Message----- Questions: 1. Are the files actually travelling with no encription ? 2. How can I encript them but making it transparent to the user ? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    >*This message was transferred with a trial version of CommuniGate(tm) Pro* > >Hi, > >My Apache is under SSL. Everything works Ok but when the user chooses to >download a file or view a PDF document, the browser states that you are about >to leave the secure conexion, so I guess the files are travelling withno >encription. > >Questions: >1. Are the files actually travelling with no encription ?

    Are the links going to https://... or to http:// ... ?

    If they are to https:// ..., then it *SHOULD* be encrypted, I think.

    >2. How can I encript them but making it transparent to the user ?

    Totally transparent? Like, so they can't tell at all? You can't. How would they know to trust that the files were securely transmitted if they weren't?

    If you want them to not get notified that they are leaving a secure connection, then teach them to configure their browser differently...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    hello everyone--

    i'd like to know if this can be solved with php.

    i'll be creating a pdf form that'll be downloaded, filled and turned in. the form must have a unique NUMBER printed on it each time it is downloaded.

    i'd like to use php to update this NUMBER (ie. counter + 1) each time the form is accessed, and automatically print this NUMBER on the form that sits on the server.

    is this possible?

    thanks in advance.

    gregory hernandgnewschool.edu

    attached mail follows:


    if you're creating the form using PHP's PDF functions all you'd need to to is generate the number and add it using whatever command to add a line of text to the PDF document...

    Don't ask me how.. not used it yet personally.

    Would like to see a decent example of PHP/PDF creation anyway...

    > -----Original Message----- > From: Gregory Hernandez [mailto:hernandgnewschool.edu] > Sent: 01 July 2002 4:25 PM > To: php-generallists.php.net > Subject: [PHP] PHP and PDF > > > hello everyone-- > > i'd like to know if this can be solved with php. > > i'll be creating a pdf form that'll be downloaded, filled and turned > in. > the form must have a unique NUMBER printed on it each time it is > downloaded. > > i'd like to use php to update this NUMBER (ie. counter + 1) each time > the form is > accessed, and automatically print this NUMBER on the form that sits on > the server. > > is this possible? > > thanks in advance. > > > gregory > hernandgnewschool.edu > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi Brian,

    i have made a pretty nice script for creating pdf files using database data. thats pretty easy. the only thing u have to care about is to calculate the document size.

    Mirza mirzaphp.co.ba

    01.07.2002 17:39

    > if you're creating the form using PHP's PDF functions all you'd need to to is generate the number and add it using whatever command to add a line of text to the PDF document...

    > Don't ask me how.. not used it yet personally.

    > Would like to see a decent example of PHP/PDF creation anyway...

    >> -----Original Message----- >> From: Gregory Hernandez [mailto:hernandgnewschool.edu] >> Sent: 01 July 2002 4:25 PM >> To: php-generallists.php.net >> Subject: [PHP] PHP and PDF >> >> >> hello everyone-- >> >> i'd like to know if this can be solved with php. >> >> i'll be creating a pdf form that'll be downloaded, filled and turned >> in. >> the form must have a unique NUMBER printed on it each time it is >> downloaded. >> >> i'd like to use php to update this NUMBER (ie. counter + 1) each time >> the form is >> accessed, and automatically print this NUMBER on the form that sits on >> the server. >> >> is this possible? >> >> thanks in advance. >> >> >> gregory >> hernandgnewschool.edu >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >>

    attached mail follows:


    hello again.

    thanks for the responses so far.

    let me change something from my prevoius post.

    let's say that i'm using an existing pdf form (i won't be creating a new one), is it still possible to use php to update a number that'll be printed on the pdf form each time it is accessed?

    again, thanks in advance.

    gregory hernandgnewschool.edu

    >>> "Brian McGarvie" <bmcgarvielennox-mckinlay.co.uk> - 7/1/02 11:50 AM >>> Actually I just for a brilliant Free PDF library...

    www.fpdf.org

    Excellent tutorials/docs...

    Use PHP to dynamically generate your forms and include any info you wish from a database i.e. the ID and so on...

    > -----Original Message----- > From: Gregory Hernandez [mailto:hernandgnewschool.edu] > Sent: 01 July 2002 4:25 PM > To: php-generallists.php.net > Subject: [PHP] PHP and PDF > > > hello everyone-- > > i'd like to know if this can be solved with php. > > i'll be creating a pdf form that'll be downloaded, filled and turned > in. > the form must have a unique NUMBER printed on it each time it is > downloaded. > > i'd like to use php to update this NUMBER (ie. counter + 1) each time > the form is > accessed, and automatically print this NUMBER on the form that sits on > the server. > > is this possible? > > thanks in advance. > > > gregory > hernandgnewschool.edu > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi Gregory,

    u mean, u want to update an existing PDF file? no, thats not possible.

    Mirza mirzaphp.co.ba

    01.07.2002 18:07

    > hello again.

    > thanks for the responses so far.

    > let me change something from my prevoius post.

    > let's say that i'm using an existing pdf form (i won't be creating a > new one), is it still possible to use php to update a number that'll be > printed on the pdf form each time it is accessed?

    > again, thanks in advance.

    > gregory > hernandgnewschool.edu

    >>>> "Brian McGarvie" <bmcgarvielennox-mckinlay.co.uk> - 7/1/02 11:50 AM >>>> > Actually I just for a brilliant Free PDF library...

    > www.fpdf.org

    > Excellent tutorials/docs...

    > Use PHP to dynamically generate your forms and include any info you > wish from a database i.e. the ID and so on...

    >> -----Original Message----- >> From: Gregory Hernandez [mailto:hernandgnewschool.edu] >> Sent: 01 July 2002 4:25 PM >> To: php-generallists.php.net >> Subject: [PHP] PHP and PDF >> >> >> hello everyone-- >> >> i'd like to know if this can be solved with php. >> >> i'll be creating a pdf form that'll be downloaded, filled and turned >> in. >> the form must have a unique NUMBER printed on it each time it is >> downloaded. >> >> i'd like to use php to update this NUMBER (ie. counter + 1) each > time >> the form is >> accessed, and automatically print this NUMBER on the form that sits > on >> the server. >> >> is this possible? >> >> thanks in advance. >> >> >> gregory >> hernandgnewschool.edu >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >>

    attached mail follows:


    If you can edit the PDF file and have access to acrobat then you can use adobe's fdf format. Basically you just create a read-only text field on the original PDF and use php to fill in the value for it every time it's loaded here's some links http://www.php.net/manual/en/ref.fdf.php http://www.phpbuilder.com/columns/uwe20001116.php3 - good tutorial -------Original Message------- hello again. > thanks for the responses so far. > let me change something from my prevoius post. > let's say that i'm using an existing pdf form (i won't be creating a > new one), is it still possible to use php to update a number that'll be > printed on the pdf form each time it is accessed? > again, thanks in advance. > gregory > hernandgnewschool.edu >>>> "Brian McGarvie" <bmcgarvielennox-mckinlay.co.uk> - 7/1/02 11:50 AM >>>> > Actually I just for a brilliant Free PDF library... > www.fpdf.org > Excellent tutorials/docs... > Use PHP to dynamically generate your forms and include any info you > wish from a database i.e. the ID and so on... >> -----Original Message----- >> From: Gregory Hernandez [mailto:hernandgnewschool.edu] >> Sent: 01 July 2002 4:25 PM >> To: php-generallists.php.net >> Subject: [PHP] PHP and PDF >> >> >> hello everyone-- >> >> i'd like to know if this can be solved with php. >> >> i'll be creating a pdf form that'll be downloaded, filled and turned >> in. >> the form must have a unique NUMBER printed on it each time it is >> downloaded. >> >> i'd like to use php to update this NUMBER (ie. counter + 1) each > time >> the form is >> accessed, and automatically print this NUMBER on the form that sits > on >> the server. >> >> is this possible? >> >> thanks in advance. >> >> >> gregory >> hernandgnewschool.edu >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Tuesday 02 July 2002 00:15, Mirza Muharemagic wrote: > Hi Gregory, > > u mean, u want to update an existing PDF file? no, thats not > possible.

    In theory it is possible. The people who make the PDFLib library also has a library for modifying existing pdfs. Look on their website for more details.

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

    /* Hurd and architecture in one sentence? Uh-oh...

    - Al Viro on linux-kernel */

    attached mail follows:


    Hi Jason,

    yes, in the theory is possible, but not it in the real life (for fre :) ). no, just joking, thanx for the information. very usefull.

    Mirza mirzaphp.co.ba

    01.07.2002 20:38

    > On Tuesday 02 July 2002 00:15, Mirza Muharemagic wrote: >> Hi Gregory, >> >> u mean, u want to update an existing PDF file? no, thats not >> possible.

    > In theory it is possible. The people who make the PDFLib library also has a > library for modifying existing pdfs. Look on their website for more details.

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

    > /* > Hurd and architecture in one sentence? Uh-oh...

    > - Al Viro on linux-kernel > */

    attached mail follows:


    >hello everyone-- > >i'd like to know if this can be solved with php. > >i'll be creating a pdf form that'll be downloaded, filled and turned >in. >the form must have a unique NUMBER printed on it each time it is >downloaded. > >i'd like to use php to update this NUMBER (ie. counter + 1) each time >the form is >accessed, and automatically print this NUMBER on the form that sits on >the server. > >is this possible?

    No problem.

    If the rest of the PDF is easy to create, or can be just a JPEG, you can just use libpdf.

    First, you'll need some kind of counter. Probably trivial to do it with MySQL, right?

    Then, use the PDF library and http://php.net/pdf_show_boxed to paste in the Serial #.

    You could also look into fdf as well, if the rest of the PDF file is really complicated.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Would like to see a decent example of PHP/PDF creation anyway...

    Depending on how you define "decent"... :-)

    Rasmus' trivial samples in his talks at http://conf.php.net are nice and simplistic, so you can verify that the damn thing works. These are great, IMNSHO.

    If you want a "real" example, try this:

    http://uncommonground.com/events.htm http://uncommonground.com/events.pdf http://uncommonground.com/events.phps

    The .phps URL is sym-linked to the PDF file, not the HTM file. :-)

    YMMV.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hello, I'm hoping someone can help me as I' new to this and can't figure it out myself.

    PHP4.20 Win32

    I'm trying to seach for a string that would occur about 10 lines into a text file. I don't want to search the entire file, and I just want to know if the string exsists or not, but I don't really know what I'm doing. This is what I was trying, it occurs inside a loop that is listing the files in a directory.

    $fp = fopen("$target_filename", "r"); $contents = fgets("$fp","4096"); if(strstr("$contents", "$search_str")) { echo "<pre>"; readfile("$target_filename"); echo "</pre>"; }

    Thanks Tim Loepp

    attached mail follows:


    Try it this way.

    <? $search_str = "something"; $file = "blah";

    $found = 0; $fp = fopen($file, "r"); while(!feof($fp) && !$found) { $contents = fgets($fp, 4096); if ( strstr($contents, $search_str) ) { $found = 1; } } fclose($fp);

    if ( $found ) { echo "<pre>"; readfile($file); echo "</pre>"; } ?>

    Christopher S. Cosby SciCare Software Services

    > -----Original Message----- > From: Tim Loepp [mailto:tloepparacnet.com] > Sent: Friday, June 28, 2002 7:43 PM > To: php-generallists.php.net > Subject: [PHP] Searching for string in text file help? > > > Hello, I'm hoping someone can help me as I' new to this and > can't figure it > out myself. > > PHP4.20 Win32 > > I'm trying to seach for a string that would occur about 10 > lines into a text > file. I don't want to search the entire file, and I just want > to know if the > string exsists or not, but I don't really know what I'm > doing. This is what > I was trying, it occurs inside a loop that is listing the files in a > directory. > > $fp = fopen("$target_filename", "r"); > $contents = fgets("$fp","4096"); > if(strstr("$contents", "$search_str")) > { > echo "<pre>"; > readfile("$target_filename"); > echo "</pre>"; > } > > Thanks > Tim Loepp > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.

    attached mail follows:


    What are the specs on your system? I'm wondering how much over-all system performance is effecting your results. For example, if you have limited amounts of ram, storing blobs in a database may end up being slower than the local file system.

    -----Original Message----- I thought the performance might even boost after storing them to blobs. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Hi andy,

    i tested it a few times, and there is actually no difference. why make it complicated, when it can be simple. my opinion is there is no difference.

    Mirza mirzaphp.co.ba

    01.07.2002 14:17

    > Hi there,

    > I am wondering if anybody has experiance in saving images to blob in mysql.

    > I do save images with 1 K and 4 KB to blob fields while I used to save them > to file. It seams to me that this is much slower accessing the files. The > images take a bit (really short but absolutly noticable) to show up on the > site. Is there a way to improve the performance, and why is this happening? > I thought the performance might even boost after storing them to blobs.

    > Thank you for any comments on that,

    > Andy

    > PS: I was planing to store all the other images (20 - 50 KB) to blobs as > well (thousands) but after this first experiance I am a bit confused if the > performance would even more suffer. Would you guys recommend this?

    attached mail follows:


    >I do save images with 1 K and 4 KB to blob fields while I used to save them >to file. It seams to me that this is much slower accessing the files. The >images take a bit (really short but absolutly noticable) to show up on the >site. Is there a way to improve the performance, and why is this happening?

    Each image request is a separate HTTP connection.

    This is true REGARDLESS of whether they are stored in file system or in MySQL.

    The file system will almost certainly be *WAY* faster than MySQL. (I'm sure somebody can come up with a two-tier system with burning fast MySQL and dog-slow hard-drive on the HTTP server, but... let's be real here...)

    If the images are "too slow" you need to look at your BANDWIDTH, the HTTP server speed, and the hard drive speed, and the caching system of the OS.

    Moving the images into MySQL is unlikely to really solve any of these.

    You could run a quick test, though, in about 15 minutes of work, with a single image, just to be sure.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    that sound verry logical. It seams that most of you are absolutly sure that saving images to the OS FS is way faster than to blob in mysql.

    The main reason why I am trying to do so is because I would like to seperate my application from the content. Whenever I make an update of the application I have to move around files which are in a data folder inside the application. So I was searching for a way to avoid this and keep the data untouched.

    Maybe someone knows a better way to do that?

    Thanx for your help guys,

    Andy

    - Knud I thought this might be of interest for u 2

    "Richard Lynch" <richphpbootcamp.com> schrieb im Newsbeitrag news:20020701232018.VNIV6023.sccrmhc02.attbi.com[192.168.1.103]... > >I do save images with 1 K and 4 KB to blob fields while I used to save them > >to file. It seams to me that this is much slower accessing the files. The > >images take a bit (really short but absolutly noticable) to show up on the > >site. Is there a way to improve the performance, and why is this happening? > > > The file system will almost certainly be *WAY* faster than MySQL. > (I'm sure somebody can come up with a two-tier system with burning fast > MySQL and dog-slow hard-drive on the HTTP server, but... let's be real > here...) > > If the images are "too slow" you need to look at your BANDWIDTH, the HTTP > server speed, and the hard drive speed, and the caching system of the OS. > > Moving the images into MySQL is unlikely to really solve any of these. > > You could run a quick test, though, in about 15 minutes of work, with a > single image, just to be sure. > > -- > Like Music? http://l-i-e.com/artists.htm

    Not really, the OS filesystem contains features that makes it always faster than a sql query, that will increase your network traffic too.

    Inserting images or whatever binary data in a database does not have much sense, you could not do a query with this field, cannot be indexed (dunno if exists a DB that implement a image indexer ;) ). Storing relative pathes gave me always more portabilities between DBM.

    In some case, you have to insert images (or every others binary data) in DB (due to global permissions system only avaible for the DB and not for the filesystem, for example), but as far is possible, I avoid to do it so.

    IMHO :)

    pa

    attached mail follows:


    I am learning PHP with version 4.2. (Win ME, Apache, MySQL) on a PC

    I have to understand the new "register globals off" methods and it seems like a good idea to learn that from the beginning ....but all the books and beginners guides gives examples the old way.

    Would it be true to say that every time an example is given where data is passed on (for forms and so forth) that I can simply replace the variable in the example with $_POST or $_GET? Or do I have to do more? eg if a simple PHP file for handling form input takes in the data using $LastName can I simply use $_POST["LastName"]?? It seems to work for a very simple example. But should I read the array into a variable first? And do I need to do any validation or declaring of variables etc?? [I did have a problem reading in a number - the solution was to put (int) before the POST array name though I don't understand why that was not needed with a string.

    I am also unclear what happens when you send something using header() - does that also go into an array - if so which one and how do I use it?

    This may all seem unecessarily complicated but I am not yet au fait with the whole thing.

    Regards

    Adrian Greeman

    attached mail follows:


    AG> I have to understand the new "register globals off" methods and it seems AG> like a good idea to learn that from the beginning ....but all the books and AG> beginners guides gives examples the old way.

    give it 3 more weeks and 2nd edition of PHP Fast & Easy will be out...all register_global updated and everything. :) but that's 3 whole weeks.

    AG> eg if a simple PHP file for handling form input takes in the data using AG> $LastName can I simply use $_POST["LastName"]??

    pretty much. If POST is the method. Substitute $_GET if GET is the method.

    Handling session variables is a little different than just using session_register() Also, when uploading files, the $_FILE assoc array behaves a wee bit differently. And there's always the use of $_SERVER[PHP_SELF] instead of just $PHP_SELF.

    It's all in the manual, but if you just start with understanding the $_POST and $_GET superglobals in relation to your forms, you've made a good first step.

    - Julie

    --> Julie Meloni --> juliethickbook.com --> www.thickbook.com

    Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

    attached mail follows:


    On Monday, July 1, 2002, at 11:30 AM, Adrian Greeman wrote:

    > Would it be true to say that every time an example is given where data > is > passed on (for forms and so forth) that I can simply replace the > variable in > the example with $_POST or $_GET? Or do I have to do more?

    Pretty much. If the data was passed by a "get"-method form, or through the querystring, then the variable should be in the _GET array (such as $_GET['variablename']). Likewise for "post"-method forms, and any cookie variable names are now "$_COOKIE['variablename']". Server variables like $PHP_SELF are now $_SERVER['PHP_SELF'], and you can read the rest under "predefined variables" in the manual at the web site.

    > eg if a simple PHP file for handling form input takes in the data using > $LastName can I simply use $_POST["LastName"]?? It seems to work for a > very > simple example. But should I read the array into a variable first?

    Only if you want to -- you can always just refer to it as $_GET['variablename']. In fact this is probably better for memory use.

    > And do > I need to do any validation or declaring of variables etc?? [I did > have a > problem reading in a number - the solution was to put (int) before the > POST > array name though I don't understand why that was not needed with a > string.

    All POSTed or GETed data is string data, so if you for some reason explicitly need to cast the variable as an integer, then yes, you need to use (int). But in many cases PHP does this automatically.

    > I am also unclear what happens when you send something using header() - > does that also go into an array - if so which one and how do I use it?

    I'm assuming you mean sending some querystring data, like

    header("Location: http://domain.com/page.php?data=contents");

    if so, then yes, you will end up with the string 'contents' in a variable called $_GET['data'] .

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Hi i'm from the uk, is there any free php scripts that will allow txt messages to be sent within the uk.

    Couldn't get the other one posted here to work either,

    Wanna do a similiar idea to what that other guy was doing, but when the UPS Kicks in send a txt, but also so i can goto my site and access it and send a txt for free, :-)

    Cheers Andy

    attached mail follows:


    Well, funnily enough, your question has much the same answer ...

    If you have a mobile phone and your service provider offers a web gateway, you can use it to send SMS messages. They will provide a script that you can use. If you have an Orange phone, see the Orange web site. If it's a Voda, see their web site, and so on. The charge is usually the same as it would be if you sent the message from your phone, but if you have a contract it may include "free" messages.

    There are services such as NovelSoft (http://www.sms-wap.com) that are independant of provider, but you have to pay for them too. Novelsoft is quite cheap, and there are PHP scripts on the site, but some providers don't accept their messages. I have a NovelSoft account, but I can't use it to send messages to my Orange phone. I read somewhere that this is because some of their customers used the service to send spam.

    Simon

    > -----Original Message----- > From: Andy Whittlestone [mailto:andymkaeurope.com] > Sent: 01 July 2002 16:49 > To: php-generallists.php.net > Subject: [PHP] SMS Again, UK > > > Hi i'm from the uk, is there any free php scripts that will allow txt > messages to be sent within the uk. > > Couldn't get the other one posted here to work either, > > Wanna do a similiar idea to what that other guy was doing, but > when the UPS > Kicks in send a txt, but also so i can goto my site and access it > and send a > txt for free, :-) > > Cheers Andy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Oh yes, I forgot about email, which was mentioned in another answer to this FAQ.

    Some providers give you an email address with your phone, for example I believe that One2One (or whatever it's called today) give you <phonenumber>one2one.com. Email sent to that address arrives at your phone as an SMS. Somebody has to pay for the message, so it's probably you.

    By the way, there is no guarantees on how long it will take to deliver an SMS, or if it will ever arrive. Typically 1% never arrive, more if the network is very busy because something interesting has just happened on "Big Brother" and everybody below 35 in the UK is sending a text (to somebody who is busy sending them one). That means it's wise to send a text, wait a few minutes and send it again. Buy a UPS with plenty of capacity ...

    Oh yes, and don't forget to put all of the network access devices on the UPS - the router, the switch and so on. Otherwise when the power fails, you won't be able to access the message gateway across the web.

    Simon

    attached mail follows:


    Hi, when reading about constants (define('MY_CONSTANT', 'my value')) I got convinced that they are pretty usefull.

    But now it seems to me, that I can't use them inside a string: $my_string = "This is MY_CONSTANT and I love it!";

    but that I must take them out: $my_string = "This is" . MY_CONSTANT . "and I love it!";

    Isn't there a way around? And must I suspect more strange things to come with constants?

    greetings, Uwe

    attached mail follows:


    >Hi, >when reading about constants (define('MY_CONSTANT', 'my value')) >I got convinced that they are pretty usefull. > >But now it seems to me, that I can't use them inside a string: >$my_string = "This is MY_CONSTANT and I love it!"; > >but that I must take them out: >$my_string = "This is" . MY_CONSTANT . "and I love it!"; > >Isn't there a way around? >And must I suspect more strange things to come with constants?

    Try this: $my_string = "This is {MY_CONSTANT} and I love it!";

    Can't promise it will work, mind you...

    It's not all that common to bury constants in strings... And is the extra " . " K ". " that big a deal? Seems a small price for cleaner code.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi, I just made the same (even on the same weekend) - it's working now. What exactly is going on and what have you done?

    With me one problem was (e.g.) that I forgot to set the document root properly in httpd.conf.

    Uwe

    attached mail follows:


    >Good morning! > >Over the weekend I attempted to set up another test platform on a Win98 >laptop, running Apache as the server and MySQL as the database engine. Just >want to use it for some testing locally. No matter what I attempted I could >not get PHP to work. I followed suggestions from; > >http://www.php.net/manual/en/install.windows.php > >I tried some other experiments, and finally gave up. I would either get file >not found messages, or a server error. Has anyone ever done this kind of >install, and if so, is there something I can do to get it working? If not I >am going to install Linux on the laptop.

    Which server error?...

    Also try different browsers. They all suck at accurately reporting what is going on with the server, but sometimes one has a better message than the other...

    Any errors in your Apache error logs?

    Did you try to do CGI or Module install?

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Dang. $2880 is kind of expensive! I wish they'd base licensing more on how many copies your encoded program you sell.

    -----Original Message----- http://www.zend.com/store/products/zend-encoder.php **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Sorry, Wrong topic.

    http://www.php-encoder.com/

    Looks like beta is starting soon for this, so we should see it in a little bit. They have an option for per script charge. You upload the file and it gives you a compiled one. My guess it is the same thing as Zend encoder, just not as expensive.

    Dan

    Dang. $2880 is kind of expensive! I wish they'd base licensing more on how many copies your encoded program you sell.

    -----Original Message----- http://www.zend.com/store/products/zend-encoder.php **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Check SourceForge.com to see what content management systems are available.

    -----Original Message----- To those who have used these content management systems: which one renders pages faster, PostNuke or PHP-Nuke? I plan to set up a site on my Linux box and want to know which one I should use. :)

    Also, would anyone know of a PHP based content management system that does not have the usual 3 columns look? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    http://www.php-encoder.com/

    Looks like beta is starting soon for this, so we should see it in a little bit. They have an option for per script charge. You upload the file and it gives you a compiled one. My guess it is the same thing as Zend encoder, just not as expensive.

    Dan

    -----Original Message----- From: Lazor, Ed [mailto:ELazorprovidence.org] Sent: Monday, July 01, 2002 10:01 AM To: 'Andres Montiel'; PHP General Subject: RE: [PHP] Page rendering speed: PostNuke or PHP-Nuke

    Check SourceForge.com to see what content management systems are available.

    -----Original Message----- To those who have used these content management systems: which one renders pages faster, PostNuke or PHP-Nuke? I plan to set up a site on my Linux box and want to know which one I should use. :)

    Also, would anyone know of a PHP based content management system that does not have the usual 3 columns look? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

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

    attached mail follows:


    anyone have some code they can send me that will successfully upload a file? I've got all the HTML correct, it's just that my PHP code ain't working. Thanks! Phil

    attached mail follows:


    How do you know it ain't working? Send us your code, maybe we can fix it.

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Monday, July 01, 2002 10:59 AM To: php-generallists.php.net Subject: [PHP] uploading a file

    anyone have some code they can send me that will successfully upload a file? I've got all the HTML correct, it's just that my PHP code ain't working. Thanks! Phil

    attached mail follows:


    Hi Phil,

    your input file name should be "the_file"

    <snip>

    global $the_path_news, $the_file_name, $the_file, $the_path;

    if ($the_file_name) { if (!move_uploaded_file($the_file, $the_path."/".$the_file_name)) { echo "something barfed."; exit; }

    else { echo "uploaded."; } } <snap> Mirza mirzaphp.co.ba

    01.07.2002 17:59

    > anyone have some code they can send me that will successfully upload a > file? I've got all the HTML correct, it's just that my PHP code ain't > working. > Thanks! > Phil

    attached mail follows:


    Upload.html ===============

    <!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> <HTML> <TITLE> FileUpload </TITLE> <head> <script language="Javascript">

    function check() { document.upload.method = "POST"; document.upload.enctype='multipart/form-data' document.upload.action="upload.php"; document.upload.submit(); return true; }

    </script> </head>

    <BODY>

    <center> <form name="upload" Onsubmit="return check()" enctype='multipart/form-data'> <br><br><br><br> <table border="0" width="100%"> <tr><td width="30%" align="right"><b><font size="2" face="Arial">File&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;</font></b></td><td width="5%"></td><td width="50%"><input type='file' name='path' size="16" value=""> </td></tr>

    <tr> <td width="50%" align="right"> <p align="left">

    </td> <td width="5%"> </td> <td width="50%"> <p align="left"> <input type="submit" Value="UPLOAD" ></td> </tr> </table>

    </form> </center>

    </BODY> </HTML>

    Upload.php ================

    <?php

    if(copy($path,$path_name)) { print "<br><br><br><center><font face='verdana' size=+2 color=blue>Your file $path_name has been uploaded!!!</font></center>" ; } else { print "<font face='verdana' size=+2 color=red>A problem was encountered during your file upload.</font><br>"; }

    ?>

    =================

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Monday, July 01, 2002 9:29 PM To: php-generallists.php.net Subject: [PHP] uploading a file

    anyone have some code they can send me that will successfully upload a file? I've got all the HTML correct, it's just that my PHP code ain't working. Thanks! Phil


    attached mail follows:


    Hi!

    With the register_global turned off. I'm working on making the login to work again. So, I have a few questions.

    1) $GLOBALS, Where does this come from and where does this goes to? I noticed there is no variable declaration for this, so I just know that it is part of PHP codes, although I haven't figure out what is it part of.

    2) What would be the way to go to make it work, when changing it within this script with register_global turned on to turned off? --clip -- while (list($var, $value) = each($GLOBALS[HTTP_POST_VARS]) { $GLOBALS[$var] = stripslashes(trim($value)); } reset ($GLOBALS[HTTP_POST_VARS]); --clip-- I tried different ways to make it work and I kept getting the error saying " Variable passed to each() is not an array or object " " Variable passed to reset() is not an array or object "

    Thanks FletchSOD

    attached mail follows:


    Hi, try these: http://www.php.net/manual/en/language.variables.predefined.php#language.vari ables.predefined

    http://www.php.net/manual/en/reserved.variables.php

    greetings,

    Uwe

    attached mail follows:


    >1) $GLOBALS, Where does this come from and where does this goes to? I >noticed there is no variable declaration for this, so I just know that it is >part of PHP codes, although I haven't figure out what is it part of.

    Every variable you assign, change, or unset, or that comes in from the outside world, is in $GLOBALS.

    $GLOBALS is PHP's internal array of all variables with their values.

    Mucking directly with $GLOBALS in any way shape or form is almost-for-sure a Bad Idea (tm).

    [There are exceptions to this rule... If you know what you're doing well enough to be doing those exceptions, go for it.]

    >2) What would be the way to go to make it work, when changing it within this >script with register_global turned on to turned off? >--clip -- > while (list($var, $value) = each($GLOBALS[HTTP_POST_VARS]) > { > $GLOBALS[$var] = stripslashes(trim($value)); > } > reset ($GLOBALS[HTTP_POST_VARS]); >--clip-- >I tried different ways to make it work and I kept getting the error saying >" Variable passed to each() is not an array or object " >" Variable passed to reset() is not an array or object "

    if (isset($HTTP_POST_VARS)){ reset($HTTP_POST_VARS); while(list($var, $val) = each($HTTP_POST_VARS)){ $$var = $val; } }

    You could repeat this code for $HTTP_GET_VARS, $HTTP_COOKIE_VARS, etc.

    You could even do it, in order, for all of them, and essentially "undo" the turning off of register_globals.

    Once you've gone that far, it's only a step away to write an "import" function which takes variable names and/or source (POST, GET, COOKIE) and sucks in the variables you expect at the top of your script, without sucking in the potentially damaging crud of a hacker.

    # Untested code. YMMV.

    function import($variables = NULL, $source = NULL){ if (is_array($variables)){ while (list($var, $source) = $variables)){ # HACK!!! # If no source was supplied, the value is the variable, not the key. if (is_int($var){ import($var); } else{ import($var, $source); } } } else{ global $$var; if ($source === NULL){ # Should suck in the ordering from EGPCS thingie in php.ini, really. I'm lazy. if (isset($HTTP_POST_VARS[$var])){ $$var = $HTTP_POST_VARS[$var]; } elseif (isset($HTTP_GET_VARS[$var])){ $$var = $HTTP_GET_VARS[$var]; } # The remaining elseif clauses for COOKIE, ENV, etc are left as an exercise for the reader... } elseif ($variables != NULL){ $array = "HTTP_$source_VARS"; # This next bit might need some syntactic work with those {}s in there... Untested code, eh? if (isset({$$array}[$var])){ $$var = {$$array}[$var]; } } } }

    Sample usage, if I got the code correct:

    import("foo"); # Imports $foo just like PHP used to import("foo", 'POST'); # Imports $foo like PHP used to, but only if it's a POST. import(array('foo', 'bar'); # Imports $foo and $bar like PHP used to. import(array('foo'=>'POST', 'bar'=>'GET'); # Imports $foo from POST and $bar from GET like PHP used to... Okay, not a whole lot like PHP used to, but sorta.

    NOTE: If you know your code will never need to run on *older* versions of PHP, replace $HTTP_POST_VARS with that new-fangled $_POST variable.

    NOTE: All the solutions up to, but not includeing, "function import", completely bypass the entire *point* of not using register_globals in the first place. It should be considered a short-term solution.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Over-complicating it? Yes, I must admit that's true. The problem however was not that I didn't understand the question, but that I apparently was hostile. For someone extra-sensitive, I think I could've looked like that, but I still don't think I was out of line with my original reply, which sparked the whole discussion.

    And yes, I agree that "Are you new to PHP" may sound like an insult - depending on the person, maybe even more than my reply.

    Bogdan

    Lazor, Ed wrote:

    >You guys are over-complicating this. If you want to help someone and don't >understand their question, just say so. People asking for help are usually >more than happy to provide additional information or rephrase their >question. > >Be careful when using the question, "Are you new to PHP?". It has an >implied, "That was an awfully silly question... are you new to PHP?". Some >may take that as an insult. Of course, it could be funny as well. Imagine >responding to Rasmus, "Are you new to PHP?" ;) hehe > > > > >>-----Original Message----- >>it could be augmented with questions like "Are you new to PHP?" and, >>in the specific case we've been discussing, "Are you trying to create >>a basic gradient or something unusual?", etc. >> >> > >**************************************************************************** >This message is intended for the sole use of the individual and entity to >whom it is addressed, and may contain information that is privileged, >confidential and exempt from disclosure under applicable law. If you are >not the intended addressee, nor authorized to receive for the intended >addressee, you are hereby notified that you may not use, copy, disclose or >distribute to anyone the message or any information contained in the >message. If you have received this message in error, please immediately >advise the sender by reply email and delete the message. Thank you very >much. > > >

    attached mail follows:


    There are benefits to this making the performance hit worthwhile in some instances.

    More info: http://www.zend.com/zend/trick/tricks-sept-2001.php

    -----Original Message----- Inserting images or whatever binary data in a database does not have much sense **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    On Mon, 1 Jul 2002 09:35:37 -0700 "Lazor, Ed" <ELazorprovidence.org> wrote:

    > There are benefits to this making the performance hit worthwhile in some > instances.

    Sure, the exceptions rules :).

    I am not sure about your answer. The article where you pointed me does not go against what we said, and show the different solutions we have to manage binary datas.

    I must precise that a path can be an url, this url points to the other server and do whatever you want there (except store images in a db ;))) ).

    hth

    pa > More info: > http://www.zend.com/zend/trick/tricks-sept-2001.php > > -----Original Message----- > Inserting images or whatever binary data in a database does not have much > sense

    attached mail follows:


    Aren't you saying that storing files on the local file system is generally faster than using database blobs?

    There are enough examples in the article and related threads to convince me that benefits to database blobs are more than exceptions to the rule. In fact, there are even examples where database access is faster.

    -----Original Message----- Sure, the exceptions rules :).

    The article where you pointed me does not go against what we said, and show the different solutions we have to manage binary datas. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    On Mon, 1 Jul 2002 11:24:31 -0700 "Lazor, Ed" <ELazorprovidence.org> wrote:

    > Aren't you saying that storing files on the local file system is generally > faster than using database blobs? In most cases I meet (mysql, pgsql and oracle), the filesystem methods were faster on Linux and Solaris systems. Anywhere I did not say you do not have to store binary datas in DB. Sometimes it is usefull.

    but : "The primary advantage to keeping files in a MySQL database over keeping them in the local file system may be the ability to separate the database and Web servers onto dedicated hardware. The PHP code above can easily open a connection to database server on another machine." And this primary adv falled down with URI ;).

    > There are enough examples in the article and related threads to convince me > that benefits to database blobs are more than exceptions to the rule. In > fact, there are even examples where database access is faster. Maybe yes, maybe not, just test it yourself on your prod systems and do your best.

    pa

    attached mail follows:


    Checked the archive and saw no difinitives... so... How come when I query my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP record that it always comes up Jan 18, 2038?

    Is the clock not set properly, or am I misunderstanding some basic principal of the time stamp?

    My clients version pf PHP is 4+ on a Windows IIS server.

    Any clues??? Thanks -NorthBayShane

    attached mail follows:


    Perhaps the problem is in your translation. NOW() records a timestamp that is formated by YYYYMMDDHHMMSS. If you are translating this in PHP a function designed to take in a UNIX timestamp (that is "Unix Epoch" time , the number of seconds from some date 30 years ago) you will recieve a rather confusing result. This may not be the problem but it was just a thought. -Kevin

    ----- Original Message ----- From: "Shane" <shanedelaplaine.com> To: <php-generallists.php.net> Sent: Monday, July 01, 2002 10:38 AM Subject: [PHP] mySQL time = year 2038 [HELP]

    > Checked the archive and saw no difinitives... so... How come when I query my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP record that it always comes up Jan 18, 2038? > > Is the clock not set properly, or am I misunderstanding some basic principal of the time stamp? > > My clients version pf PHP is 4+ on a Windows IIS server. > > Any clues??? > Thanks > -NorthBayShane > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi Shane,

    use SYSDATE().

    Mirza mirzaphp.co.ba

    01.07.2002 18:38

    > Checked the archive and saw no difinitives... so... How come when I query my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP record that it always comes up Jan 18, 2038?

    > Is the clock not set properly, or am I misunderstanding some basic principal of the time stamp?

    > My clients version pf PHP is 4+ on a Windows IIS server.

    > Any clues??? > Thanks > -NorthBayShane

    attached mail follows:


    Can you post some example code. I know that 2038 is the maximum for a MySQL date column, but I don't know how you'd be setting it to that...

    ---John Holmes...

    ----- Original Message ----- From: "Shane" <shanedelaplaine.com> To: <php-generallists.php.net> Sent: Monday, July 01, 2002 12:38 PM Subject: [PHP] mySQL time = year 2038 [HELP]

    Checked the archive and saw no difinitives... so... How come when I query my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP record that it always comes up Jan 18, 2038?

    Is the clock not set properly, or am I misunderstanding some basic principal of the time stamp?

    My clients version pf PHP is 4+ on a Windows IIS server.

    Any clues??? Thanks -NorthBayShane

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

    attached mail follows:


    >Checked the archive and saw no difinitives... so... How come when I query >my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP >record that it always comes up Jan 18, 2038? > >Is the clock not set properly, or am I misunderstanding some basic >principal of the time stamp? > >My clients version pf PHP is 4+ on a Windows IIS server.

    Show us some source code...

    2038 is the "end of time" for Unix timestamps on 32-bit hardware.

    In other words, if you take 0xFFFFFFFF, that 2 billion number that's the biggest signed integer you can get with 32 bits, and you try to turn that into a date/time, you'll get something in March of 2038, which is 2 billion seconds after JANUARY 1st, 1970, midnight (GMT), which is "0" time.

    Most likely, you are somehow convincing MySQL and/or PHP to use some number very close to 0xFFFFFFFF and convert that to a time stamp...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Where can I get mcrypt for windows and php 4.2.1?

    attached mail follows:


    Is this the place to address it?

    -- 
    Member - Liberal International	On 11 Sept 2001 the WORLD was violated.
    This is doctornl2k.ab.ca	Ici doctornl2k.ab.ca
    Society MUST be saved! Extremists must dissolve.  
    Beware of defining as intelligent only those who share your opinions
    

    attached mail follows:


    >Is this the place to address it?

    There is probably a phpMyAdmin mailing list that would be *FAR* more suitable...

    There might even be a PHP Security mailing list http://php.net/mailing-lists.php that would be more suitable than here (but less than the phpMyAdmin list).

    If you *really* think it fits best here...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    List, I've a RH7.3 machine (just installed) and want to get PHP to access my M$ SQL database. I'm on a small time crunch here too. My M$ web server died and it's so hosed that I had to call support (ouch!). Anyways...they haven't fixed it yet and I thought it would be funny to get my RH7.3/Apache/PHP server to replace it before they could fix my machine ;>. I've done this once before (like last year or so) but I cannot finc my docs so any pointers would be great.

    TIA /B

    attached mail follows:


    Here is the error I'm receiving when attempting to upload a file.... Warning: Unable to create 'temp/test.txt': Permission denied in /home/.../www/website/upload3.php on line 11

    ..could it be that my web host isn't giving me permissions to upload files ?

    attached mail follows:


    Message-ID: <C8891DEC2698D411A91B00508BF9898806E11847phsormsg04.phsor.org> From: "Lazor, Ed" <ELazorprovidence.org> To: 'Phil Schwarzmann' <pschwarjhmi.edu>, php-generallists.php.net Date: Mon, 1 Jul 2002 10:21:20 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [PHP] uploading a file - here is the error message...

    The web server needs write access to where you're trying to store the files. Check the directory permissions. Check with your ISP to make sure there are solutions other than making the directory world writeable.

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Monday, July 01, 2002 10:13 AM To: php-generallists.php.net Subject: [PHP] uploading a file - here is the error message...

    Here is the error I'm receiving when attempting to upload a file.... Warning: Unable to create 'temp/test.txt': Permission denied in /home/.../www/website/upload3.php on line 11

    ..could it be that my web host isn't giving me permissions to upload files ? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    That's always possible. Unless you have access to your temp directory you will not be able to update the permissions. At this point I would email your host and ask them about the situation. Good luck. -Kevin

    ----- Original Message ----- From: "Phil Schwarzmann" <pschwarjhmi.edu> To: <php-generallists.php.net> Sent: Monday, July 01, 2002 11:13 AM Subject: [PHP] uploading a file - here is the error message...

    > Here is the error I'm receiving when attempting to upload a file.... > > Warning: Unable to create 'temp/test.txt': Permission denied in > /home/.../www/website/upload3.php on line 11 > > > ..could it be that my web host isn't giving me permissions to upload > files ? >

    attached mail follows:


    Hi Phil,

    first thing u should do is to check permission of this directory (CHMOD). the 2nd one, u should replace function "copy" with "move_uploaded_file". than is should work.

    Mirza mirzaphp.co.ba

    01.07.2002 19:13

    > Here is the error I'm receiving when attempting to upload a file.... > Warning: Unable to create 'temp/test.txt': Permission denied in > /home/.../www/website/upload3.php on line 11

    > ..could it be that my web host isn't giving me permissions to upload > files ?

    attached mail follows:


    I took your advice first and tried "move_uploaded_file" and it kept saying "It barfed" (hehe). Then I switched to "copY" and got this new error. Thaks for your help!!

    >>> mirzaphp.co.ba 07/01/02 01:29PM >>> Hi Phil,

    first thing u should do is to check permission of this directory (CHMOD). the 2nd one, u should replace function "copy" with "move_uploaded_file". than is should work.

    Mirza mirzaphp.co.ba

    01.07.2002 19:13

    > Here is the error I'm receiving when attempting to upload a file....

    > Warning: Unable to create 'temp/test.txt': Permission denied in > /home/.../www/website/upload3.php on line 11

    > ..could it be that my web host isn't giving me permissions to upload > files ?

    attached mail follows:


    Date: Mon, 01 Jul 2002 17:56:31 -0500 From: "Richard Lynch" <richphpbootcamp.com> To: php-generallists.php.net Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Message-Id: <20020701232128.VOEU6023.sccrmhc02.attbi.com[192.168.1.103]> Subject: Re: uploading a file - here is the error message...

    >Here is the error I'm receiving when attempting to upload a file.... > >Warning: Unable to create 'temp/test.txt': Permission denied in >/home/.../www/website/upload3.php on line 11 > > >..could it be that my web host isn't giving me permissions to upload >files ? >

    Yes. Or at least not where you are trying to put the file...

    Give us the first 11 lines of upload3.php please.

    It's possible that you simply need to create a world-writable directory for your uploads.

    Do *NOT* *NOT* *NOT* *NOT* *NOT* *NOT* *NOT* create that world-writable directory *INSIDE* your "web" directory (or htdocs, or where-ever it is that you are putting your HTML files).

    Did you catch that? It's really important that you not have world-writable directories in your web server tree...

    When you FTP (or SCP, or SSH) in to your account, what do you see *FIRST*?

    If it's something like this:

    / /htdocs /cgi

    Then you should create a new directory called "incoming" (or "uploads" or whatever) there so you see:.

    / /htdocs /cgi /uploads

    Note that "uploads" is *NOT* inside of "htdocs" but "next to" it.

    Then, make *that* directory world-writable. (Use your FTP software or from SSH/telnet do):

    chmod 777 uploads

    *THEN*, alter your PHP script to upload the files to there:

    $path = "/full/path/to/uploads"; if (move_uploaded_file($file, "$path/$file_name")){ # Do *everything* you can think of here to be sure # "$path/$file_name" is totally kosher, and is not # some hacker binary or porn or whatever you don't # want on your server. # Once you *know* it's kosher, insert the path into a MySQL table: $query = "insert into kosher_uploads (path) values ('$file_name')"; mysql_query($query) or error_log(mysql_error()); #Check HTTP error log for errors! } else{ echo "Upload failed!"; }

    Then, in a separate script, in a "cron" job (read "man 5 crontab") you can do:

    <?php $upload = "/full/path/to/uploads"; $destination = "/full/path/to/where/you/really/wanted/it/"; $query = "select path from kosher_uploads"; # It's a cron job that will send *YOU* email, so it's okay to print MySQL errors $paths = mysql_query($query) or print(mysql_error()); $moved = array(); while (list($path) = mysql_fetch_row($paths)){ if (rename("$upload/$path", "$destination/$path")){ $moved[] = $path; } } $goners = implode("', '", $moved; $query = "delete from kosher_uploads where path in ('$goners')"; mysql_query($query) or print(mysql_error()); ?>

    NOTE: The first script does not deal well with filename "collisions" IE, What if *TWO* people upload "Britney.JPEG" at the same time. (Assuming you want to allow JPEG upload in the first place.) (And that you don't want to rule out anything named Britney on principle.) :-)

    All this code is just typed in, untested... But the ideas are sound. YMMV.

    If the real problem is that the upload *ITSELF* is trying to create temp/test.txt (I think not) then you need to dig into php.ini and/or .htaccess an alter the file_upload_dir and get that to be a directory that PHP user can write to (again, a world-writable directory *NOT* inside your web-tree). Your ISP may or may not have chosen to make this impossible for you to do. No way to tell with the info you've given so far... Asking the ISP would be faster/easier on that one.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi people,

    I got this line that is relly giving me a pain..:

    if (preg_match("siteUserList.cgi\?group=site177(&?)", $QUERY_STRING))

    As you can see it just matches the query string when it looks like this: siteUserList.cgi?group=site177& (with or without a "&")

    The thing is I need it to match also if after the "&" there is a number (that will have more than 1 digit)

    Ive tried many diffrent thing with \d+ but I can get it to work.. can somebody give me some light? Thanks.

    attached mail follows:


    Hi,

    something like this:

    $QUERY_STRING = "siteUserList.cgi?group=site177&2345"; if (preg_match("#siteUserList.cgi\?group=site177(&?[\d]*)#",$QUERY_STRING,$array11)) { echo "found: $array11[0]<br />$array11[1]"; }

    Mirza mirzaphp.co.ba

    01.07.2002 19:37

    > Hi people,

    > I got this line that is relly giving me a pain..:

    > if (preg_match("siteUserList.cgi\?group=site177(&?)", > $QUERY_STRING))

    > As you can see it just matches the query string when it looks like > this: siteUserList.cgi?group=site177& (with or without a "&")

    > The thing is I need it to match also if after the "&" there is a number > (that will have more than 1 digit)

    > Ive tried many diffrent thing with \d+ but I can get it to work.. can > somebody give me some light? Thanks.

    attached mail follows:


    On Monday, July 1, 2002, at 01:37 PM, <phpnet.co.cr> wrote:

    > I got this line that is relly giving me a pain..: > > if (preg_match("siteUserList.cgi\?group=site177(&?)", > $QUERY_STRING)) > > As you can see it just matches the query string when it looks like > this: siteUserList.cgi?group=site177& (with or without a "&") > > The thing is I need it to match also if after the "&" there is a number > (that will have more than 1 digit) > > Ive tried many diffrent thing with \d+ but I can get it to work.. can > somebody give me some light? Thanks.

    preg_match('/siteUserList.cgi\?group=site177&?(\d\d+)?/', $QUERY_STRING)

    that will match the following criteria: if there is a "&" sign OR a "number with more than 1 digit" OR both an "&" sign AND a "number with more than 1 digit"

    If you only want it to match if there is BOTH an "&" sign AND a "number with more than 1 digit", it should be like this:

    preg_match('/siteUserList.cgi\?group=site177(&\d\d+)?/', $QUERY_STRING)

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    I looked over the revised version of the document and unfortunately I still don't fully understand. I know that I have to save the data on each line, and then either display it or turn it into a variable. You put the data in an array and then implode it into a string, however I am not 100% certain about this process...

    Could you give me any advice?

    -----Original Message----- From: Analysis & Solutions [mailto:danielcanalysisandsolutions.com] Sent: Monday, July 01, 2002 6:26 AM To: PHP List Subject: Re: [PHP] XML Problem

    Sire:

    On Sun, Jun 30, 2002 at 10:21:40PM +0200, Sebastian A. wrote: > > Later on, you make the $Cdata a string, $temp, and then the next time you > use it: $Temp = $Data['TRADE-DATETIME'] > You re-assign it again without using the data. Did I miss something?

    Yes. Further down was the default case, with the line:

    $Data[$Elem] = $Temp;

    But, that's not there any more. I reworked that file a bit to clarify that and add in more error checking.

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

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

    attached mail follows:


    Sebastian:

    On Mon, Jul 01, 2002 at 07:36:34PM +0200, Sebastian A. wrote: > I looked over the revised version of the document and unfortunately I still > don't fully understand. I know that I have to save the data on each line, > and then either display it or turn it into a variable. You put the data in > an array and then implode it into a string, however I am not 100% certain > about this process...

    There's nothing more I can do to clarify the situation.

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


    Hi, at this link: http://www.php.net/manual/en/funcref.php i can see the categories of the available functions, But How can i see all the fucnctions in php together (in one screen)? Is there a way to do that. Thank You anil

    attached mail follows:


    here is a quicky that I wrote up to do just that

    <?php $ext = get_loaded_extensions();

    foreach($ext AS $module_name) $functions[$module_name] = get_extension_funcs($module_name);

    print_r($functions); // This is the returned array from above ?>

    Jim Lucas ----- Original Message ----- From: "Anil Garg" <anilgniksun.com> To: <php-generallists.php.net> Sent: Monday, July 01, 2002 10:52 AM Subject: [PHP] viewing php predefined fucntions

    > Hi, > at this link: > http://www.php.net/manual/en/funcref.php > i can see the categories of the available functions, But > How can i see all the fucnctions in php together (in one screen)? > Is there a way to do that. > Thank You > anil > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Never have encountered this. When I include a query string on the URL line I can not access the variables.

    For example: www.tim.com?action=move

    I should be able to access the variable action. However I am currently not able to do this. I am not receiving an error of any kind, but nothing is being produced when I echo or print this as $action.

    Is there a setting that I've missed somewhere?

    Any help will be much appreciated.

    Thanks

    Tim Nields

    attached mail follows:


    On Tuesday 02 July 2002 04:45, Tim Nields wrote: > Never have encountered this. When I include a query string on the URL line > I can not access the variables. > > For example: www.tim.com?action=move > > I should be able to access the variable action. However I am currently not > able to do this. I am not receiving an error of any kind, but nothing is > being produced when I echo or print this as $action. > > Is there a setting that I've missed somewhere?

    register_globals

    RTFM and the archives.

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

    /* Truth can wait; he's used to it. */

    attached mail follows:


    In the beginning of your page try:

    $action=$_GET["action"]; echo $action;

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Monday, July 01, 2002 12:01 PM To: php-generallists.php.net Subject: Re: [PHP] Query String...

    On Tuesday 02 July 2002 04:45, Tim Nields wrote: > Never have encountered this. When I include a query string on the URL line > I can not access the variables. > > For example: www.tim.com?action=move > > I should be able to access the variable action. However I am currently not > able to do this. I am not receiving an error of any kind, but nothing is > being produced when I echo or print this as $action. > > Is there a setting that I've missed somewhere?

    register_globals

    RTFM and the archives.

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

    /* Truth can wait; he's used to it. */

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

    attached mail follows:


    Thank you very much...

    "Jason Wong" <php-generalgremlins.com.hk> wrote in message news:<200207020201.25465.php-generalgremlins.com.hk>... > On Tuesday 02 July 2002 04:45, Tim Nields wrote: > > Never have encountered this. When I include a query string on the URL line > > I can not access the variables. > > > > For example: www.tim.com?action=move > > > > I should be able to access the variable action. However I am currently not > > able to do this. I am not receiving an error of any kind, but nothing is > > being produced when I echo or print this as $action. > > > > Is there a setting that I've missed somewhere? > > register_globals > > RTFM and the archives. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Truth can wait; he's used to it. > */ >

    attached mail follows:


    Tim,

    $action = $_GET["action"]; should do it. I assume you have register_globals off (as it is by default nowadays).

    HTH Chris

    Tim Nields wrote:

    >Never have encountered this. When I include a query string on the URL line >I can not access the variables. > >For example: www.tim.com?action=move > >I should be able to access the variable action. However I am currently not >able to do this. I am not receiving an error of any kind, but nothing is >being produced when I echo or print this as $action. > >Is there a setting that I've missed somewhere? > >Any help will be much appreciated. > >Thanks > >Tim Nields > > >

    attached mail follows:


    List, I'm getting this error message...where does it come from?

    /B

    Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4

    attached mail follows:


    [snip]

    Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4 [/snip]

    Could we see line 4?

    attached mail follows:


    It depends on your operating system. This is a Windows system level configuration option. For example, in Windows 2000, you'd configure DSN's in Start->Settings->Control Panel->Administrative Tools->Data Sources(ODBC)

    -----Original Message----- I'm getting this error message...where does it come from?

    Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4 **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    List, Guess I should be more specific:

    Heres line four: $db = odbc_connect("somedsn","sa", "");

    My System: RedHat 7.3/Apache/PHP 4.1.2-7 I'm getting this error message...I think I just need to define the DSN...is that done in /etc/odbc.ini? Or what?

    /B

    Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4

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

    attached mail follows:


    What kind/version of DB?

    -----Original Message----- From: David Busby [mailto:busbypnts.com] Sent: Monday, July 01, 2002 2:55 PM To: php-general Subject: [PHP] Where do I specify a DSN? v0.2

    List, Guess I should be more specific:

    Heres line four: $db = odbc_connect("somedsn","sa", "");

    My System: RedHat 7.3/Apache/PHP 4.1.2-7 I'm getting this error message...I think I just need to define the DSN...is that done in /etc/odbc.ini? Or what?

    /B

    Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4

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

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

    attached mail follows:


    In article <20020628114946.16490.qmailpb1.pair.com> , webmastertececo.com (Jj Harrison) wrote:

    >what is the best way to increment a mySQL table cell? > >is there a increment function or do I need to increment it in php?

    Do you mean like this:

    update myTable set myCell = myCell + 1 where myId = 42

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <NGBBLPBEELHLNAOOPEOLIEPGDDAA.fatihyore.com.tr> , fatihyore.com.tr (Fgôk ÞôündÉö) wrote:

    >In php.ini, upload_max_filesize = 8MB. >When I try to upload file over 5MB, my php file didn't work correctly. >I mean post variable in the php file are lost, session variables also are >lost ...

    Are you 100% sure that you are looking at the correct php.ini?...

    What does <?php phpinfo();?> say is the upload_max_filesize?

    And did you over-ride that with your HTML? There's a tag that can be used to decrease (but not increase) the MAX FILE SIZE.

    Uploading 5 MB files via HTTP is just a Bad Idea (tm)...

    Is there any way to move to FTP?

    I suspect there are several other possible sources of error:

    Your HTTP server, and any intervening router *IS* allowed to limit the size of a POST to any value they choose, so long as that value is AT LEAST 1 MB. (I think.) While they are all encouraged *NOT* to impose such a limit, they may.

    The user under which PHP is running *MAY* have some kind of shell limit imposed on their individual temp files or somesuch, I guess... I mean, I know there are things like 'ulimit' and 'usage' and so on (see 'man ulimit') and I reckon somebody somewhere may be bright enough to have come up with a limitation scheme for the 'nobody' user in the '/tmp' directories... I dunno exactly how they might have done that, but it's in the realm of "possible".

    Client configuration -- There may be a buffer and/or Ethernet communication error that only manifests when you start getting over your 5 MB threshold... On both your desktop and on the web-server, do:

    ifconfig -a

    (I think that's ifconfig /a under Winblows... Or, no, ipconfig /a No, that's not right... Hell, I don't know. Go ask Bill!)

    Anyway, if you do this right before/during/after your upload, and the "Collision Rate" or "errors" or "overruns" or anything that looks like some kind of an "error" increases significantly, your Ethernet settings are probably "wrong" -- They could be "wrong" in a very subtle way involving TTL, MTU, and other TLA's that I don't really understand, and few people do, since everybody who tries to 'splain it to me just confuses me. (So, by definition, they must not understand it very well, eh? :-)

    You may need to do: whereis ifconfig just to find out where the heck the program lives... If it lives in /sbin, you may need to do: /sbin/ifconfig -a to get an answer. If your ISP is smart, you may not be allowed to even *DO* ifconfig on your web-server... If they are that smart, you can maybe assume they have set it up correctly... Maybe.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020628235711.65676.qmailpb1.pair.com> , brandoaugmented-chaos.com (Brandon) wrote:

    >I would like to store a jpg/gif image in a MySQL database (as a BLOB type I >guess ;p), how would I output that into an <img src=""> in php?

    You wouldn't, really.

    You would do something like this:

    <IMG SRC=fakeoutbrowser.php/image.gif?image_id=42 ...>

    Then, the PHP code in fakeoutbrowser.php would look like:

    <?php $query = "select imagedata from images where image_id = $image_id"; $image = mysql_query($query) or error_log(mysql_error()); # Check HTTP log for Errors! $image_data = mysql_result($image, 0, 0); header("Content-type: image/gif"); echo $image_data; ?>

    NOTE: I *highly* recommend you *NOT* actually do this. Images will simply clog up your MySQL database, risk db-corruption, and slow down your MySQL data transfers to *NO* benefit.

    Unless you are the CIA doing high-end image-comparison in SQL to actually detect if two images "look alike" there's *NO* benefit to cramming your images into an SQL database.

    Far, far better to store them in a high-performance, customized, optimized, much-used data store commonly known as "the file system" :-)

    Just throw the images in a directory (possibly *outside* your web-tree) and use PHP/MySQL to authorize access, and even use PHP to http://php.net/fread the file, but not actually cram it into MySQL.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020628125957.61236.qmailpb1.pair.com> , webmastertececo.com (Jj Harrison) wrote:

    >Here is my code: > >$query = "UPDATE poll_options SET votes + 1"; >mysql_query($query); > >All where conditions have were removed to try and fix the problem

    Dunno...

    Why aren't you asking the database what went wrong? :-)

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

    Actually, you'd be better off to use:

    mysql_query($query) or error_log(mysql_error());

    and then check your HTTP error logs, assuming your ISP provides them.

    You can leave this error-checking code in there, and always leave a trail for yourself of what went wrong when where. Keeping or die() on a production web-site is a security risk.

    Oh, actually, now that I re-read the post, I do know what's wrong in this case:

    update poll_options set VOTES = votes + 1 ^^^^^^^ This is missing ---------/

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020627132329.96221.qmailpb1.pair.com> , tnieldsiitri.org (Tim Nields) wrote:

    >I am running php4.2.1. I tried to use a simple include() coommand, but the >path that it defaults to is /usr/local/lib/php. Can anyone tell me how to >change this?

    You might (or might not) be able to edit "php.ini" and alter the include_path there.

    If your ISP doesn't give you your own php.ini file, (most don't) then you *probably* have permission to use an .htaccess file to do that:

    Create a file named ".htaccess" (yes, the '.' at the beginning is for real) and put a line like this in it:

    php_value include_path "./:/path/to/your/home/directory/:/any/other/directory/you/like"

    Note that this syntax is subtly different (php_value) from the php.ini syntax.

    If you have your own server, and edit php.ini, make sure that:

    A) You are editing the same php.ini that <?php phpinfo();?> says it is using. B) You stop/start Apache so the new php.ini is re-loaded.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020628155417.50282.qmailpb1.pair.com> , d99majoswipnet.se (Martin Johansson) wrote:

    >I am planning to do a webapplication that a company is intrested to use in >their Intranet. >To my webapplication I need to use booth PHP and MySQL. >Does someone know if they really are free, even if I use them in a >webapplication >that lately will be sold and installed on the company's webserver.

    You'll have to read their licenses, but the short answer is "Yes."

    I know it's a scary concept that they'd be free, but they really are.

    MySQL (used to?) have some caveats about when it was/wasn't free, but I think those are gone now... Read their license to be 100% sure.

    PHP is just plain free.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020627101659.GA65894xs4all.nl> , wstanxs4all.nl (William S.) wrote:

    >Is there a mailing list just dedicated to gdlib >or any places that show a gallery with examples? >I would be interested in seeing examples >of images that are complex/artistic and beyond >simple rectangles and boxes.

    It's a work in progress, but you may find these images of interest:

    http://chatmusic.com/maplocater.htm

    Those ugly red circles (I am not a Designer) and the longitude/latitude lines are coming from a database of ~2000 music venues for touring musicians to utilize (http://chatmusic.com/venues.htm).

    Only the World -> US "demo path" is working at this time. Pages after that are "in development" Knock yourself out uploading more detailed maps, if that is working at the time you play, but no promise I'll keep them...

    Anyway, in spite of the paucity of maps, there is some non-trivial data being overlaid onto the underlying regional images, and the longitude/latitude and "red dot" data is all being computed on-the-fly.

    The original images are:

    http://chatmusic.com/visual/maps/worldmap.jpg http://chatmusic.com/visual/maps/continentalus.jpg

    The red dots, the long/lat lines, and the AREA tags are all being generated from PostgreSQL data.

    PostgreSQL lets me do some of the AREA tag computations of intersection and other fun "region" calculations in SQL :-)

    I still need to hook in the Radio stations (http://chatmusic.com/broadcast.htm) with blue dots, and music store retailers (green dots, of course) and ... Well, let's just say I've got a lot of work to do. :-)

    Eventually (in glacial time, at the moment) I'm hoping to have a large-scale OpenContent model of geographic data and data-servers in a distributed application powered by PHP...

    Then anybody on the planet could have complete access to geographic/zip/street/location data for free. More importantly, contributors could upload maps of the area[s] that interest them for a truly OpenContent distributed paradigm.

    Source code is too chaotic to be made public at this time. Will post when/if that changes.

    Anybody interested in funding this effort is most welcome to email me :-)

    NOTE: Yes, the long/lat are horribly inaccurate as you approach the poles on that first map. No, I don't care because: A) I can swap in a different map that is not logarithmic and change a few db records when I have time. B) The whole point is to "zoom in" to more detailed/accurate maps (down to neighborhood level) C) The click-able regions are defined independent of the long/lat lines. D) There just aren't a hell of a lot of music venues at the North/South pole. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <20020629041739.405.qmailpb1.pair.com> , shado_phoenixhotmail.com (Cysec) wrote:

    >I have already scripted a site using PHP 4 and was at the point of uploading >it to my client's chosen server (decided to go third party) when I discover, >their server is running PHP3, launch is in five days, and I have 40+ pages >using PHP4's session handling (session_start() etc.). This would be a total >pain to change throughout the site, so I was wondering if anyone knew of a >script of functions that emulate PHP4's session handling. I would love to >be able to just update the server, and would have if it were one I was >administrating, however I can't. Any help would be vastly appreciated.

    Woof.

    PHP's session() stuff was kinda sorta loosely modeled after the (old) PHPLib stuff, so you *MIGHT* be able to find that and use it...

    I don't foresee that happening in 2 days (and counting) though...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <009a01c21da7$7c215b60$1300a8c0redplanet> , aquasas.co.id (Aqua) wrote:

    >I have 100 records in mySQL database and I need to display them in my web >page using php and html. How to display them in multiple pages? Each page >must contain 25 records. Does anyone know how to do it other than create 4 >pages and manually list the records there? or maybe point me some reference >please. Your help will be much appreciated. Thanks!

    Search MySQL's site or PHPBuilder/WeberDev/etc for an example of the LIMIT clause.

    Or, very briefly:

    <?php if (!isset($start)){ $start = 0; $limit = 25; } $query = "select blah from mytable limit $start, $limit"; $records = mysql_query($query) or error_log(mysql_error()); #check http error_log for errors! while (list($blah) = mysql_fetch_row($records)){ echo "$blah<BR>\n"; } echo "<A HREF=samepage.php?start=", $start - 25, ">Prev</A>"; echo "<A HREF=samepage.php?start=", $start + 25, ">Next</A>"; ?>

    You'll want to check that you don't go over 100 or under 0, and that there actually *IS* a Next/Prev page, but this is the core of it.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <00e001c21db3$7b1b66a0$0a01a8c0jcowart> , jeffcowart.net (Jefferson Cowart) wrote:

    >Is there any way to return all the rows returned by a mysql query with >one command. Currently I have to run through a for or while loop the >same number of times as there are rows and take that row and copy it to >an array. I end up with an array of arrays but it seems like it would be >a common enough problem that the function would already exist.

    Why do you think you need the data in an array? Usually, you can just deal with it immediately and discard it.

    I think Oracle lets you snatch a whole array at once, but not MySQL.

    If you screw up your SQL, you don't want to try to snatch the whole thing at once anyway -- The potential for trashing your web/db-server by asking for, oh, 10,000 records at once is just too high.

    Better safe than sorry.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Jeff,

    Also, try php.weblogs.com ADODB if you absolutly MUST have all of your data in an array.

    I'll agree with Richard that it's not a great idea unless there is a specific need. While loops for displaying the contents of many records are much better. (IMHO, etc...)

    =C=

    * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com *

    -----Original Message----- From: Richard Lynch [mailto:ceol-i-e.com] Sent: Sunday, June 30, 2002 5:41 PM To: php-generallists.php.net Subject: [PHP] Re: MySQL fetch data

    In article <00e001c21db3$7b1b66a0$0a01a8c0jcowart> , jeffcowart.net (Jefferson Cowart) wrote:

    >Is there any way to return all the rows returned by a mysql query with >one command. Currently I have to run through a for or while loop the >same number of times as there are rows and take that row and copy it to >an array. I end up with an array of arrays but it seems like it would be >a common enough problem that the function would already exist.

    Why do you think you need the data in an array? Usually, you can just deal with it immediately and discard it.

    I think Oracle lets you snatch a whole array at once, but not MySQL.

    If you screw up your SQL, you don't want to try to snatch the whole thing at once anyway -- The potential for trashing your web/db-server by asking for, oh, 10,000 records at once is just too high.

    Better safe than sorry.

    --
    Like Music?  http://l-i-e.com/artists.htm
    

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

    attached mail follows:


    In article <20020627082709.78063.qmailpb1.pair.com> , chris.morrowbtopenworld.com (Chris Morrow) wrote:

    >Up until now this has worked fine. But now I have a function in the >settings.inc file that tries to read the value of a cookie called >"testcookie". My problem is that the settings.inc file doesn't seem to be >able to access the cookie at all. But if I try to access it direct from a >page rather than the required file it works fine.

    It has nothing to do with the require and *everything* to do with the FUNCTION.

    You see, it's a really Bad Idea (tm) to have your functions use variables from the "outside" world -- variables should be passed in as parameters.

    function foo (parameter, parameter, ..., parameter){ . . . }

    Inside the function "foo" there are *NO* variables except the "parameter" variables.

    You can over-ride this, though, using "global"

    function foo (parameter, parameter, ..., parameter){ global $cookie1; . . . }

    EXCEPTION: The new-fangled "superglobals" $_POST, $_GET, $_COOKIE etc are global everywhere.

    So you *could* use $_COOKIE['cookie1'] without using "global".

    This rule about variable scope is a FEATURE -- Without it, the function is a relatively weak little thing, and you are all to likely to have stupid, stupid, stupid bugs from variable name conflicts and a million lines of PHP code on your web-server to find the mistake... With the rule that only the paramters (and globals) can exist inside a function, you limit your problem search to a very much smaller space.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <03d201c21db6$7deb2110$7800a8c0leonard> , kaleonardoBonBon.net (Leo) wrote:

    >I have a form and I don't want to insert recording with blank value. >I put: >if ($lastname="") { > $insert="no" >} >if ($insert="no"){ > do not insert; >else > insert; >} >my probleme is in some case $lastname="" is true and other case is false. >I tried with $lastname=" " but no change. how can I check if a varible is >empty or not?

    if (isset($lastname)){ # Do MySQL insert }

    http://php.net/isset

    NOTE: CHECKBOX variables will not show up unless checked, so this technique will not necessarily work for them, depending on what business logic you are trying to achieve...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    "==" (2) is for comparison while you are accidently doing assignments by "=" (1) if ($lastname="") - wrong if ($lastname=="") - better that's why u r screwed up here :-)

    Uli

    At 17:49 30.06.02 -0500, Richard Lynch wrote: >In article <03d201c21db6$7deb2110$7800a8c0leonard> , kaleonardoBonBon.net >(Leo) wrote: > >>I have a form and I don't want to insert recording with blank value. >>I put: >>if ($lastname="") { >> $insert="no" >>} >>if ($insert="no"){ >> do not insert; >>else >> insert; >>} >>my probleme is in some case $lastname="" is true and other case is false. >>I tried with $lastname=" " but no change. how can I check if a varible is >>empty or not? > > >if (isset($lastname)){ > # Do MySQL insert >} > >http://php.net/isset > >NOTE: >CHECKBOX variables will not show up unless checked, so this technique will >not necessarily work for them, depending on what business logic you are >trying to achieve... > >-- >Like Music? http://l-i-e.com/artists.htm > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    In article <20020627092803.25191.qmailpb1.pair.com> , alexnetflex.nl (Alex Elderson) wrote:

    >open connection to webapps.hardinxveld.netflex.nl oke > > get / done > get / failt > >Closing connection to webapps.hardinxveld.netflex.nl oke > > >The problem is the "Connection: Close\n\n" header. The webserver close the >connection after the first request, if i remove >the "Connection: Close\n\n" header the first fgets($web_conn, 128) command >will never ends. > >It's running on winXP apache 2.0.36 PHP 4.2.1 (test server) from the shell

    First of all, you need to be aware that a web-server is not required to respond using HTTP/1.1 just because you asked for it... If the web-server don't feel like doing HTTP/1.1, it can fall back to HTTP/1.0 in its response. [At least, that's how I understand it...]

    So this whole multiple-file thingie may not work if, as I suspect, HTTP/1.0 doesn't support multiple files in one connection.

    Secondly, I think it's probably just a Bad Idea (tm) to try to force HTTP to do 2 files in one connection anyway -- It just complicates your life, and is giving you headaches already... How much worse will it get in a year?

    That said, I suspect that fgets() is looking for a particular character all by itself on a line that determines the end of a file. Control-D, possibly. So, *MAYBE* sending a chr(4) (control-D) after each file will work...

    Even if it does work, I still think it's a Bad Idea -- I'm not sure fgets() is DOCUMENTED to use the Control-D, so there's no guarantee it will keep working. More headaches next week/month/year.

    Disclaimer: I'm not promising any of this is correct -- mostly guess-work here.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Richard Lynch wrote:

    >Secondly, I think it's probably just a Bad Idea (tm) to try to force HTTP to >do 2 files in one connection anyway -- It just complicates your life, and is >giving you headaches already... How much worse will it get in a year? >

    Actually, it's a very good idea and very well supported. Even with HTTP/1.0, Web servers support persistent connections; the client simply has to ask for it with the "Connection: Keep-Alive" header. In HTTP/1.1 (obviously the Web server he was dealing with), you have to ask for the server to close the connection with a "Connection: Close" header, because persistent connections are the default behavior.

    >That said, I suspect that fgets() is looking for a particular character all >by itself on a line that determines the end of a file. Control-D, possibly. >So, *MAYBE* sending a chr(4) (control-D) after each file will work... >

    The problem has nothing to do with fgets actually. If the Web server doesn't close the connection, the client doesn't close the connection, and the client endlessly loops waiting for more content, it's going to hang. That's to be expected. :)

    >Disclaimer: I'm not promising any of this is correct -- mostly guess-work >here. >

    I explained this more thoroughly here: http://marc.theaimsgroup.com/?l=php-general&m=102522127531834&w=2

    Cheers.

    Chris

    attached mail follows:


    In article <009201c21dd4$a1c96d80$9600a8c0ady> , adipublichome.ro (Adi) wrote:

    >how to make a changerate.php file for: > >Read a file: rate.php >Find string : 'USD' => '0.33' >Put '0.33' value in an editable textbox. I can change this value, let's say >to 0.35; >I Have an Update Button, when I press, the new value (0.35) change with old >value (0.33) in rate.php like this: 'USD' => '0.35'

    First, don't use "help pls!" as a subject. That will get ignored by many readers.

    Secondly, you *REALLY* should put this stuff into a DATABASE, not a file. Honest. It's going to be much *EASIER* if you do.

    Here's the PHP for what you think you want, but you really don't:

    <?php if (isset($rates)){ $file = fopen('rate.php', 'w') or die("Unable to record new rate information. Sorry!"); while (list($country, $rate) = each($rates)){ $line = "'$country' => '$rate'"; $charcount = fputs($file, $line); if ($charcount != strlen($line)){ echo "Only wrote $charcount out of ", strlen($line), " characters!<BR>\n"; } } } ?> <FORM ACTION=<?=$PHP_SELF?> METHOD=POST> <?php $rates = file('rate.php') or die("Unable to look up rate information. Sorry!"); while (list(,$line) = each($rates)){ $parts = explode('=>', $line); $country = trim($parts[0]); $rate = trim($parts[1]); $country = substr($country, 1, -1); # Strip off apostrophes. echo "$country <INPUT NAME=rates[$country] VALUE=$rate><BR>\n"; } ?> <INPUT TYPE=SUBMIT> </FORM>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    In article <3D1B5913.4030308vsa.co.za> , internetvsa.co.za (Phpcoder) wrote:

    >I would like to generate barcodes and have it print out the barcode >automatically from awebpage, is this possible? How?

    There is some C code on some web-site with "milk" in the domain name that will generate a bar-code...

    I've been meaning to port that to PHP since forever...

    I think it only handles UPC (the standard you see on most every product you buy).

    There are actually a bazillion bar-codes out there, and you could even generate your own custom one if you really felt the need...

    As far as printing goes, I have printed JPEG output from said web-site, printed it, and verified that the stock-boy at my local K-Mart could scan that bar-code. They still don't stock my music CDs, but I was pretty sure it would work just about anywhere else after that test run.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Thanks. Here is what I did for future reference.

    <select name = "departments"> <option value = ''> -- Select a Department -- </option> <? $connection = mysql_connect( "127.0.0.1", "username", "password") or die ("Could not connect");

    $db = mysql_select_db ("asset") or die ("Could not connect"); $sql = "select department_name from Departments";

    $sql_result = mysql_query($sql,$connection) or die ("Could not connect");

    while($row = mysql_fetch_array($sql_result)) { $department = $row["department_name"]; echo "<option value = '$department'>$department</option>"; } ?> </select>

    > From: Erik Price <priceehhbrown.com> > Date: Mon, 1 Jul 2002 09:18:12 -0400 > To: Mike Tuller <phpce.anoka.k12.mn.us> > Cc: php mailing list <php-generallists.php.net> > Subject: Re: [PHP] Populate Popup Menu from Database > > > On Saturday, June 29, 2002, at 11:41 AM, Mike Tuller wrote: > >> What is here is beyond my understanding, and seems like it is a little >> much >> for what I need. >> >> Here is what my database table looks like: >> >> Departments >> department_id >> department_name >> >> I just want to list the department name in the popup. > > although I wrote this instruction in response to a question about > integrating the listbox with javaScript, ignore the JS stuff, and you > will see how to dynamically populate a listbox with database data: > > http://marc.theaimsgroup.com/?l=php-general&m=102503848224300&w=2 > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Monday, July 1, 2002, at 04:22 PM, Mike Tuller wrote:

    > Thanks. Here is what I did for future reference.

    Good. What you chose to do is exactly what I do except for one thing... :

    > $sql = "select department_name from Departments";

    I generally grab the primary key column value as well, in the same query, and then I use that as the "value" attribute for the <option> tags:

    > while($row = mysql_fetch_array($sql_result)) > { > $department = $row["department_name"]; > echo "<option value = '$department'>$department</option>"; > > }

    while ($row = mysql_fetch_assoc($result)) { $dept_id = $row['department_id']; $dept_name = $row['department_name']; echo "<option value='$dept_id'>$department_name</option>\n"; }

    The reason I do this is because I end up using the ID far more than the "name" of a database record -- while I might echo the "name" to the user where needed (such as in the above dropdown listbox), the ID comes in handy as a reference in hyperlinks, form fields, etc -- it provides something that I've discovered is really missing in writing HTML-based applications: a unique handle on an object. This is very hard to replicate given the statelessness of HTTP, but with a database record's primary key, you always have this unique identifier by which to refer to the object. and a number is more pithy than a name.

    It'll avoid situations where someone enters the same "name" value twice, too. But it's not really a big deal unless you're doing a lot of work with a lot of data.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Thanks for the tip.

    > From: Erik Price <priceehhbrown.com> > Date: Mon, 1 Jul 2002 17:05:39 -0400 > To: Mike Tuller <phpce.anoka.k12.mn.us> > Cc: php mailing list <php-generallists.php.net> > Subject: Re: [PHP] Populate Popup Menu from Database > > > On Monday, July 1, 2002, at 04:22 PM, Mike Tuller wrote: > >> Thanks. Here is what I did for future reference. > > Good. What you chose to do is exactly what I do except for one > thing... : > >> $sql = "select department_name from Departments"; > > I generally grab the primary key column value as well, in the same > query, and then I use that as the "value" attribute for the <option> > tags: > >> while($row = mysql_fetch_array($sql_result)) >> { >> $department = $row["department_name"]; >> echo "<option value = '$department'>$department</option>"; >> >> } > > while ($row = mysql_fetch_assoc($result)) { > $dept_id = $row['department_id']; > $dept_name = $row['department_name']; > echo "<option value='$dept_id'>$department_name</option>\n"; > } > > The reason I do this is because I end up using the ID far more than the > "name" of a database record -- while I might echo the "name" to the user > where needed (such as in the above dropdown listbox), the ID comes in > handy as a reference in hyperlinks, form fields, etc -- it provides > something that I've discovered is really missing in writing HTML-based > applications: a unique handle on an object. This is very hard to > replicate given the statelessness of HTTP, but with a database record's > primary key, you always have this unique identifier by which to refer to > the object. and a number is more pithy than a name. > > It'll avoid situations where someone enters the same "name" value twice, > too. But it's not really a big deal unless you're doing a lot of work > with a lot of data. > > > Erik > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    >What is the easiest way to get an array of all letters not in a string? I.e. >$array = notinstring("abc"); //returns array of: >d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z > >

    I think this might do it:

    $alphabet = 'abcdefghijklmnopqrstuvwxyz'; $abc = 'abc'; for ($i = 0; $i < strlen($abc); $i++){ $abcs[] = $abc[$i]; }

    $notabc = preg_replace($abcs, '', $alphabet); for ($i = 0; $i < strlen($notabc); $i++){ $notabcs[] = $notabc[$i]; }

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I am trying to put a variable within a print <<< END. The thing is, I >want text directly after it - which php will include in the variable >name. I have to END; and use another print $variable;. Is there an >easier way to seperate the variable?

    I think if you put {} around the variable, you'll get what you want...

    Or, at least, it works in a regular old string. Dunno about the Here-Doc crapola -- Never got into it. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I realise its a longshot but is it possible to use PHP (or any other >web-based languages) to combine multiple ZIP files into a single ZIP file? >and any scripts i can download to do it. > >Any help with this is most appreciated. ;-)

    If you can figure out how to do it on the command line, you can get PHP to execute those commands:

    http://php.net/exec

    Performance of the ZIP process will remain the same, but on a busy server, a lot of "exec" calls is not so good.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


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

    2) is INFINITELY superior.

    Every call to mail() fires up a very large program.

    You do *NOT* want to do that more than a few times in one script.

    Your server also may limit the number of Cc: (or Bcc:) addresses you can use.

    You may also want to consider talking directly to your SMTP server instead.

    There are some excellent mail scripts/classes that take care of all this for you, if installed properly.

    See http://upperdesign.com for one example

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I'd like to add all values for $purchase_price that are returned, how do I >do this? >Here's what i have now. ><?php >$result = mysql_query("SELECT purchase_price FROM assets where >order_number='$order_number' ORDER BY $desc");

    $total = 0;

    >while(list($purchase_price) = mysql_fetch_row($result)) {

    echo "$purchase_price<BR>\n"; $total += $purchase_price; # Short-hand for $total = $total + $purchase_price; }

    >?>

    Actually, it might be better to just change your SQL to:

    select SUM(purchase_price) from assets where order_number = '$order_number'

    The SQL SUM() will be *MUCH* faster than your while () loop.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi,

    In the documentation it says that str_replace() accepts an array as its subject. I have been trying to use it with a multidimensional array, but keep on getting the following error:

    Notice: Array to string conversion in c:\code\xml\index.php on line 85

    And my arrays are flattened :-(

    $foo = array( '0' => array('foo => 'bar'), '1' => array('fff' => 'foooo', 'feen' => 'foo') );

    Returns an array like Array ( [0] => Array [1] => ) when printed out.

    Is the documentation wrong or is PHP 4.2.1 broken?

    Thanks Peter

    attached mail follows:


    Hello , I have a text file that looks like this. each entry is on a different line I need to pull the data out of it and put each line of data into its own variable

    US State City Company Name Section 2 www.domain.com adminwww.domain.com

    I have trend this but it does not work properly

    $fp = fopen(file.txt,"r"); $line = explode("\n",$fp); $valueC = "$line[0]"; $valueST = "$line[1]"; fclose($fp);

    -- 
    Best regards,
     rdkurth                          mailto:rdkurthstarband.net
    

    attached mail follows:


    On Monday, July 1, 2002, at 05:17 PM, rdkurthstarband.net wrote:

    > I have trend this but it does not work properly > > $fp = fopen(file.txt,"r"); > $line = explode("\n",$fp); > $valueC = "$line[0]"; > $valueST = "$line[1]"; > fclose($fp);

    What error messages are you getting? I imagine that since you've suppressed the errors with the "", you will need to remove this to give us any useful information.

    One other thing, has your file been saved with the appropriate line breaks for your server? In some cases, a file may have DOS/Windows or Macintosh line breaks which are not \n but rather \r\n and \r respectively IIRC.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Just use file(), this is most appropriate for reading file line by line. http://www.php.net/manual/en/function.file.php > > On Monday, July 1, 2002, at 05:17 PM, rdkurthstarband.net wrote: > > > I have trend this but it does not work properly > > > > $fp = fopen(file.txt,"r"); > > $line = explode("\n",$fp); > > $valueC = "$line[0]"; > > $valueST = "$line[1]"; > > fclose($fp); > > What error messages are you getting? I imagine that since you've > suppressed the errors with the "", you will need to remove this to give > us any useful information. > > One other thing, has your file been saved with the appropriate line > breaks for your server? In some cases, a file may have DOS/Windows or > Macintosh line breaks which are not \n but rather \r\n and \r > respectively IIRC. > > > Erik > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    Here's one way assign each line:

    <?php

    $file_loc = "D:\\web\\bev\\file.txt";

    $whattoread = fopen($file_loc, "r");

    $country = fgets($whattoread, 4096); $state = fgets($whattoread, 4096); $city = fgets($whattoread, 4096); $company = fgets($whattoread, 4096); $division = fgets($whattoread, 4096); $url = fgets($whattoread, 4096); $email = fgets($whattoread, 4096); echo "country is $country<br>"; echo "state is $state<br>"; echo "city is $city<br>"; echo "comapny is $company<br>"; echo "division is $division<br>"; echo "url is $url<br>"; echo "email is $email<br>";

    fclose($whattoread); ?>

    Bev

    -----Original Message----- From: rdkurthstarband.net [mailto:rdkurthstarband.net] Sent: Monday, July 01, 2002 5:17 PM To: php-general Subject: [PHP] extracting data from text file

    Hello , I have a text file that looks like this. each entry is on a different line I need to pull the data out of it and put each line of data into its own variable

    US State City Company Name Section 2 www.domain.com adminwww.domain.com

    I have trend this but it does not work properly

    $fp = fopen(file.txt,"r"); $line = explode("\n",$fp); $valueC = "$line[0]"; $valueST = "$line[1]"; fclose($fp);

    -- 
    Best regards,
     rdkurth                          mailto:rdkurthstarband.net
    

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

    attached mail follows:


    >Hello , >I have a text file that looks like this. each entry is on a different >line I need to pull the data out of >it and put each line of data into its own variable > >US >State >City >Company Name >Section 2 >www.domain.com >adminwww.domain.com > >I have trend this but it does not work properly > > $fp = fopen(file.txt,"r"); > $line = explode("\n",$fp); > $valueC = "$line[0]"; > $valueST = "$line[1]"; > fclose($fp);

    $fp is a NUMBER. The first file you open is Number 1, the second is number 2, and so on.

    So you can't just go explode()ing $fp -- You've got to read some data.

    $data = fread($fp, 10000); or $data = fgets($fp, 100000000); or...

    Lots of choices, actually, depending on how the file is layed out.

    Now, some questions:

    How "regimented" is the data? Is it *really* clean and always the same number of lines?

    If so, a simple:

    $country = fgets($fp, 1000000); $state = fgets($fp, 1000000); . . .

    inside of a while(!feof($fp)){ loop will work.

    If there are sometimes some "missing" lines, or maybe sometimes two lines where there should be one, it gets a bit more tricky...

    You may need to look into http://php.net/strtok and do some high-falutin' artificial-intelligence analysis of the data coming it as you read it to "guess" which line is what...

    And definitely get rid of the symbol, or AT LEAST check the value of $fp and do something intelligent if it's no good.

    if (!$fp){ # send error message or whatver. exit; }

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    List, My ODBC connection is failing it seems...I can run this code just fine...odbc_connect and odbc_pconnect seem to work...the odbc_prepare even works just fine...but as soon as I execute (with odbc_execute, odbc_exec, or odbc_do it fails...any ideas?

    <?php

    $db = odbc_pconnect("Desire","sa", "xxxxxxxx"); echo "Database Connection:".$db."<br>"; $sql = odbc_prepare($db, "execute spGetItems"); echo "Prepared SQL id:".$sql."<br>"; // This line will fail $rs = odbc_execute($sql);

    ?>

    attached mail follows:


    >List, > My ODBC connection is failing it seems...I can run this code just >fine...odbc_connect and odbc_pconnect seem to work...the odbc_prepare >even works just fine...but as soon as I execute (with odbc_execute, >odbc_exec, or odbc_do it fails...any ideas? > ><?php > >$db = odbc_pconnect("Desire","sa", "xxxxxxxx"); >echo "Database Connection:".$db."<br>"; >$sql = odbc_prepare($db, "execute spGetItems"); >echo "Prepared SQL id:".$sql."<br>"; >// This line will fail >$rs = odbc_execute($sql); > >?> >

    Is there an odbc_error() function that will maybe clue you in to what's wrong?...

    $rs = odbc_execute($sql) or error_log(odbc_error());

    I dunno what the function name is, but I'll get a dollar it's listed here:

    http://php.net/odbc

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi!

    I seem to have problem with the odbc_fetch_into function and it seem to be broken. It skipped some columns when retrieving data from the two tables. I didn't have that problem with the previous version of PHP. I'll include the sample of the function code for your convience. Does anyone have this problem? Know what hte problem is? Know hte workaround to it? The error seem not to be the result of my doing, but of PHP's doing. Please no more changing of hte parameter to the odbc_fetch_into function.

    --clip-- PHP version 4.0.5 odbc_fetch_into($result,1,&$user_detail);

    PHP version 4.0.6 $row = 1; odbc_fetch_into($result,$row,$user_detail);

    PHP version 4.2.1 odbc_fetch_into($result,$user_detail,1); --clip--

    Thanks, FletchSOD

    attached mail follows:


    Could anybody point me to a good tutorial/howto on how to make a variable accessible to all of my PHP pages? I'm running PHP 4.0.6 with register_globals set to ON... (I cant change that). I've tried with the $HTTP_SESSION_VAR,$_SESSION, and session_register() method but just can't seem to make it work. Any help would be appreciated.

    Thanks, Brandon

    attached mail follows:


    With register_globals on:

    1. Put session_start() at the top of each page. 2. Initialize the variable, then call session_register(): $foo = 'bar'; session_register('foo'); 3. Do all assignments to $foo, not $HTTP_SESSION_VAR['foo'], since $foo gets written to $HTTP_SESSION_VAR['foo'] at the end of the current page, and so will overwrite anything that was assigned to $HTTP_SESSION_VAR['foo']. 4. Because of #3, the value assigned to $foo won't be available in $HTTP_SESSION_VAR['foo'] until the next page.

    Clear as mud? I thought so ;)

    Kirk

    > -----Original Message----- > From: Brandon [mailto:brandoaugmented-chaos.com] > Sent: Monday, July 01, 2002 4:02 PM > To: php-generallists.php.net > Subject: [PHP] How to use Session Variables > > > Could anybody point me to a good tutorial/howto on how to > make a variable > accessible to all of my PHP pages? I'm running PHP 4.0.6 with > register_globals set to ON... (I cant change that). I've > tried with the > $HTTP_SESSION_VAR,$_SESSION, and session_register() method > but just can't > seem to make it work. Any help would be appreciated. > > Thanks, > Brandon > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Yep, I was using the DATE() function in PHP to convert a TIMESTAMP from a MySQL DB query. I was getting a year of 2038 because MySQL and PHP use different TIMESTAMP formats.

    There are several FUNCTIONS that convert the two TIMESTAMPS from one to the other, (see comments in PHP manuals) but I wound up using the call from a mySQL query to convert the data.

    much like this.... // GET CONVERTED MYSQL TIME TO UNIX TIME $getmyTime = mysql_query("SELECT UNIX_TIMESTAMP(timestamp_col) AS yournamehere FROM myDBnamehere WHERE id = $whatever") or die("Invalid query"); $mysqlTime = mysql_result($getmyTime, 0, 0); // TURN TIME INTO VIEWABLE STRING $myTime = date("F j, Y h:i A", $mysqlTime)." EST";

    This spits back "July 1, 2002 04:41 PM EST" instead of some year in 2038 when I did the same thing without the SELECT UNIX_TIMESTAMP query.

    Thanks again for all your replies. PHP RULES! (insert white boy dance here) - NorthBayShane

    -----Original Message----- From: Shane Sent: Monday, July 01, 2002 9:39 AM To: php-generallists.php.net Subject: [PHP] mySQL time = year 2038 [HELP]

    Checked the archive and saw no difinitives... so... How come when I query my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP record that it always comes up Jan 18, 2038?

    Is the clock not set properly, or am I misunderstanding some basic principal of the time stamp?

    My clients version pf PHP is 4+ on a Windows IIS server.

    Any clues??? Thanks -NorthBayShane

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

    attached mail follows:


    > Yep, I was using the DATE() function in PHP to convert a > TIMESTAMP from a MySQL DB query. I was getting a year of > 2038 because MySQL and PHP use different TIMESTAMP formats.

    > $getmyTime = mysql_query("SELECT UNIX_TIMESTAMP(timestamp_col) AS yournamehere FROM > myDBnamehere WHERE id = $whatever") > or die("Invalid query");

    If you mainly need to output a date in a particular format you might find it more effective to use mysql's date formatting capabilities. Have a look in the manual for the section on DATE_FORMAT() which will let you get the date out of your table in just about any format you desire.

    CYA, Dave

    attached mail follows:


    > (Chris Shiflett <shiflettphp.net>): > John Wulff wrote: > > I have never heard of someone wanting to do this, but you might want to > look into methods of executing shell commands in the background, which > seems like it should be possible. Basically, you're wanting to execute > something that immediately returns control back to your PHP script. The > PHP script *must* complete before it will be "finished" from the Web > server's perspective. Thus, you'll have to at least split up the logic > you want to do later into a separate script and just figure out how to > get that running just before your script terminates. If it's written in > PHP, don't forget about the CLI; it might come in handy for you in this > case. > > Let us know what you come up with.

    Yeah, I could do that but I don't really want to spawn a whole process and copy over all the data that's there already. In a Java servlet this is a piece of cake--you just spin off a thread to do the work and return from the request thread. Here I'd want to do something like a fork(), then exit the parent and do some processing in the child.

    The PHP manual says that the pcntl() functions (which include forking) are not available from with a web server context, so I guess Apache doesn't like its modules forking off demons.

    -- 
    Lee Daniel Crocker <leepiclab.com> <http://www.piclab.com/lee/>
    "All inventions or works of authorship original to me, herein and past,
    are placed irrevocably in the public domain, and may be used or modified
    for any purpose, without permission, attribution, or notification."--LDC
    

    attached mail follows:


    >Hi, I'm trying to install PHP 4.2.1 on SuSE SLES 7.3 and I get the following >error message > >checking lex output file root... ./configure: lex: command not found >configure: error: cannot find output from lex; giving up

    lex is like this low-level thingie that lets PHP syntax like if/else/while/for get defined. [Gross over-simplification of the whole process, but not totally inaccurate.]

    So, like, you have to have lex installed to build PHP.

    The thing is, it's a pretty common thing to have, so it's *MOST* likely on your computer somewhere, just PHP isn't finding it...

    Try these, in order, to see if you have lex somewhere:

    whereis lex locate lex find / -name lex -print

    The last one will take a *LONG* time, maybe...

    Once you figure out where "lex" is, you need to get that directory into your "$path" (or $PATH) variable.

    Try these:

    echo $PATH echo $path

    Depending on your OS and the phase of the moon, one of them will output something.

    Whichever it is, you need to alter. How to alter it depends on your OS and shell and the phase of the moon. I usually go digging through my .profile and any .*sh* files in my home directory:

    cd ls -als

    And in one of those files that starts with a "." for the file name I can usually find out how to alter my $PATH ($path).

    If, by some miracle, you don't *HAVE* lex, you can almost-for-sure install it from your original CDs or find it using Google.

    The preceeding all assume a minimal level of Un*x skill... Which is what I've got. YMMV. Not applicable in all OS'es.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I have a table with id, pid(parent), title and page_name(url) fields. > >The vars provided to the script are the current page's title, id and >pid(parent)

    You can look up the parent and in the database, so it's not horribly important that those be provided.

    *UNLESS* you have a heterarchy, and not a hierarchy -- In other words, *UNLESS* there are two different "paths" to get to 'id' through different parents. In other other words, *UNLESS* you have duplicate id's in the database... If you *DO* have a heterarchy, you'd need to track the user's path as they traveled to know which route to display.

    I'll assume you don't have a heterarchy, for now.

    >When I am on the parent page I get this(Which is what I want): >[ Chronological History ][ Website Chronological History ] > >When I am in the Child I get this: > >[ Website Chronological History ][ Website Chronological History ] > >What am I doing wrong???

    You really can't get all the parents in one SQL statement.

    You'll need to look up the parent. Then the grand-parent. Then the great-grand-parent. And so on.

    Each with a different SQL query.

    Now, this is not ideal for performance.

    In fact, it's *HORRIBLE* if (A) your tree is really "deep" -- If you have 10 generations of "depth" to the ggggg'great-grand-parents, then it's gonna take 9 queries to look it up.

    If you're only looking at three or four levels, it's really no big deal... Unless your site is, like, getting a zillion hits.

    Let's assume it's not getting a zillion hits for now, okay?

    >I have stared at this two many times now and am probably missing the obvious > >function menu($id, $pid, $title) { > $query = "select * from meta_data WHERE pid = '$id' OR pid = '$pid' && >pid != 0";

    This will give both the current record and the parent record, but never, ever, ever, the grand-parent record...

    > $result = mysql_query($query); > $num_results = mysql_num_rows($result); > if($num_results != 0){ > ?> ><table width="100%"> ><tr><td align="center"> > <? > echo '[ '.$title.' ]'; > for ($i=0; $i < $num_results; $i++) > { > $row = mysql_fetch_array($result); > if($id == $row['id']){ > echo '[ '.$row['title'].' ]'; > } elseif($row['pid'] == $id || $row['id'] == $pid && $pid != 0) { > echo '[ <a >href="'.$row['page_name'].'">'.$row['title'].'</a> ]'; > } > } > ?> ></td></tr> ></table> > <? > }

    Try something more like this:

    function menu($id){ $query = "select pid, title from meta_data where id = $id"; $meta = mysql_query($query) or error_log(mysql_error()); # Check HTTP error_log for SQL errors! list($pid, $title) = mysql_fetch_row($meta, 0); if (isset($pid) && $pid)){ # Switch the menu() and $title parts around if you want bread-crumbs in the other direction $result = menu($pid) . $title; } else{ $result = ''; } return $result; }

    NOTE:

    There *ARE* techniques for encoding the SQL in such a way that a single SQL statement can get the entire "path" at once, but they get kinda complicated and gnarly, and, really, as I said, if you have a shallow tree, it's just not worth the hassle... If you have a really *DEEP* tree, you'll need to do some more research.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi Richard:

    Nice to have you back on the list. I've noticed your replies are not winding up back in the threads due to the Reference header not being set by Outlook.

    While this isn't going to cause the end of the world, it'd be nice if they were there.

    Enjoy,

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


    On Mon, Jul 01, 2002 at 08:00:39PM -0400, Analysis & Solutions wrote: > Hi Richard:

    Oops. Meant to reply directly to Ricahrd. Sorry 'bout that.

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


    >Hi, > >Maybe it's already discussed here, but PHP is generating errors of undefined >constants. These constants are defined in my scripts. Als the superglobal >$_ENV is empty. > >Can anyone tell what's wrong here? > >I'm using a W2K server, with Apache 1.3.26 and PHP 4.2.1

    Check php.ini settings and track_variables or whatever it is...

    Actually, use <?php phpinfo();?> first to be sure you are looking at the correct php.ini file.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Hi all, > >Just wondering if anyone came across this "problem" before: > >When I print a document directly from my browser, it comes out with the >title on >the top right , page number of the top left, address on the bottom left and >date on the bottom right, Page Headers and Footers > >Using IE I can set the page headers and footers under the page setup option. > >Header: &w&bPage &p of &P >Footer: &u&b&d > >I need some way of disabling / changing this as my clients print reports >that need a proper printout. I need to change it using css / vbscript / >JavaScript ??? > >Anyone ever worked with this function? I know its not PHP related but im >sure someone came across the problem.

    The only way to reliably generate printable data cross-platform that I am aware of is PDF...

    Fortunately, PHP *can* generate PDF files...

    Whether you want to make it possible to convert the content in question to PDF or not, I dunno...

    Is it for every page of your site or specific documents or ???

    For sure, you *CANNOT* take over *my* computer and change *MY* settings for what *I* want on my Header:/Footer: of Web documents. That simply ain't gonna happen.

    But if you just need a couple reports printable, it is not too terribly tricky to generate PDF files for them. Hell, I figured it out, so it can't be *too* tricky. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Does someone have a good guide on installing php with informix support? also i wish to know wheter it is possible to compile php with this version.

    ISQL 7.20 Embedded sql for C. 9.14 4GL 7.30 4GL runtime 7.20 Dynamic server 7.30 Java API 1.05

    Thanks in advance, Emile Bosch

    attached mail follows:


    'lo,

    anybody ever experience this:

    1. i start a session w/ session_start() 2. register some vars w/ session_register() 3. click to next page, everything cool. all vars are there, and session id is same 4. any other page, all session vars gone, but sessid is still the same.

    so session is persisting, but data is being emptied from it.

    any help would be excellent.

    thanks,

    dietrich

    attached mail follows:


    Is there a way to programatically (inside a session) change session duration for the current session only? (using cookie-based sessions) ?

    --
    ----
    --------
    - Ivan Voras <ivoras  fer.hr> -
    - If I knew what I was doing, it wouldn't be called "research". -- R. P.
    Bergman -
    

    attached mail follows:


    When I said "process" I meant "request". Sorry. Is it possible that the PHP globals are being used across requests (i.e., within the same process)? We noticed this when upgrading from a version of PHP (4.0.6?) prior to the new super-globals being added to PHP 4.1.2.

    The code in this case is so straightforward that I can't see any other explanation. The variable in question comes from the URL. For example, if the URL is http://foo.com/page.php?var=abc, $var in the PHP is a different value in these rare cases. And the variable we use here is in a very specific format and it is a valid value just that it's a different value from the one in the URL.

    Also note that we've only seen this problem when the variable has a longer string than the one in the URL. Using the URL from the above example again, $var has a value like "abcdef" which is valid value but longer (in addition to being wrong). It's as if PHP is re-using memory from a previous request and is not truncating the string properly for the next request.

    Does that make more sense? Possible?

    Rasmus Lerdorf <rasmusphp.net> wrote: > I don't see how. But if what you are saying is actually happening, then > it is a Linux kernel-level bug if memory is leaking from one process to > another. No matter how badly we screwed up in PHP, the kernel prevents > such a screwup from infecting a separate process.

    > I'd suggest having a close look at your code.

    > -Rasmus

    > On 30 Jun 2002 troyrecipezaar.com wrote:

    >> We are seeing a rare bug that seems to imply that there is a bug in PHP's >> global variables across httpd processes. To make a long story short, it >> appears that on rare occassions our script gets the value of a HTTP_GET_VARS >> variable from another user's process. Is this possible? BTW, it seems to occur >> when using HTTP_GET_VARS and the new 'super globals'. >> >> FWIW, we're using PHP 4.1.2 on (Red Hat) Linux 2.4.9 with Apache 1.3.12. >> >> Thanks! >> >> (please reply via email in addition to posting here if possible) >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >>

    attached mail follows:


    Hi all,

    what's the correct pattern for "one or more whitespaces" (including \n\r\t and anything else I'm missing)?

    what about "zero or more whitespaces"?

    Thanks in advance,

    Justin French

    attached mail follows:


    On Tuesday 02 July 2002 10:06, Justin French wrote:

    > what's the correct pattern for "one or more whitespaces" (including \n\r\t > and anything else I'm missing)?

    I prefer the PCRE so:

    \s+

    > what about "zero or more whitespaces"?

    \s*

    It's all in the manual!

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

    /* Everyone can be taught to sculpt: Michelangelo would have had to be taught how ___not to. So it is with the great programmers. */