php-general Digest 26 Jan 2001 16:10:25 -0000 Issue 477 Topics (messages 36681 through 36739): PHP/MYSql equivalent to Hypermail/Monharc? 36681 by: Greg Schnippel Password security from PHP to MySQL 36682 by: Egan Re: SQL Server DB to mySQL DB 36683 by: Jason Bouwmeester Re: Persistent connections and transactions 36684 by: Martin A. Marques 36690 by: Frank Joerdens 36693 by: Martin A. Marques 36713 by: Frank Joerdens Question about dopping zeros 36685 by: Ethan Nelson 36717 by: Randy 36723 by: Randy mktime() not allowing dates before 1970 36686 by: Diego Fulgueira 36687 by: Monte Ohrt PostgreSQL + PHP + SQL warning messages 36688 by: Evelio Martinez 36696 by: Martin A. Marques Enabling track_vars. 36689 by: April 36694 by: Philip Olson Splitting at word count 36691 by: H. Wade Minter Fopen 36692 by: Nate Re: Zend hit (Encoder price) 36695 by: Jim Jagielski 36699 by: Rasmus Lerdorf 36701 by: Jim Jagielski 36703 by: Dallas Kropka 36705 by: Dallas Kropka 36706 by: Rasmus Lerdorf number_format() buggy round when usind database resultset 36697 by: Lucas Persona Re: regular expression help 36698 by: Jeff Warrington VAR and variables 36700 by: Matt 36708 by: Steve Edberg html table 36702 by: Mike 36704 by: Rasmus Lerdorf 36707 by: Brian V Bonini 36715 by: Randy file_exists search the include_path? 36709 by: Dean Hall 36720 by: John Donagher edit plus 36710 by: Pat Hanna 36712 by: Randy 36718 by: Randy 36722 by: Dell Coleman Re: Ideas?? (OT- MySQL) 36711 by: Randy Get rid of da Zero's 36714 by: Ethan Nelson Web based Time Sheets for Professionals 36716 by: Web Time Sheets CGI and PHP 36719 by: Dave Stewart 36731 by: John Meredith memory leak with mcrypt 2.4.5 36721 by: Remco Chang Post without submit? 36724 by: Chris 36725 by: Richard S. Crawford 36726 by: DanO 36727 by: Richard S. Crawford 36728 by: Remco Chang exec() bug? 36729 by: Dustin Butler Ver 3 vs. Ver 4 36730 by: Karl J. Stubsjoen 36733 by: Zeev Suraski Re: Greek PHP mailing list 36732 by: Stephan Ahonen APC patch (PHPLIB support?) 36734 by: Daniel Cowgill session without cookies 36735 by: tassilo.maussner.net password protection 36736 by: Bill Rausch 36738 by: James Atkinson Re: Search for the documentation 36737 by: Brian Clark Tracing 36739 by: Morten Rønseth Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Hi, I have been using Hypermail for archiving our mailing lists but I'm becoming and more frustrated with its limitations. Is there an equivalent PHP script to hypermail out there? Ideally, I would like to maintain the incoming e-mail addresses in a mysql database. Thanks, -Greg
I know that ~.my.cnf with [client] password={mypass} is the recommended method of securing your MySQL password when using a shell command line to access MySQL. But what is the recommended method for MySQL password security via PHP? Is there some way to make it use the ~.my.cnf file? It seems to me that if you hardcode a MySQL password into your PHP source code, it could become exposed inadvertently. Forgive me if this is already answered in the FAQ or manual. Egan
Thanks for the tip. I actually read that the default for mySQL is TAB and LF for delimiters, so I used those in SQL and exported a .txt file, imported it into mySQL database and voila! A few code modifications and we be running on mySQL. Thanks again! Jason -----Original Message----- From: Christopher Allen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 9:16 AM To: Jason Bouwmeester; [EMAIL PROTECTED] Subject: Re: [PHP] SQL Server DB to mySQL DB Just did this to a 65mb fixed width file. What I did was get it into a csv file via perl :) Then I created the db table. Then I used: load data infile "/file.csv" into table blah fields terminated by ',' ; then go ahead and create any indexes etc... !works slick! > Is there an easy way to do this? I know that SQL Server can export a comma > delimited file, can mySQL import this? I imagine the PHP will be easy to > modify as long as the field names are the same.
El Jue 25 Ene 2001 14:34, Frank Joerdens escribió: > On Thu, Jan 25, 2001 at 11:18:49AM -0300, Martin A. Marques wrote: > [ . . . ] > > > No, and thats why in the postgres list we talked about persistent > > connections not having much benefits. That is because the connection is > > persistent to the httpd child that called it and not to all. > > Well, yes, but as long as the child lives, it'll be connected which > means that every subsequent request to this child involving a database > connection won't have to suffer the connection startup cost. If you have > a rather inexpensive query, and a lot of web apps use simple, > straightforward selects that are very inexpensive, then the connection > startup overhead contributes more to the performance hit than the actual > query. Of course. But the persistent connection are not working as the manuals say they should work. > [ . . . ] > > > Now be carefull. http connection open and close, they do not stay open, > > so if you try to execute different SQL statments with different httpd > > connections, your gonna have trouble (the sql server won't let you, > > because there is another transaction been executed). > > Hmm. Say the Apache child is idle (under which cirumstances exactly does > it consider itself 'idle'?), receives a request for a page which > executes a query (because it contains php code that does). This takes a > while. In the meantime, while the SQL server is chugging away running > the query, will the Apache child not accept further http requests? How > does the Apache child know that it is waiting for the query to complete? > This is what I don't know about the mechanism. That has nothing to do with apache. If the SQL statments are well implemented, the second query wouldn't see any of the changes that the first query executed until the work is commited, and it shouldn't be able to modify the rows with which the first query is updating or deleting. But thats Postgres that doesn't let it, not the apache server, not php. Saludos... :-) -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: [EMAIL PROTECTED] Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas -----------------------------------------------------------------
On Thu, Jan 25, 2001 at 04:04:24PM -0300, Martin A. Marques wrote: [ . . . ] > Of course. But the persistent connection are not working as the manuals say > they should work. It appears this riddle has been solved: From a post by Adam Lang on pgsql-php on Dec 8: <start quote> Well, there's a problem with PHP's [mis]documentation. First of all, it counts open DB connections not on per-webserver, but on per-process/thread basis. The default PHP config file has the limits of persistent and non-persistent connections set to -1 (no limit)... Setting it to some (supposedly) reasonable value (like, 50) accomplishes nothing: you should multiply 50 by the number of webserver processes/threads. There can be lots of them... :[ And then there comes PHP's "logic": if I can just open the new connection, why bother reusing the old one? And thus Postgres backends start multiplying like rabbits, eventually reaching the limit... :[ You should set a reasonable limit on number of open persistent connections (like 1, maybe 2 or 3), only then PHP will actually reuse them. My webserver now works with such setup and there are no more problems with pg_pconnect(). <end quote> [ . . . ] > > Hmm. Say the Apache child is idle (under which cirumstances exactly does > > it consider itself 'idle'?), receives a request for a page which > > executes a query (because it contains php code that does). This takes a > > while. In the meantime, while the SQL server is chugging away running > > the query, will the Apache child not accept further http requests? How > > does the Apache child know that it is waiting for the query to complete? > > This is what I don't know about the mechanism. > > That has nothing to do with apache. If the SQL statments are well > implemented, the second query wouldn't see any of the changes that the first > query executed until the work is commited, and it shouldn't be able to modify > the rows with which the first query is updating or deleting. > But thats Postgres that doesn't let it, not the apache server, not php. You are assuming that the Postgres backend has accurate information about the client's identity. The "client" for the backend is the Apache child, not the browser. The Postgres backend doesn't know anything about web browsers. So if Apache/PHP allows a 2nd browser to connect to a particular Apache process while it's waiting for a query to complete that would generate information to be sent back to the first browser, then you're in trouble. But I think it would be pretty silly for Apache/PHP to allow that. Regards, Frank
El Jue 25 Ene 2001 16:49, Frank Joerdens escribió: > On Thu, Jan 25, 2001 at 04:04:24PM -0300, Martin A. Marques wrote: > [ . . . ] > > > Of course. But the persistent connection are not working as the manuals > > say they should work. > > It appears this riddle has been solved: From a post by Adam Lang on > pgsql-php on Dec 8: > > <start quote> > Well, there's a problem with PHP's [mis]documentation. First of all, > it counts open DB connections not on per-webserver, but on > per-process/thread basis. > The default PHP config file has the limits of persistent and > non-persistent connections set to -1 (no limit)... Setting it to > some (supposedly) reasonable value (like, 50) accomplishes nothing: you > should multiply 50 by the number of webserver processes/threads. There > can be lots of them... :[ > And then there comes PHP's "logic": if I can just open the new > connection, why bother reusing the old one? And thus Postgres backends > start multiplying like rabbits, eventually reaching the limit... :[ > You should set a reasonable limit on number of open persistent > connections (like 1, maybe 2 or 3), only then PHP will actually reuse > them. My webserver now works with such setup and there are no more > problems with pg_pconnect(). > <end quote> Yes, I got this mail from Adam, but I think it was on the IMP mailing list or the Postgres-devel mailing list. Well, that doesn't matter to much. ;-) Any way, it speaks very bad about the logic that PHP has of what is a persistent connection (I think I had the same problem with informix). > > That has nothing to do with apache. If the SQL statments are well > > implemented, the second query wouldn't see any of the changes that the > > first query executed until the work is commited, and it shouldn't be able > > to modify the rows with which the first query is updating or deleting. > > But thats Postgres that doesn't let it, not the apache server, not php. > > You are assuming that the Postgres backend has accurate information > about the client's identity. The "client" for the backend is the Apache > child, not the browser. The Postgres backend doesn't know anything about > web browsers. So if Apache/PHP allows a 2nd browser to connect to a > particular Apache process while it's waiting for a query to complete > that would generate information to be sent back to the first browser, > then you're in trouble. But I think it would be pretty silly for > Apache/PHP to allow that. OK, lets see if we can understand what each other is saying (maybe I'm not getting your point here). Lets say browser A connects to the apache server, to a page using php code. Lets say the code is OK (no bugs). Apache opens a persistent connection to the database and starts executing the queries. Now the connection between the apache server and the web browser doesn't close until the queries are all finished and the output is send back to the browser. Now, how about if browser B connects to the apache server just in the middle of the execution of the queries that browser A asked for? Well, the connection between Browser A and the web server is still opened, so another httpd child process answers the request. If a persistent connection is needed (as Adam said) this child will open a new one, because the other one is still in use. So now you have two web connections with two backend connections. My question would be, and seeing Adams thoughts, wouldn't it be the best optimization configuration of php.ini to have only one persistent conection? Wouldn't there be one per-child? Any way, you can't have two connections to the same httpd child. Saludos... :-) -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: [EMAIL PROTECTED] Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------
On Thu, Jan 25, 2001 at 05:10:54PM -0300, Martin A. Marques wrote: [ . . . ] > OK, lets see if we can understand what each other is saying (maybe I'm not > getting your point here). > Lets say browser A connects to the apache server, to a page using php code. > Lets say the code is OK (no bugs). Apache opens a persistent connection to > the database and starts executing the queries. Now the connection between the > apache server and the web browser doesn't close until the queries are all > finished and the output is send back to the browser. > Now, how about if browser B connects to the apache server just in the middle > of the execution of the queries that browser A asked for? > Well, the connection between Browser A and the web server is still opened, so > another httpd child process answers the request. I thought one of the points being raised (can't find the mail/thread I'm referring to now) was that somehow confusion might ensue from a mix-up, on the Apache/PHP level, regarding the client identity, thus corrupting a transaction in progress. It seemed to make sense but now that we've discussed it, I can't see anymore how it might happen. . . . [ goes away to search mail archives ] . . . Ah, here we go. A post from Rod Taylor on pgsql-hackers on Dec 27: ------------------ begin quote ------------------ The *real* problem with persistent connections is: Script1: BEGIN; Script1: UPDATE table set row = 'things'; Script2: Insert into table (id) values ('bad data'); Script1: COMMIT; Since script2 managed to do a BAD insert in the middle of script1's transaction, the transaction in script1 fails. Obvious solution? Don't do connection sharing when a transaction is enabled. The whole persistent connection thing is only valid for mysql as it's the only thing that doesn't really support transactions (and even thats partially changed). They need to look for stuff going through (keywords like BEGIN) and 'lock' that connection to the single entity that opened it. It's much easier to write your own. I wrote a few functions like: get_connection('DB PARMS'); begin_transaction(); commit_transaction(); close_connection(); ------------------ end quote ------------------ [ . . . ] > My question would be, and seeing Adams thoughts, wouldn't it be the best > optimization configuration of php.ini to have only one persistent conection? > Wouldn't there be one per-child? Any way, you can't have two connections to > the same httpd child. Those where my thoughts too (or, rather, Adams thoughts ;)), and this is what I am trying at the moment. Regards, Frank
I need to format decimals that are percise to the second place in the following format: 4.00 to 4 4.50 to 4.5 4.25 to 4.25 As you can see, I just want to drop the trailing zeros, and if necessary the decimal. Thanks ___________________________________ Ethan Nelson, Systems Administrator Net Solutions, LLC 840 Lawrence Street Eugene, OR 97401 [EMAIL PROTECTED] http://www.netsolutionsllc.com Voice +1 541 345-7087 Fax +1 541 485-5519
Hello Ethan, $onum=4.11440; $onum =number_format($onum,2)+0; echo $onum; With this technique, you get the following: $onum output 4.166 4.12 4.135 4.11 4.000 4 4.3000 4.3 Is that what you wanted? To me, it's much easier to code and use than reg expressions and replaces. Best regards, Randy Thursday, January 25, 2001, 1:10:18 PM, you wrote: EN> I need to format decimals that are percise to the second place in the EN> following format: EN> 4.00 to 4 EN> 4.50 to 4.5 EN> 4.25 to 4.25 EN> As you can see, I just want to drop the trailing zeros, and if necessary the EN> decimal. EN> Thanks EN> ___________________________________ EN> Ethan Nelson, Systems Administrator EN> Net Solutions, LLC EN> 840 Lawrence Street EN> Eugene, OR 97401 EN> [EMAIL PROTECTED] EN> http://www.netsolutionsllc.com EN> Voice +1 541 345-7087 EN> Fax +1 541 485-5519
Oops! Copied the numbers wrong. Here's are the numbers I meant to type: R> $onum output R> 4.166 4.12 4.1166 4.12 R> 4.135 4.11 4.1135 4.11 R> 4.000 4 R> 4.3000 4.3 R> Is that what you wanted? To me, it's much easier to code and use R> than reg expressions and replaces. R> Best regards, R> Randy R> Thursday, January 25, 2001, 1:10:18 PM, you wrote: EN>> I need to format decimals that are percise to the second place in the EN>> following format: EN>> 4.00 to 4 EN>> 4.50 to 4.5 EN>> 4.25 to 4.25 EN>> As you can see, I just want to drop the trailing zeros, and if necessary the EN>> decimal. EN>> Thanks EN>> ___________________________________ EN>> Ethan Nelson, Systems Administrator EN>> Net Solutions, LLC EN>> 840 Lawrence Street EN>> Eugene, OR 97401 EN>> [EMAIL PROTECTED] EN>> http://www.netsolutionsllc.com EN>> Voice +1 541 345-7087 EN>> Fax +1 541 485-5519
I know the UNIX epoch is 1/1/1970 and that mktime() returns the number of seconds between that date and the date specified by its parameters. If this date is before 1/1/1970, it always returns -1, not a large negative number, which would be more reasonable, i think. The question is: How can I know the number of seconds ellapsed between any date in the past and today? Thanks in advance.
use Date_Calc. http://www.phpinsider.com/php/code/Date_Calc/ Diego Fulgueira wrote: > > I know the UNIX epoch is 1/1/1970 and that mktime() returns the number of > seconds between that date and the date specified by its parameters. If this > date is before 1/1/1970, it always returns -1, not a large negative number, > which would be more reasonable, i think. > The question is: How can I know the number of seconds ellapsed between any > date in the past and today? > > Thanks in advance. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Monte Ohrt <[EMAIL PROTECTED]> http://www.ispi.net/
Hi! Is there any way to get the equivalent sqlca.sqlcode value of informix in PostgreSQL from php ? I would like to use the sqlcode to print the messages in Spanish. Thanks in advance -- Evelio Martínez Testanet. Dept. desarrollo software. Av. Reino de Valencia, 15 - 5 46005 Valencia (Spain) Tel: +34 96 395 90 00 Fax: +34 96 316 23 19
El Jue 25 Ene 2001 16:36, Evelio Martinez escribió: > Hi! > > Is there any way to get the equivalent sqlca.sqlcode value of informix > in PostgreSQL from php ? > > I would like to use the sqlcode to print the messages in Spanish. The problem is that informix puts in an array (sort of) all the info about the last query. What sort of information would you like? Last insert? You have an pg_getlastoid() function. Hope it helps. Saludos...:-) -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: [EMAIL PROTECTED] Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------
Is it possible to enable track_vars from a .htaccess doc, and does anyone have a link to a good basic (as in, insanely beginner) tutorial to do it?
Here's a tutorial : http://www.oreillynet.com/pub/a/php/2001/01/11/php_admin.html Here's track_vars in the manual : http://www.php.net/manual/en/configuration.php#ini.track-vars So in .htaccess it would be something like : php_flag track_vars 1 To have it off, it would be : php_flag track_vars 0 Regards, be outside the box. Philip Olson http://www.cornado.com/ On Thu, 25 Jan 2001, April wrote: > Is it possible to enable track_vars from a .htaccess doc, and does anyone > have a link to a good basic (as in, insanely beginner) tutorial to do it? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm doing a page where the front page will show "news" stories. What I'd like is if the story is longer than X words/chars/etc, the index page will show the first X words, then a link for the full story. Does anyone have a good idea on how to split after a certain number of words? Thanks, Wade -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6cIdgX5y4ZKLK2pMRAjOoAJ0RD43TCH7yVTLKhVjtsJ2mr/ZLMgCgmcz0 QHiQipt8ngHq7dnVdiQeHXY= =PwwQ -----END PGP SIGNATURE-----
Hi there, I am trying to open remotely the file http://www.parentprofiles.com/clicker.php and am useing the code: <? $fp = fopen("http://www.parentprofiles.com/clicker.php?profile_id=" . $this->profile_id . "&code=1","r"); echo $fp; ?> to do it. however when I do all I get is a response that says: Resource id #1 instead of giving me the page. Any ideas? Alan ______________________________________________ Is your life touched by adoption . . . or do you wish it were? Visit www.Adoption.com. Get FREE Adoption.com e-mail at www.AdoptionMail.com.
Rasmus Lerdorf wrote: > > > Well, without the Encoder the entire *possibility* of "seriously proprietary > > kickass scripts" that people distribute and sell is out of the question. > > Let's not go overboard here. You can build and sell serious stuff without > an encoder. Obfuscating the code is not a requirement for all people. A > usage license attached to the code that specifies what the client can do > with it is often all it should take. If you really are building serious > stuff that you sell to serious customers, then they are not likely to > violate a license to save a few hundred dollars. > If it requires too many hoops to jump through for people to program in PHP with the intention to distribute, then no matter how much better PHP is than other solutions, the decision will be: bag it, it's too much trouble, find something else. I never said that obfuscating the code is a requirement for all people. I'd like to know where I said that. It's easy to make me sound like an idiot or worse when you put words in my mouth. I said that for some people it is. BIG difference. To dismiss those people is kind of foolish. Doesn't the existance of such a product help *promote* the use of PHP? isn't that what we all want? If there are barriers that prevent people from using PHP, then doesn't it make sense to address those? If *they* want it (a obfuscation method) or need it, then they do. It's not your right to tell people how to distribute their code, or in what method to do it. And I could tell you stories about how much licenses and NDAs and such other legal agreements mean to some... :) -- =========================================================================== Jim Jagielski [|] [EMAIL PROTECTED] [|] http://www.jaguNET.com/ "Casanova will have many weapons; To beat him you will have to have more than forks and flatulence."
> I never said that obfuscating the code is a requirement for all people. > I'd like to know where I said that. It's easy to make me sound like an > idiot or worse when you put words in my mouth. I said that for some > people it is. BIG difference. That was not how I understood what you wrote. You wrote: > without the Encoder the entire *possibility* of "seriously proprietary > kickass scripts" that people distribute and sell is out of the question. "out of the question" does not imply this "some people" idea. The above says that if you wish to seriously write proprietary php, you must buy the Encoder. My simple point is that there are other ways to approach the problem. -Rasmus
Rasmus Lerdorf wrote: > > You wrote: > > without the Encoder the entire *possibility* of "seriously proprietary > > kickass scripts" that people distribute and sell is out of the question. > > "out of the question" does not imply this "some people" idea. The above > says that if you wish to seriously write proprietary php, you must buy the > Encoder. My simple point is that there are other ways to approach the > problem. > "seriously proprietary" sounds, well, serious. If someone has something "seriously proprietary" I doubt, sincerely doubt, that saying "You can tell them No in a Licence" will be accepted with a happy and warm grin :) That's why I quoted the exact line ;) -- =========================================================================== Jim Jagielski [|] [EMAIL PROTECTED] [|] http://www.jaguNET.com/ "Casanova will have many weapons; To beat him you will have to have more than forks and flatulence."
I haven't read all the posts, but as you stated>.... Charge $6000 to the big companies, I have no problem with that. I personally would be willing to pay that if web applications was my business. But at the same time, allow those who don't necessarily need to have the encoder but just want some code encoded to have an affordable solution. there is an alternative, Zend sells packages of 5 -20- and 100 uses of the encoder, in license packs.... for allot less.... granted the largest is still 1000 USD, but its less.... I'm sure that there are other alternatives to using the Zend encoder, (Obstruficating <SP?> is Rasmus's argument) but even using his method, there is a BIG possibility that anyone who wants to will find that hidden security measure, or your DB code, and rip it, hack it, slash it, and package it to profit from your work. We are in the process of creating a large project for distribution, and the encoder is paramount to the system we are designing.... without it, we don't have a chance in hell of keeping our security keys secure from prying eyes.... of course, we are one of those companies which can afford to drop 6G's at this program, but we weren't expecting it to run that high. I must say that Zend did a lousy PR job at promoting the system, but we need to use it. Dallas K. -----Original Message----- From: Michael A. Peters [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 11:40 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Zend hit (Encoder price) My question is- Does the encoder license permit a company to purchase the license, and then optionally encode php for third parties? Can I, for example, encode purchase the encoder, and then make a deal with John who can't afford the encoder to encode John's web application for $150 and give John the encoded version? The answer, unfortunately, is no, at least as I read the commercial license. This is really too bad, if you ask me- as there are a lot of really bright kids out there who have seen that the Open Source model, while very noble and absolutely loved, doesn't always pay. Why then, should they develop using php if they are not capable of protecting their code if that's their choice? They'll be using Java or C/C++ or perl (which can be encoded for a lot less). There needs to be a solution where those who do not yet have big bucks can take advantage of the encoder to protect what their mind has conceived. Otherwise, they won't use php (or their code will be ripped off if its really really good) and zend will lose future market as these brilliant minds move towards affordable technology to protect what their intellectual work. Charge $6000 to the big companies, I have no problem with that. I personally would be willing to pay that if web applications was my business. But at the same time, allow those who don't necessarily need to have the encoder but just want some code encoded to have an affordable solution. On Thursday, January 25, 2001, at 05:26 AM, Sander Pilon wrote: > > > > > Hello, > > > > What do you think about Zend position? > > http://php.weblogs.com/ > > http://zend.com/phorum/read.php?num=3&id=6277&loc=0&thread=6277 > > > > I think that if Zend wants to sell it for $6000, then they have all right > to. These guys have worked hard, and they deserve some cash for it. > > If people can't afford it at $6000, then that's their problem. Software is > intellectual property, it shouldn't be free, and authors should be able to > charge any price for it they want to charge for it. > > But, I don't think it's a wise decision to sell it at $6000, personally I > think I would sell it between $1000 and $4000, but that's just me. ($6000 is > a bit on the high side, considering what alternatives one haves for that > price, and considering that anyone who paid $1000 a year back (I recall > something about 'sponsoring') gets it all.) > > -S > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer (510) 623-9726x357 Fax: (510) 249-9125 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Yes, but name me one way that will ensure your code in the manner that Zend does it, making your code unreadable just pisses the people off who wish to alter the parts which are intended to be altered. And with Zend, its possible to write readable code, encode the sensitive parts, and invite the open source market with open arms without risking anything.... Imagine a script which requires a license code to unlock the program, but yet wants to incorporate the OS Market to extend the script.... how long do you think it will take for someone to find your access keys? Now this assumes that you will be using straight PHP, and while some small C++ app will accomplish this, only those with that experience can write those in and that places limits on what those companies can do. They are PHP Scripters, not C++ coders. Just my thoughts, Dallas K. -----Original Message----- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 2:57 PM To: Jim Jagielski Cc: [EMAIL PROTECTED]; Sander Pilon; Uioreanu Calin; [EMAIL PROTECTED] Subject: Re: [PHP] Zend hit (Encoder price) > I never said that obfuscating the code is a requirement for all people. > I'd like to know where I said that. It's easy to make me sound like an > idiot or worse when you put words in my mouth. I said that for some > people it is. BIG difference. That was not how I understood what you wrote. You wrote: > without the Encoder the entire *possibility* of "seriously proprietary > kickass scripts" that people distribute and sell is out of the question. "out of the question" does not imply this "some people" idea. The above says that if you wish to seriously write proprietary php, you must buy the Encoder. My simple point is that there are other ways to approach the problem. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
> Yes, but name me one way that will ensure your code in the manner that Zend > does it, making your code unreadable just pisses the people off who wish to > alter the parts which are intended to be altered. And with Zend, its > possible to write readable code, encode the sensitive parts, and invite the > open source market with open arms without risking anything.... Imagine a > script which requires a license code to unlock the program, but yet wants to > incorporate the OS Market to extend the script.... how long do you think it > will take for someone to find your access keys? > > Now this assumes that you will be using straight PHP, and while some small > C++ app will accomplish this, only those with that experience can write > those in and that places limits on what those companies can do. They are PHP > Scripters, not C++ coders. Write yourself a PHP extension and put whatever sensitive business logic in that and distribute the .so alongside your userspace scripts. I said nothing about license codes that unlock anything, nor code obfuscation. I know that's how you understood it, but your misunderstood. -Rasmus
Hi, I'm finding some problems on using number_format($value, $decimal, ",", ".") when I have a value comming from a resultset (database query results)... If I had something like '123.45', using number_format it will return '123,00'. I think this happens because my value is a string and PHP rounds it before using it on number_format. If I try to change the data type like (double) $value, I will also have a '123.00' result. I could do something on database like 'to_char(FIELD, '999G999D99') but database default is '.' for decimal separator and ',' for thousand separator...and I want the opposite. Suggestions/Solutions? :) Thanks, -- Lucas Persona [EMAIL PROTECTED]
In article <005801c08668$e0459070$0201010a@shaggy>, "Jamie Burns" <[EMAIL PROTECTED]> wrote: I tried something like this and your examples worked: $str = "<tag element = \"value\" nextelement>"; if (eregi("=[[:space:]]*\"([^\"]+)|=[[:space:]]*([[:alnum:]]+)",$str,$regs)) { print("yes - ".$regs[1].":".$regs[2]."<br>\n"); } since the pattern has an 'or' (|), you have to look in either the second or the third element of the array you use to store values from the ereg. Jeff > can anyone help me figure out a regular expression to find the value of > a tag element? > > for example: > > <tag element="my value"> > <tag element=value> > <tag element="my value" nextelement> > <tag element=value nextelement> > <tag element = "my value"> > <tag element = value> > <tag element = "my value" nextelement> > <tag element = value nextelement> > > so in each of the above i need to find either "my value" or "value"... > > i tried this but it wont work for every situation: > > ereg("element[ ]*[=][ ]*[\"]?([^\">]*)[ |\"|>].*" ... > > thanks for your help - regular expressions are not my best area! > > jamie.
I have a question that may seem kind of silly, but I'm curious... When using PHP why would one use "var" to define a variable as opposed to just regularly creating it? For example, if I have a class defined as below: <pre> class Simple { var $a; function Simple() { $this->a = 5; } function first() { return $this->a; } } </pre> This class, when created, sets the variable $a to 5, and the function first returns the value in $a.... my question is could I omit the var and still have it function in this fashion? What is the purpose of it? Also, can I access this variable through the same -> convention, i.e. would the following be allowed? <pre> $test = new Simple(); echo $test->a; </pre> Thanks.
At 3:00 PM -0600 1/25/01, Matt wrote: >I have a question that may seem kind of silly, but I'm curious... > >When using PHP why would one use "var" to define a variable as >opposed to just regularly creating it? Because that's the way it is ;). The var is part of the syntax of a class definition; it isn't used anywhere else. I don't know the actual deep reason for having it, as far as the parser is concerned, but it does make it clear - at least to me - what the class variables are. You can also initialize the variable here, too: var $a = 5; >For example, if I have a class defined as below: ><pre> >class Simple { > var $a; > > function Simple() { > $this->a = 5; > } > > function first() { > return $this->a; > } > >} ></pre> > >This class, when created, sets the variable $a to 5, and the >function first returns the value in $a.... my question is could I >omit the var and still have it function in this fashion? What is the >purpose of it? > >Also, can I access this variable through the same -> convention, >i.e. would the following be allowed? ><pre> >$test = new Simple(); >echo $test->a; ></pre> > Yep. You can also _set_ $a this way: $test = new simple; $test->a = 77; echo $test->first(); will display 77. See http://www.php.net/manual/en/language.oop.php for more info. - steve -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
How do I get every other column to be a different color (or font ect.)when I'm populating a table from a db(different field counts all the time) Thanks Mike [EMAIL PROTECTED]
> How do I get every other column to be a different color (or font ect.)when > I'm populating a table from a db(different field counts all the time) If $i is a counter then $i%2 will alternate between 0 and 1 $i%3 would cycles through 0,1 and 2 -Rasmus
$color = "tan"; FOR ($i=0 ; $i < $numrows ; $i++) { if ( ($i % 2) == 0 ) { ECHO ("\n<TR>"); } else { ECHO ("\n<TR BGCOLOR=$color>"); } } > -----Original Message----- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 4:19 PM > To: Mike > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] html table > > > > How do I get every other column to be a different color (or > font ect.)when > > I'm populating a table from a db(different field counts all the time) > > If $i is a counter then $i%2 will alternate between 0 and 1 > > $i%3 would cycles through 0,1 and 2 > > -Rasmus > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I use a slightly different technique... Defined in database or global file: $tblbgcolor1="FFFFFF"; $tblbgcolor2="FFFFCC"; Program Loop to create the table: $altcolor=$tblbgcolor2; while ($row = mysql_fetch_array($Query)) { if ($altcolor==$tblbgcolor2) $altcolor=$tblbgcolor1; else $altcolor=$tblbgcolor2; echo "<TR bgcolor='#$altcolor'><TD>Text to display on Row</TD></TR>"; } (this loops through rows fetched from a mysql table, but can be any kind of loop) Best regards, Randy Thursday, January 25, 2001, 3:57:47 PM, you wrote: BVB> $color = "tan"; BVB> FOR ($i=0 ; $i < $numrows ; $i++) { BVB> if ( ($i % 2) == 0 ) { BVB> ECHO ("\n<TR>"); BVB> } else { BVB> ECHO ("\n<TR BGCOLOR=$color>"); BVB> } BVB> } >> -----Original Message----- >> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] >> Sent: Thursday, January 25, 2001 4:19 PM >> To: Mike >> Cc: [EMAIL PROTECTED] >> Subject: Re: [PHP] html table >> >> >> > How do I get every other column to be a different color (or >> font ect.)when >> > I'm populating a table from a db(different field counts all the time) >> >> If $i is a counter then $i%2 will alternate between 0 and 1 >> >> $i%3 would cycles through 0,1 and 2 >> >> -Rasmus >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >>
I thought I saw in one of the older manuals that there is an optional second parameter to 'file_exists' that will tell it too search the 'include_path' for a file instead of using an absolute path. However, I can't seem to find this documentation any more. Does anyone know if this still works? How it works? If it's just a second boolean parameter or what? In other words, instead of: if (file_exists("/www/inc/my_script.php")) {...} I'd like to say: if (file_exists("my_script.php", TRUE)) {...} // or something like this assuming "/www/inc" is part of my include_path. Thanks. Dean.
It doesn't. Some of the file-related functions have that capability and some don't. This may be what you're looking for: function file_exists_in_path($file) { foreach(split(':', ini_get('include_path')) as $dir) { if ($dir[sizeof($dir)-1] != '/') { $dir.='/'; } if (file_exists($dir.$file)) { return TRUE; } } return FALSE; } On Thu, 25 Jan 2001, Dean Hall wrote: > I thought I saw in one of the older manuals that there is an optional second >parameter to 'file_exists' that will tell it too search the 'include_path' for a file >instead of using an absolute path. However, I can't seem to find this documentation >any more. > > Does anyone know if this still works? How it works? If it's just a second boolean >parameter or what? > > In other words, instead of: > > if (file_exists("/www/inc/my_script.php")) {...} > > I'd like to say: > > if (file_exists("my_script.php", TRUE)) {...} // or something like this > > assuming "/www/inc" is part of my include_path. > > Thanks. > Dean. > -- John Donagher Application Engineer Intacct Corp. - Powerful Accounting on the Web 408-395-0989 720 University Ave. Los Gatos CA 95032 www.intacct.com -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.0.1 (GNU/Linux) Comment: For info see http://www.gnupg.org mQGiBDnCZ1oRBACFgkFCV6p3dWic1qm1FLhip5beIyzZSt+ccTDYQQdPZA/t5H+k PZ7ZFBIUrXz/oEqwQwlEKlg8JQqg7hgtcL+xrIJ0BInLeSJG4lvvB551g59Thr7/ OsdxNVxKci775+K+GkdAz4xcULMuB+QE7t665Ri46EAS8ALos5UG6DGmhwCguD0v 1cxwy/KlKr+oi4sWM9caueED/RmjiSD3vmBZQt6PMisVe1AmkEf6cJoemduCSJxu 0eMz/LIeu+CqfpuJH2N/dZ3hRj9xMSHF4l71wKqV99zhm58kDGwG1u3yVzULPDqz 0yL+8nunlkoOUyn3zOnh3Zmz4POFVMZQ5oian3QkLllUwly5JCi5tWULxZ2vOkb0 zzjuA/4jigNxYV4NAyCl+wAbnyzk9/Iz8EHv4/0Ex8ytlcMtvBJKa9HjJxlyIl74 yOILHk3+GSAdM0b3ZmbavpoCpebinOMBhqEVBwCI4VUIAqf86gx+2dKBGxfKPnU4 Xxvqs/BOl/EbeJjyd4uieYndGRaWg+kYXqZ7SxrlFN24fohnd7QgSm9obiBEb25h Z2hlciA8am9obkB3ZWJtZXRhLmNvbT6IVgQTEQIAFgUCOcJnWgQLCgQDAxUDAgMW AgECF4AACgkQIt6tVu6+jd3SHwCgjssFktMXf8NjE9JBR+sJ2gDIsW8An0CFNdFd dU+DJYC6ogYP9AsVfM27uQENBDnCZ2MQBAD8E0qe1gBKjtoRmyiyORtwhOz/2XZE mqiZN2NouAUWRRZd4dHggFAA1jUsp2MVIZZQyY9ajNVy3Oaxj5kYz8LR5GItxxcD jC8RFXKM40ZfTJeR7fH6eJa689w+le71Tt4ALyN4xcjSWuksr8795AhHFjonDi8D rgGIq6GtWvi/KwADBgQAmeBbcjPzhqR2M8TdvEyNfVTQSSp/RNoTjNNWpHui8V0p kiQ49tbsqeMjXGToGgMugfmrX77JidXyuVjgYjT9xUdaaA25qKAR75M9izDliT7Y h5L+QZTAw0/5X9go7XK3WI3LYfFrp4TP0veXgSWxDqccqsRzWKW7IoXsliTCbVqI RgQYEQIABgUCOcJnYwAKCRAi3q1W7r6N3YIcAKCkJMTPLu6tOPnXPl2s3xmnSawy BACeOx83WlBhVScYWo+BUzntJ6ks4T0= =OkJU -----END PGP PUBLIC KEY BLOCK-----
Anyone who uses Edit Plus. Can you send me the php function files and auto complete file. The edit plus web page has the links but none of them work. Thanks Pat
Hello Pat, I've emailed you the files that I use. I've customized them a bit since I downloaded them from editplus.com. Best regards, Randy Thursday, January 25, 2001, 4:02:45 PM, you wrote: PH> Anyone who uses Edit Plus. Can you send me the php function files and auto PH> complete file. The edit plus web page has the links but none of them work. PH> Thanks PH> Pat
Hello Kristi, Sure, I'm sending them now... Best regards, Randy Thursday, January 25, 2001, 4:56:03 PM, you wrote: KR> Could you email them to me too? :) KR> ----- Original Message ----- KR> From: "Randy" <[EMAIL PROTECTED]> KR> To: <[EMAIL PROTECTED]> KR> Sent: Thursday, January 25, 2001 5:20 PM KR> Subject: Re: [PHP] edit plus >> Hello Pat, >> >> I've emailed you the files that I use. I've customized them a bit >> since I downloaded them from editplus.com. >> >> Best regards, >> Randy >> >> >> Thursday, January 25, 2001, 4:02:45 PM, you wrote: >> >> PH> Anyone who uses Edit Plus. Can you send me the php function files and KR> auto >> PH> complete file. The edit plus web page has the links but none of them KR> work. >> PH> Thanks >> PH> Pat >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >>
Hi Going to http://www.editplus.com/files/ will give you the index of all the available files. HTH D. Coleman Pat Hanna wrote: > Anyone who uses Edit Plus. Can you send me the php function files and auto > complete file. The edit plus web page has the links but none of them work. > Thanks > Pat
You will probably be much happier in the future if you make a one-to-many setup rather than a many-to-many. As Mathew said, create your tables with: BID table: bidid, projectid, OtherFields PROJECT table: projectid, OtherFields If you are at a project and want to look at bids, just "select * from bid where projectid ='<CurrentProjectID>'" Even if you have multiple projects per bid, you might try to create one bid record for each project in that bid which would maintain the above methodology. But having fields such as Bid1, Bid2, etc, is a VERY bad idea. At various client's sites, I've had to maintain/fix other programmer's programs who used that technique and it will strangle the program. Best regards, Randy Thursday, January 25, 2001, 1:17:37 AM, you wrote: MK> <[EMAIL PROTECTED]> wrote ... >> I am creating a web site which allows users to post projects and then >> others to place bids. I am setting up two tables in MySQL 'Projects' >> & 'Bids' my problem is how best to cross reference. What I was >> thinking of doing is creating a number of fields in the Projects table... >> >> and then inserting the BidID from the bids table into Bid1, and if >> that is already used then it will go into Bid2. But how many Bid# >> shall I create?? I`m sure there must be a faster method than this, >> anyone have any suggestions?? MK> This is a standard question where you have two tables that need to be linked MK> in a many-to-many relationship. The answer is that you need a third table, MK> called for example ProjectBids. It has two columns, one for Bid ID and one MK> for Project ID. Each row links one bid to one project. You can enter as many MK> rows as you like, so each bid can be linked to one or more projects, and MK> each project can be linked to one or more bids. MK> But are you sure you have a many-to-many relationship? It sounds like each MK> bid might be associated with just one project. In that case you could just MK> have a column in the Bid table that contains the Project ID.
Almost there... actually this creates one problem... It turns 40.00 into 4 It needs to quit shaving zero's when it hits the decimal point. 40.00 into 40 45.50 into 45.5 40.25 into 40.25 Thanks -----Original Message----- From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 12:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Question about dopping zeros ereg_replace("[0\.]*$", "", $number) should do it. I'm not sure you need the slash in front of the dot or not. try it and see. In article <[EMAIL PROTECTED]> you write: >I need to format decimals that are percise to the second place in the >following format: > >4.00 to 4 >4.50 to 4.5 >4.25 to 4.25 > >As you can see, I just want to drop the trailing zeros, and if necessary the >decimal. > >Thanks > >___________________________________ >Ethan Nelson, Systems Administrator >Net Solutions, LLC >840 Lawrence Street >Eugene, OR 97401 >[EMAIL PROTECTED] >http://www.netsolutionsllc.com >Voice +1 541 345-7087 >Fax +1 541 485-5519 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Announcing the eTech Online Time Sheet system for gathering Employee Time over the Internet. Online TimeSheets easily integrate with Payroll, Billing & Project Management. Simplified Time Tracking and Project Management is a click away. http://www.solutioncorp.com/timesheet.shtml Please call us or visit our site. Thank You Gary P. Finley eTech SolutionCorp voice: 817-355-8883 http://www.SolutionCorp.com If you have recieved the message in error, we apologize. Please click below to send a remove request to us: mailto:[EMAIL PROTECTED]?subject=RemoveName_TimeSheet
Hi, I have this line in my shtml pages... <!--#exec cgi=\"../../cgi-bin/ads.cgi" --> How do I write this as a function to include in my .php files. (I've looked up virtual () in the manual but can't make head nor tail of it). Many thanks, Dave Stewart
One of exec, system or backtick (ie. `) functions will do it for you. - John On Fri, Jan 26, 2001 at 12:14:47PM +1300, Dave Stewart wrote: > Hi, > > I have this line in my shtml pages... > > <!--#exec cgi=\"../../cgi-bin/ads.cgi" --> > > How do I write this as a function to include in my .php files. > > (I've looked up virtual () in the manual but can't make head nor tail > of it). > > Many thanks, > > Dave Stewart > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- John "Neutiquam erro" Meredith <[EMAIL PROTECTED]>
i found out that the mcrypt functions/library leak memory (libmcrypt 2.4.5) with PHP 4.0.2 (on Solaris 2.6) and Apache 1.3.12 (actually, it's Stronghold 3.0). the function that leaks is mcrypt_generic_init(). the PHP manual states that if you call mcrypt_generic_end (), it will clear up the buffer and close the library. however, i found out that the function unfortunately does not dealloc the memory. if someone could confirm this, i'll submit it into the bugs report. remco chang www.bountyquest.com
is there anyway to post without clicking a submit button?
Without knowing exactly what you want to do, I would try something like the following in JavaScript: function doSubmit() { document.form.submit() } Then associate the function with any sort of desired event. In a project of mine, I have it attached to a keypress function so that the form is submitted when the user presses the enter key from the last form field. I suppose you could also put it in the BODY tag if you're feeling especially adventurous. At 12:23 AM 1/26/01 -0500, Chris wrote: >is there anyway to post without clicking a submit button?
yes, with javascript: <script> function sendIt(form) { form.submit(); return true; } function startIt() { setTimeout('sendIt(document.formName)',3000); } </script> <body onload="startIt();"> <form method=post action=someScript name=formName> <input type=hidden value=turkey name=bacon> </form> timeout is in milliseconds. you could alternately pass document.formName directly to sendIt. HTH, DanO > -----Original Message----- > From: Chris [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 9:23 PM > To: PHP > Subject: [PHP] Post without submit? > > > is there anyway to post without clicking a submit button? >
Sorry, just to be a bit clearer... Suppose you wanted to associate it with a link, you could do something like the following: <a href="#" onClick="javascript:doSubmit();">click here to submit</a> Hope that helps. At 03:22 PM 1/25/01 -0800, Richard S. Crawford wrote: >Without knowing exactly what you want to do, I would try something like >the following in JavaScript: > >function doSubmit() { > document.form.submit() >} > >Then associate the function with any sort of desired event. In a project >of mine, I have it attached to a keypress function so that the form is >submitted when the user presses the enter key from the last form field. I >suppose you could also put it in the BODY tag if you're feeling especially >adventurous.
there is some code at the PHP code exchange that allows you to do http post with only PHP (not using java script)... it might not do exactly what you have in mind, but it's an interesting alternative. remco chang www.bountyquest.com ----- Original Message ----- From: "Richard S. Crawford" <[EMAIL PROTECTED]> To: "Chris" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]> Sent: Thursday, January 25, 2001 6:24 PM Subject: Re: [PHP] Post without submit? > Sorry, just to be a bit clearer... Suppose you wanted to associate it with > a link, you could do something like the following: > > <a href="#" onClick="javascript:doSubmit();">click here to submit</a> > > Hope that helps. > > > > At 03:22 PM 1/25/01 -0800, Richard S. Crawford wrote: > >Without knowing exactly what you want to do, I would try something like > >the following in JavaScript: > > > >function doSubmit() { > > document.form.submit() > >} > > > >Then associate the function with any sort of desired event. In a project > >of mine, I have it attached to a keypress function so that the form is > >submitted when the user presses the enter key from the last form field. I > >suppose you could also put it in the BODY tag if you're feeling especially > >adventurous. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi, Can someone confirm this behavior on their system. I've tried it on 4.0.2 and 4.03pl1, both on Linux boxes, both with the same results. echo "One Character: " . exec("echo 't'",$tmp) . "<br>\n"; echo "One Character: " . $tmp[0] . "<br>\n"; echo "Two Characters: " . exec("echo 'te'",$tmp) . "<br>\n"; My output is: One Character: One Character: t Two Characters: te It seems if the output of exec is one character it gets discarded somewhere. The ouput is correct in the array argument, but the "last line of output" is not returned by the function if the length of the "last line of output" is 1. Thanks, Dustin
Hello, Does Version 4 support either { } "squiglees" or [ ] "brackets" in this code: if($retrn{strlen($retrn)-1} == '&') -or- if($retrn[strlen($retrn)-1] == '&') I am developing on ver 3.0 and the { } don't work in the above, but the brackets do. Karl
At 01:36 26/1/2001, Karl J. Stubsjoen wrote: >Hello, > >Does Version 4 support either { } "squiglees" or [ ] "brackets" in this >code: > >if($retrn{strlen($retrn)-1} == '&') >-or- >if($retrn[strlen($retrn)-1] == '&') Yes. This is a 4.x feature only. The idea is that in the long run, [] will no longer be supported for string offsets, only {} will. Zeev -- Zeev Suraski <[EMAIL PROTECTED]> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
> Ah now, but who would use a HP, when you've got your trusty TI? :-) Yup, especially since all the games are on the TI, though they're pretty scarce for the 89, my personal preference, since they're more expensive, so fewer people have them. The options: Get a graph-link cable (which I can't find ANYWHERE), or make your own during study hall, making them sufficiently stupid that the code can be compressed down to a screenful: kyk():Prgm:Local a,b,c:13->a:"|------------+------------|"->b:ClrIO:Output 0,-1,left(b,a)&"¥"&right(b,a):While abs(13-a)<13:getKey()->c:If abs(50-c)=1 Then:a+c-50->a:Output 0,-1,left(b,a)&"¥"&right(b,26-a):EndIf:EndWhile:EndPrgm Play with the 1 and 3 keys. Guess what it does by just looking at the code, and win a free donut (should arrive within 6-8 weeks, and shouldn't be too stale by then). 1 and 3 have character codes 49 and 51, respectively, if you want to take this on...
George and I have identified and fixed a bug involving class member data initialization. This seems to fix session support in PHPLIB, and possibly other related problems as well. A simple example of offending code: class Foo { var $x = array("b" => "c"); var $y = array("a"); } '$x' was correctly serialized, but '$y' was not. The patch is up on our cvs repository (via ssh to apc.communityconnect.com:/cvs, port 23, user:anoncvs, pwd:cvs). Dan
hi.. i use the session-functions with php4 and everything works fine. but if a visitor turns off cookies nothing seems to work.. is there a way to support a sessionid with cookies and thru the url ? thanks markus
Hi all, This isn't strictly a PHP issue but is quite related. Given that you have a PHP-driven web site with user authorization and session identifiers etc., what can you do to prevent electronic "snooping" of the clear text password that is passed from the browser to the server? When filling out a form, for example: Enter your user name and password: ... <FORM ACTION="<?=$PHP_SELF?>" METHOD="POST"> <B>User Name:</B><BR> <INPUT TYPE="TEXT" NAME="newusername" VALUE="" SIZE="10" MAXLENGTH="15"> <P> <B>Password:</B><BR> <INPUT TYPE="password" NAME="newpassword" VALUE="" SIZE="10" MAXLENGTH="15"> <P> <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"> </FORM> ... the TYPE="password" makes sure the browser doesn't echo the password as it is typed but it is still sent to the web server as clear text. How do folks deal with this issue? Thanks, Bill --- Bill Rausch, Software Development, Unix, Mac, Windows Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED]
The only way to keep a password secure between the client and server is to use a Secure Socket Layer (SSL) to create an encrypted channel of communication between the client and server. You can see this in practice over at Sourceforge.net. They use PHP over an SSL connection to handle user logins. Do a seach on Google for 'SSL' and start reading :) - James > -----Original Message----- > From: Bill Rausch [mailto:[EMAIL PROTECTED]] > Sent: January 25, 2001 4:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] password protection > > > Hi all, > > This isn't strictly a PHP issue but is quite related. Given that you have > a PHP-driven web site with user authorization and session > identifiers etc., > what can you do to prevent electronic "snooping" of the clear > text password > that is passed from the browser to the server? When filling out a form, > for example: > > Enter your user name and password: > ... > <FORM ACTION="<?=$PHP_SELF?>" METHOD="POST"> > <B>User Name:</B><BR> > <INPUT TYPE="TEXT" NAME="newusername" VALUE="" SIZE="10" MAXLENGTH="15"> > <P> > <B>Password:</B><BR> > <INPUT TYPE="password" NAME="newpassword" VALUE="" SIZE="10" > MAXLENGTH="15"> > <P> > <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"> > </FORM> > ... > > the TYPE="password" makes sure the browser doesn't echo the password as it > is typed but it is still sent to the web server as clear text. How do > folks deal with this issue? > > Thanks, > Bill > --- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello Philip, (PO == "Philip Olson") [EMAIL PROTECTED] forecasted: PO> http://www.php.net/tips.php PO> it will turn your browser into a search machine. Even better, for people who use EditPlus (sorry, unsure about other editors) you can do this with just one shortcut from within EditPlus itself. Since IE 5 is my primary browser: Follow the instructions on http://www.php.net/tips.php for adding the Quick Search add-on. (I named my shortcut php, but you could use anything you wanted.) Then in EditPlus, go to: Tools -> Configure User Tools Click on the 'Add Tool >>' button. Choose 'Program' from the pop-out. I named mine 'PHP Search' Command: C:\Program Files\Internet Explorer\Iexplore.exe Argument: php $(CurWord) (Where 'php' in the above is the same shortcut name you entered in IE Quicksearch) Initial Directory: leave it blank or you'll get the the 'Launch Window' MS-DOS box along with the browser. Click 'Apply' then 'OK' Now, when you need to consult the manual for a specific function (or heck, any term), just hit Ctrl+[number] where [number] is the shortcut displayed beside 'PHP Search' in the Tools menu. For example, if I placed my cursor right before the 'm' in: @mysql_pconnect($host, $username, $password) And hit Ctrl+6, it opens IE and takes me straight to: http://www.php.net/manual/en/function.mysql-pconnect.php For the 'Argument' line in 'Configure User Tools' you could also use php $(CurSel) but you'll have to highlight a word before you hit Ctrl+[number]. If you're not using IE, this should still be pretty easy to configure. If anyone can't get this to work, let me know off-list. I'll be glad to help. -Brian
Hi, Is there any way to do a stack crawl/trace when an error occurs? Today, I only get the line in the script in which the error occured, but I have to put on my Sherlock habit in order to find the actual sequence of avents that led up to the error.... Cheers, -Morten --------------------------------------------------------------- Coil AS http://www.coil.no Morten Lerskau Rønseth mailto:[EMAIL PROTECTED] Karenslyst Allé 16d Tlf.: (47) 2254 1820 0278 Oslo Fax : (47) 2254 1821 Norway Mob.: (47) 9343 4357 ICQ : 25163080