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: Thu May 16 2002 - 19:02:29 CDT

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

    php-general Digest 17 May 2002 00:02:29 -0000 Issue 1349

    Topics (messages 97896 through 97987):

    Re: IF Statements
            97896 by: Patrick Lynch

    PHP and MySQL
            97897 by: City Colleges of Chicago - Mannheim
            97898 by: Craig Vincent
            97899 by: Craig Vincent

    Re: Done w/ PHP - VB or C# ?
            97900 by: Steve Bradwell
            97969 by: Michael Kimsal
            97971 by: Miguel Cruz
            97973 by: Robert Cummings
            97977 by: Michael Kimsal
            97986 by: Peter
            97987 by: Victor Polyushko

    Re: Plz dont hate me for this
            97901 by: John Horton

    Multiple drop-down lists
            97902 by: Brian McGarvie
            97905 by: Chris

    Informix.so module
            97903 by: Mike Baranski

    snmp replies not printed
            97904 by: Razvan Cosma

    Newline in fputs
            97906 by: Henry Grech-Cini
            97919 by: Analysis & Solutions

    fsockopen
            97907 by: Scott St. John
            97908 by: Henry Grech-Cini
            97917 by: Jason Wong
            97968 by: Miguel Cruz

    what is php.ini on linux?
            97909 by: andy
            97910 by: Rasmus Lerdorf
            97911 by: Razvan Cosma
            97913 by: andy
            97914 by: Jay Blanchard
            97916 by: Jason Wong

    upload but restrict
            97912 by: r
            97915 by: Jason Wong
            97970 by: Miguel Cruz

    LDAP Search Scope / Schema Retrieval
            97918 by: D Canfield
            97948 by: Matt Rohrer

    Problems with mail() w/Win2k
            97920 by: Jared Boelens

    recognising plain text files
            97921 by: Lee P Reilly
            97922 by: Rasmus Lerdorf

    Uploading JPEG's - Security Issues?
            97923 by: Andre Dubuc
            97925 by: Rasmus Lerdorf
            97937 by: Jim Winstead
            97945 by: Andre Dubuc

    Re: tag img and php
            97924 by: Jim lucas
            97928 by: Maciej Przybycien

    some Javascript functions with PHP
            97926 by: savaidis
            97933 by: Kevin Stone

    Console application with PHP
            97927 by: DoL
            97935 by: Vail, Warren

    Can anyone help me save img from URL?
            97929 by: Victor Polyushko
            97934 by: Patrick Lynch
            97972 by: Miguel Cruz
            97974 by: Robert Cummings
            97976 by: Victor Polyushko
            97978 by: Robert Cummings

    uh, oh errors?
            97930 by: Jas
            97931 by: Rasmus Lerdorf
            97932 by: Patrick Lynch
            97936 by: Jas
            97938 by: Kevin Stone
            97939 by: Kevin Stone
            97942 by: Sysadmin.saginawcontrol.com
            97943 by: Jerome Houston
            97944 by: Robert Cummings

    Re: Using Sessions under Win98/Apache
            97940 by: Edward Marczak

    Gettext and PHP4.2.0?
            97941 by: Bram van Leur

    Making Multiple Pages
            97946 by: Jason Soza
            97949 by: Kevin Stone
            97952 by: Jason Soza
            97954 by: Kevin Stone
            97957 by: Cal Evans
            97958 by: J Smith

    Re: eregi(mail)
            97947 by: Liam Gibbs

    Re: [PHP-DEV] Console application with PHP
            97950 by: Markus Fischer
            97979 by: Vail, Warren
            97981 by: Markus Fischer

    Re: Date Function in Php
            97951 by: Baba Buehler

    Warning: Max file size of 4194304 bytes exceeded...
            97953 by: Lee P Reilly
            97955 by: Lee P Reilly

    Configuration.... XML.... Life
            97956 by: Michael Dransfield
            97963 by: Manuzhai

    refreshing PHP on onClick
            97959 by: Leotta, Natalie (NCI/IMS)
            97960 by: Robert Cummings
            97961 by: Kevin Stone
            97962 by: Leotta, Natalie (NCI/IMS)
            97964 by: Robert Cummings
            97966 by: Leotta, Natalie (NCI/IMS)

    Re: for loop using chars
            97965 by: Erich Reimberg N
            97982 by: Kevin Stone

    Informix compile problem
            97967 by: Mike Baranski

    Passing to an Applet
            97975 by: Joshua Baker

    Key is an undefined function?
            97980 by: Damian Harouff

    odbc_fetch_array not working in php 4.2.1 for win?
            97983 by: Emile Bosch
            97985 by: Emile Bosch

    Date and time functions
            97984 by: DC

    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:


    Hi Jon,

    Your brackets are just a bit out of sync:

    Here is a version that parses. You will have to make sure that my change
    does not affect your intended logic.

      if (
              ($this->checkReferralCB($this->benefitRef,
    $this->benefitNo,$this->childDOB)) &&
            (!$this->checkLocation($this->post, "W")) &&
            (!empty($this->childDOB)) ||
            ($this->checkPregnancy($this->benefitRef, $this->benefitNo))
            )

    Best Regards,
    Patrick Lynch.

    Optip Ltd, Internet & Mobile Development
    http://www.optip.com/

    -----Original Message-----
    From: Jon Yates [mailto:Jon.Yatesmi-services.com]
    Sent: 15 May 2002 15:04
    To: 'php-generallists.php.net'
    Subject: [PHP] IF Statements

    People, hope you can help. The below IF statement is getting a PARSE
    error. Can anyone spot why?

    Cheers.

    Jon
      
      if (($this->checkReferralCB($this->benefitRef, $this->benefitNo,
    $this->childDOB))
      && (!$this->checkLocation($this->post, "W")) &&
    (!empty($this->childDOB)))
      || ($this->checkPregnancy($this->benefitRef, $this->benefitNo))

     <<JYvCard.vcf>>

    attached mail follows:


    My program is no longer giving a parse error, but my database is not being
    updated (as far as the stock numbers are concerned). Any ideas???

    I made the changes below per a few people on the list:

    <P>Quantity of books:<br>

    <SELECT name = "quantity" size="1">

    <OPTION value="1">1</OPTION>

    <OPTION value="2">2</OPTION>

    <OPTION value="3">3</OPTION>

    <OPTION value="4">4</OPTION>

    <OPTION value="5">5</OPTION>

    <OPTION value="6">6</OPTION>

    <OPTION value="7">7</OPTION>

    <OPTION value="8">8</OPTION>

    <OPTION value="9">9</OPTION>

    <OPTION value="10">10</OPTION>

    </SELECT>

    <P>The book you are ordering:

    <?

    echo " $booktitle ";

    ?>

    <P>Additional Message:<br>

    <textarea name="message" cols=30 rows=3></textarea>

    </p>

    <INPUT type="submit" value="Send your order.">

    <input type=hidden name="booktitle" value="<? print $booktitle; ?>">

    </FORM>

    <?php

    $user = "adminer";

    $pass = "hoosiers";

    $db = "Book Store1";

    $local = "jolinux";

    $link = mysql_connect( "$local", $user, $pass );

    if (! $link )

    die ( "Couldn't open the database" );

    mysql_select_db( $db, $link )

    or die ( "Couldn't open the $db: ".mysql_error() );

    if ($submit){

    if( $booktitle AND "quantity" ){

    $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
    booktitle='$booktitle' AND quantity=quantity";

    }

    // $result = mysql_query($mysql);

    }elseif(!$submit){

    echo "Your order has not been placed.<p>";

    }

    ?>

    </BODY>

    </HTML>

    Renee

    attached mail follows:


    > mysql_select_db( $db, $link )
    >
    > or die ( "Couldn't open the $db: ".mysql_error() );
    >
    >
    > if ($submit){
    >
    > if( $booktitle AND "quantity" ){
    >
    > $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
    > booktitle='$booktitle' AND quantity=quantity";
    >
    > }

    Easy enough =) You're not running the mysql query =) You're never sending
    a command to MySQL to tell it to execute the $sql statement

    if( $booktitle AND "quantity" ){

    $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
    booktitle='$booktitle' AND quantity=quantity";
    mysql_query($sql);
    }

    Should do the trick. Or even cleaner

    if( $booktitle AND "quantity" ){
    mysql_query("UPDATE Book2 SET stock ='$stock-quantity' WHERE
    booktitle='$booktitle' AND quantity=quantity");
    }

    Sincerely,

    Craig Vincent

    attached mail follows:


    Missed a spot =)

    > if( $booktitle AND "quantity" ){

    I'm not certain if this if statement is accurate. I've never used a
    statement like this but from the looks of it the AND "quantity" part would
    always be true (assuming it parses it). This could be adding to your
    problem as well. I think you were aiming for something like

    if ($booktitle AND $quantity) {

    or how I do it (although it looks a bit messier)

    if (($booktitle) && ($quantity)) {

    Sincerely,

    Craig Vincent

    attached mail follows:


      

     (25) - Here's a virtual quarter, call someone who cares.
      
      
    ----Original Message-----
    From: Phil Schwarzmann [mailto:pschwarjhmi.edu]
    Sent: Wednesday, May 15, 2002 5:03 PM
    To: php-generallists.php.net
    Subject: [PHP] Done w/ PHP - VB or C# ?

    I know I'll get mauled big-time on this mailing list but I'm thinking
    about putting PHP on hold for a while and learning ASP.NET
     
    I love PHP and open-source computing but if one wants to get a job in
    web development, you'll have a much better time find a job with both PHP
    and ASP (among others) skills.
     
    I'm going to hop on the ASP bandwagon but I'm not sure if I should
    first learn ASP w/ VB or w/ C#
     
    Any thoughts on this? What are the pros and cons of both?
     
    Thanks!

    attached mail follows:


    Miguel Cruz wrote:
    >
    <snip>

    > all the power of DOS batchfiles. Every single thing you want to do - even
    > basic filesystem operations like working with directories and file
    > permissions!!! - requires purchasing expensive and buggy .COM components
    > from nasty little companies with horrible documentation and nonexistent
    > customer service. I consider it an incredibly developer-hostile
    > environment (unless you're in the business of developing developer tools,
    > which seems to be the lynchpin of the ASP ponzi scheme).

    As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
    I'd have to say that you could definitely at least read a directory's
    contents without having to purchase external libraries. Please don't
    go overboard.

    Wouldn't it be cool if you didn't have to be a C programmer to
    write PHP extensions that you could distribute to others (whether
    for profit or not)? I certainly think so, but it's currently not
    possible right now. All those "nasty little companies" you mention
    are making some money because they can program VB, wrap up stuff
    as DLLs, and sell them. They see a need in the ASP community and
    address it, while being able to make some money too. What a novel
    concept!

    >
    > Your choices are your own, but it's always seemed to me that it makes more
    > sense to be focus on being really good at something fun, than to spread
    > out to things that every other loser is already doing.

    It's all perspective. I'm not saying everyone who does PHP is a loser,
    but I have met more than a few losers who happen to work in PHP. Same
    with every other language.

    > Insofar as it can
    > be said about a programming language, PHP is actually fun - in a way that
    > only Perl seems to match (though Perl is certainly a more frustrating kind
    > of fun).
    >
    > As for .NET, I thought I just read that Microsoft was pulling everything
    > in for a rethink because of all the negative reactions it was getting.

    Where the heck did you read that? Do you know what .NET is?
    Glad that you do, because most other people don't - there really
    isn't a good definition, so it's hard to say someone 'pulled everything
    in'. What MS has done is retarget the 'hailstorm' service to
    corporate intranets looking to do internal authentication as opposed
    to a public authentication system. Hardly retracting .NET from
    the scene.

    There's a lot of interesting concepts in the .NET codebase out there now
    (ASP.NET webforms, for example) as well as other platforms
    (Java springs to mind). Just because it's "not PHP" shouldn't mean
    you ignore it or worse yet, publicly denigrate it.

    Michael Kimsal
    http://www.logicreate.com/
    734-480-9961

    attached mail follows:


    On Thu, 16 May 2002, Michael Kimsal wrote:
    > Miguel Cruz wrote:
    >> all the power of DOS batchfiles. Every single thing you want to do - even
    >> basic filesystem operations like working with directories and file
    >> permissions!!! - requires purchasing expensive and buggy .COM components
    >> from nasty little companies with horrible documentation and nonexistent
    >> customer service. I consider it an incredibly developer-hostile
    >> environment (unless you're in the business of developing developer tools,
    >> which seems to be the lynchpin of the ASP ponzi scheme).
    >
    > As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
    > I'd have to say that you could definitely at least read a directory's
    > contents without having to purchase external libraries. Please don't
    > go overboard.

    It's been a while, but I remember that it was impossible to create a
    functional directory browser with off-the-shelf ASP functionality. The
    file component was categorically unwilling to follow mounted shares until
    we got some extra add-in. This was after a month of debate in newsgroup
    microsoft.public.this.that.the-other-thing, and plenty of experimentation
    during which I discovered, reported, and was contacted by MS engineers
    about more bugs than I've ever encountered in PHP.

    > Wouldn't it be cool if you didn't have to be a C programmer to write PHP
    > extensions that you could distribute to others (whether for profit or
    > not)? I certainly think so, but it's currently not possible right now.
    > All those "nasty little companies" you mention are making some money
    > because they can program VB, wrap up stuff as DLLs, and sell them.
    > They see a need in the ASP community and address it, while being able to
    > make some money too. What a novel concept!

    I don't think it's a bad thing that they see a niche and try to fill it. I
    think it's a bad thing from the web developer's perspective that there are
    so many unfilled niches.

    Furthermore, in contrast to the PHP/Open Source world I find the
    profiteering got annoying after a while. It was a drag just having to fill
    out a P.O. every week to buy another ridiculous little thing that may or
    may not be production-quality and had a no-refund policy.

    And the fact is, most of those little companies provide wretched
    documentation and support, and there is no real onlne user community in
    the Windows world to exchange information with. Well, there are lots of
    users, but the ratio of crap-to-usefulness in the fora is so high that
    finding information is painful at best.

    > It's all perspective. I'm not saying everyone who does PHP is a loser,
    > but I have met more than a few losers who happen to work in PHP. Same
    > with every other language.

    No doubt. But a development environment that's the centerpiece of every
    late-night-TV-commercial "Are you tired of your Burger Hut job? We'll
    teach you to be a computer programmer earning $70k/year in only 3
    weeks!!!" tech school is bound to have a higher percentage of losers than
    others.

    >> As for .NET, I thought I just read that Microsoft was pulling everything
    >> in for a rethink because of all the negative reactions it was getting.
    >
    > Where the heck did you read that? Do you know what .NET is?

    Slashdot. And no, to be honest.

    > There's a lot of interesting concepts in the .NET codebase out there now
    > (ASP.NET webforms, for example) as well as other platforms (Java springs
    > to mind). Just because it's "not PHP" shouldn't mean you ignore it or
    > worse yet, publicly denigrate it.

    Public denigration of what I don't understand is how I strike out at a
    callous world that's denied me my just deserts: fame, millions, and a
    torrid love affair with Nancy Reagan. Either address the fundamental
    injustice here or cut me some slack.

    miguel

    attached mail follows:


    Miguel Cruz wrote:
    >
    > Public denigration of what I don't understand is how I strike out at a
    > callous world that's denied me my just deserts: fame, millions, and a
    > torrid love affair with Nancy Reagan. Either address the fundamental
    > injustice here or cut me some slack.

    Couldn't have said it better *heheheh*

    Cheers,
    Rob.

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    Miguel Cruz wrote: <snip>

    >>As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much), >>I'd have to say that you could definitely at least read a directory's >>contents without having to purchase external libraries. Please don't >>go overboard. > > > It's been a while, but I remember that it was impossible to create a > functional directory browser with off-the-shelf ASP functionality. The > file component was categorically unwilling to follow mounted shares until > we got some extra add-in. This was after a month of debate in newsgroup > microsoft.public.this.that.the-other-thing, and plenty of experimentation > during which I discovered, reported, and was contacted by MS engineers > about more bugs than I've ever encountered in PHP.

    This isn't specifically ASP, but NT permissions in general. PHP running under "off the shelf" Windows can't access shares either.

    > > I don't think it's a bad thing that they see a niche and try to fill it. I > think it's a bad thing from the web developer's perspective that there are > so many unfilled niches. > > Furthermore, in contrast to the PHP/Open Source world I find the > profiteering got annoying after a while. It was a drag just having to fill > out a P.O. every week to buy another ridiculous little thing that may or > may not be production-quality and had a no-refund policy. > > And the fact is, most of those little companies provide wretched > documentation and support, and there is no real onlne user community in > the Windows world to exchange information with. Well, there are lots of > users, but the ratio of crap-to-usefulness in the fora is so high that > finding information is painful at best. >

    Honestly, I find that now in the PHP community as well, to a larger extent than I used to, but perhaps it's because I/we aren't in the 'sessions v cookies' mentality anymore.

    Compiling GD support, for one, is a pain in the ass which you can't get really get good support for, due to the variety of systems. Servlet support as well. Java support has gotten better, but it generally just magically happens. I don't think I've had too many deep technical issues that have been resolved with help from the PHP community. Not because they're 'lesser' people, but we're trying to do stuff that most people don't do. It'd be like trying to get JScript support at an ASP site. Yeah, JScript works with ASP, but no one really uses it much, compared to VBScript.

    > >> >>Where the heck did you read that? Do you know what .NET is? > > > Slashdot. And no, to be honest.

    :) Great answer. Honestly.

    > > >>There's a lot of interesting concepts in the .NET codebase out there now >>(ASP.NET webforms, for example) as well as other platforms (Java springs >>to mind). Just because it's "not PHP" shouldn't mean you ignore it or >>worse yet, publicly denigrate it. > > > Public denigration of what I don't understand is how I strike out at a > callous world that's denied me my just deserts: fame, millions, and a > torrid love affair with Nancy Reagan. Either address the fundamental > injustice here or cut me some slack. >

    Not sure how old you are or when you had this thing for Nancy - never been 'fanciable' since I've known her (but maybe I'm too much of a youngster).

    Michael Kimsal http://www.logicreate.com

    attached mail follows:


    For me personally I find working with ASP & .NET to be a pain in the butt, yeah sure you can to use all the fancy GUI's that can take care of some code for you etc.. but then there's the argument about php and having to write the code your self. Personally I find that a better approach as for me it's all about learning and achieving because at the end of the day you can sit back and look at it and go wow I did that from scratch from line 1 of code etc.

    Basically it all comes down to personal preference. I'm coming from a back ground which doesn't include much programming at all (which can be seen by some of the dumb q's i've posted in here...) and I guess that using something with a prodominately (think that's how it's spelt) gui workings and that takes care of alot of code for me should be more appealing but it's not .... any way basically YOU have to decide what's best for you and that your happy with the choices that you've made as in the end it's you that's got to live with them.

    & that's my 2 cents

    Peter

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Thursday, 16 May 2002 7:03 AM To: php-generallists.php.net Subject: [PHP] Done w/ PHP - VB or C# ?

    I know I'll get mauled big-time on this mailing list but I'm thinking about putting PHP on hold for a while and learning ASP.NET

    I love PHP and open-source computing but if one wants to get a job in web development, you'll have a much better time find a job with both PHP and ASP (among others) skills.

    I'm going to hop on the ASP bandwagon but I'm not sure if I should first learn ASP w/ VB or w/ C#

    Any thoughts on this? What are the pros and cons of both?

    Thanks!

    attached mail follows:


    Does anyone know if there is any global reliable and free :-) statistics on usage of PHP vs ASP. I am having the same dilemma., do I need to stick to going deeply into PHP (which in my opinion rulez!!) or start paying more attention to ASP...

    Best Regards, Victor Polyushko

    ----- Original Message ----- From: "Peter" <phpvfsa.com.au> To: "Php" <php-generallists.php.net> Sent: Thursday, May 16, 2002 4:52 PM Subject: FW: [PHP] Done w/ PHP - VB or C# ?

    > > For me personally I find working with ASP & .NET to be a pain in the butt, > yeah sure you can to use all the fancy GUI's that can take care of some code > for you etc.. but then there's the argument about php and having to write > the code your self. Personally I find that a better approach as for me it's > all about learning and achieving because at the end of the day you can sit > back and look at it and go wow I did that from scratch from line 1 of code > etc. > > Basically it all comes down to personal preference. I'm coming from a back > ground which doesn't include much programming at all (which can be seen by > some of the dumb q's i've posted in here...) and I guess that using > something with a prodominately (think that's how it's spelt) gui workings > and that takes care of alot of code for me should be more appealing but > it's not .... any way basically YOU have to decide what's best for you and > that your happy with the choices that you've made as in the end it's you > that's got to live with them. > > > & that's my 2 cents > > Peter > > -----Original Message----- > From: Phil Schwarzmann [mailto:pschwarjhmi.edu] > Sent: Thursday, 16 May 2002 7:03 AM > To: php-generallists.php.net > Subject: [PHP] Done w/ PHP - VB or C# ? > > > I know I'll get mauled big-time on this mailing list but I'm thinking > about putting PHP on hold for a while and learning ASP.NET > > I love PHP and open-source computing but if one wants to get a job in > web development, you'll have a much better time find a job with both PHP > and ASP (among others) skills. > > I'm going to hop on the ASP bandwagon but I'm not sure if I should > first learn ASP w/ VB or w/ C# > > Any thoughts on this? What are the pros and cons of both? > > Thanks! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi, Also try www.uklinux.net They have php and perl cgi (with a mysql or postgres backend)

    -----Original Message----- From: Salman Ahmed [mailto:statbatgem.net.pk] Sent: 16 May 2002 03:05 To: PHP List Subject: [PHP] Plz dont hate me for this

    Hi,

    I am also PHP lover plz dont hate me for this but I really need to know any free perl hosting company where I can host my perl script. Only circumstances has made this that I programming in perl. I have no idea where to put my question, as I always did programming in php and asked this list. So I am asking this question here to, plz tell me about free CGI hosting site.

    Asking for the help and forgiveness Statbat

    attached mail follows:


    All,

    How would you implement 4 drop down lists....

    Data in list 2 dependant on list 1, list 3 dependant on list 2 and list 4 dependant on list 3? Using an ODBC source.

    attached mail follows:


    You may wanna search the archives for this, as its been discussed quite a few times before.

    Basically it comes down to either using some sort of client scripting language (Javascript, VB script etc...), or refreshing the page everytime someone makes a choice in the list box and then populating the rest. IE

    They select Ohio in the first box, then you would refresh the page, and select * from cities where state = "OH"...

    -Chris

    At 01:21 PM 5/16/2002 +0100, Brian McGarvie wrote: >All, > >How would you implement 4 drop down lists.... > >Data in list 2 dependant on list 1, list 3 dependant on list 2 and list >4 dependant on list 3? Using an ODBC source. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Has anyone gotten this working with the newest version of PHP? We have an app that uses this, and can't seem to get it to compile. Bug 15177 is marked as critical, but nothing has been done. Any idea when it'll be fixed?

    Mike.

    -- 
    ##############################
    #          Mike Baranski                   #
    # Security Management Consulting  #
    #      http://www.secmgmt.com         #
    #           919-788-9200                 #
    #############################
    

    attached mail follows:


    Hello, I have installed php 4.1.2 and ucd 4.2.4 both from tarballs on a linux box, and compiled php both as an apache module and standalone (same options, except for the --with-apxs). Now, when I use snmpwalk or whatever other function from within apache, it works (almost) correctly: snmp_set_quick_print causes php to return both the OID and the value although the manual says different, but I can live with that. the problem is that a simple script run from the standalone interpreter on the same machine behaves very strange. Example:

    #!/usr/local/bin/php -q <? snmp_set_quick_print(1); $test=snmpwalk("1.2.3.4","public","system"); for (reset($test); $i = key($test); next($i)){ echo "$test[$i]\n"; }

    does not print ANYTHING (nothing in php.log, also. I have error_reporting = E_ALL in php.ini) but if I do a snmpget("1.2.3.4","public","system.sysName.0") I get system.sysName.0 sysName not set which is (almost) correct. the snmp* commands from the ucd-snmp package work just fine. Does anyone have some clue on what could have happened? Thank you.

    attached mail follows:


    Dear All,

    Firstly, I am a newbie to php so please be gentle.

    I'm having problems with carriage returns placed in a file on a Linux based server. When this file is download to a WindowsXP machine the carriage returns are quite frankly useless. I just get "[]" (where "[]" represents an undisplayable character. No actual carriage returns or newlines!

    I generate the file using the following code (fragment only):

    while($row=mysql_fetch_array($mysql_result)) { $f_title=$row["title"]; $f_first_name=$row["first_name"]; $f_surname=$row["surname"]; $f_email=$row["email"]; fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n"); }

    I then use the following link to a download_it.php script as described in Tansley as follows:

    $parameters="file_name=".urlencode($file_name)."&file_size=$file_size"; echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";

    The download_it.php file looks as follows: <?php #downloadit.php $file_name=urldecode($file_name); header("Content-type: Application/octet-stream"); header("Content-Disposition: attachment;filename=download/download.txt"); header("Content-Description: PHP Download"); header("Content-Length: $file_size"); readfile($file_name); ?>

    Appart from the fact that the Content-Disposition appears not to be working under IE6 since the file name is not correct.

    The downloaded file does not contain Windows type carriage returns of newlines! However it does contains the data thank goodness.

    What is the fix?

    Henry Grech-Cini

    attached mail follows:


    On Thu, May 16, 2002 at 02:14:13PM +0100, Henry Grech-Cini wrote: > > I'm having problems with carriage returns placed in a file on a Linux based > server. When this file is download to a WindowsXP machine the carriage > returns are quite frankly useless.

    Unix type machines separate lines with a newline char "\n" Windows type machines separate lines with a return and newline "\r\n"

    If you want things to look nice on both, use "\r\n"

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


    I am using fsockopen to test several of our SQL and WEB servers at our office. Testing ports 80, 1433 and 8080 work fine, but I would like to set something up to test ports on our mainframe. These are printers listening on 9100 and when I test it fails. I don't see anything in the online docs about going above a certain port - or is there something else.

    Thanks,

    -Scott

    attached mail follows:


    I'm confused!

    Did you want to make a new post for this comment or a reply to another post. Or does it in some way relate to my question. On my newsgroup browser it appears as if this post is in the wrong place! In answer to my post on "Newlines in fputs"

    Thanks for responding anyway.

    Henry

    "Scott St. John" <scottscottah.com> wrote in message news:Pine.LNX.4.44.0205160906340.20264-100000kelly.talon.net... > I am using fsockopen to test several of our SQL and WEB servers at our > office. Testing ports 80, 1433 and 8080 work fine, but I would like to > set something up to test ports on our mainframe. These are printers > listening on 9100 and when I test it fails. I don't see anything in the > online docs about going above a certain port - or is there something else. > > Thanks, > > -Scott > >

    attached mail follows:


    On Thursday 16 May 2002 21:31, Henry Grech-Cini wrote: > I'm confused! > > Did you want to make a new post for this comment or a reply to another > post. Or does it in some way relate to my question. On my newsgroup browser > it appears as if this post is in the wrong place! In answer to my post on > "Newlines in fputs"

    Lazy person replied to an existing post instead start a new one. Messes up threading for everyone.

    > Thanks for responding anyway.

    Probably not :)

    > "Scott St. John" <scottscottah.com> wrote in message > news:Pine.LNX.4.44.0205160906340.20264-100000kelly.talon.net... > > > I am using fsockopen to test several of our SQL and WEB servers at our > > office. Testing ports 80, 1433 and 8080 work fine, but I would like to > > set something up to test ports on our mainframe. These are printers > > listening on 9100 and when I test it fails. I don't see anything in the > > online docs about going above a certain port - or is there something > > else. > > > > Thanks, > > > > -Scott

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

    /* Sin has many tools, but a lie is the handle which fits them all. */

    attached mail follows:


    On Thu, 16 May 2002, Scott St. John wrote: > I am using fsockopen to test several of our SQL and WEB servers at our > office. Testing ports 80, 1433 and 8080 work fine, but I would like to > set something up to test ports on our mainframe. These are printers > listening on 9100 and when I test it fails. I don't see anything in the > online docs about going above a certain port - or is there something else.

    "When I test it fails" is not a useful problem report.

    Show the relevant parts of the code you're running and tell us what, specifically is happening (i.e., if an error message is displayed, paste that into your problem report; if a variable seems to be getting an unexpected value, change your code to print that value out, and then show us both the code and the value that it actually printed out).

    Otherwise it's just sort of a guessing game.

    miguel

    attached mail follows:


    Hi there,

    I am wondering what the equivalent to php.ini is on linux. There is no such file on linux. Is there a different name?

    I would like to set up the max execution time

    Thanx,

    Andy

    attached mail follows:


    It is called php.ini. A php.ini-dist sample file comes with the distribution. phpinfo() will tell you where it is supposed to live. Just copy php.ini-dist to that_location/php.ini and edit it appropriately.

    -Rasmus

    On Thu, 16 May 2002, andy wrote:

    > Hi there, > > I am wondering what the equivalent to php.ini is on linux. There is no such > file on linux. Is there a different name? > > I would like to set up the max execution time > > Thanx, > > Andy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    there is, is is called... php.ini :) It should reside in /etc, if there is none, create it and add whatever options you need in it. In the source tree you will find two files - php.ini-dist and php.ini-recommended which might be of help.

    On Thu, 16 May 2002, andy wrote:

    > Hi there, > > I am wondering what the equivalent to php.ini is on linux. There is no such > file on linux. Is there a different name? > > I would like to set up the max execution time > > Thanx, > > Andy > > > >

    attached mail follows:


    I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini put the max execution time to 60000 and restarted apache (php as module) But I do still get a max execution time 30s reached.

    Do you have an idea what's wrong?

    Thanx,

    Andy "Rasmus Lerdorf" <rasmusphp.net> schrieb im Newsbeitrag news:Pine.LNX.4.44.0205160637450.24933-100000christine.ca... > It is called php.ini. A php.ini-dist sample file comes with the > distribution. phpinfo() will tell you where it is supposed to live. Just > copy php.ini-dist to that_location/php.ini and edit it appropriately. > > -Rasmus > > On Thu, 16 May 2002, andy wrote: > > > Hi there, > > > > I am wondering what the equivalent to php.ini is on linux. There is no such > > file on linux. Is there a different name? > > > > I would like to set up the max execution time > > > > Thanx, > > > > Andy > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    [snip] I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini put the max execution time to 60000 and restarted apache (php as module) But I do still get a max execution time 30s reached.

    Do you have an idea what's wrong? [/snip]

    Did you restart your HTTP server? If not the php.ini file was not read. Also, if you are using Apache there is a timeout in that server that must be changed as well. Same for IIS. Anytime any changes are made to any files which affects the web server requires that the web server be restarted.

    HTH!

    Jay

    attached mail follows:


    On Thursday 16 May 2002 22:09, andy wrote: > I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini > put the max execution time to 60000 and restarted apache (php as module) > But I do still get a max execution time 30s reached. > > Do you have an idea what's wrong?

    Run phpinfo() to see where php is expecting it's php.ini file.

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

    /* Your lucky number has been disconnected. */

    attached mail follows:


    Greetings friends, pals, nymphos, programmers, geeks and others, of gods chosen people!

    Here goes, I have a program that uploads any file and allows the person to see whats in a particular directory without any problems, not bad for a newbie eh? stand up and clap!!!

    what i want to do is make sure that whatever the person uploads cannot "run" or be executed....any ideas on how to do this?

    Baically its a file sharing program..."a" uploads something "b" downloads it...I just dont want to get screwed in the bargain

    I was thinking of using the promise system, make them promise that they wont do anything bad...but the fact of the matter is people lie.....:-)

    Any help appreciated. Cheers, -Ryan. P.S after reading this email dont send me mails telling me that I am crazy.....coz i already know that. And remember "Never get into fistfights with ugly people, they have nothing to lose."

    attached mail follows:


    On Friday 17 May 2002 10:40, r wrote: > Greetings friends, pals, nymphos, programmers, geeks and others, of gods > chosen people! > > Here goes, > I have a program that uploads any file and allows the person to see whats > in a particular directory without any problems, > not bad for a newbie eh? stand up and clap!!! > > what i want to do is make sure that whatever the person uploads cannot > "run" or be executed....any ideas on how to do this?

    Why? Who is going to run it, and where are they going to run it?

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

    /* I am looking for a honest man. -- Diogenes the Cynic */

    attached mail follows:


    On Thu, 16 May 2002, r wrote: > Here goes, > I have a program that uploads any file and allows the person to see whats in > a particular directory without any problems, > not bad for a newbie eh? stand up and clap!!! > > what i want to do is make sure that whatever the person uploads cannot "run" > or be executed....any ideas on how to do this? > > Baically its a file sharing program..."a" uploads something "b" downloads > it...I just dont want to get screwed in the bargain

    Not sure I get your question. Cannot be "run" or "executed" by whom? By the web server? Just don't let it run them. By people who download them? Impossible. There are too many executable formats. The only choice would be to have a whitelist of file formats (i.e., "GIF", "JPEG", "PNG", use 'file' to check the prologue of each file, and then toss anything else.

    miguel

    P.S. Your system clock is about 11 hours fast (or you've selected the wrong time zone), which is annoying since it puts your messages out of sequence and I can't tell whether or not they've been replied to without reading through 200 other headers.

    attached mail follows:


    Two related questions:

    1) Is there any work being done to support the retrieval of the LDAP schema in PHP (similar to Perl's Net::LDAP::Schema)? Is there any other good way to get this information into PHP?

    2) Is there any way to change the search scope of an LDAP search in PHP? Specifically, the following OpenLDAP search command will fetch the schema from the server: ldapsearch -s base -x -b 'cn=subschema' objectclass=* + But, I can find no way to switch the search scope from SUB to BASE, so the equivalent call in PHP won't work.

    Any suggestions?

    Thanks

    DC

    attached mail follows:


    On Thu, May 16, 2002 at 09:34:16AM -0500, D Canfield wrote: > Two related questions: > > 1) Is there any work being done to support the retrieval of the LDAP > schema in PHP (similar to Perl's Net::LDAP::Schema)? Is there any other > good way to get this information into PHP? > > 2) Is there any way to change the search scope of an LDAP search in > PHP? Specifically, the following OpenLDAP search command will fetch the > schema from the server: > ldapsearch -s base -x -b 'cn=subschema' objectclass=* + > But, I can find no way to switch the search scope from SUB to BASE, so > the equivalent call in PHP won't work. > > Any suggestions?

    look into ldap_read() and the optional arguments to ldap_search()

    matt

    attached mail follows:


    Hey guys I recently join this list and this is my first real post to it so if I f**k something up please do beat me to death. :)

    I have a simple mailer script that was mailing POSTed form information to a client, this script was running on a Debian box w/Apache. This server is having hardware issues so I moved the sites to a win2k machine. The same script bombs out when it trys to use the mail() function.

    The error message I receive is not so enlightening:

    Warning: Server Error in D:\Inetpub\belcoind.com\mailFunc.php on line 24

    I changed the line in the php.ini to read:

    SMTP = localhost;

    the server has its own smtp service running on it

    I also tried:

    SMTP = mail.mydomain.com;

    This genereated the same problem.

    I have been using PHP with Apache forever but I rarely use it on Windows so any insight into this problem would be great.

    Thanks in advance,

    -Jared

    attached mail follows:


    Hi,

    I am doing some validation on files that are being upload. I only wish to allow users to upload files that are in *plain text* format (not neccessarily with a .txt extension). I have the following piece of code, which works fine in IE, but in Netscape Navigator:

    if ($file_type != "text/plain") ... error handling...

    Can anyone explain the reason for this, or offer a better solution?

    Thanks,

    Lee

    attached mail follows:


    The uploaded mime type is set by the browser, not by PHP. So I guess in your Netscape case it isn't sending the right type.

    Perhaps have a look at the 'file' UNIX-level command and use that.

    -Rasmus

    On Thu, 16 May 2002, Lee P Reilly wrote:

    > Hi, > > I am doing some validation on files that are being upload. I only wish > to allow users to upload files that are in *plain text* format (not > neccessarily with a .txt extension). I have the following piece of code, > which works fine in IE, but in Netscape Navigator: > > if ($file_type != "text/plain") > ... error handling... > > Can anyone explain the reason for this, or offer a better solution? > > Thanks, > > Lee > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    My question will probably expose my woeful lack understanding of security breaches, but perhaps someone can enlighten me.

    On my site, registered members will be allowed to upload jpg/jpeg pictures. I'm concerned about possible security problems. First, is there a way to ensure that a picture (and not some other malicious stuff) has been uploaded?

    Aside from checking the mime type info associated with the file, is there any way of verifying what's in the file that has been uploaded? (I'm using Linux LM8.2) Would it be possible to fake info to fool this check? Would verification checks for html/scripts/commands be of any use?

    Secondly, since the file in question is already uploaded and saved to disk in /tmp or wherever, wouldn't any verification scheme be sort of, 'after-the-fact'?

    I would appreciate any input, suggestions, or ideas on what to do here. Am I being overly-paranoid about this, or do I have legitimate security concern.

    Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2

    Tia, Andre

    -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory.

    May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

    attached mail follows:


    Are you afraid of someone embedding PHP in a .jpg file? That's not really an issue as your web server is probably configured to only serve up PHP as .php files. Likewise, your web server config is likely such that any .jpg file is served up as content-type image/jpeg and as such it really doesn't matter what sort of junk is embedded in the image. At most it will show up as a broken image icon in your browser.

    -Rasmus

    On Tue, 14 May 2002, Andre Dubuc wrote:

    > Thanks Rasmus, > > I thought there had to be function out there that could examine the actual > contents. > > Now the question remains, would an ereg/eregi check for html/code/commands > work on a "jpg/jpeg" type file? From a brief examination of one, I note that > it's not text, but code. I tried writing some text commands into a jpeg file > to see what would happen, and wasn't too surprised that the file didn't load > -- but then again, I don't know what I'm doing:> > > I suppose, following what I saw in a movie "Along Came a Spider" -- > manipulating image files with hidden text files, etc. -- sort of put me on > guard. I have no idea whether this is even possible. . . sounds probable > though. Would be great to find out before the site is compromised. > > Tia, > Andre > > > On Tuesday 14 May 2002 10:32 pm, you wrote: > > Have a look at the getimagesize() function. This function looks at the > > actual file data, not the mime type nor the file's extension but the data > > itself and tells you what sort of image file it is. > > > > And no, it wouldn't really be after the fact because because stores the > > file with a temporary random filename in /tmp ensuring not to overwrite > > anything that is already there. It is then your job to perform the check > > and copy the file to some appropriate directory on your server. If you > > don't do anything with the file, PHP will automatically delete it at the > > end of the request. > > > > -Rasmus > > > > On Tue, 14 May 2002, Andre Dubuc wrote: > > > My question will probably expose my woeful lack understanding of security > > > breaches, but perhaps someone can enlighten me. > > > > > > On my site, registered members will be allowed to upload jpg/jpeg > > > pictures. I'm concerned about possible security problems. First, is there > > > a way to ensure that a picture (and not some other malicious stuff) has > > > been uploaded? > > > > > > Aside from checking the mime type info associated with the file, is there > > > any way of verifying what's in the file that has been uploaded? (I'm > > > using Linux LM8.2) Would it be possible to fake info to fool this check? > > > Would verification checks for html/scripts/commands be of any use? > > > > > > Secondly, since the file in question is already uploaded and saved to > > > disk in /tmp or wherever, wouldn't any verification scheme be sort of, > > > 'after-the-fact'? > > > > > > I would appreciate any input, suggestions, or ideas on what to do here. > > > Am I being overly-paranoid about this, or do I have legitimate security > > > concern. > > > > > > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2 > > > > > > Tia, > > > Andre > > > > > > > > > -- > > > Please pray the Holy Rosary to end the holocaust of abortion. > > > Remember in your prayers the Holy Souls in Purgatory. > > > > > > May God bless you abundantly in His love! > > > For a free Cenacle Scriptural Rosary Booklet: > > > http://www.webhart.net/csrb/ > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Please pray the Holy Rosary to end the holocaust of abortion. > Remember in your prayers the Holy Souls in Purgatory. > > May God bless you abundantly in His love! > For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ >

    attached mail follows:


    Rasmus Lerdorf <rasmusphp.net> wrote: > Are you afraid of someone embedding PHP in a .jpg file? That's not really > an issue as your web server is probably configured to only serve up PHP as > .php files. Likewise, your web server config is likely such that any .jpg > file is served up as content-type image/jpeg and as such it really doesn't > matter what sort of junk is embedded in the image. At most it will show > up as a broken image icon in your browser.

    right.

    the thing you may need to worry about, if you provide some sort of service that allows for anyone to upload a jpeg file that anyone else can then download, is people using programs that piggyback other data (mp3 files, rar archives, etc) on those images.

    one simple check you can do to minimize this is to compare the image dimensions to the file size -- if you've got a 120x120 image in a three meg jpeg file, something is probably awry. so with a combination of php's getimagesize() and filesize(), you can try to detect that sort of thing.

    (this is one of the problems that plague sites that provide free webspace. it's only a security issue insofar as this can constitute an effective denial-of-service 'attack' on your systems.)

    jim

    attached mail follows:


    Thanks Rasmus,

    I thought there had to be function out there that could examine the actual contents.

    Now the question remains, would an ereg/eregi check for html/code/commands work on a "jpg/jpeg" type file? From a brief examination of one, I note that it's not text, but code. I tried writing some text commands into a jpeg file to see what would happen, and wasn't too surprised that the file didn't load -- but then again, I don't know what I'm doing:>

    I suppose, following what I saw in a movie "Along Came a Spider" -- manipulating image files with hidden text files, etc. -- sort of put me on guard. I have no idea whether this is even possible. . . sounds probable though. Would be great to find out before the site is compromised.

    Tia, Andre

    On Tuesday 14 May 2002 10:32 pm, you wrote: > Have a look at the getimagesize() function. This function looks at the > actual file data, not the mime type nor the file's extension but the data > itself and tells you what sort of image file it is. > > And no, it wouldn't really be after the fact because because stores the > file with a temporary random filename in /tmp ensuring not to overwrite > anything that is already there. It is then your job to perform the check > and copy the file to some appropriate directory on your server. If you > don't do anything with the file, PHP will automatically delete it at the > end of the request. > > -Rasmus > > On Tue, 14 May 2002, Andre Dubuc wrote: > > My question will probably expose my woeful lack understanding of security > > breaches, but perhaps someone can enlighten me. > > > > On my site, registered members will be allowed to upload jpg/jpeg > > pictures. I'm concerned about possible security problems. First, is there > > a way to ensure that a picture (and not some other malicious stuff) has > > been uploaded? > > > > Aside from checking the mime type info associated with the file, is there > > any way of verifying what's in the file that has been uploaded? (I'm > > using Linux LM8.2) Would it be possible to fake info to fool this check? > > Would verification checks for html/scripts/commands be of any use? > > > > Secondly, since the file in question is already uploaded and saved to > > disk in /tmp or wherever, wouldn't any verification scheme be sort of, > > 'after-the-fact'? > > > > I would appreciate any input, suggestions, or ideas on what to do here. > > Am I being overly-paranoid about this, or do I have legitimate security > > concern. > > > > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2 > > > > Tia, > > Andre > > > > > > -- > > Please pray the Holy Rosary to end the holocaust of abortion. > > Remember in your prayers the Holy Souls in Purgatory. > > > > May God bless you abundantly in His love! > > For a free Cenacle Scriptural Rosary Booklet: > > http://www.webhart.net/csrb/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    Please pray the Holy Rosary to end the holocaust of abortion.
    Remember in your prayers the Holy Souls in Purgatory.
    

    May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

    attached mail follows:


    show the contents of 'try_param.php' please.

    Jim Lucas ----- Original Message ----- From: "Maciej Przybycien" <maciejlotus.phys.nwu.edu> To: <php-generallists.php.net> Sent: Wednesday, May 15, 2002 10:38 AM Subject: [PHP] tag img and php

    > > Hi, > I included php file as html img: > <img src="/smtMonitoring/jpgraph_cache/try_param.php" width="340" > height="240" > > and Netscape brawser seems not to interpret that. However if I change > try_param.php -> try_param.png then image can be desplayed. > > According to the documentation 'try_param.php' should be interpereted > fine. > What could be the problem? > > Thank you, > Maciek > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Thank you for responding to my email. I am still stuck with my problem.

    I am using additionally jpgraph-1.6.1. Here is the content of my try.php file: <?php (include "jpgraph.php"); (include "jpgraph_line.php"); // Create the graph. These two calls are always required $graph = new Graph(450,350, "auto"); $graph->SetScale("textlin"); $graph->img->SetMargin(30,30,50,50); $graph->xaxis->SetFont(FF_FONT1,FS_BOLD); $graph->title->Set("SMT HISTOGRAMS");

    // A new plot $ydata = array(55,66,67,66,67,67,66,68,67,66,68,67,68,67,68,67,68,68,68,68,68,69,68,68,68,68,68,68,68,68,68,69,68,68,70,67,69,68,69,68,69,68,69,68,68,69,68,68,68,69,68,68,68,69,68,68,68,68,69,68,69,67,69,68,68,68,69,69,68,68,69,67,68,68,68,69,69,69,69,69,69,69,68,68,68,68,68,68,68,68,68,68,68,68,68,68,69,68,69,67,69,68,69,68,69,68,69,68,69,67,68,67,69,68,68,68,69,69,69,68,68,69,69,68,69,69,69,68); // Create the linear plot $lineplot=new LinePlot($ydata); // Add the plot to the graph $graph->Add($lineplot);

    // A new plot $ydata1 = array(57,68,69,68,69,69,69,70,69,70,69,69,70,70,70,70,70,69,70,70,71,70,70,70,70,70,71,70,71,70,71,70,71,69,70,71,71,70,70,71,70,70,71,70,71,70,70,70,71,69,71,70,71,70,71,70,70,70,70,70,70,70,69,70,70,69,70,69,71,69,70,69,70,69,70,69,70,69,71,69,70,69,71,69,70,69,70,70,70,69,70,69,70,69,70,69,70,69,69,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,68,69,69); // Create the linear plot $lineplot1=new LinePlot($ydata1); // Add the plot to the graph $graph->Add($lineplot1);

    $graph->Stroke(); ?>

    I thought that I maight have set some file access uncerrectly and Java servlets cannot read them so I tried to display simple file: <?php echo "Hello World<p>"; ?> I got the same result as previously.

    I can display any of those files when I load html file: <html> </head> <body bgcolor="#A8FFFF" text="#0000A0" link="#408080" vlink="#0000A0" alink="#008040"> <h4>SMT MONITORING-----------</h4>

    <form> <img src="/jpgraph_cache/try.php" width="340" height="240" > </form> </body></html>

    So I am really confused. I just suppose that the problem is somehow related to html being generated on-fly in Java servlets. But I don't understand why is that.

    The source of Java generated html page is: <html> <body bgcolor="#A8FFFF" text="#0000A0" link="#408080" vlink="#0000A0" alink="#008040"> <h4>SMT MONITORING</h4>

    <form> <img src="/smtMonitoring/jpgraph_cache/hello2.php" width="340" height="240" > </form> </body></html>

    Thanks, Maciek

    On Thu, 16 May 2002, Jim lucas wrote:

    > show the contents of 'try_param.php' please. > > Jim Lucas > ----- Original Message ----- > From: "Maciej Przybycien" <maciejlotus.phys.nwu.edu> > To: <php-generallists.php.net> > Sent: Wednesday, May 15, 2002 10:38 AM > Subject: [PHP] tag img and php > > > > > > Hi, > > I included php file as html img: > > <img src="/smtMonitoring/jpgraph_cache/try_param.php" width="340" > > height="240" > > > and Netscape brawser seems not to interpret that. However if I change > > try_param.php -> try_param.png then image can be desplayed. > > > > According to the documentation 'try_param.php' should be interpereted > > fine. > > What could be the problem? > > > > Thank you, > > Maciek > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

    attached mail follows:


    I use: print('<SCRIPT LANGUAGE="JavaScript">'); print('document.write("Code Name: "+navigator.appCodeName+"<BR>");'); print('</SCRIPT>');

    How is possible to keep this info to a MySQL database with PHP? I think is not possible becouse PHP runs first. Also how is possible to get with PHP info like this (browser type ecc) and user's IP address without Javascript? Or use Javascript and then run a php script to write it to the MySQL database?

    Thanks

    Prodromos Savaidis

    attached mail follows:


    The user's IP address is stored in the PHP global, $REMOTE_ADDR. Browser information can be extracted from the get_browser() function. http://www.php.net/manual/en/function.get-browser.php -Kevin

    ----- Original Message ----- From: "savaidis" <savaidishol.gr> To: <php-generallists.php.net> Sent: Thursday, May 16, 2002 7:44 AM Subject: [PHP] some Javascript functions with PHP

    > > I use: > print('<SCRIPT LANGUAGE="JavaScript">'); > print('document.write("Code Name: "+navigator.appCodeName+"<BR>");'); > print('</SCRIPT>'); > > How is possible to keep this info to a MySQL database with PHP? > I think is not possible becouse PHP runs first. > Also how is possible to get with PHP info like this (browser type ecc) > and user's IP address without Javascript? > Or use Javascript and then run a php script to write it to the MySQL > database? > > > Thanks > > Prodromos Savaidis > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi All

    I am trying to write something similar to a server console display, is it a good idea to use PHP?

    Wondering how things like 1. server clock (similar to a clock applet) 2. server status can be displayed with PHP code?

    Note: I need to display the above two in a continuous fashion on the status bar!!

    Many Thanks Dominic

    attached mail follows:


    PHP and Web Servers probably make a bad choice for what is essentially a real time application. PHP and web servers expect to serve up a page of essentially HTML(and Javascript, or Java Applets), then close the connection to a browser so that it can handle the requests of others, and not deal with that connection again until the browser makes another connection, usually as a result of a hotlink click, or submit.

    There is a way to simulate what you want using JavaScript (if PHP can output HTML, it can also output Javascript). Check http://www.hotscripts.com in their JavaScript section for routines to perform 3 functions,

    1. a routine which will cause the a page to request a refresh every 10 seconds or so, there by requesting the same page, which your PHP can fill with the latest (real-time?) data. 2. a routine for using JavaScript to display data on the status line. 3. a routine for displaying the time (using the clock on the browser machine).

    hope this helps,

    Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658

    -----Original Message----- From: DoL [mailto:dwylaunetvigator.com] Sent: Thursday, May 16, 2002 9:12 AM To: php-devlists.php.net; php-generallists.php.net Subject: [PHP] Console application with PHP

    Hi All

    I am trying to write something similar to a server console display, is it a good idea to use PHP?

    Wondering how things like 1. server clock (similar to a clock applet) 2. server status can be displayed with PHP code?

    Note: I need to display the above two in a continuous fashion on the status bar!!

    Many Thanks Dominic

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

    attached mail follows:


    Hi,

    I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine

    Any suggestion will be greatly appreciated. Thank you in advance

    Victor Polyushko

    attached mail follows:


    As fas as I know, the only way to do this is to give somebody instructions to right click on the file and so "Save As".

    Plan B is to put the GIF in a ZIP file and let it be downloaded like that.

    Best Regards, Patrick Lynch.

    Optip Ltd, Internet & Mobile Development Co. Clare, Ireland. http://www.optip.com/

    -----Original Message----- From: Victor Polyushko [mailto:victorgbiswebdesign.com] Sent: 16 May 2002 18:05 To: php-generallists.php.net Subject: [PHP] Can anyone help me save img from URL?

    Hi,

    I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine

    Any suggestion will be greatly appreciated. Thank you in advance

    Victor Polyushko

    attached mail follows:


    On Thu, 16 May 2002, Victor Polyushko wrote: > I was wondering if someone knows how to save the image from the given > url http://domain.com/image.gif into a file on a local machine

    lynx -source -dump http://domain.com/image.gif > image.gif

    miguel

    attached mail follows:


    Miguel Cruz wrote: > > On Thu, 16 May 2002, Victor Polyushko wrote: > > I was wondering if someone knows how to save the image from the given > > url http://domain.com/image.gif into a file on a local machine > > lynx -source -dump > image.gif

    If there were actually an image I'd use:

    wget http://domain.com/image.gif

    Cheers, Rob.

    --
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    Hi Guys,

    Thank you fo your input. I am sorry I am new to the list so + English is not my first language :-( anyhow., I shoudl 've made my question more clear.

    I am trying to save the image from the given URL (http://domain.com/image.gif) running a PHP script on the page. I have tried fread() and it does not allow me to accomplish that :-((

    Have you guys ever come across such a problem?

    Again thank you very much for your suggestions

    Best Regards, Victor Polyushko

    ----- Original Message ----- From: "Robert Cummings" <robert.cummingswebmotion.com> To: "Miguel Cruz" <mncstoic.net> Cc: "Victor Polyushko" <victorgbiswebdesign.com>; <php-generallists.php.net> Sent: Thursday, May 16, 2002 2:01 PM Subject: Re: [PHP] Can anyone help me save img from URL?

    > Miguel Cruz wrote: > > > > On Thu, 16 May 2002, Victor Polyushko wrote: > > > I was wondering if someone knows how to save the image from the given > > > url http://domain.com/image.gif into a file on a local machine > > > > lynx -source -dump > image.gif > > If there were actually an image I'd use: > > wget http://domain.com/image.gif > > Cheers, > Rob. > -- > .-----------------. > | Robert Cummings | > :-----------------`----------------------------. > | Webdeployer - Chief PHP and Java Programmer | > :----------------------------------------------: > | Mail : mailto:robert.cummingswebmotion.com | > | Phone : (613) 731-4046 x.109 | > :----------------------------------------------: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `----------------------------------------------' >

    attached mail follows:


    Victor Polyushko wrote: > > Hi Guys, > > Thank you fo your input. I am sorry I am new to the list so + English is not > my first language :-( anyhow., I shoudl 've made my question more clear. > > I am trying to save the image from the given URL > (http://domain.com/image.gif) running a PHP script on the page. I have tried > fread() and it does not allow me to accomplish that :-(( > > Have you guys ever come across such a problem?

    $imageData = implode( '', file( 'http://domain.com/image.gif' ) ); $length = strlen( $imageData );

    if( $length > 0 ) { if( (fh = fopen( 'destination', 'w' )) ) { fwrite( fh, $imageData ); } }

    Cheers, Rob.

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    Not sure how to resolve this, looked at php.net for the headers available and this is the error I am recieving:

    Warning: Cannot add header information - headers already sent by (output started at /path/to/connection/script/db.php:6) in /path/to/login/checking file/auth_done.php on line 13

    Here is the code that is in auth_done.php:

    session_start(); require '/path/to/login/checking file/db.php'; $db_table = 'auth_users'; $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = password(\"$p_word\")"; $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); $num = mysql_numrows($result); if ($num !=0) { session_register('u_name'); session_register('p_word'); $msg_success = "Good freakin job poindexter!!"; } else { header ("Location: index.php"); // This is line 13 that is my error generator }

    This is the code for the db.php script: <?php $dbh = mysql_connect('localhost','username','password') or die('Could not connect to database, please try again later'); mysql_select_db('db_name') or die('Could not select database, please try again later'); ?>

    Any help would be great! I am assuming there is another way to redirect users besides the header function, just not sure what it is or how to use it. Thanks in advance, Jas

    attached mail follows:


    What is on line 6 of the db.php file? Do you have a stray carriage return at the end of this file?

    On Thu, 16 May 2002, Jas wrote:

    > Not sure how to resolve this, looked at php.net for the headers available > and this is the error I am recieving: > > Warning: Cannot add header information - headers already sent by (output > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > file/auth_done.php on line 13 > > Here is the code that is in auth_done.php: > > session_start(); > require '/path/to/login/checking file/db.php'; > $db_table = 'auth_users'; > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > password(\"$p_word\")"; > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > $num = mysql_numrows($result); > if ($num !=0) { > session_register('u_name'); > session_register('p_word'); > $msg_success = "Good freakin job poindexter!!"; > } else { > header ("Location: index.php"); // This is line 13 that is my error > generator > } > > This is the code for the db.php script: > <?php > $dbh = mysql_connect('localhost','username','password') or die('Could not > connect to database, please try again later'); > mysql_select_db('db_name') or die('Could not select database, please try > again later'); > ?> > > Any help would be great! I am assuming there is another way to redirect > users besides the header function, just not sure what it is or how to use > it. Thanks in advance, > Jas > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi Jas,

    I normally output can output a JaveScript document.location.href="XXX.XXX"; command

    Plan B is to do your processing before there is any output and then decide whether or not to do a redirect using the header() function.

    Best Regards, Patrick Lynch.

    Optip Ltd, Internet & Mobile Development Co. Clare, Ireland. http://www.optip.com/

    -----Original Message----- From: Jas [mailto:jlgerfenhotmail.com] Sent: 16 May 2002 18:11 To: php-generallists.php.net Subject: [PHP] uh, oh errors?

    Not sure how to resolve this, looked at php.net for the headers available and this is the error I am recieving:

    Warning: Cannot add header information - headers already sent by (output started at /path/to/connection/script/db.php:6) in /path/to/login/checking file/auth_done.php on line 13

    Here is the code that is in auth_done.php:

    session_start(); require '/path/to/login/checking file/db.php'; $db_table = 'auth_users'; $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = password(\"$p_word\")"; $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); $num = mysql_numrows($result); if ($num !=0) { session_register('u_name'); session_register('p_word'); $msg_success = "Good freakin job poindexter!!"; } else { header ("Location: index.php"); // This is line 13 that is my error generator }

    This is the code for the db.php script: <?php $dbh = mysql_connect('localhost','username','password') or die('Could not connect to database, please try again later'); mysql_select_db('db_name') or die('Could not select database, please try again later'); ?>

    Any help would be great! I am assuming there is another way to redirect users besides the header function, just not sure what it is or how to use it. Thanks in advance, Jas

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

    attached mail follows:


    That worked, I had about 3 blank lines trailing my ?>. Thanks a ton! Jas

    "Rasmus Lerdorf" <rasmusphp.net> wrote in message news:Pine.LNX.4.44.0205161011300.28713-100000christine.ca... > What is on line 6 of the db.php file? Do you have a stray carriage return > at the end of this file? > > On Thu, 16 May 2002, Jas wrote: > > > Not sure how to resolve this, looked at php.net for the headers available > > and this is the error I am recieving: > > > > Warning: Cannot add header information - headers already sent by (output > > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > > file/auth_done.php on line 13 > > > > Here is the code that is in auth_done.php: > > > > session_start(); > > require '/path/to/login/checking file/db.php'; > > $db_table = 'auth_users'; > > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > > password(\"$p_word\")"; > > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > > $num = mysql_numrows($result); > > if ($num !=0) { > > session_register('u_name'); > > session_register('p_word'); > > $msg_success = "Good freakin job poindexter!!"; > > } else { > > header ("Location: index.php"); // This is line 13 that is my error > > generator > > } > > > > This is the code for the db.php script: > > <?php > > $dbh = mysql_connect('localhost','username','password') or die('Could not > > connect to database, please try again later'); > > mysql_select_db('db_name') or die('Could not select database, please try > > again later'); > > ?> > > > > Any help would be great! I am assuming there is another way to redirect > > users besides the header function, just not sure what it is or how to use > > it. Thanks in advance, > > Jas > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Don't feel bad about this. This is something that messes a lot of people up. The browser knows where your headers end and where content begins by adding blank line between the headers and the rest of the page. ALL headers must come before any content is printed to the page. PHP will give you that error if you attempt to write a new header. So in fact your problem is not on Line 13.. but is actually on Line 11. There are at least two ways to avoid this...

    1. Don't print content before headers. :) 2. Use output buffering to write the whole page before it is outputed to the browser.

    Hope this helps, -Keivn

    ----- Original Message ----- From: "Jas" <jlgerfenhotmail.com> To: <php-generallists.php.net> Sent: Thursday, May 16, 2002 11:10 AM Subject: [PHP] uh, oh errors?

    > Not sure how to resolve this, looked at php.net for the headers available > and this is the error I am recieving: > > Warning: Cannot add header information - headers already sent by (output > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > file/auth_done.php on line 13 > > Here is the code that is in auth_done.php: > > session_start(); > require '/path/to/login/checking file/db.php'; > $db_table = 'auth_users'; > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > password(\"$p_word\")"; > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > $num = mysql_numrows($result); > if ($num !=0) { > session_register('u_name'); > session_register('p_word'); > $msg_success = "Good freakin job poindexter!!"; > } else { > header ("Location: index.php"); // This is line 13 that is my error > generator > } > > This is the code for the db.php script: > <?php > $dbh = mysql_connect('localhost','username','password') or die('Could not > connect to database, please try again later'); > mysql_select_db('db_name') or die('Could not select database, please try > again later'); > ?> > > Any help would be great! I am assuming there is another way to redirect > users besides the header function, just not sure what it is or how to use > it. Thanks in advance, > Jas > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    DOH! I retract that statement about Line 11.. I saw it and immediately thought you were printing out that line, clearly you're not. But the rest of my point is still valid, and Rasmus pointed out the true location of the error. Anyway glad to hear you got the problem solved so quickly.

    ----- Original Message ----- From: "Kevin Stone" <kevinhelpelf.com> To: "PHP-general" <php-generallists.php.net> Sent: Thursday, May 16, 2002 11:23 AM Subject: Fw: [PHP] uh, oh errors?

    > Don't feel bad about this. This is something that messes a lot of people > up. The browser knows where your headers end and where content begins by > adding blank line between the headers and the rest of the page. ALL headers > must come before any content is printed to the page. PHP will give you that > error if you attempt to write a new header. So in fact your problem is not > on Line 13.. but is actually on Line 11. There are at least two ways to > avoid this... > > 1. Don't print content before headers. :) > 2. Use output buffering to write the whole page before it is outputed to the > browser. > > Hope this helps, > -Keivn > > ----- Original Message ----- > From: "Jas" <jlgerfenhotmail.com> > To: <php-generallists.php.net> > Sent: Thursday, May 16, 2002 11:10 AM > Subject: [PHP] uh, oh errors? > > > > Not sure how to resolve this, looked at php.net for the headers available > > and this is the error I am recieving: > > > > Warning: Cannot add header information - headers already sent by (output > > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > > file/auth_done.php on line 13 > > > > Here is the code that is in auth_done.php: > > > > session_start(); > > require '/path/to/login/checking file/db.php'; > > $db_table = 'auth_users'; > > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > > password(\"$p_word\")"; > > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > > $num = mysql_numrows($result); > > if ($num !=0) { > > session_register('u_name'); > > session_register('p_word'); > > $msg_success = "Good freakin job poindexter!!"; > > } else { > > header ("Location: index.php"); // This is line 13 that is my error > > generator > > } > > > > This is the code for the db.php script: > > <?php > > $dbh = mysql_connect('localhost','username','password') or die('Could not > > connect to database, please try again later'); > > mysql_select_db('db_name') or die('Could not select database, please try > > again later'); > > ?> > > > > Any help would be great! I am assuming there is another way to redirect > > users besides the header function, just not sure what it is or how to use > > it. Thanks in advance, > > Jas > > > > > > > > -- > > 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:


    What are some benefits to using output buffering versus just letting it generate as it goes?

    -----Original Message----- From: Kevin Stone [mailto:kevinhelpelf.com] Sent: Thursday, May 16, 2002 1:24 PM To: PHP-general Subject: Fw: [PHP] uh, oh errors?

    Don't feel bad about this. This is something that messes a lot of people up. The browser knows where your headers end and where content begins by adding blank line between the headers and the rest of the page. ALL headers must come before any content is printed to the page. PHP will give you that error if you attempt to write a new header. So in fact your problem is not on Line 13.. but is actually on Line 11. There are at least two ways to avoid this...

    1. Don't print content before headers. :) 2. Use output buffering to write the whole page before it is outputed to the browser.

    Hope this helps, -Keivn

    ----- Original Message ----- From: "Jas" <jlgerfenhotmail.com> To: <php-generallists.php.net> Sent: Thursday, May 16, 2002 11:10 AM Subject: [PHP] uh, oh errors?

    > Not sure how to resolve this, looked at php.net for the headers available > and this is the error I am recieving: > > Warning: Cannot add header information - headers already sent by (output > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > file/auth_done.php on line 13 > > Here is the code that is in auth_done.php: > > session_start(); > require '/path/to/login/checking file/db.php'; > $db_table = 'auth_users'; > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > password(\"$p_word\")"; > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > $num = mysql_numrows($result); > if ($num !=0) { > session_register('u_name'); > session_register('p_word'); > $msg_success = "Good freakin job poindexter!!"; > } else { > header ("Location: index.php"); // This is line 13 that is my error > generator > } > > This is the code for the db.php script: > <?php > $dbh = mysql_connect('localhost','username','password') or die('Could not > connect to database, please try again later'); > mysql_select_db('db_name') or die('Could not select database, please try > again later'); > ?> > > Any help would be great! I am assuming there is another way to redirect > users besides the header function, just not sure what it is or how to use > it. Thanks in advance, > Jas > > > > -- > 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:


    one REALLY notable advantage is:

    if you us ob_*() functions, instead of writing HTML pages with php tags inserted, you can write XML pages with PHP tags inserted. then after you're done, you can pass the contents of the output buffer to an XSLT processer like sablotron, THEN outputting an HTML page.

    -jerome

    ----Original Message Follows---- From: Sysadminsaginawcontrol.com To: kevinhelpelf.com, php-generallists.php.net Subject: RE: [PHP] uh, oh errors? Date: Thu, 16 May 2002 13:43:30 -0400

    What are some benefits to using output buffering versus just letting it generate as it goes?

    -----Original Message----- From: Kevin Stone [mailto:kevinhelpelf.com] Sent: Thursday, May 16, 2002 1:24 PM To: PHP-general Subject: Fw: [PHP] uh, oh errors?

    Don't feel bad about this. This is something that messes a lot of people up. The browser knows where your headers end and where content begins by adding blank line between the headers and the rest of the page. ALL headers must come before any content is printed to the page. PHP will give you that error if you attempt to write a new header. So in fact your problem is not on Line 13.. but is actually on Line 11. There are at least two ways to avoid this...

    1. Don't print content before headers. :) 2. Use output buffering to write the whole page before it is outputed to the browser.

    Hope this helps, -Keivn

    ----- Original Message ----- From: "Jas" <jlgerfenhotmail.com> To: <php-generallists.php.net> Sent: Thursday, May 16, 2002 11:10 AM Subject: [PHP] uh, oh errors?

    > Not sure how to resolve this, looked at php.net for the headers available > and this is the error I am recieving: > > Warning: Cannot add header information - headers already sent by (output > started at /path/to/connection/script/db.php:6) in /path/to/login/checking > file/auth_done.php on line 13 > > Here is the code that is in auth_done.php: > > session_start(); > require '/path/to/login/checking file/db.php'; > $db_table = 'auth_users'; > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw = > password(\"$p_word\")"; > $result = mysql_query($sql,$dbh) or die("Couldn't execute query"); > $num = mysql_numrows($result); > if ($num !=0) { > session_register('u_name'); > session_register('p_word'); > $msg_success = "Good freakin job poindexter!!"; > } else { > header ("Location: index.php"); // This is line 13 that is my error > generator > } > > This is the code for the db.php script: > <?php > $dbh = mysql_connect('localhost','username','password') or die('Could not > connect to database, please try again later'); > mysql_select_db('db_name') or die('Could not select database, please try > again later'); > ?> > > Any help would be great! I am assuming there is another way to redirect > users besides the header function, just not sure what it is or how to use > it. Thanks in advance, > Jas > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

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

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

    _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

    attached mail follows:


    Sysadminsaginawcontrol.com wrote: > > What are some benefits to using output buffering versus just letting it > generate as it goes?

    Pros:

    - headers can be added at any time - buffer content can be post processed (gz compression) (xslt) - if an error occurs can avoid serving half a document

    Cons:

    - transmission of content doesn't start until preprocessor completes - slightly more overhead since content must be stored in memory until buffer is flushed.

    Cheers, Rob.

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    On 5/16/02 5:17 AM, "Neil Freeman" <neil.freemanasa.co.uk> wrote:

    > FYI... > > I'm using sessions successfully using PHP v4.1.0 on Windows NT.

    Hurmph. Well, the upgrade to 4.2.x did it for me under 98. I just need to check the rest of my code, though. For now, seems pretty harmless. Thanks, though.

    -- 
    Ed Marczak
    marczakusa.net
    

    P.S. Are you also using Apache? Or IIS?

    attached mail follows:


    Hi everyone,

    I've recently (for once in my life!) succesfully compiled PHP4.2.0 using the following configure command-line: './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext=shared' '--with-zlib' '--with-gdbm' '--with-layout=GNU' '--enable-debugger' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-track-vars' '--enable-yp' '--enable-ftp' '--enable-wddx' '--without-unixODBC' '--without-oracle' '--without-oci8' '--with-mysql=/usr' '--with-gd-dir=/usr' '--with-flex' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-ttf'

    As you can see it contains "--with-gettext" so I'd expect a function like bindtextdomain() is availible. However, Horde (chora, actually) reports: Fatal error: Call to undefined function: bindtextdomain() in /home/virtual/site4/fst/var/www/html/horde/lib/Lang.php on line 91

    What could have gone wrong and how can I fix it?

    Thanks in advance

    -- 
    Bram v. Leur
    The Netherlands
    

    Proud to PHP!

    attached mail follows:


    I have some ideas on how this should be done, but I'm at work and can't really test them, so I was thinking maybe I could run it by you all and maybe get some feedback and/or new ideas.

    I have a PHP/MySQL-generated page that displays image thumbnails. Currently, I have a loop that makes a table and table rows, fills the rows with the thumbnails, then when there's no more information, it completes whatever row it's on with blank <td>'s, then closes the table.

    This was working fine, but my site is actually attracting more traffic than I originally thought, and I'm getting more image submissions. It's getting to where it's no longer practical to arrange all the thumbnails onto one page, I need to have like 25 on one page, then have the script create a link at the bottom so users can click and see the next 25.

    I'm thinking I need to use some kind of row count language in the script, i.e. first count how many rows are in the MySQL table, if it's less than 25, just display them all. If there's more than 25, display only 1 - 25, then create a link to view 26 - 50, etc.

    Is that what I need to be looking into? Any other ideas would be appreciated. Thanks!

    Jason Soza

    attached mail follows:


    $query = "SELECT * FROM mytable LIMIT $i, 20";

    Where 20 is the number of rows to retrieve and $i is the starting row.

    By incrementing $i + 20 you can do next, prev buttons, or parse the total number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next).

    Search www.mysql.com for more information about using LIMIT in your queries.

    -Kevin

    ----- Original Message ----- From: "Jason Soza" <soljagci.net> To: <php-generallists.php.net> Sent: Thursday, May 16, 2002 12:31 PM Subject: [PHP] Making Multiple Pages

    > I have some ideas on how this should be done, but I'm at work and can't > really test them, so I was thinking maybe I could run it by you all and > maybe get some feedback and/or new ideas. > > I have a PHP/MySQL-generated page that displays image thumbnails. > Currently, I have a loop that makes a table and table rows, fills the > rows with the thumbnails, then when there's no more information, it > completes whatever row it's on with blank <td>'s, then closes the table. > > This was working fine, but my site is actually attracting more traffic > than I originally thought, and I'm getting more image submissions. It's > getting to where it's no longer practical to arrange all the thumbnails > onto one page, I need to have like 25 on one page, then have the script > create a link at the bottom so users can click and see the next 25. > > I'm thinking I need to use some kind of row count language in the > script, i.e. first count how many rows are in the MySQL table, if it's > less than 25, just display them all. If there's more than 25, display > only 1 - 25, then create a link to view 26 - 50, etc. > > Is that what I need to be looking into? Any other ideas would be > appreciated. Thanks! > > Jason Soza > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Great! I think that's the SQL function I needed.

    Now for the PHP part - I'm a bit fo a newbie at writing code, so bear with me here. My query string is currently something like:

    $sql = mysql_query("SELECT * FROM mytable WHERE color=$color");

    So I would modify that to read:

    $sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i, 25");

    Where $i = 1 To get just the first 25 records. I think I'm confused on how to set $i and create links. Would I just initially set $i = "1"; then make links that point to:

    myscript.php?color=red&i=25

    Then have a $_GET['i'] variable in my script and set $i equal to that?

    Your help is appreciated. Thanks again.

    Jason Soza

    ----- Original Message ----- From: "Kevin Stone" <kevinhelpelf.com> Date: Thursday, May 16, 2002 10:53 am Subject: Re: [PHP] Making Multiple Pages

    > $query = "SELECT * FROM mytable LIMIT $i, 20"; > > Where 20 is the number of rows to retrieve and $i is the starting row. > > By incrementing $i + 20 you can do next, prev buttons, or parse > the total > number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - > next). > > Search www.mysql.com for more information about using LIMIT in > your queries. > > -Kevin > > ----- Original Message ----- > From: "Jason Soza" <soljagci.net> > To: <php-generallists.php.net> > Sent: Thursday, May 16, 2002 12:31 PM > Subject: [PHP] Making Multiple Pages > > > > I have some ideas on how this should be done, but I'm at work > and can't > > really test them, so I was thinking maybe I could run it by you > all and > > maybe get some feedback and/or new ideas. > > > > I have a PHP/MySQL-generated page that displays image thumbnails. > > Currently, I have a loop that makes a table and table rows, > fills the > > rows with the thumbnails, then when there's no more information, it > > completes whatever row it's on with blank <td>'s, then closes > the table. > > > > This was working fine, but my site is actually attracting more > traffic> than I originally thought, and I'm getting more image > submissions. It's > > getting to where it's no longer practical to arrange all the > thumbnails> onto one page, I need to have like 25 on one page, > then have the script > > create a link at the bottom so users can click and see the next 25. > > > > I'm thinking I need to use some kind of row count language in the > > script, i.e. first count how many rows are in the MySQL table, > if it's > > less than 25, just display them all. If there's more than 25, > display> only 1 - 25, then create a link to view 26 - 50, etc. > > > > Is that what I need to be looking into? Any other ideas would be > > appreciated. Thanks! > > > > Jason Soza > > > > > > -- > > 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:


    One way to get it started would be to work strictly within the links. Don't initilize $i unless it is not set (which logically would mean your visitng the page for the first time). So..

    if (!isset($_GET['i'])) $i = 0; else $i += 20;

    Another way would be to extract the number of total rows, divide by 20, and build a list of links in a for() loop. $num_rows = mysql_num_rows($sql); $num_pages = floor($num_rows/20); for ($i=0; $i<num_pages; $i++) { // create links with $i in the url string. }

    There are many other ways of doing it but this should get you started. Good luck.

    -Kevin

    ----- Original Message ----- From: "Jason Soza" <soljagci.net> To: "Kevin Stone" <kevinhelpelf.com> Cc: <php-generallists.php.net> Sent: Thursday, May 16, 2002 1:15 PM Subject: Re: [PHP] Making Multiple Pages

    > Great! I think that's the SQL function I needed. > > Now for the PHP part - I'm a bit fo a newbie at writing code, so bear > with me here. My query string is currently something like: > > $sql = mysql_query("SELECT * FROM mytable WHERE color=$color"); > > So I would modify that to read: > > $sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i, > 25"); > > Where $i = 1 To get just the first 25 records. I think I'm confused on > how to set $i and create links. Would I just initially set $i = "1"; > then make links that point to: > > myscript.php?color=red&i=25 > > Then have a $_GET['i'] variable in my script and set $i equal to that? > > Your help is appreciated. Thanks again. > > Jason Soza > > ----- Original Message ----- > From: "Kevin Stone" <kevinhelpelf.com> > Date: Thursday, May 16, 2002 10:53 am > Subject: Re: [PHP] Making Multiple Pages > > > $query = "SELECT * FROM mytable LIMIT $i, 20"; > > > > Where 20 is the number of rows to retrieve and $i is the starting row. > > > > By incrementing $i + 20 you can do next, prev buttons, or parse > > the total > > number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - > > next). > > > > Search www.mysql.com for more information about using LIMIT in > > your queries. > > > > -Kevin > > > > ----- Original Message ----- > > From: "Jason Soza" <soljagci.net> > > To: <php-generallists.php.net> > > Sent: Thursday, May 16, 2002 12:31 PM > > Subject: [PHP] Making Multiple Pages > > > > > > > I have some ideas on how this should be done, but I'm at work > > and can't > > > really test them, so I was thinking maybe I could run it by you > > all and > > > maybe get some feedback and/or new ideas. > > > > > > I have a PHP/MySQL-generated page that displays image thumbnails. > > > Currently, I have a loop that makes a table and table rows, > > fills the > > > rows with the thumbnails, then when there's no more information, it > > > completes whatever row it's on with blank <td>'s, then closes > > the table. > > > > > > This was working fine, but my site is actually attracting more > > traffic> than I originally thought, and I'm getting more image > > submissions. It's > > > getting to where it's no longer practical to arrange all the > > thumbnails> onto one page, I need to have like 25 on one page, > > then have the script > > > create a link at the bottom so users can click and see the next 25. > > > > > > I'm thinking I need to use some kind of row count language in the > > > script, i.e. first count how many rows are in the MySQL table, > > if it's > > > less than 25, just display them all. If there's more than 25, > > display> only 1 - 25, then create a link to view 26 - 50, etc. > > > > > > Is that what I need to be looking into? Any other ideas would be > > > appreciated. Thanks! > > > > > > Jason Soza > > > > > > > > > -- > > > 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:


    Do a google search for ADODB. It's a PHP database abstraction layer. It has built in 'pagination' methods (Previous X, next X) along with an example of how to use them.

    =C=

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

    -----Original Message----- From: Jason Soza [mailto:soljagci.net] Sent: Thursday, May 16, 2002 1:31 PM To: php-generallists.php.net Subject: [PHP] Making Multiple Pages

    I have some ideas on how this should be done, but I'm at work and can't really test them, so I was thinking maybe I could run it by you all and maybe get some feedback and/or new ideas.

    I have a PHP/MySQL-generated page that displays image thumbnails. Currently, I have a loop that makes a table and table rows, fills the rows with the thumbnails, then when there's no more information, it completes whatever row it's on with blank <td>'s, then closes the table.

    This was working fine, but my site is actually attracting more traffic than I originally thought, and I'm getting more image submissions. It's getting to where it's no longer practical to arrange all the thumbnails onto one page, I need to have like 25 on one page, then have the script create a link at the bottom so users can click and see the next 25.

    I'm thinking I need to use some kind of row count language in the script, i.e. first count how many rows are in the MySQL table, if it's less than 25, just display them all. If there's more than 25, display only 1 - 25, then create a link to view 26 - 50, etc.

    Is that what I need to be looking into? Any other ideas would be appreciated. Thanks!

    Jason Soza

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

    attached mail follows:


    You should also add an ORDER BY clause in there, as the SQL standard doesn't guarantee the order that rows are retrieved in. There's a chance that you'll get, say, 20 rows on the first page, go to the second page and get some of the rows you've already seen on the first page. If you use an ORDER BY, you'll at least guarantee that you'll get them in the same order each time.

    J

    Kevin Stone wrote:

    > $query = "SELECT * FROM mytable LIMIT $i, 20"; > > Where 20 is the number of rows to retrieve and $i is the starting row. > > By incrementing $i + 20 you can do next, prev buttons, or parse the total > number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next). > > Search www.mysql.com for more information about using LIMIT in your > queries. > > -Kevin >

    attached mail follows:


    Thanks to all who helped out with the eregi(mail) stuff. I got my problem solved, and on top of that, there were some bugs that I found in the code. Thanks again to everyone.

    __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com

    attached mail follows:


    Hi,

    all is possible. I suggest taking a look at http://gtk.php.net/ and http://www.php.net/manual/en/features.commandline.php for a start.

    - Markus

    On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : > Hi All > > I am trying to write something similar to a server console display, is it a > good idea to use PHP? > > Wondering how things like > 1. server clock (similar to a clock applet) > 2. server status > can be displayed with PHP code? > > Note: I need to display the above two in a continuous fashion on the status > bar!! > > Many Thanks > Dominic > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    Please always Cc to me when replying to me on the lists.
    GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
    ---------------------------------------------------------
    "I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
    "Always right, never wrong :)"
    - Two PHP developers who want to remain unnamed
    

    attached mail follows:


    Does this work on Windows, or is it restricted to Linux/unix?

    Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658

    -----Original Message----- From: Markus Fischer [mailto:mfischerguru.josefine.at] Sent: Thursday, May 16, 2002 11:58 AM To: DoL Cc: php-devlists.php.net; php-generallists.php.net Subject: [PHP] Re: [PHP-DEV] Console application with PHP

    Hi,

    all is possible. I suggest taking a look at http://gtk.php.net/ and http://www.php.net/manual/en/features.commandline.php for a start.

    - Markus

    On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : > Hi All > > I am trying to write something similar to a server console display, is it a > good idea to use PHP? > > Wondering how things like > 1. server clock (similar to a clock applet) > 2. server status > can be displayed with PHP co