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: Fri Aug 24 2001 - 01:57:40 CDT

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

    php-general Digest 24 Aug 2001 06:57:40 -0000 Issue 834

    Topics (messages 64140 through 64209):

    Re: The future of PHP
            64140 by: J Smith
            64142 by: B. van Ouwerkerk
            64143 by: Jeff Pearson
            64151 by: Jim Jagielski
            64152 by: Gabe da Silveira
            64154 by: Elias Santiago
            64162 by: Hugh Bothwell
            64187 by: Manuel Lemos
            64201 by: Christopher CM Allen
            64207 by: Egan

    Re: Getting MySQL Query Times.
            64141 by: Gabe da Silveira
            64144 by: Andrey Hristov
            64200 by: David Robley

    Re: numrows
            64145 by: Martin Kampherbeek
            64146 by: Martin Kampherbeek

    Re: force download in IE -- conclusion
            64147 by: Tim Frank

    code check
            64148 by: Tom Malone
            64153 by: Gabe da Silveira
            64167 by: mike cullerton

    Re: printing
            64149 by: Bill MacAllister

    Dynamic check boxes...
            64150 by: Jeff Lewis
            64155 by: Hugh Bothwell

    Does not deliver mail
            64156 by: Christof Coetzee

    Newbie Question re: Select boxes
            64157 by: LB
            64164 by: jimw.apache.org

    Your invitation to the Legal Solutions Europe 2001 Conference
            64158 by: Webmaster

    order of update??
            64159 by: Gerard Samuel
            64163 by: Sam Masiello
            64165 by: jimw.apache.org
            64166 by: Gerard Samuel
            64170 by: Sam Masiello
            64172 by: Gerard Samuel
            64204 by: David Robley

    Re: Need help to create HTML table with 2 columns.
            64160 by: Hugh Bothwell
            64183 by: Dave Freeman

    Variables not changing problem...
            64161 by: Nicholas A. Zukin

    Informix - ifx_num_rows
            64168 by: Leila
            64171 by: Martín Marqués
            64191 by: Chris Fry
            64192 by: Martín Marqués

    Re: I get "headers already sent by" error each time I use setcookie function
            64169 by: Inércia Sensorial Trabalhando

    SSL Advice
            64173 by: Boaz Yahav
            64189 by: SED

    print_r question
            64174 by: james
            64176 by: mike cullerton
            64177 by: jimw.apache.org
            64178 by: Philip Olson

    Re: mcrypt trouble, still
            64175 by: Andrew Libby

    compiling php-4.0.6 with imap-4.2
            64179 by: Juan Pablo Rivera

    Dynamic Pages and Search Engines
            64180 by: Georgie

    Re: upgrading PHP
            64181 by: Joseph Bannon

    Sorting and foreach of MultiDimensional Array failing
            64182 by: Montz, James C. (James Tower)

    Re: always last
            64184 by: Dave Freeman

    Re: print_r question: Jim, Phil, Mike Thanx!
            64185 by: james

    Re: Creditcard checksum and identification
            64186 by: Manuel Lemos

    include or require or what?
            64188 by: daniel james

    Array's in classes
            64190 by: Scott Mebberson

    konquerer and php
            64193 by: Scott
            64194 by: Jason Murray
            64202 by: Scott

    Re: how do i remove non html special characters??
            64195 by: Yasuo Ohgaki

    The future of PHP - object orientation
            64196 by: Orr, Steve

    send mail to mailing list using mail() or smtp?
            64197 by: Matthew Delmarter

    Mixing PHP with a FAX Gateway? HELP!!! IDEAS???
            64198 by: Fotwun
            64203 by: Jason

    incorrect Timezone using mail()
            64199 by: jeffrey jeffrey

    Re: sysvsem extention question
            64205 by: Jason T. Greene
            64206 by: Jason T. Greene

    Session Problem
            64208 by: Lawrence.Sheed.dfait-maeci.gc.ca
            64209 by: Rudolf Visagie

    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:


    XML is pretty standardized, but the implementation of it in various web
    browsers isn't.

    I wouldn't consider XML all that comparable to HTML. They don't serve the
    same purpose. XML is generally used to order and describe data (metadata,
    basically), and although HTML serves roughly the same purpose, HTML is much
    more focused in what it provides -- HTML is meant to be rendered in a web
    browser, while XML's use is really undefined. You can use XML for
    server-to-server communications, peer-to-peer stuff, messaging, document
    descriptions, and pretty much any generalized markup. HTML really isn't
    designed for that sort of stuff.

    As for "freestyle", XML's syntax is much less open to interpretation than
    HTML's. XML is much more rigid -- forget a closing tag and your document
    becomes invalid. Screw up the order of your elements and it's invalid. If
    you forget a closing tag in HTML, you can be forgiven, but in XML, you're
    toast. Even linebreak elements in XML need closing tags.

    It doesn't really matter how IE and Netscape or any other browser renders
    XML. That's what XSL is for -- transforming XML into HTML before it is sent
    to the client. (Alternatively, the XML could be sent directly to the client
    and then doing the transformation client-side.

    As for XML scripting engines, again, XML is just markup, it isn't really a
    scripting engine. There is a bit of scripting-like looping structures and
    logic that can be used in XSL, but it's nowhere near the level of PHP, ASP,
    Perl, etc. Apache's Cocoon XML/XSL system does have a programming system
    built in called XSP (eXtensible Server Pages), which is basically takes
    Java embedded into XML or XSL and compiles it all as one big Java class.
    (You can add different languages to XSP, but it isn't fun. The next version
    will have "producers" that can create XML from scripting/compiled
    languages, including PHP.)

    I've mixed PHP and XML (with XSLT) on my current project quite nicely. I
    started with Cocoon and XSP, but as Sablotron and PHP's XSLT extensions
    became more stable, I started using them rather than combining both Cocoon
    and PHP.

    J

    Elias Santiago wrote:

    > He MAY be right, may not. XML is just not so standardized (if in doubt
    > look how IE and Netscape each implement it "their way") I consider XML
    > like
    > "freestyle HTML". I know this technology has great potential but if
    > developers don't decide on how to standardize it, it could die young. PHP
    > however (as an avid follower) is on a "fast track" and even Microsoft
    > considers it a strong contender to ASP. However, both PHP and XML
    > technologies are just scripting engines. Products like the Zend engine
    > are just starting to scratch the surface for truly dynamic, cached,
    > real-time
    > web applications. I'm not saying that either PHP or XML (or any other
    > technology that comes along) is going to die or leave the other "in the
    > dust" but look what has happened with Java, it has certainly lost
    > momentum.
    >

    attached mail follows:


    > > Notice it even gives info on PHP use .... :-)
    >
    >He would see JSP at 19.9% and PHP at 11.2 and say that proves his point.

    Ask the same question to PPL on this list.. I'll bet you see the opposite.

    It only proves your favorite kid doesn't understand a thing about statistics.

    I think PHP is great.. there is a place for everything.. even for Java :)

    Bye,

    B.

    attached mail follows:


    Thomas,

    Keeping in mind that preaching Languages is the same as religion. If someone
    is decided for something, nothing you can say will change their mind; my
    point in bringing up the numbers was that again, these numbers include ONLY
    IT'S OWN CUSTOMERS!!!! If everyone was included in the poll, Im sure the
    numbers would be totally different. But I also overlooked Dave's point that
    it also only includes the Linux version of PHP.

    > -----Original Message-----
    > From: Thomas Deliduka [mailto:thomasneweve.com]
    > Sent: Thursday, August 23, 2001 10:07 AM
    > To: PHP List
    > Subject: Re: [PHP] The future of PHP
    >
    >
    > On 8/23/2001 11:59 AM this was written:
    >
    > > On its Solaris Developer Connection site, Sun posed the question, "What
    > > language do you use to develop Web-based client applications?"
    > The responses
    > > went like this: Perl, 41.3 percent; JSP, 19.9 percent; C/C++,
    > 14.2 percent;
    > > Linux script language PHP, 11.2 percent; Microsoft Active
    > Server Pages, 8.8
    > > percent; and other, 4.3 percent. Check it out for yourself at
    > > soldc.sun.com/polls/index.jshtml -- if they haven't taken it down yet.
    > >
    > >
    > >
    > > Notice it even gives info on PHP use .... :-)
    >
    > He would see JSP at 19.9% and PHP at 11.2 and say that proves his point.
    > --
    >
    > Thomas Deliduka
    > IT Manager
    > -------------------------
    > New Eve Media
    > The Solution To Your Internet Angst
    > http://www.neweve.com/
    >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >

    attached mail follows:


    This whole discussion is kind of bogus anyway :)

    It's like saying that the age of Pliers is over because you bought
    a set of Wrenches. PHP is a different tool that JSP. PHP is a much
    more comprehensive tool that JSP, which is really geared for a very
    specific task. Despite the fact that at some levels they compete,
    on a *much* larger ranger of levels, they compliment.

    -- 
    ===========================================================================
       Jim Jagielski   [|]   jimjaguNET.com   [|]   http://www.jaguNET.com/
          "A society that will trade a little liberty for a little order
                       will lose both and deserve neither"
    

    attached mail follows:


    Let's not forget the ecosystem in which these different technologies thrive. It's all based on who's paying whom to do what. The reality of the situation is that the people in charge don't know (or care) about all these different technologies. They may make some broad decisions (linux vs win), but you can bet they often rely on individual techies to help guide them to the solution they need. As technology advances, you can bet the divide between management and development will only widen. All that matters now is the end result. With the disparity in developer skill, the difficulty in estimating development time accurately, and the increase in processing power there's a lot of room for developers to make their own decisions.

    In this kind of environment, there is a lot of room for different programming languages. PHP has the benefits of lightning fast development cycles. Java has the advantage of being a strict, modern, fault-tolerant language that lends itself to well-written code. ASP has advantage of MS 'programming for dummies'-style devlopment tools. Perl has the advantage of its text processing abilities. C has the speed advantage by staying barebones and relatively low level for a verbose language.

    In order for one of these technologies to die, something has to come along with all the advantages and no new disadvantages. Somehow I don't see this happening to open-source projects like PHP, or MySQL. It's much easier to improve them then to develop something better. I see it much more likely that these projects could fork to encompass different goals.

    In article <DBEIKNMKGOBGNDHAAKGNCEEMHPAA.davehawk-systems.com>, davehawk-systems.com (Dave) wrote:

    > >He would see JSP at 19.9% and PHP at 11.2 and say that proves his point. > > And flash developers will claim that the only way to create a site is have > the > whole thing Flash and crap flying across the client screen all the time... > Untill the modem access market drops below 50% of the users on the net... > hard > time convincing me that 100's of kb in Flash is worth it. > > He obviously is sold on JSP... let him sink with his ship. PHP isn't going > anywhere anytime soon... not while *nix boxes are still the most stable > performers for web.

    -- 
    __________________________________
    Gabe da Silveira, Web Designer
    Twin Cities Student Unions
    University of Minnesota
    http://www.coffman.umn.edu
    

    wFone: (612)624-7270 eMail: jibletvisi.com hPage: http://www.visi.com/~jiblet

    attached mail follows:


    <two-cents> Almost all modern technologies are the evolution of previous ones:

    C -> C++,Perl, PHP, Python; Basic -> QBasic -> VBasic/ASP;

    Even new languages like Rebol are based (in one way or another) to previous languages. Anyone could develop a parser/interpreter for any new language they could devise. Eventually each language develops it's own characteristics.

    </two-cents>

    "Gabe Da Silveira" <jibletvisi.com> wrote in message news:jiblet-628E62.13144823082001pb1.pair.com... > Let's not forget the ecosystem in which these different technologies > thrive. It's all based on who's paying whom to do what. The reality of > the situation is that the people in charge don't know (or care) about > all these different technologies. They may make some broad decisions > (linux vs win), but you can bet they often rely on individual techies to > help guide them to the solution they need. As technology advances, you > can bet the divide between management and development will only widen. > All that matters now is the end result. With the disparity in developer > skill, the difficulty in estimating development time accurately, and the > increase in processing power there's a lot of room for developers to > make their own decisions. > > In this kind of environment, there is a lot of room for different > programming languages. PHP has the benefits of lightning fast > development cycles. Java has the advantage of being a strict, modern, > fault-tolerant language that lends itself to well-written code. ASP has > advantage of MS 'programming for dummies'-style devlopment tools. Perl > has the advantage of its text processing abilities. C has the speed > advantage by staying barebones and relatively low level for a verbose > language. > > In order for one of these technologies to die, something has to come > along with all the advantages and no new disadvantages. Somehow I don't > see this happening to open-source projects like PHP, or MySQL. It's > much easier to improve them then to develop something better. I see it > much more likely that these projects could fork to encompass different > goals. > > > > > In article <DBEIKNMKGOBGNDHAAKGNCEEMHPAA.davehawk-systems.com>, > davehawk-systems.com (Dave) wrote: > > > >He would see JSP at 19.9% and PHP at 11.2 and say that proves his point. > > > > And flash developers will claim that the only way to create a site is have > > the > > whole thing Flash and crap flying across the client screen all the time... > > Untill the modem access market drops below 50% of the users on the net... > > hard > > time convincing me that 100's of kb in Flash is worth it. > > > > He obviously is sold on JSP... let him sink with his ship. PHP isn't going > > anywhere anytime soon... not while *nix boxes are still the most stable > > performers for web. > > -- > __________________________________ > Gabe da Silveira, Web Designer > Twin Cities Student Unions > University of Minnesota > http://www.coffman.umn.edu > > wFone: (612)624-7270 > eMail: jibletvisi.com > hPage: http://www.visi.com/~jiblet

    attached mail follows:


    "Christopher Cm Allen" <callendriver8.org> wrote in message news:003201c12be2$f9309b00$1dbea318mn.mediaone.net... > Greetings Php'ers: > <2 cents> > bahh to servelts-asp these are new kids on the block. Template this or that, > it doesnt matter, most templates are for lazy peeps anyways :)

    Heck, I'm lazy; that's why I use PHP ;-) Like everything else, you use the tool for the job.

    JSP has its good points, mainly for higher-end applications. If I need continuous communication between client and server, I'll use it instead.

    But for getting a simple page going, PHP is quicker.

    attached mail follows:


    Hello,

    Rasmus Lerdorf wrote: > > > So, the jist is, what does PHP have to offer to the web in the future? I > > think it's still a viable option that will be around for at least another > > 6-7 years. This kid thinks it's shelf life is another 3. What do ya'll > > think? > > Personally I would be a hell of a lot more worried if I was in the Java > camp. M$ with .NET and especially CLR is gunning directly for Java and > its position in the enterprise. PHP will roll with the punches and work > alongside .NET and CLR and always keep up with all the latest technologies > out there because PHP is developed by and for the web community. > > Name a single interested web-related technology that PHP can't interact > with. I can't think of one. And as more come out, we'll find ways to get > PHP to talk to them.

    Personally I would be a lot more worried if I have bet all the farm in a single technology.

    PHP is most suited for Web development because historically it has been the area on which it was mostly focused.

    Now, we are in the Internet downhill days. Not that Internet is loosing importance, but a lot of people had to drop Web/Internet development because they no longer can make as much money from it as in the past. A lot of those people had to start doing Web development for but for paying users like in corporations Intranet development.

    There is still a lot of that mentality in the paying users world that only software that costs money is credible. You may claim that those are techno-ignorant users, but you can't neglect they may constitute a significant part of the users.

    I'm afraid that PHP is not yet very credible in that world. The truth is there is not great marketing force behind PHP like there is Sun behind Java or Microsoft behind .Net . Actually, a great part of computing market simply ignores PHP.

    So, it is very hard to convince the anybody to bet all the farm in PHP. You may have the technical arguments, but is not enough, I'm afraid.

    You in particular, may not need to convince others to bet on PHP, but it is nothing like that for most people that want to live from software development. They have to put up with work/business opportunities that the market offers to live from it. So, today, I'm afraid that you already still have an hard time to convince people to dedicate only to PHP, even those that know and believe PHP is that great.

    Regards, Manuel Lemos

    attached mail follows:


    > > I'm afraid that PHP is not yet very credible in that world. The truth is > there is not great marketing force behind PHP like there is Sun behind > Java or Microsoft behind .Net

    Good point, and how does one go about marketing a language that is open-source? I do it by not allowing FP like extensions on my server's. All of my custom apps are php or if need be I switch to C/perl. If I get pushed hard enough I will do c++ :)

    By your own words though , the volume of users of a non-marketed php, compared to the users of marketed Java et al. speaks for itself. Php holds its own.. What if a group of developers/designers started marketing PHP?

    > So, it is very hard to convince the anybody to bet all the farm in PHP. > You may have the technical arguments, but is not enough, I'm afraid. > > You in particular, may not need to convince others to bet on PHP, but it > is nothing like that for most people that want to live from software > development. They have to put up with work/business opportunities that > the market offers to live from it.

    hmmm, I might live in a smaller world than you but I find tons of small to middle businesses that have no clue as to why or how things are done in applications(primarily web). Sure they know the buzz words of Java etc but when I come in and tell them I work with a certain tool set and that I can get it done for less $ and time they really don't care if I have a hammer or a mallet.

    >So, today, I'm afraid that you > already still have an hard time to convince people to dedicate only to > PHP, even those that know and believe PHP is that great.

    that's the truth.

    thanks,

    ccma

    attached mail follows:


    On Thu, 23 Aug 2001 20:32:10 -0500, "Christopher CM Allen" <callendriver8.org> wrote:

    >hmmm, I might live in a smaller world than you but I find tons of small to >middle businesses that have no clue as to why or how things are done in >applications(primarily web). Sure they know the buzz words of Java etc but >when I come in and tell them I work with a certain tool set and that I can >get it done for less $ and time they really don't care if I have a hammer or >a mallet.

    Many small businesses would like to do e-commerce, but can't afford expensive consultants, expensive hardware, and expensive software tools developed by huge corporations.

    There is a vast market for web developers who use free software tools like Linux/Apache/PHP, and offer their services to small businesses at modest rates.

    Look at all the large corporations bleeding money and cutting staff. Mega-corporations are in decline, and their era is ending. Long live the small business!

    Egan

    attached mail follows:


    Thank you Andrey & Nathan. THat was probably going to be the next thing to research. I think I figured out why my code got slow though. I have a preg search of a large field with .* in it at the beginning of an if,elseif,elseif,elseif struct that I should move to the end of it.

    In article <007601c12bf4$e0b41f40$a300000apcsedu.com>, securitypcsedu.com (Nathan Cook) wrote:

    > IMO, you are better off printing microtime > [http://www.php.net/manual/en/function.microtime.php] before and after the > query, and after you loop through it. This will give you a better idea of > where > the hangups may be. You may also want to sprinkle mircotimes throughout your > code to get a good idea of processing time.

    In article <047c01c12bf3$bdae2b40$0b01a8c0ANDreY>, ahristovicygen.com (Andrey Hristov) wrote:

    > Use microtime before and after the query.

    -- 
    __________________________________
    Gabe da Silveira, Web Designer
    Twin Cities Student Unions
    University of Minnesota
    http://www.coffman.umn.edu
    

    wFone: (612)624-7270 eMail: jibletvisi.com hPage: http://www.visi.com/~jiblet

    attached mail follows:


    $this->starttime=explode(' ',microtime()); // query..... $this->endtime=explode(' ',microtime()); $this->starttime=$this->starttime[1]+$this->starttime[0]; $this->endtime=$this->endtime[1]+$this->endtime[0]; $this->parse_time=$this->endtime-$this->starttime;

    I've copied that from a class member but the idea is clear;

    Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%

    ----- Original Message ----- From: "Nathan Cook" <securitypcsedu.com> To: <php-generallists.php.net>; "Gabe da Silveira" <jibletvisi.com> Sent: Thursday, August 23, 2001 7:57 PM Subject: Re: [PHP] Getting MySQL Query Times.

    > IMO, you are better off printing microtime > [http://www.php.net/manual/en/function.microtime.php] before and after the > query, and after you loop through it. This will give you a better idea of where > the hangups may be. You may also want to sprinkle mircotimes throughout your > code to get a good idea of processing time. > > Nathan Cook > ncookpcsedu.com > ----- Original Message ----- > From: "Gabe da Silveira" <jibletvisi.com> > To: <php-generallists.php.net> > Sent: Thursday, August 23, 2001 10:22 AM > Subject: [PHP] Getting MySQL Query Times. > > > > I was looking thru the mysql functions, and there doesn't seem to be one > > that gives you the amount of time a query takes. Is there anyway to get > > this information (since it gives it to you when you type queries > > directly into the mysql shell client)? A script of mine is starting to > > get fairly slow (2-3 seconds for page to process) and I want to be able > > to log the query speeds so I can see if there's a database bottleneck or > > if my code is just kludgy. > > > > -- > > __________________________________ > > Gabe da Silveira, Web Designer > > Twin Cities Student Unions > > University of Minnesota > > http://www.coffman.umn.edu > > > > wFone: (612)624-7270 > > eMail: jibletvisi.com > > hPage: http://www.visi.com/~jiblet > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    On Fri, 24 Aug 2001 01:52, Gabe da Silveira wrote: > I was looking thru the mysql functions, and there doesn't seem to be > one that gives you the amount of time a query takes. Is there anyway > to get this information (since it gives it to you when you type queries > directly into the mysql shell client)? A script of mine is starting to > get fairly slow (2-3 seconds for page to process) and I want to be able > to log the query speeds so I can see if there's a database bottleneck > or if my code is just kludgy.

    It might be worth running a mysql EXPLAIN on your query, if it is a complex one.

    -- 
    David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
    CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  
    

    Reality is an obstacle to hallucination.

    attached mail follows:


    This is the error I get. MySQL Query Failed. Error 1030: Got error -1 from table handler

    Message-ID: <20010823110725.89485.qmailpb1.pair.com> To: php-generallists.php.net From: "Johannes Janson" <johannes.jansongmx.de> Date: Thu, 23 Aug 2001 12:40:21 +0200 Subject: Re: numrows

    Hi,

    >$query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id DESC"; > >$result = MYSQL_QUERY($query);

    add "or die(mysql_error())" see what MySQL doesn't like about the query.

    cheers johannes

    attached mail follows:


    This is the error I get. I tested in MYSQLadmin and there it works. I think there is something with numrows. MySQL Query Failed. Error 1030: Got error -1 from table handler

    Message-ID: <20010823171117.28544.qmailweb13408.mail.yahoo.com> Date: Thu, 23 Aug 2001 10:11:17 -0700 (PDT) From: "ERISEN, Mehmet Kamil" <erisenyahoo.com> To: php-generallists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [PHP] numrows

    Hello, Chris, with all due respect, DESC is a reserved word for SQL. is english ORDER BY ID DESC meand sort by id in descending order.

    Martin, your SQL seems to be fine. Are you sure that you are connected to your database. I have run the following SQL against my database SELECT * FROM users WHERE username <> '1' AND user_id < 250 ORDER BY user_id DESC and it returned back records. SO SQL syntax is fine.

    attached mail follows:


    I have had success getting IE 5.5 for PC recognising the suggested filename by changing the content type to something other than application/octet-stream. If it was left as that for IE 5.5(which the script snippet indicates) it would tend to take the filename of the script that executed it, or HTML file where the link to the script was located.

    I have been using the forced download for txt and pdf files, dynamically generated with PHP of course, for about 2 years. It is a pain in the ass to figure out the correct combinations for every different IE browser. Luckily it is a campus only system and the users are on PC or Linux.

    Oh, and there is a bug if you try to force download in IE over an SSL connection WHEN USING SESSIONS. I stumbled accross someone working on the SquirrelMail project who found a solution. You just have to send these two extra headers to get IE force these downloads over SSL

    if (ereg("MSIE", $HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { header('Pragma: '); header('Cache-Control: cache'); }

    That one had me stumped for 2 years and I had to bail out of the sessions and pass everything through the URL to force a download.

    Hope that helps too.

    Tim Frank

    >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

    On 22/08/01, 5:47:26 PM, pylemsympatico.ca (Pierre-Yves) wrote regarding Re: [PHP] Re: force download in IE -- conclusion:

    > I worked on a script like yours for a looooooooooong time now!

    > I need to force the download of various type of file, doc, pdf, zip, even > html!

    > Your script works fine on Opera 5.02 and netscape 4.76 on my win NT 4.0 box, > but > not on IE 5.5 On this one, it offers me to download the script file but > instead of being > a php file it has now an html extension !!

    > Anyhow, I do have a download by email attachment button also, because I gave > up on trying > to find a script to force download....

    > py

    > ----- Original Message ----- > From: "David Minor" <davedminor.com> > To: <php-generallists.php.net> > Sent: Wednesday, August 22, 2001 4:10 PM > Subject: [PHP] Re: force download in IE -- conclusion

    > > I ran some tests of different header configurations of 6 browser/platform > > combinations to find out what worked and what didn't. I didn't cover all > of > > the platforms available, just those that my user-base uses, so this isn't > > complete. > > > > combinations tested was IE5.5, NN4, NN6 for Windows 98 and IE5.5, NN4.7 > for > > Mac 9.1. I tested all of these browsers using/not using 'attachment' in > the > > Content-Disposition header. and also changed out the Content-Type header > > with 'application/octet-stream', 'application/download', and '*/*'. > > > > Here's the summary and what I did to make things work as well as possible. > > My goal is to prompt the user with a save-as dialog for an mp3 file. > > > > IE5.5 for Mac always uses the quicktime plugin to play the file no matter > > what the disposition or type is. (also no matter what the file extension > > is. Couldn't figure out how to trick it to download the file.) > > > > IE5.5 for Win98 would attempt to download the file if > ("content-disposition: > > attachment; filename=....") attachment was there. > > > > All 3 of the Win98 browsers would do prompt with as few clicks as possible > > when content-type was "application/octet-stream". Therefore, I test in > my > > script for the Mac users and give them "Content-type: > application/downlaod" > > while I give other users "Content-Type: application/octet-stream". Of > > course, this doesn't help the IE5.5 Mac users who still have to use > > "Downlaod Link to Disk" routine to get a save-as prompt. > > > > Anyone who sees different ways this could be done, please respond. > > > > Here's my code: > > > > if (eregi("mac",$HTTP_USER_AGENT)) > > $type = "application/download"; > > else > > $type = "application/octet-stream"; > > > > // stream file to user > > header("Content-Type: $type"); > > header("Content-Disposition: attachment; filename=$filename"); > > header("Content-Length: ".filesize($tmp_file)); > > header("Content-Transfer-Encoding: binary"); > > readfile($tmp_file); > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > >

    attached mail follows:


    Sorry to bother you all with this, but I have no way to test this, as I have no access to a Mac. Could you tell me if this little piece of code looks as if it would work (detect whether someone's using the Mac OS)?

    if (preg_match("/mac/i", "$HTTP_USER_AGENT") || preg_match("/macintosh/i", "$HTTP_USER_AGENT") || preg_match("/ppc/i", "$HTTP_USER_AGENT") || preg_match("/PowerPC/i", "$HTTP_USER_AGENT")): $basefont = "Geneva"; else: $basefont = "Verdana, Helvetica, Serif"; endif;

    It doesn't return an error, but that doesn't mean it works. I really appreciate your help. TIA

    Tom Malone Web Designer http://www.tom-malone.com

    attached mail follows:


    Perhaps you could put it on a webpage and ask a Mac user to see if it works.

    BTW, there is no reason to use preg_match for that. Instead use strpos(), it is MUCH faster.

    In article <JPEOKCOKMOJMOOOEPBHJMEKBEKAA.tomtom-malone.com>, tomtom-malone.com (Tom Malone) wrote:

    > Sorry to bother you all with this, but I have no way to test this, as I have > no access to a Mac. Could you tell me if this little piece of code looks as > if it would work (detect whether someone's using the Mac OS)? > > if (preg_match("/mac/i", "$HTTP_USER_AGENT") || preg_match("/macintosh/i", > "$HTTP_USER_AGENT") || preg_match("/ppc/i", "$HTTP_USER_AGENT") || > preg_match("/PowerPC/i", "$HTTP_USER_AGENT")): > $basefont = "Geneva"; > else: > $basefont = "Verdana, Helvetica, Serif"; > endif; > > It doesn't return an error, but that doesn't mean it works. I really > appreciate your help. TIA > > Tom Malone > Web Designer > http://www.tom-malone.com >

    -- 
    __________________________________
    Gabe da Silveira, Web Designer
    Twin Cities Student Unions
    University of Minnesota
    http://www.coffman.umn.edu
    

    wFone: (612)624-7270 eMail: jibletvisi.com hPage: http://www.visi.com/~jiblet

    attached mail follows:


    on 8/23/01 11:51 AM, Tom Malone at tomtom-malone.com wrote:

    > Sorry to bother you all with this, but I have no way to test this, as I have > no access to a Mac. Could you tell me if this little piece of code looks as > if it would work (detect whether someone's using the Mac OS)?

    ie 5.0 macos 9, powermac G3, i end up in the 'true' branch, but nothing happens to my font that i can tell...

    > > if (preg_match("/mac/i", "$HTTP_USER_AGENT") || preg_match("/macintosh/i", > "$HTTP_USER_AGENT") || preg_match("/ppc/i", "$HTTP_USER_AGENT") || > preg_match("/PowerPC/i", "$HTTP_USER_AGENT")): > $basefont = "Geneva"; > else: > $basefont = "Verdana, Helvetica, Serif"; > endif; > > It doesn't return an error, but that doesn't mean it works. I really > appreciate your help. TIA > > Tom Malone > Web Designer > http://www.tom-malone.com >

    -- mike cullerton

    attached mail follows:


    The way that I do it on Linux is to generate TeX output, invoke TeX using system(), and then just lpr the output to the printer. The current production system that I am using actually uses a perl script invoked from a php script, really ugly, but I had the perl script from another project.

    Here is a PHP example:

    $tex_file = "/tmp/file.tex"; $dvi_file = "/tmp/file.dvi";

    $fp = fopen ($tex,"w"); fputs ($fp, "This is a short story.\n"); fputs ($fp, "\\end\n"); fclose($fp);

    system ("tex --output-directory /tmp $tex_file >> $log_file"); system ("dvips -P el4050 $dvi_file");

    You have to understand TeX/LaTeX. The good news is that if you use TeX you will end up with output that the fools that use Crystal Reports will drool over.

    Bill

    --On Tuesday, August 14, 2001 2:47 PM +0100 Fernando Avila <fanointer-k.com.ar> wrote:

    > Hello Matthew, > > Friday, August 10, 2001, 8:55:24 PM, you wrote: > > > ML> If you run windows, then see: > > ML> http://www.php.net/manual/en/ref.printer.php > > > ML> -----Original Message----- > ML> From: Fernando Avila [mailto:fanointer-k.com.ar] > ML> Sent: Friday, August 10, 2001 10:18 AM > ML> To: php-generallists.php.net > ML> Subject: [PHP] printing > > > ML> Hello php-general, > > ML> I was thinking about my problem about printing reports > ML> CAn i do something like connecting a printer to the server > where php ML> and mysql runs.. And when someone send the comand to > print the quote ML> get printed in the server's printer? > ML> if it's posible maybe i will be albe to print a good quote > > > And if i run linux? > because I have a redhat 6.2 server > > > Thanks > > -- > Best regards, > Fernando mailto:fanointer-k.com.ar > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: > php-list-adminlists.php.net >

    +------------------------------------------------------- | Bill MacAllister, Senior Programmer | PRIDE Industries | 10030 Foothills Blvd., Dept 1150 | Roseville, California 95747 | Phone: +1 916-788-2402

    attached mail follows:


    I have a form where users can enter a link (kind of a free for al links type of thing) When they add their site to the database a 0 is added to the "approved" field.

    When I load an admin script I can check all of the ones that have a 0 in that field. I want to have checkboxes form down the side of them so I can check the ones I want approved.

    Is it possible to have them all update with the click of one submit button?

    Jeff

    attached mail follows:


    "Jeff Lewis" <jeffhyrum.net> wrote in message news:009201c12bff$de696af0$76a1a8c0LEWISJCIT... > I have a form where users can enter a link > (kind of a free for al links type of thing) > When they add their site to the database > a 0 is added to the "approved" field. > > When I load an admin script I can check > all of the ones that have a 0 in that field. > I want to have checkboxes form down the > side of them so I can check the ones I want > approved. > > Is it possible to have them all update with the > click of one submit button?

    There are two obvious approaches to this:

    First, with JavaScript, you could write a 'select all' button, which checks all the checkboxes, then submits the form normally.

    Or, you could have a submission button that tells PHP to approve all listed items whether checked or not, ie

    <input type='submit' name='submit' value='Checked'> <input type='submit' name='submit' value='All'>

    The problem with this is that unchecked checkboxes simply don't appear when the form is submitted; you need some way to get a full list of the IDs in question.

    A quick fix I have found is as follows, for each option:

    <input type='hidden' name='cb307' value='No'> <input type='checkbox' name='cb307' value='Yes'>

    NOTE: the name is NOT an array, and the hidden field must come before the checkbox. This way, if the checkbox is not checked, the 'No' value comes through; otherwise it is over-written by 'Yes'.

    Another option would be to keep a comma-delimited list of IDs and write 'em all into a single hidden field, ie

    <input type='checkbox' name='cb305' value='Yes'> <input type='checkbox' name='cb306' value='Yes'> <input type='checkbox' name='cb307' value='Yes> <input type='hidden' name='idlist' value='305,306,307'>

    Hope this helps...

    attached mail follows:


    ID: 12932 Updated by: derick Reported By: christofcdesoftware.co.za Old Status: Open Status: Bogus Bug Type: *Mail Related Operating System: win2k PHP Version: 4.0.4pl1 New Comment:

    [2001-08-23 14:18:01] christofcdesoftware.co.za

    I have a mail account that points to my mail server, my domain name is www.cdesoftware.co.za and my e-mail address is christofcdesoftware.co.za Problem: I have client submission forms on websites running on our server that calls a PHP script for sendind the info on this form to a mail address specified in a hidden field in the web page form. The php script delivers all mail that must be sent to anyname.cdesoftware.co.za, but not any other mail address on any other server.

    Please help me with this a possible

    Thank you Christof

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

    attached mail follows:


    1) I thought that PHP automatically created variables for all form elements on a page. When I run this, the dropdown box contains the first item, but $Report evaluates as null. I am unclear why.

    <select name="Report"><BR> <option value=>1 Test Report A</option> <option value=>2 Test Report B</option> <option value=>3 Test Report C</option> </select> <? echo ("the value is $Report"); ?>

    2) Is there any way for PHP to detect the change even on the dropdown, or do I need to use javascript?

    Thanks in advance, still trying to get a grip on this.

    lb

    attached mail follows:


    Lb <loydNOSPAM420hotmail.com> wrote: > 1) I thought that PHP automatically created variables for all form elements > on a page. When I run this, the dropdown box contains the first item, but > $Report evaluates as null. I am unclear why. > > <select name="Report"><BR> > <option value=>1 Test Report A</option> > <option value=>2 Test Report B</option> > <option value=>3 Test Report C</option> > </select> > <? echo ("the value is $Report"); ?>

    you have set the value for each option to an empty string. you probably mean either '<option value="1">Test Report A</option>' or '<option>1 Test Report A</option>'.

    > 2) Is there any way for PHP to detect the change even on the dropdown, or do > I need to use javascript?

    you have to use javascript.

    jim

    attached mail follows:


    Hi

    My apologies for writing to you unannounced. I came across your name whilst researching some data for the above event and I thought it might be of interest to you. For more info see below or visit www.lseurope.com

    This is Europe's largest and most prestigious IT solutions event. It incorporates a comprehensive conference programme and a free to attend exhibition. The Legal Solutions conference will focus on how to develop and integrate an IT strategy into the overall framework of a law firm's key disciplines, including knowledge management, marketing, intranets, extranets, web technologies, and communications. The conference will feature keynote presentations from some of the world's acknowledged law firm management strategists such as:

    David Maister Prof Joost Breuker Andrew Levison Alan Hodgart

    and case studies from firms with the profile of: Clifford Chance Nauta Dutilh Freshfield Bruckhaus Deringer.

    I hope that you find the conference of interest and look forward to hearing from you. Should you wish to register, please visit www.lseurope.com or reply to this email including your daytime telephone number and your address details.

    Thank you.

    Nick Hussey

    P.S.: If you wish to be removed from our mailing list, please visit http://www.ark-interactive.com/cgi-bin/po4001/manager.pl?action=delete&email=php-general%40lists.php.net&group1=Roberto-law7-10

    --------------------www.ark-interactive.com----------------------------------------------

    attached mail follows:


    My seem stupid to some, but when running update tablename set x='$x', y='$y', z='$z' where a=$a; Does it matter if it the set were in backwards order ie z, y, x ??

    Just curious, Im having a problem and I dont know if its because of the order....

    Thanks

    attached mail follows:


    The order doesn't matter, but perhaps you might want to put single quotes around your $a at the end of your SQL statement. You didn't mention the error that you were getting, but this might help nonetheless :)

    update tablename set x='$x', y='$y', z='$z' where a='$a';

    HTH

    Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 smasiellosynacor.com

    -----Original Message----- From: Gerard Samuel [mailto:trini0optonline.net] Sent: Thursday, August 23, 2001 3:00 PM To: PHP Subject: [PHP] order of update??

    My seem stupid to some, but when running update tablename set x='$x', y='$y', z='$z' where a=$a; Does it matter if it the set were in backwards order ie z, y, x ??

    Just curious, Im having a problem and I dont know if its because of the order....

    Thanks

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    Gerard Samuel <trini0optonline.net> wrote: > My seem stupid to some, but when running > update tablename set x='$x', y='$y', z='$z' where a=$a; > Does it matter if it the set were in backwards order ie z, y, x ??

    the order does not matter. (although unless you're sure $a is an integer value, you may want to wrap it in quotes, too.)

    jim

    attached mail follows:


    Im currently hacking away at a current setup that uses php/mysql on a user table. I have successfully inserted and selected from it, but I cannot update. Yes there were quotes, but thanks for letting me know that the order didn't matter, that narrows my list of possibilities down. Talk to you all later. trini0

    jimwapache.org wrote: > Gerard Samuel <trini0optonline.net> wrote: > >>My seem stupid to some, but when running >>update tablename set x='$x', y='$y', z='$z' where a=$a; >>Does it matter if it the set were in backwards order ie z, y, x ?? >> > > the order does not matter. (although unless you're sure $a is an > integer value, you may want to wrap it in quotes, too.) > > jim > >

    attached mail follows:


    Why "can't you update" ? What error message are you getting?

    Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 smasiellosynacor.com

    -----Original Message----- From: Gerard Samuel [mailto:trini0optonline.net] Sent: Thursday, August 23, 2001 3:28 PM To: PHP Subject: Re: [PHP] Re: order of update??

    Im currently hacking away at a current setup that uses php/mysql on a user table. I have successfully inserted and selected from it, but I cannot update. Yes there were quotes, but thanks for letting me know that the order didn't matter, that narrows my list of possibilities down. Talk to you all later. trini0

    jimwapache.org wrote: > Gerard Samuel <trini0optonline.net> wrote: > >>My seem stupid to some, but when running >>update tablename set x='$x', y='$y', z='$z' where a=$a; >>Does it matter if it the set were in backwards order ie z, y, x ?? >> > > the order does not matter. (although unless you're sure $a is an > integer value, you may want to wrap it in quotes, too.) > > jim > >

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    No visible errors per se. When I run the script, it either doesn't update the database or if I specify the password, it deletes the entry in the database. Its something on my end. I got to look it over, Thanks

    Sam Masiello wrote: > Why "can't you update" ? What error message are you getting? > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 x289 > smasiellosynacor.com > > -----Original Message----- > From: Gerard Samuel [mailto:trini0optonline.net] > Sent: Thursday, August 23, 2001 3:28 PM > To: PHP > Subject: Re: [PHP] Re: order of update?? > > Im currently hacking away at a current setup that uses php/mysql on a > user table. I have successfully inserted and selected from it, but I > cannot update. Yes there were quotes, but thanks for letting me know > that the order didn't matter, that narrows my list of possibilities > down. Talk to you all later. > trini0 > > jimwapache.org wrote: > > Gerard Samuel <trini0optonline.net> wrote: > > > >>My seem stupid to some, but when running > >>update tablename set x='$x', y='$y', z='$z' where a=$a; > >>Does it matter if it the set were in backwards order ie z, y, x ?? > >> > > > > the order does not matter. (although unless you're sure $a is an > > integer value, you may want to wrap it in quotes, too.) > > > > jim > > > > > > > >

    attached mail follows:


    On Fri, 24 Aug 2001 04:57, Gerard Samuel wrote: > Im currently hacking away at a current setup that uses php/mysql on a > user table. I have successfully inserted and selected from it, but I > cannot update. Yes there were quotes, but thanks for letting me know > that the order didn't matter, that narrows my list of possibilities > down. Talk to you all later. > trini0 > > jimwapache.org wrote: > > Gerard Samuel <trini0optonline.net> wrote: > >>My seem stupid to some, but when running > >>update tablename set x='$x', y='$y', z='$z' where a=$a; > >>Does it matter if it the set were in backwards order ie z, y, x ?? > > > > the order does not matter. (although unless you're sure $a is an > > integer value, you may want to wrap it in quotes, too.) > > > > jim

    As a debugging aid, use mysql_error() to trap any error messages returned from the database, and mysql_affected_rows to determine the number of rows affected by your update query. It _might_ be that your query is valid, but actually no rows meet the criteria for update?

    -- 
    David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
    CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  
    

    "His Honor is crazy," Tom admitted judgementally.

    attached mail follows:


    "John Bass" <php_mysql21hotmail.com> wrote in message news:F776KqINGuk0YemjjCA0000f589hotmail.com... > Hi All, > > I am trying to generate a table with two columns. Each column should print > 2 fields named image_link and web_url. Have spent over week looking > documentations and trying different coding but nothing is working. Any help > will be greatly appreciated.

    The other answers are generally correct but a bit hard to follow. Try this:

    <?php

    // declare variables $col = 0; $numcols = 0;

    // == fn startTable =============== function startTable($columns) { global $col, $numcols;

    // reset variables $col = 0; $numcols = (int) $columns;

    // start table echo "\n<table>"; }

    // === fn addColumn ============== function addColumn($str) { global $col, $numcols;

    // first column? start row if ($col == 0) echo "\n\t<tr>";

    // echo cell contents echo "\n\t\t<td>$str</td>";

    // last column? end row and reset $col++; if ($col == $numcols) { echo "\n\t</tr>"; $col = 0; } }

    // ==== fn endTable =============== function endTable() { global $col, $numcols;

    // pad the table as necessary for ($i = $col; $i < $numcols; $i++) addColumn('&nbsp;');

    // end table echo "\n</table>"; }

    // ======= MAIN =================

    mysql_connect("host", "user", "pwd") or die("Error connecting: ".mysql_error());

    $query = "SELECT image_link,web_url FROM testdata"; $result = mysql_db_query("db", $query) or die("Error querying: ".mysql_error());

    startTable(2); while ($row = mysql_fetch_array($result)) addColumn( $row["image_link"].'<br>'.$row["web_url"] ); endTable(); ?>

    How's that?

    attached mail follows:


    On 23 Aug 01, at 14:30, John Bass wrote:

    > <TABLE> > <?php > $query = "SELECT image_link, web_url FROM testdata"; > $result = mysql_query ($query) or die ("Query Failed"); > while ($row = mysql_fetch_object ($result)) > { > printf ("<tr><TD>%s<br>%s</TD> <TD>%s<br>%s</tr>\n", $row->image_link, > $row->web_url,$row->image_link, $row->web_url); > } > ?> > </TABLE>

    Your 'while ($row...) is reading in one row of data. You're then outputing that one row of data twice. Is that what you wanted?

    You don't specifically say what it is that isn't working in this code so I'm really just guessing. If you're actually after a different set of data in each row then you're going to need to approach it differently.

    To have new data in the second column you'll basically have to add a flag to track if you've already put data on that row and then change the tags accordingly (if you've already got the start of the row, add the new column and end the row, otherwise start a row and add your data).

    CYA, Dave

    ----------------------------------------------------------------------- Outback Queensland Internet - Longreach, Outback Queensland - Australia http://www.outbackqld.net.au mailto:dfreemanoutbackqld.net.au -----------------------------------------------------------------------

    attached mail follows:


    I'm using the function below to create a listing of name/value pairs to use in Flash. The first time it runs it works fine, but then after the first time, it uses the originally used variables. So if the URL looks like this:

    mydomain.com/hum_images.php?hub_section=product&hub_subsection1=FOOTWEAR

    The first time it will output correctly and the debugging lines will properly output:

    FOOTWEAR product

    However, if I then enter:

    mydomain.com/hum_images.php?hub_section=product&hub_subsection1=APPAREL

    function selectHubImages ($hub_section, $hub_subsection1) {

    global $db;

    $result = mysql_db_query ($db, "SELECT navigations.nav_label, navigations.nav_parent, navigations.nav_name, navigations.nav_menu, product_items.product_section, product_items.product_parent, product_items.product_name, RAND() AS 'random' FROM product_items, navigations WHERE navigations.nav_name = product_items.product_name AND product_items.product_section = '$hub_section' AND product_items.product_parent = '$hub_subsection1' ORDER by random");

    $n = 1;

    echo "$hub_subsection1<br>"; // for debugging echo "$hub_section<br>"; // for debugging

    while ($row = mysql_fetch_object ($result) and $n <= 5) {

    echo "thumb" . $n . "=" . $row->product_name . "&"; echo "thumb_subsection_two" . $n . "=" . $row->nav_parent . "&"; echo "thumb_label" . $n . "=" . $row->nav_label . "&";

    $n = $n + 1;

    }

    echo "thumb_vartot=" . ($n - 1);

    echo "&done=1&backspace=";

    mysql_free_result ($result);

    }

    attached mail follows:


    Hi all,

    I have Php 4.0.6 on Linux with Informix Dynamic Server 7.31.UD1. I try to use the function ifx_num_rows after afx_query and the value returned is always "0", but i can see the result with ifx_fetch_row. Does Anyone know if there is a bug with this function "ifx_num_rows" ?

    Thanks in advance. Leila

    attached mail follows:


    On Jue 23 Ago 2001 16:50, you wrote: > Hi all, > > I have Php 4.0.6 on Linux with Informix Dynamic Server 7.31.UD1. > I try to use the function ifx_num_rows after afx_query and the value > returned is always "0", but i can see > the result with ifx_fetch_row. > Does Anyone know if there is a bug with this function "ifx_num_rows" ?

    From the php informix manual:

    int ifx_num_rows (int result_id) Gives the number of rows fetched so far for a query with result_id after a ifx_query() or ifx_do() query.

    Saludos... :-)

    -- 
    Porqué usar una base de datos relacional cualquiera,
    si podés usar PostgreSQL?
    -----------------------------------------------------------------
    Martín Marqués                  |        mmarquesunl.edu.ar
    Programador, Administrador, DBA |       Centro de Telematica
                           Universidad Nacional
                                del Litoral
    -----------------------------------------------------------------
    

    attached mail follows:


    This function does not work reliably with most databases, not just Informix. Caused me a lot of problems as I have a number of pages where I'd like to display a "No records found message".

    Just have to do it the hard way.

    I think there's a disclaimer in the docs about this being unreliable.

    Chris

    Martín Marqués wrote:

    > On Jue 23 Ago 2001 16:50, you wrote: > > Hi all, > > > > I have Php 4.0.6 on Linux with Informix Dynamic Server 7.31.UD1. > > I try to use the function ifx_num_rows after afx_query and the value > > returned is always "0", but i can see > > the result with ifx_fetch_row. > > Does Anyone know if there is a bug with this function "ifx_num_rows" ? > > >From the php informix manual: > > int ifx_num_rows (int result_id) > Gives the number of rows fetched so far for a query with result_id after a > ifx_query() or ifx_do() query. > > Saludos... :-) > > -- > Porqué usar una base de datos relacional cualquiera, > si podés usar PostgreSQL? > ----------------------------------------------------------------- > Martín Marqués | mmarquesunl.edu.ar > Programador, Administrador, DBA | Centro de Telematica > Universidad Nacional > del Litoral > ----------------------------------------------------------------- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    --
    

    Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia

    Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: chrisquillsoft.com.au http://www.quillsoft.com.au

    You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt

    **********************************************************************

    This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so.

    This notice should not be removed.

    attached mail follows:


    On Jue 23 Ago 2001 21:21, Chris Fry wrote: > This function does not work reliably with most databases, not just > Informix. Caused me a lot of problems as I have a number of pages where I'd > like to display a "No records found message".

    I normally have a count(*) query to know how much records belong to the query (especially when I use LIMIT and that stuff).

    With Informix, you'll have to use sqlca.sqlerrd[0..5]. One of the elements of the array is the amount of records.

    > Just have to do it the hard way. > > I think there's a disclaimer in the docs about this being unreliable.

    It once was on the informix docs, but not anymore. The source may have changed.

    Saludos... :-)

    P.D.: No problems with pg_num_rows() :-)

    -- 
    Porqué usar una base de datos relacional cualquiera,
    si podés usar PostgreSQL?
    -----------------------------------------------------------------
    Martín Marqués                  |        mmarquesunl.edu.ar
    Programador, Administrador, DBA |       Centro de Telematica
                           Universidad Nacional
                                del Litoral
    -----------------------------------------------------------------
    

    attached mail follows:


    It will fail if the first line is a blank line. For example (numbers are line numbers):

    1. 2.<?php 3. setcookie(); // etc... 4.?>

    While:

    1.<?php 2. setcookie(); // etc... 3.?>

    It should work...

    --
    

    Julio Nobrega

    A hora está chegando: http://toca.sourceforge.net "Ha Minh Nguyen" <haminh.nguyencgey.com> wrote in message news:006701c12bbd$49a2bda0$a6ba430atelecom.capgemini.fr... Hi, I don't know why I get : "Warning: Cannot add header information - headers already sent by (output started at c:\windows\bureau\cookie1.php:2) in c:\windows\bureau\cookie1.php on line 6" message each time I use setcookie function.

    The second line is : <?php I put <html> at the end of the file. Do you have any ideas ?

    Thank you, Ha Minh NGUYEN

    attached mail follows:


    Hi

    We are running a very successful PHP site with lots of traffic. We decided to move to a configuration of a few front ends and a back SQL. Till now it was one server and the SSL was for that server. Now we will have 2-4 front ends which are practically the same. The machine name is different and the SSL seems to have a problem with this.

    We have a way to bypass this but I was wondering what is the right way to go? do you buy a certificate for each server or do you only need one?

    thanks

    berber

    attached mail follows:


    Hi Berber,

    I was reading the agreement for Verisign certificate and they request a fee for each machine and, if I remember it correctly, each domain, and it's not a cheap one!

    Regards, Sumarlidi Einar Dadason

    SED - Graphic Design

    ------------------------------------------ Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: sedsed.is Homepage: www.sed.is ------------------------------------------

    -----Original Message----- From: Boaz Yahav [mailto:berbernetvision.net.il] Sent: 23. ágúst 2001 21:47 To: PHP General (E-mail) Subject: [PHP] SSL Advice

    Hi

    We are running a very successful PHP site with lots of traffic. We decided to move to a configuration of a few front ends and a back SQL. Till now it was one server and the SSL was for that server. Now we will have 2-4 front ends which are practically the same. The machine name is different and the SSL seems to have a problem with this.

    We have a way to bypass this but I was wondering what is the right way to go? do you buy a certificate for each server or do you only need one?

    thanks

    berber

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net To
    contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    When I print an array out with print_r (php 4.06 on IIS 4.0) it does not print newlines even if newlines are embedded in the array element. I must embed <br>, instead.

    The manual examples use \n and the output shows that newlines are created.

    Am I missing something?

    Newbie, here. Hope this is the right thread for such question.

    Thanx, James

    attached mail follows:


    one thing i do is put print_r inside <pre> </pre>.

    function my_print_r($obj) { ?><pre><? print_r($obj); ?></pre><? }

    does the output from print_r look fine if you view source?

    mike

    on 8/23/01 2:58 PM, james at jamesscgdev.com wrote:

    > When I print an array out with print_r (php 4.06 on IIS 4.0) it does not > print newlines even if newlines are embedded in the array element. I must > embed <br>, instead. > > The manual examples use \n and the output shows that newlines are created. > > Am I missing something? > > Newbie, here. Hope this is the right thread for such question. > > Thanx, > James > > > >

    -- mike cullerton

    attached mail follows:


    James <jamesscgdev.com> wrote: > When I print an array out with print_r (php 4.06 on IIS 4.0) it does not > print newlines even if newlines are embedded in the array element. I must > embed <br>, instead.

    it probably is printing the newlines, but in html, newlines are treated like any other whitespace, and do not always cause a new line. you can wrap your output in "<pre></pre>" to preserve the newlines.

    jim

    attached mail follows:


    About the simplest way to accomplish what you want is :

    <pre> <?php print_r($var) ?> </pre>

    \newlines don't show up in browser but will in the source, check your html source and see how pretty it is (full of newlines).

    Here's an example :

    $string = "a\nb\nc\n";

    print $string; (newlines in source) print nl2br($string); (newlines and <br>'s in source)

    Regarding print_r(), use <pre> as suggested above or you _could_ do other things but we'll worry about later :)

    Regards, Philip

    On Thu, 23 Aug 2001, james wrote:

    > When I print an array out with print_r (php 4.06 on IIS 4.0) it does not > print newlines even if newlines are embedded in the array element. I must > embed <br>, instead. > > The manual examples use \n and the output shows that newlines are created. > > Am I missing something? > > Newbie, here. Hope this is the right thread for such question. > > Thanx, > James > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Dominic, These locations can be set by in php.ini or passed as parameters to the mcrypt functions they pretain to (notably those used to initialize).

    Andy

    On Thu, Aug 23, 2001 at 07:24:42AM -0500, Dominic Schanen wrote: > Well, in response to my previous post and its reply, the server > administrator tried reinstalling mcrypt and did the testing during the > install and it all seemed to work for him there. However, I still get the > error: > > Warning: mcrypt module initialization failed > > So, now my question is this. In the phpinfo file, all the ciphers and modes > are listed fine and it shows that mcrypt is enabled. However, for the > directives mcrypt.algorithms_dir and mcrypt.modes_dir, they have no local or > master value. Is this something that needs to be set in phpinfo to point at > the mcrypt installation? Thanks. > > -- > Dominic > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    -- 
    --------------------------------------------------
    Andrew Libby
    Director of Technology
    CommNav, Inc
    alibbycommnav.com
    

    attached mail follows:


    Hi to all:

    Can anybody help me, I need to compile php-4.0.6 with imap-4.2

    thaks.

    attached mail follows:


    Ok, i have a script that creates a page that will be submitted to search engines. I had originally planned on having one line of code on the search engine page: include(http://localhost/freelance.php3?id=1);

    But for some reason, it doesnt work. I've tried everything, changing the php3 to php and include("freelance.php3?id=1")

    The only thing that works is header location("balh balh... but that redirects to the freelance.php3?id=1 page and *i think* thats bad for search engines (isnt it?)

    So what I'd like some info on is why my include() function doesnt work and does a header lcoation command make any difference to the search engines.

    THANKS IN ADVANCE

    attached mail follows:


    Has anyone come up with an upgrade proceedure for upgrading PHP to a higher version?

    Joseph

    attached mail follows:


    In the following code, I'm reading a variable set of random numbers into a multi-dimensional array.

    The first iteration runs properly, but when I get to my 2nd+ iteration, I get the following errors; Warning: Wrong datatype in sort() call in /home/usrlinux/WWW/pballs.php on line 18 Warning: Invalid argument supplied for foreach() in /home/usrlinux/WWW/pballs.php on line 19

    Is there a specific function for sorting and foreach statements of multidimensional arrays? If so, why does it work properly for the first interation,i.e. sort($num_array[1]) then subsequently fail on sort($num_array[2])

    Thank you in advance!

    <? srand ((double) microtime() * 1000000); $totnum = 5; $min = 1; $max = 49; $tickcount=1; $num_array = array(); array_push($num_array, array()); echo "Now Generating $tickets Tickets!<br>\n"; while ($tickcount <= $tickets) { while ( $numbercount < $totnum) { $num_array[$tickcount][] = rand($min,$max); $numbers = array_unique($num_array[$tickcount]); $numbercount = count($num_array[$tickcount]); } sort($num_array[$tickcount]); foreach($num_array[$tickcount] as $val) { echo "<img src=ball.php?text=$val&color=grey>&nbsp;&nbsp"; } $pb[$tickcount] = rand(1,42); print "<img src=ball.php?text=$pb[$tickcount]&color=red>"; $tickcount++; } ?>

    ___________________________ James C. Montz James Tower http://www.jamestower.com jcmontzjamestower.com

    attached mail follows:


    On 23 Aug 01, at 11:10, Jeremy Morano wrote:

    > $result = mysql_query($sql,$connection) or die("Couldn't execute query."); > > > while ($row = mysql_fetch_array($result)) { > $uid = $row['uid'] > $team = $row['team'];

    if ($uid == $row['uid']) {

    $option_block .= "<option value=\"$uid\" selected>$team</option>";

    } else {

    > $option_block .= "<option value=\"$uid\">$team</option>";

    }

    > $option_block .= "<option value=\"$uid\">$team</option>"; > }

    [etc]

    Basically, you need to see if the value they selected is the one you're currently working with and add the 'selected' attribute to your <option> tag. If it's not then just keep on going through.

    CYA, Dave

    ----------------------------------------------------------------------- Outback Queensland Internet - Longreach, Outback Queensland - Australia http://www.outbackqld.net.au mailto:dfreemanoutbackqld.net.au -----------------------------------------------------------------------

    attached mail follows:


    I appreciate your responses. A wrapper function using the <pre></pre> suggestions works fine for my immediate purposes -- viewing output in the browser as I learn the language.

    Thanx again, James

    "James" <jamesscgdev.com> wrote in message news:20010823214214.65921.qmailpb1.pair.com... > When I print an array out with print_r (php 4.06 on IIS 4.0) it does not > print newlines even if newlines are embedded in the array element. I must > embed <br>, instead. > > The manual examples use \n and the output shows that newlines are created. > > Am I missing something? > > Newbie, here. Hope this is the right thread for such question. > > Thanx, > James > > > >

    attached mail follows:


    Hello,

    Peter Ostry wrote: > > Has anyone a PHP Script for the checksum of Creditcards? > And a Script which can identify card types based on their first numbers? > (VISA, AMEX, MASTER, DINERS, JBC, DISCOVERY) > > There where a lot of JavaScript pages on the web some years ago, but I > have lost my local copies and the pages are vanished...

    You may want to try this PHP forms generation and validation class, than among other things validates credit card numbers and can even check if a supplied card is from a given company. It can validate on the client side with Javascript and on the server side with PHP.

    Just take a look at it here:

    http://phpclasses.UpperDesign.com/browse.html/package/1

    Regards, Manuel Lemos

    attached mail follows:


    I am working on a form that needs to run INSERTS into a table, but also has other connections and functions going on, so $php_self isn't really an option (I'm a newbie, and switch still scares me)...

    Can I effectively use an include/require(insert.php) on the main of the form, have the form action be insert.php but stay with the form, and if so, HOW?

    __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

    attached mail follows:


    Hi Guys,

    I have written a class in which it uses the global command to get the value of a variable from outside of this class which I use within the class.

    I have recently changed this variable to an array and added 5 extra keys to this array. It is a string indexed array. In now seems as though PHP wont import the array. It is really weird though because if I access the key of an array such as $database["hostname"] is just echo's nothing at all to the browser. It also echo's nothing to the browser if I use $database[0]. But, if I echo just $database to the browser it returns "Array" ?

    Does anybody have any idea of why this is happening?

    Thanks

    Scott.

    attached mail follows:


    I have a database browser that I made with php and mysql. When I use it in Netscape it behaves normally. However when I view it using Konquerer, all kinds of php code shows up on the screen when I execute a php page. I thought that Konquerer might not be recognizing the <? and ?> start and end tags so I tried <script language="php"> and </script>. However if I use these nothing at all shows up on the screen. Can someone tell me what the problem is? Thanks, SW

    attached mail follows:


    > I have a database browser that I made with php and mysql. When I use it in

    > Netscape it behaves normally. However when I view it using Konquerer, all

    > kinds of php code shows up on the screen when I execute a php page. I > thought that Konquerer might not be recognizing the <? and ?> start and end > tags so I tried <script language="php"> and </script>. However if I use > these nothing at all shows up on the screen. Can someone tell me what the

    > problem is?

    PHP files are parsed by the web server, not the web browser.

    You can't load a PHP file directly (ie, file:///) into Konqueror, nor any other browser. If you do, what you describe above will happen - you will see the source code.

    Jason

    attached mail follows:


    What's happening specifically is that I have an html form with action "whatever.php" and when I click on submit I get code echoed to the screen. As I said it works normally in Netscape, I get the php page with all the data displayed perfectly. Thanks, SW

    On Thursday 23 August 2001 20:28, you wrote: > > I have a database browser that I made with php and mysql. When I use it > > in > > > > Netscape it behaves normally. However when I view it using Konquerer, > > all > > > > kinds of php code shows up on the screen when I execute a php page. I > > thought that Konquerer might not be recognizing the <? and ?> start and > > end > > > tags so I tried <script language="php"> and </script>. However if I use > > these nothing at all shows up on the screen. Can someone tell me what > > the > > > > problem is? > > PHP files are parsed by the web server, not the web browser. > > You can't load a PHP file directly (ie, file:///) into Konqueror, nor > any other browser. If you do, what you describe above will happen - you > will see the source code. > > Jason

    attached mail follows:


    "Sunny at wde" <sandeep_wdeyahoo.com> wrote in message news:20010821010142.8761.qmailweb3903.mail.yahoo.com... > hi all! > > i'm building a registration system, and i want to strip all funky > character map symbols from the username as well. i know strip_tags() > gets rid of html, but how do i get rid of them?? :( > > i just want simple a-z, A-Z and 0-9 allowed in the username.

    Check with reguler expression, ereg(),etc or strspn(). You probably should not strip invalid chars, but return errror.

    --
    Yasuo Ohgaki
    

    attached mail follows:


    What kind of PHP application development frameworks, class libraries, or templates are widely used? Is SiteManager any good? How about phplib? Others? Doesn't the future of object oriented PHP depend on good foundation classes? Any comments on PHP object orientation?

    Steve Orr

    attached mail follows:


    I would appreciate some feedback. I am writing a script to fire off emails in HTML or text format to everyone in a mailing list. It works no problem - but I am concerned with how many emails it can deal with over time.

    The script has no timeout setting, I am not sure if it needs one. It fires off 100 emails, pauses for 1 minute using sleep(60), and then fires off another 100. It sends the mail using mail(). I did my first send the other day to 930 addresses and it worked fine.

    My question - is this going to work for a few thousand emails? What about 100,000? Would it be better to send the mail directly to the smtp server? Can you foresee any problems?

    I look forward to your reply...

    Regards,

    Matthew Delmarter

    attached mail follows:


    Hey,

    I'm wondering if anyone here has any experiencing mixing webware with a FAX solution on the unix platform, particulary FreeBSD 4.2.

    I have 2 seperate possilble solutions here. The first involves faxing using software configured on the server. The 2nd is a PHP type solution, capturing HTML from a URL and assembling it into an attachment for email. Please give me any thoughts you can offer on these.

    What I currently have is a e-commerce solution I wrote in PHP. There are pages that are generated (sort of like a populated form) that need to be faxed. This is all theory I am talking right now, because I have never done anything like this, including just faxing from a server.

    Now, what would it entail to get our dedicated server preped to do faxing for starters. It's at our colo facility and gobs of bandwidth. Obviously we have no modem connected at this point, and I don't even know if an actual phone line would be available to us. So, what I am guessing is that there are services that offer dial-out gateways for faxing and such, over the Internet. Where, our software can send data to a faxing gateway, which in turn sends the fax through their lines. Anyone know of any services like this?

    Also, what type of faxing software is available on FreeBSD? How does it integrate with actual means of faxing (gateways/modem) etc.

    Basically, the whole fax over server thing is new to me, and I'm trying to see if anyone has any experience at all doing this. The goal is: when you are looking at this rendered HTML page, you have a button that says "Fax" and when you click on it, the web page you are looking at is faxed off, through the server, looking just as it appeared on the screen basically (which merely consists of text in tables, and a couple <HR>'s). The goal is to make this as seamless as possible.

    2nd solution------------- Now, eFax offers you a service where you can send an email, containing an attachment, such as .html and it will render the email and attachments and fax them off like they look. This would not be such a bad idea, but we want to avoid people having to manually "Send Page By Email" through outlook each time. What I am thinking if I can capture the HTML that is generated from the script (ie- showdetails.php?order_id=432) and then create an attachment of that HTML (ie- my_attachment_to_fax.html) and then send it through email ( function mail(); ) that would be perfect. Anyone have any code on how capture the HTML from a URL (fopen(); ?) and then assemble that into an attachment (.html / correct mime type/headers) and send it off?

    Sound plausible?

    Please give me any insight to either of these methods. Thank you.

    Fotwun

    attached mail follows:


    Hey,

    If anyone has any better solutions too, let me know, I'm open to anything.

    > -----Original Message----- > From: Fotwun [mailto:fotwunsofthome.net] > Sent: Thursday, August 23, 2001 5:32 PM > To: php-generallists.php.net > Subject: [PHP] Mixing PHP with a FAX Gateway? HELP!!! IDEAS??? > > > > > Hey, > > I'm wondering if anyone here has any experiencing mixing webware > with a FAX > solution on the unix platform, particulary FreeBSD 4.2. > > I have 2 seperate possilble solutions here. The first involves > faxing using > software configured on the server. The 2nd is a PHP type > solution, capturing > HTML from a URL and assembling it into an attachment for email. > Please give > me any thoughts you can offer on these. > > What I currently have is a e-commerce solution I wrote in PHP. There are > pages that are generated (sort of like a populated form) that need to be > faxed. This is all theory I am talking right now, because I have > never done > anything like this, including just faxing from a server. > > Now, what would it entail to get our dedicated server preped to do faxing > for starters. It's at our colo facility and gobs of bandwidth. > Obviously we > have no modem connected at this point, and I don't even know if an actual > phone line would be available to us. So, what I am guessing is that there > are services that offer dial-out gateways for faxing and such, over the > Internet. Where, our software can send data to a faxing gateway, which in > turn sends the fax through their lines. Anyone know of any services like > this? > > Also, what type of faxing software is available on FreeBSD? How does it > integrate with actual means of faxing (gateways/modem) etc. > > Basically, the whole fax over server thing is new to me, and I'm trying to > see if anyone has any experience at all doing this. The goal is: when you > are looking at this rendered HTML page, you have a button that says "Fax" > and when you click on it, the web page you are looking at is faxed off, > through the server, looking just as it appeared on the screen basically > (which merely consists of text in tables, and a couple <HR>'s). > The goal is > to make this as seamless as possible. > > 2nd solution------------- > Now, eFax offers you a service where you can send an email, containing an > attachment, such as .html and it will render the email and attachments and > fax them off like they look. This would not be such a bad idea, > but we want > to avoid people having to manually "Send Page By Email" through > outlook each > time. What I am thinking if I can capture the HTML that is generated from > the script (ie- showdetails.php?order_id=432) and then create an > attachment > of that HTML (ie- my_attachment_to_fax.html) and then send it > through email > ( function mail(); ) that would be perfect. Anyone have any code on how > capture the HTML from a URL (fopen(); ?) and then assemble that into an > attachment (.html / correct mime type/headers) and send it off? > > Sound plausible? > > Please give me any insight to either of these methods. Thank you. > > Fotwun > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Hi, When i use this function mail(), mail was sent successfully but when recipient receive the mail the date timezone is incorrect. It displayed -0800 instead of +0800. Im from +0800. The timezone does not display correctly. I have tried different servers but still the same. And all clients get the wrong date. Im Using php 4.06 and win2k and winnt4.

    Can anybody help me.

    Thanks

    attached mail follows:


    > > Last, i don't see why the implementation as exists, requires 3 > > semaphores.

    I just looked over the code, and the reason for this is it specifically designed for a multi-process web environment. The most common method for semaphore initialization is in the parent process right before fork. There is no parent initializer for a php module author, and since each child has its own environment, there is no way to know when to initialize the semaphore.

    The way that Tom solved that problem was to create a "USAGE" semaphore which is used to insure that the semaphore is only initialized once. There must have been some sort of race condition because the purpose of the 3rd semaphore is a lock.

    This is actually a sharp way to handle the problem of no central way to initialize.

    -Jason

    attached mail follows:


    > As far as creating the new module goes, it shouldn't be 'to much effort'. The basic implimentation of system v semaphores > is actualy quite simple, its the usage of sempahores that can be very confusing :-) sysv sem's are often refered to as the > most difficult to comprehend of the sysv standards.

    Well they took a simple concept and made it extremly complex. > I would be more then willing to donate my time and efforts to that project, and i do have some knowledge of how semaphores > can be used (reader-writer, resource count and lock implimentations). However as i mentioned before, my last C project is > some years ago, also my knowledge of Zend internals is limited to the php-usage scope > > do note a locked semaphore == 0, any value above 0 allows for a 'lock', this is done to allow multiple client-locks > clasical example is : if the printer manager daemon has 5 printers, it creates a semaphore with a max_acquire of 5. (so > acquire count == 5). Every client connecting, lowers that count... untill its zero. Then the client blocks 'till the value > is positive again. > > Proposed API of the sysvsem > ----------------------------------- > > * $sem = sem_get($key,$max_acquire,$perms) > Gets or creates a semaphore id, id is returned in $sem > * $ret = sem_acquire($sem) > Tries to lowerer the acquire count of the semaphore. If count is already 0, wait till it is raised (by sem_release) or > returns an error (sem_remove was called or invalid permission to get semaphore). note: when the client blocks 'semzcnt' is > increased (semzcnt = # of processes waiting for lock) > * $ret = sem_release($sem) > Increases the acquire count > > [proposed new function] > * $count = sem_get_waiting($sem) > Returns the amount of processes blocking on a semaphore acquire call. I propose -1 = error, 0 > incicates # of waiting > processes.

    I like this, but I am wondering if we should perhaps support some of the more advanced capibilities of sysv sems, like support of operation arrays with semop and IPC_PRIVATE, etc.

    > Documentation > ------------------ > I'd be happy to help write up some documentation, general how-to-use semaphores for usage in php docs, plus some example > implimentations..

    That would be great!!

    -Jason

    > > I will see how far i can get using the existing implimentation as a template for implimenting a php module.. however be > sure i'll come knocking for help fairly soon :-) > > -- Chris > > Jason Greene wrote: > > > There probably should be a full implementation of semaphores in php. If you > > have a need for this, we should discuss exactly how it should be implemented. > > I will have some free time available soon, so I can start working on this. Though I have > > a couple other projects as well. If you would be interested in contributing a CVS > > account can be arranged. This should probably start as a separate module, and then > > eventually replace the sysvsem extension as it is no long being actively maintained. > > > > I have a great desire for php to function well as a standalone scripting language > > as well as web, so I am always interested as projects like this. > > > > Is there anyone else who would find this useful? > > > > -Jason > > > > ----- Original Message ----- > > From: "Tom May" <tom.mayinfospace.com> > > To: "Chris Chabot" <chabotcreviewboard.com> > > Cc: <php-devlists.php.net>; <php-generallists.php.net>; <jasoninetgurus.net> > > Sent: Tuesday, August 21, 2001 1:58 PM > > Subject: Re: sysvsem extention question > > > > > First off, before you get the wrong impression of my answer, let me > > > say that your observation "It all seems kinda kludgy and quick-hack > > > for a specific > project, and not 'sysv semaphores implimented in > > > php'" is right on. > > > > > > Chris Chabot <chabotcreviewboard.com> writes: > > > > > > > I have been playing with the idea of making some application backend > > > > services using pcntl (for singaling and fork)+ sysvsem's (for > > > > synchronisation). > > > > > > Cool. But see below. > > > > > > > However while reading thru the sysvsem source code, i noticed the > > > > behaviour of the semaphores in PHP is basicly as a 'lock' (as one would > > > > use a file lock w/ flock()). From what i understand from my advanced > > > > unix programming book, and the linux man pages, this is not what > > > > semaphores are supposed to be (though they can be abused to be so). > > > > > > > > The way one would -expect- semaphores to function on a unix platform > > > > is best described in "Linux Programmers Guide" at > > > > http://uiarchive.uiuc.edu/mirrors/ftp/ftp.ibiblio.org/pub/Linux/docs/linux-doc-project/programmers-guide/lpg-0.4.pdf > > > > (page 46 and on). > > > > > > > > A short sumary would be: a semaphore is a resource counter (not an > > > > absolute lock). > > > > > > A lock is just a degenerate case. A slightly less degenerate case > > > (that can't be implemented with flock) is when you want to allow N > > > users of the resource instead of just one. > > > > > > > The main this is that a process other then the process that acquired > > > > the semaphore can decrease the semaphore count, thus releasing it for > > > > another client. Another big difference is that a process can set the > > > > semaphore count lower then zero (0 == locked). This sometimes can be > > > > usefull for Client / Server synchonisation. > > > > > > > > Example usage for a typical Client / Server program flow using > > > > semaphores / signals : > > > > > > I admit I haven't looked at this hard enough to understand all the > > > details, but could message queues help you out here? You could get > > > higher throughput since the server fills the buffer and calls msgsnd() > > > beforehand, whereas in your signalling implementation clients will > > > stall between the time they signal the server and the time the server > > > has filled a buffer for them. Also, you need some additional overhead > > > to manage the buffer handoff from client to server. And doing things > > > in signal handlers can get dicey. > > > > > > If a message queue isn't big enough for you, you can pass references > > > to shared memory in your messages. > > > > > > > Server : > > > > create sem > > > > sem acquire > > > > setup envirioment > > > > fork children > > > > > > > > Multiple Clients: > > > > repeat (wait for sem acquire) { > > > > send signal to Server > > > > communicate with server, get 'buffer' > > > > process buffer > > > > } > > > > > > > > Server: > > > > > > > > while (Fill data into buffer) { > > > > semaphore release (!); > > > > Sleep(infinite or untill time out); > > > > } > > > > > > > > -> Sleeps untill interupted by signal (signal send by Client/Child) > > > > -> In signal handler: > > > > Send 'buffer' to client that acquired semaphore > > > > return; > > > > will cause the program to go back to main loop, sleep was interupted, > > > > so goes to while (fill buffer) again. Also note that the Client -never- > > > > calls semaphore release. The server does that once the resource is > > > > available again. > > > > > > > > Rinse and Repeat till end of time, or end of data :-) This will > > > > distribute the data to be processed over all the different clients > > > > (since semaphores guarantee a linear processing of clients, so all > > > > clients get there equal share). > > > > > > > > Last, i don't see why the implimentation as exists, requires 3 > > > > semaphores. > > > > > > I don't remember why either. I did that code somewhere around the end > > > of 1998 . . . > > > > > > > It all seems kinda kludgy and quick-hack for a specific > > > > project, and not 'sysv semaphores implimented in php'. (please forgive > > > > my rude assumptions) > > > > > > Bingo. > > > > > > > Does the maintainer (Tom May) want to work on this, or anyone else? I'd > > > > be happy to help out, but my last C coding days are over 6 years behind > > > > me, so i don't feel very confident to lead this project.. So any/all > > > > help and/or comments would be apreciated. > > > > > > I no longer use php or maintain any of the stuff I helped with (aside > > > from answering the occaisional question, like this one. > > > > > > > Also i noticed a potential security hole in the exisiting source, at > > > > line 190 of sysvsem.c it uses > > > > > > > > semget(key, 3, perm|IPC_CREATE); > > > > > > > > However, perm is not zero'd to 7 bits before being used, thus allowing > > > > extra flags being added to the call, which presumably is unintentional, > > > > since it allows nasty flags to be passed to this call. perm is gotton > > > > from arg_perm, which is a lval. What i imagine you 'should' do is zero > > > > out all non-relivant bits, basicly AND perm with 0x777. this will clear > > > > all bits other then the (file style) permission flags. > > > > > > AND with 0777. Good catch. > > > > > > > -- Chris Chabot > > > > > > > > Ps. please CC me in replies, since im not subscribed to the php lists. > > > > > > Me either. > > > > > > Tom. > >

    attached mail follows:


    I can't get session variables to work

    I know this has been done to death in the past, but I've looked on php.net, and google for a solution, have tried the suggestions, and seem to fix it.

    My php session settings are as follows:

    Name Local Global settings session.auto_start Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.entropy_file no value no value session.entropy_length 0 0 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On

    The code I'm using to test is as follows:

    <?php session_start();

    echo "COUNT{$count}"; if (!isset($count)) { echo "registering session"; session_register($count); $count=1; } else { $count++; echo $count; } ?>

    The output is as follows:

    COUNTregistering session

    Refreshing shows the same output

    My /tmp directory exists and has the following permissions. drwxrwxrwt 3 root root 4096 Aug 24 10:40 tmp

    What should I be looking for?

    attached mail follows:


    Try

    session_register("count");

    Rudolf Visagie rudolfqedi.co.za

    -----Original Message----- From: Lawrence.Sheeddfait-maeci.gc.ca [mailto:Lawrence.Sheeddfait-maeci.gc.ca] Sent: 24 August 2001 04:42 To: php-generallists.php.net Subject: [PHP] Session Problem

    I can't get session variables to work

    I know this has been done to death in the past, but I've looked on php.net, and google for a solution, have tried the suggestions, and seem to fix it.

    My php session settings are as follows:

    Name Local Global settings session.auto_start Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.entropy_file no value no value session.entropy_length 0 0 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On

    The code I'm using to test is as follows:

    <?php session_start();

    echo "COUNT{$count}"; if (!isset($count)) { echo "registering session"; session_register($count); $count=1; } else { $count++; echo $count; } ?>

    The output is as follows:

    COUNTregistering session

    Refreshing shows the same output

    My /tmp directory exists and has the following permissions. drwxrwxrwt 3 root root 4096 Aug 24 10:40 tmp

    What should I be looking for?

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net