Re: [PHP] PHP vs. CGI
John Taylor-Johnston wrote: Three advantages I like: 1- no more cgiwrap. 2- thus I can work in any directory and am not bound to cgi-bin 'being bound to cgi-bin' is a function of how the server is set up, not 'cgi' itself. I've worked on systems where anything ending in .cgi was treated as a cgi script, regardless of directory location. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Objects: Cant set object variables with refrences ...
James wrote: However I would like refernce semantics and the final output of this script to be 1000. So I changed the line to "$this->t &= $c;" and suddenly I get the error: "Fatal error: Call to a member function on a non-object in /user/sh/jmb/Project/Wiki/Public_html/test.php on line 25" Anyone have any help on what is happening? $this->t = &$c; I dunno where &= comes from. I see people using it many times, but =& makes more sense imo. The & is 'by reference', and putting it explicitly in front of which variable is to be passed by reference *seems* more logical to me. Otherwise you could end up with $this->t &= $c.$d; What's being passed by reference at that point? Michael Kimsal http://www.phphelpdesk.com http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWIG CMS Part1
Kevin Waterson wrote: Well basically, Smarty is gay. Smarty supposedly will seperate code from content. but you have still need to markup to able to handle loops, conditions etc which puts code right back into the content. But it is Smarty code and not PHP code, where is the value in that? The pre-supposition is of course that html designers are idiots when what is really needed is to teach them some basics about PHP rather than introducing an entire new (Smarty) concept. Of course when you build an application with Smarty you get to use buzzwords like multi-tiered, but this slows you down. I'm no Smarty fan, but there are two aspects which are rarely, if ever (I'd say NEVER, but 'never say never'!) brought up in Smarty's defense. First - if you're dealing with multiple people on a project, having 'HTML' people use Smarty can prevent them from including random PHP code, which may email contents of forms to themselves, etc. The rebuttal to that (at our office) is that especially on projects that have multiple people, you should rarely have people putting stuff on a live server without peer review of some sort. Second - there's a POTENTIAL for Smarty (or any other template system) to be 'cross platform'. If you could reuse the same Smarty template across PHP, Perl, CF, Java, Python, TCL, whatever, it'd become a defacto standard. They aren't pushing this. There is one (ultimatetemplate.com I think) which has ASP and PHP parsers for the same template syntax system. Good idea, but not getting enough attention. It'd be one of the few reasons I'd recommend someone learning/using an external template system. The extensive use of regex within the application cannot be a good thing. The use of tags such as {foobar} could easily be replaced by or and most every thing else is easily handled with file_get_contents() include() or eval() I am not saying Smarty is a worthless piece of dog shit, quite, I just feel it create unneccessary overhead without delivering true seperation of code and content. The regexes are only done once per file, until it changes, as Smarty will take the 'original' version and translate it into native PHP calls then save that file. I'm not sure how it handles concurrency on new templates (possibility of race conditions?) but I tend to think most people getting their ire up over various template systems usually don't have sites with much traffic anyway. I may be wrong here - it's more of a hunch than anything else. Michael Kimsal http://www.logicreate.com <-- doesn't use Smarty :) 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MySQL/PHP Associative Array Insert
Chris Shiflett wrote: --- Cditty <[EMAIL PROTECTED]> wrote: A co-worker is teaching me to move to the next level in php. I have started using associative arrays for my scripts, but I am having a problem using them to do an insert into MySQL. Can someone give me an example of how to do an insert to the database using these arrays? My array is this...$item['itemID'] Using arrays is easy. For example: $sql = "insert into blah (foo) values('"; $sql .= $item['item_id']; $sql .= "')"; It isn't necessary for that to span three lines, but my mail client will annihilate it otherwise. Just use concatenation (.) to make things easy on yourself instead of embedding your variable in the string (possible with curly braces). Of course, if you want to do it the cool way (which is what your co-worker probably wants), look at Mr. Kimsal's example: (That's what I figured the co-worker was after, with the 'next level' bit) --- michael kimsal <[EMAIL PROTECTED]> wrote: The only problem here is that there is no table name, which is easily remedied. You probably want to pass the table name as another argument. Also, use "replace into" for an elegant way to insert the record if it does not exist (based on whether your where clause matches) or update the record if it does. Mr. Kimsal mentioned later in his explanation I believe. GOOD CALL - sorry - shouldn't have been trying to do that so late at night. :) You can eliminate the slashadd() function and the array_walk() call if you make sure your values are properly escaped. If magic_quotes is on, you definitely want to avoid the extra slashes, and it might be worth checking whether it is on in your script, so that you don't depend on any specific PHP configuration. Yeah, I was going to mention about that too, but I figured someone looking at the code might just assume that I hadn't thought about the slash issue. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Graphic Pie Charts
Vernon wrote: How do I create a graphic pie chart on the fly with PHP. I have already figured out how to get the variables from the database and so forth am just looking to create the graphics. Thanks If you have the GD libraries installed, you could use the jpgraph libraries - google for jpgraph (aditus.nu I think, but can't remember) Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL/PHP Associative Array Insert
Cditty wrote: A co-worker is teaching me to move to the next level in php. I have started using associative arrays for my scripts, but I am having a problem using them to do an insert into MySQL. Can someone give me an example of how to do an insert to the database using these arrays? My array is this...$item['itemID'] If you want to go up to even another level: Now all you need to do is pass more info to the $x array, and it'll make the insert SQL for you, including adding the slashes, and you don't need to worry about { } or where to put quotes and backslashes and all that crap. 1 column or 50 columns is absolutely no more work for you. Modify it just slightly some by using REPLACE with MySQL and you've got updates and inserts taken care of. PLUG: That's the sort of thing we get up to during our PHP Training Courses. More info at http://tapinternet.com/php Michael Kimsal http://phpappserver.com http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP3 Web Architecture Framework
Karthikeyan.Balasubramanian wrote: Hi, I browsed the web for many different web architecture and frameworks. I found many Interesting but all wants latest version of PHP at least PHP 4.0.6. I dont want to upgrade the PHP Version(4.0.5) that i have because many clients are using it and i dont want to mess it up. Its a Pain in PHP that to support any extension we need to recompile with appropriate extensions unlike Java where all you need to do is put the appropriate Jar files in the /Lib directory and it automatically gets SET in the classpath and works great but I do ADORE PHP for its ease and efficiency and ofcourse along with Apache it rocks. So please dont suggest me to upgrade my PHP or something other. Maybe you shouldn't publicly talk about how you and your clients are sticking with php4.0.5. It has known security holes, which is just one of many reasons to upgrade. You *will* spend much more time coding trying to make stuff work in PHP3 and early PHP4 than you will by taking advantage of relatively modern PHP4 versions. Session handling is something which comes to mind, and improved array handling. There will be things you can do in a few lines of code in recent versions of PHP4 that you simply won't be able to do at all, or not without *much* more work than it's worth. PHPGroupware.org *might* work for you. I know that there was a stated goal of their code working on PHP3 and PHP4 installations. I found that somewhat strange, but it was a goal. It may not be anymore. For *new* development, it doesn't make much sense to use the old stuff. If you're running older versions and people have apps that are running fine, that's another story, but even in those cases, the security exploits make it an unwise strategy for the long term. "Pear which ofcourse needed recompilation with Pear support" I don't think PEAR does require any recompilation. Certainly with most of the PEAR stuff you can just use the source code and it'll work fine. I would be very surprised if there wasn't at least SOME PEAR code which required PHP4.0.6 or higher. You don't need to recompile all of PHP, or at least you don't need to place the entire recompiled version of PHP into Apache again. You can usually compile "SO" files (shared object files) which you can dl() or put in php.ini. ./configure --with-gd=shared for example, will make a gd.so file suitable for dl() use. "So please dont suggest me to upgrade my PHP or something other." Sorry, if you get many responses, at least some will suggest you upgrade. This is like saying you drive a 6 year old car (equivalent in internet time!) and that you *won't* get a newer car (cause your passengers like the seats in the old car) but you want all the benefits of a new engine. The fact that the car has known safety hazards and that a new car is essentially free aren't supposed to factor in to this? True, your passengers may have to adjust to new seats, and they may not like those seats as much as the old ones, but they'll have a safer ride, and you'll have a new, more powerful engine. I just can't think of too many valid reasons to not be running at least PHP4.1.x, if not 4.2. 4.3 has only been out for a few weeks, and I don't expect too many people to be running that yet. Most *interesting* development work in PHP regarding frameworks involves people who are somewhat on the cutting edge, using recent technology. They are most likely not going to bother trying to support PHP4.0.5 and below. Good luck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoders and GPL License
Larry Brown wrote: I just want to clarify this for myself. My impression was that the affects of GPL requiring software developed from the original GPL to also be free was only applicable to modifications of the program itself. The GPL is a ridiculously outdated and vague license which has rarely been tested in any courts (if ever) and therefore there's no clearly established caselaw to base decision on. 'outdated'? 'vague'? GPL speaks of 'linking'. How is this to be defined? The GPL has language (linking, binary, compiler, kernel, etc) which is not something which even enters into the consideration of most developers who use scripting langauges (perl, php, python, etc). The GPL was written almost exclusively with C and similar languages in mind, although it's not explicitly stated anywhere. "derivative works" is not clearly defined. If I distribute a PHP script, is calling a 'wordwrap' function somehow 'linking' to the original PHP code? My program's functionality certainly depends on the wordwrap code functioning properly. Is it a 'work based on the Program'? The definition states that 'a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.' Whose copyright law? The original developer's? The 2nd generation developer's? Translated into another language is damn vague, imo. If I take the original wordwrap function code - in C - and translate that to Python, have I translated it to another language? I realize that the PHP code isn't GPL - I'm not speaking specifically to PHP, but to the GPL 'definition' of things. It's a shame so many people just write stuff and put it out under GPL without coming close to understanding the implications of the license, or the ambiguities. At some point, there will be larger legal cases which will invalidate some of the principles which developers though the GPL meant, but didn't really understand. So if php was GPL and I modified the source and built my own customized version of php I couldn't sell it but could only give it away, You can sell GPL software. Often there's not much point because you have to grant the right of redistribution to others, so the first person you sold it to would be able to redistribute the source code (because they're entitled to recieve the original source code), thereby being able to undermine your sales efforts. In practice, many people probably wouldn't bother redistributing something, but it would only take one person to do so to have the impact. Also, just because something is GPL doesn't require the original developers to give it away to everyone by setting up FTP servers and all that other stuff. All you're required to do is provide to source to someone who requests it, and you only have to do that if they got it from you. Example: I have a large system which I GPL. I distribute a binary to customers who purchase it. My only obligation is to provide source code to the customer upon request. At that point, THEY can recreate a binary from my source and sell that, but they would also then have to fulfill requests for the source (which they may not want to do). *I* do not have to fulfill requests for the source to anyone except those to whom I distribute/sell a binary version. That's really it. but if I used php to develop some other software that runs on php I could sell it without a problem. Similar to creating software that runs on Linux, the software can be sold but if I modify Linux itself and turn around and sell it, it would be against the license. Again, no, you can sell it, but you're obligated to provide the source to any purchser who requests it, and you can't then stop them from redistributing it. Any Linux kernel changes you made then 'sold' would either not sell at all, or would sell a couple copies then get rolled back in to the main tree of some distribution. Michael Kimsal PHP Training http://www.tapinternet.com/php 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ever complained about lousy PHP programmers?
Olinux wrote: I prefer single quotes on stuff that doesn't need to be parsed. In most cases this is more efficient, though probably not noticed except on a large scale. I also think it makes it easier to include html strings (because double quotes don't need to be escaped) and I find it easier to work my code in Homesite. echo ''.$something.' '.$something_else.''; rather than echo "$something $something_else"; Both the zend accelerator (lower price for small businesses now) and the ioncube system (free) optimize any minor double-quote performance out after the first run, so it should be a non-issue for more and more people. Additionally, as you mention, it's really only an issue on largescale system (or systems under heavy load). It's completely a comfortability issue - I personally find the double-quoted version easier both to read and to type. It's not my favorite use of time to do extra typing just to try to shave off 2 tenths of a millisecond for the processor - computers are here to make life easier (supposedly!) :0 Michael Kimsal LogiCreate http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Source Guardian
Sean Malloy wrote: Keep in mind the "Works out of the box with no changes to your server" requires the use of the function dl() Good point - had forgotten that may have issues for some people. However - in our case we've used 'protected' versions only for demos, which people generally aren't running on production machines, but local development environments, so issues of crashing or 'safe_mode' and other issues have usually been of limited concern. But it is a good point nonetheless, and isn't just a strike against SG, but ioncube as well should the user not be able to edit the php.ini file. according to the PHP docs; dl() is not supported in multithreaded Web servers. Use the extensions statement in your php.ini when operating under such an environment. However, the CGI and CLI build are not affected ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestions on FAQ application?
Jeff Lewis wrote: Why re-invent what is already written? I'm well aware that it's easy to write but there may be something out there already that suits my needs and has some features that I hadn't thought of. If you don't have a suggestion on a package please spare me the rude replies which seem to run rampant on here lately... I've checked Hotscripts and I can't findanything relatively new or that suits my needs. I was wondering if anyone uses a FAQ program that they could suggest? Are you looking for something new, or something which suits your needs? Not trying to flame here, but I didn't understand the sentence. I think what the other poster was getting at is that if you searched and can't find anything that meets your needs, do go ahead and write your own tool. Yes, re-inventing the wheel isn't the best idea, but your 'wheel' (what you want the app to be) doesn't exist, based on your own searching. If you'd searched Lycos for 30 seconds, I'd say search again. If you've exhausted HotScripts, I'd say you've gone thru the majority of known systems - certainly systems that had authors who were interested enough to bother to register them in the first place. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Source Guardian
Christopher Ditty wrote: Does anyone here use Source Guardian? I am about to purchase it and thought I'd ask before I do. Any problems using it? Thanks CDitty Hello. We've used it to create demos. It does work, but is being surpassed by other options (at the time we purchased, it was the cheapest option, but it's not anymore). They seem to have updated their site some - $150 for 'just' the obfuscator is a bit much, and the obfuscation portion was, I thought, pretty poor. If you relied at all on globals, or ever used 'extract' on arrays coming from form input, it was useless. We don't rely on globals, but we do rely on form array extraction sometimes - completely wasted when the system would 'obfuscate' your code. Reason being: echo $myName; ?> becomes echo $uu7whfdsisdf; ?> But if you've got a form with You can't do extract($_POST['foo']); echo $bar; ?> and expect it to work, because the obfuscation will turn it into: extract($_POST['foo']); echo $uu7whfdsisdf; ?> I wrote them and told them it was fairly pointless, atleast for systems large/advanced enough that you'd consider wanting to protect them in the first place. They didn't seem to have much on their site before about how to get new .so and .dll files for newer versions of PHP (they bundle .so and .dll files for each version of PHP - 4.1.0, 4.1.1, etc). Also, the support for working 'out of the box' with no need to fiddle with the php.ini file was useful. Ioncube's encoder answer requires your users to install the appropriate .so or .dll file in a particular directory, or to edit php.ini - not as useful for giving out demos. Ioncube is making an effort to move in that 'ease of use' direction, but it doesn't seem to be there just yet. Having said that, the ioncube answer offers a greater level of security for the encrypted code - the sourceguardian stuff is, last I checked, 'just' encrypted source code. zend and ioncube package encrypted byte code. If someone decrypts zend-encoded files, they'll only get bytecode. If they decrypt sourceguardian code, they get the original code. This was how it was last summer - they may have upgraded since then. All in all, it's not bad. That the files now can be run on Windows servers is a plus, but lack of a command line version to allow for dynamic encryption from a server isn't all that good. If you *need* that, you'll need to find something else. Why? The 'time limiting' aspect, for starters - you can set a 'timeout' for a particular date. Unless you put up a new trial file on a site every day, you won't be able to offer '14 day' trials, for a start. The file will timeout on date X, regardless of when the user downloaded it. The Zend license manager is much more flexible in that regard, but is overkill for most smaller projects. Does this help at all? Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: something annoying about includes/relative paths.
Sean Malloy wrote: Moving to PHP from an ASP backgroun, I always found one thing really annoying about PHP. With ASP, you could have a file structure such as: SYSTEM |--HTML | |--header.asp | |--LOGIC | |--engine.asp | |--core.asp in default.asp, you would in core.asp, engine.asp would be included as such in engine.asp, header.asp would be included as such Its a bad example. However, it demonstrates that the relative path for each include changed depending on what file was being included. PHP doesn't do that. Which is kind of annoying, but you get used to it.. But I've come up with a work around. htdocs/index.php include('./system/core.php'); htdocs/system/core.php define('CORE_PATH', str_replace('core.php', '', __FILE__)); include(CORE_PATH.'logic/engine.php'); htdocs/system/logic/engine.php include(CORE_PATH.'html/header.php'); and so on and so forth. searching for __FILE__, and removing the filename from the output, gives you a sort of relative path hack. Hope someone finds that useful You could also simply use the $DOCUMENT_ROOT variable prepopulated for you ($_SERVER['DOCUMENT_ROOT'] perhaps?) and base your includes relative to that. Michael Kimsal http://www.phpappserver.com/ 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Medium to Large PHP Application Design
Nick Oostveen wrote: As PHP becomes more accepted in the corporate world, it is only logical that larger and more complex applications are going to be developed using it. While there is an abundance of information out there about making specific things work, there seems to be a shortage regarding the big picture. As such, my question is this: What methods and techniques can be used to help design and build complex, medium to large PHP applications that are not only scalable, but maintainable and extensible? I'm looking for online references, personal experience and opinion and even examples of open source code which you think demonstrate the above criteria on this one. I think an extended discussion on this topic could be of great benefit to everyone. Obviously separating application and business logic from interface code is a given, but what about other things? Are the object orientated facilities of PHP currently worth really trying to take advantage of? If so, what are you doing to take advantage of them? Are design concepts such as design patterns relevant at this level? What frameworks, if any, currently exist to assist in rapid, structured development, and what specific benefits do they bring to the table? These are just some of the questions that I'd like to see expanded upon, I'm sure there are others out there who can add more to the list. Nick Oostveen Hello Mr. Oostveen: Is that the same hpmarketing.com that had someone named 'jozef' at it? The domain name looks familiar - like I've seen it in online chats before. Anywho... Are you only looking for 'open source' (GPL/BSD/etc) frameworks? If not, I'd encourage you to take a look at http://www.logicreate.com/index.php/html/main/developer1.html for a quick overview of our product - feel free to email back or call if you've any questions. Now, in general, yes, it's certainly worth thinking about design patterns at this level (whatever 'this' is). There's very few situations where thinking like that *isn't* helpful. Preplanning code projects, coming up with a structure, and other 'niceties' become essential as projects grow and mature to help manage the inevitable complexities which arise. These complexities stem not just from the management of the code itself, but from the growing number of contributors and/or end users whc will be affected by the project as it becomes larger and/or more important. There's some discussion about topics of scalability, design patterns, and other similar topics on many websites, but not much on the group here itself. I'd suggest having a look at http://www.phppatterns.com for a start. Interesting related tools I came across recently: Umbrello and Microgold.com's UML program. Umbrello (uml.sourceforge.net) is a KDE app, and microgold is a windows app. The microgold, while about $200 (I think ) has the added ability to take preexisting classes and attempt to reverse them into UML diagrams, suitable for giving newcomers to a project a good starting point for understanding a project. Of course, UML is just one facet of a project's development, which isn't even that widely embraced in most circles, but it's becoming quite common in other circles. Hope that helps some. Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Connection pool extension?
Vinod Panicker wrote: Hi, Thanks for the quick response - I am aware of PHP's support for sockets, but since I cant store persistent connection information in a PHP script I was looking out for a module Tx, Vinod. --- Vinod Panicker <[EMAIL PROTECTED]> Sr. Software Designer Geodesic Information Systems Ltd. -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 1:00 PM To: 'Vinod Panicker'; [EMAIL PROTECTED] Subject: RE: [PHP] Connection pool extension? PHP supports sockets check out: http://www.php.net/manual/en/ref.sockets.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Vinod Panicker [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 5:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Connection pool extension? Hi, I was wondering if there is a php extension available that allows me to do the following - 1. Connect to a given IP address and port 2. Allow me to send and receive data from a particular ip and port 3. Pool the connections so that further requests to the given ip and port will reuse the existing connection Tx, Vinod. --- Vinod Panicker <[EMAIL PROTECTED]> Sr. Software Designer Geodesic Information Systems Ltd. Vinod, Look for 'SRM' - VL-SRM I think it is. It's a separate daemon that has specific PHP functions to allow PHP to talk to it - it'll hold connections open for you automatically. Michael Kimsal http://www.tapinternet.com/php PHP Training Courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Securing areas of a web site with PHP
Jean-Christian Imbeault wrote: I'll try this out and see what I get. Though I have read that not all browsers follow cache-control directives ... Exactly - and some don't follow other HTTP header directives to the letter either. You will not be able to 'secure' this stuff 100% simply because you only control 50% of the environment (the server, not the client). The cache-control stuff people have already replied is good, but realize nothing's 100%. You also can't prevent someone from taking a snapshot of the page, or control who sees a piece of paper with the information printed on it either. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php app frameworks?
Jason Sheets wrote: If you go to www.hotscripts.com they have several PHP application frameworks listed. I've investigated PHPLIB, and horde (http://www.horde.org) but wound up creating my own framework because I have not yet found a well documented framework that does what I need it to do. What were you looking for that you couldn't find in other products/projects? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP support...
Peter Lavender wrote: OK this is lame, but I'm posting a reply straight after the message hits my box... I'm running debian and have apt-get php and openldap. openldap works, as does php. I'm now working with the ldap functions and here is where I'm stuck. apt-cache search php4 what turns up? php4-ldap I've installed the package, restarted apache but still not joy.. :( Pete I'd suggest posting this to a debian group as well - perhaps first next time if there's another problem. They don't like people dispelling the 'apt-get install solves it all' myth in non-debian circles. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Good program to indent large quantity of files?
Leif K-Brooks wrote: I haven't been indenting any of my code, but I want to start indenting to make the code more readable. It would be near-impossible for me to manually indent what's already there, though. So, I'm looking for a program to indent an entire folder of PHP files at once. Any suggestions? phpedit.com (I believe) has a 'code beautifier' program which will take existing files and make them 'pretty' (indented, etc) Not sure if it can do things in batches or not, but still faster than doing things manually. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Training Courses in PHP & MySQL
Ben C . wrote: Does anyone know where I can get a good training course in both PHP and MySQL that would make me proficient? Or does anyone know of a good tutor? I would prefer it to be in California or on the west coast. Please provide your comments. I'd neglected to mention that with our courses, students get a free Zend Studio, and free snacks and lunch. Little things, true, but they mean a lot to some people. :0 Michael Kimsal http://www.tapinternet.com/php 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Training Courses in PHP & MySQL
Ben C . wrote: Does anyone know where I can get a good training course in both PHP and MySQL that would make me proficient? Or does anyone know of a good tutor? I would prefer it to be in California or on the west coast. Please provide your comments. Hello Ben: We offer PHP/MySQL training courses - currently in Detroit/Chicago, but we're planning others in Texas and later California. More info can be found at http://www.tapinternet.com/php. We've recently partnered with Zend and are looking to expand our classes into various other markets. If you're serious about learning PHP, give me a call or drop me an email at [EMAIL PROTECTED] Our next class is in January in Detroit, but we may still be able to convince you to come out here anyway! :) I can be reached at 734-480-9961, or 1-866-745-3660 (toll free). I look forward to hearing from you. Michael Kimsal http://www.tapinternet.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib
Bogomil Shopov wrote: hi folks Is there any way to include in PDF file .gif file with more than 8 colors? Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil No, there's no *standard* way. I dare say that PDFlib itself could be hacked to accomodate things differently, but that's a PDFlib issue itself, not PHP's issue. If you have the option, PNGs might be better in this situation because they can be greater than 8 bits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session: I RTFM
Marco Tabini wrote: Single quotes are normal strings. Double quotes are strings in which substitutions can take place. For example: Double quotes also expand escape strings (e.g."\n") whereas single quotes don't. However, in a case like this: -- What is the difference between: $familyname = getvar("familyname"); and $familyname = getvar('familyname'); -- There's no effective difference. :) Good magazine Marco - keep it up! Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session: I RTFM
Instead of while(list($k,$v)=each($_POST)){ $_SESSION[$k]=$v; //echo "_name_ ".stripslashes($k)." _value_ ".stripslashes($v).""; } why not just $_SESSION = array_merge($_SESSION,$_POST); ??? Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Performance issues
Karel wrote: I'm having a lot of trouble with loading times... Let me explain in detail: I've a full & huge coded website based upon a mysql database... mysql entries: at least 2M php code: at least 1M lines (longest file about 25k, without includes) about 2 months ago we resetted the entire database and reworked a part of the code (nothing really essential). And now we are experiencing a really heavy load on the server. (no root access, but we think it's PHP). What reasons could there be for that? BTW if I was pretty unclear about what I said in here, please ask... I know my english ain't that well ;) My company can perform a detailed analysis of your site, isolating the specific weak points regarding performance, with specific recommendations about what to improve. This could be a code issue, or a database issue, or a combination, but you probably won't be able to get a solid answer by doing 'back and forth' over the newsgroups with various people, however well-intentioned. If you're serious about getting this issue resolved, please contact us - we will need access to your code, database, and server account. We have a standard NDA, or will work within NDA terms you provide. We've done this before with good results, and will be happy to work with you on your issues. -- Michael Kimsal http://www.tapinternet.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms
Beauford.2002 wrote: John Mary John Mary Maybe you just had a typo before? Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it! 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: C#
Wilmar Perez wrote: Hello guys I'm sorry if this message disturbs anyone, I know it is completely off topic. I've been thinking about open a C# mailing list for I hadn't been able to find a good one so far. All I want to know is if there is enough people out there interested in joining such list. I posted this message to this list for a couple of reason: it is the only programming list I am in and since you're php developers I thought many of you may be interested. Again please don't get mad at me for this I don't mean to upset or disturb anyone. Sr. Perez: Please visit aspfriends.com (I think that's it) or learnasp.com. There are links there to many c# and other .net-related lists and boards. Good luck. Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Done w/ PHP - VB or C# ?
Miguel Cruz wrote: >>As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much), >>I'd have to say that you could definitely at least read a directory's >>contents without having to purchase external libraries. Please don't >>go overboard. > > > It's been a while, but I remember that it was impossible to create a > functional directory browser with off-the-shelf ASP functionality. The > file component was categorically unwilling to follow mounted shares until > we got some extra add-in. This was after a month of debate in newsgroup > microsoft.public.this.that.the-other-thing, and plenty of experimentation > during which I discovered, reported, and was contacted by MS engineers > about more bugs than I've ever encountered in PHP. This isn't specifically ASP, but NT permissions in general. PHP running under "off the shelf" Windows can't access shares either. > > I don't think it's a bad thing that they see a niche and try to fill it. I > think it's a bad thing from the web developer's perspective that there are > so many unfilled niches. > > Furthermore, in contrast to the PHP/Open Source world I find the > profiteering got annoying after a while. It was a drag just having to fill > out a P.O. every week to buy another ridiculous little thing that may or > may not be production-quality and had a no-refund policy. > > And the fact is, most of those little companies provide wretched > documentation and support, and there is no real onlne user community in > the Windows world to exchange information with. Well, there are lots of > users, but the ratio of crap-to-usefulness in the fora is so high that > finding information is painful at best. > Honestly, I find that now in the PHP community as well, to a larger extent than I used to, but perhaps it's because I/we aren't in the 'sessions v cookies' mentality anymore. Compiling GD support, for one, is a pain in the ass which you can't get really get good support for, due to the variety of systems. Servlet support as well. Java support has gotten better, but it generally just magically happens. I don't think I've had too many deep technical issues that have been resolved with help from the PHP community. Not because they're 'lesser' people, but we're trying to do stuff that most people don't do. It'd be like trying to get JScript support at an ASP site. Yeah, JScript works with ASP, but no one really uses it much, compared to VBScript. > >> >>Where the heck did you read that? Do you know what .NET is? > > > Slashdot. And no, to be honest. :) Great answer. Honestly. > > >>There's a lot of interesting concepts in the .NET codebase out there now >>(ASP.NET webforms, for example) as well as other platforms (Java springs >>to mind). Just because it's "not PHP" shouldn't mean you ignore it or >>worse yet, publicly denigrate it. > > > Public denigration of what I don't understand is how I strike out at a > callous world that's denied me my just deserts: fame, millions, and a > torrid love affair with Nancy Reagan. Either address the fundamental > injustice here or cut me some slack. > Not sure how old you are or when you had this thing for Nancy - never been 'fanciable' since I've known her (but maybe I'm too much of a youngster). Michael Kimsal http://www.logicreate.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Done w/ PHP - VB or C# ?
Miguel Cruz wrote: > > all the power of DOS batchfiles. Every single thing you want to do - even > basic filesystem operations like working with directories and file > permissions!!! - requires purchasing expensive and buggy .COM components > from nasty little companies with horrible documentation and nonexistent > customer service. I consider it an incredibly developer-hostile > environment (unless you're in the business of developing developer tools, > which seems to be the lynchpin of the ASP ponzi scheme). As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much), I'd have to say that you could definitely at least read a directory's contents without having to purchase external libraries. Please don't go overboard. Wouldn't it be cool if you didn't have to be a C programmer to write PHP extensions that you could distribute to others (whether for profit or not)? I certainly think so, but it's currently not possible right now. All those "nasty little companies" you mention are making some money because they can program VB, wrap up stuff as DLLs, and sell them. They see a need in the ASP community and address it, while being able to make some money too. What a novel concept! > > Your choices are your own, but it's always seemed to me that it makes more > sense to be focus on being really good at something fun, than to spread > out to things that every other loser is already doing. It's all perspective. I'm not saying everyone who does PHP is a loser, but I have met more than a few losers who happen to work in PHP. Same with every other language. > Insofar as it can > be said about a programming language, PHP is actually fun - in a way that > only Perl seems to match (though Perl is certainly a more frustrating kind > of fun). > > As for .NET, I thought I just read that Microsoft was pulling everything > in for a rethink because of all the negative reactions it was getting. Where the heck did you read that? Do you know what .NET is? Glad that you do, because most other people don't - there really isn't a good definition, so it's hard to say someone 'pulled everything in'. What MS has done is retarget the 'hailstorm' service to corporate intranets looking to do internal authentication as opposed to a public authentication system. Hardly retracting .NET from the scene. There's a lot of interesting concepts in the .NET codebase out there now (ASP.NET webforms, for example) as well as other platforms (Java springs to mind). Just because it's "not PHP" shouldn't mean you ignore it or worse yet, publicly denigrate it. Michael Kimsal http://www.logicreate.com/ 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Done w/ PHP - VB or C# ?
Phil Schwarzmann wrote: > I know I'll get mauled big-time on this mailing list but I'm thinking > about putting PHP on hold for a while and learning ASP.NET > > I love PHP and open-source computing but if one wants to get a job in > web development, you'll have a much better time find a job with both PHP > and ASP (among others) skills. Funny, I don't know many ASP developers who are all that eager to learn other technologies. I also don't see that many Java developers jumping up and down to say "gosh, I gotta go learn perl or I won't be able to get a job". That's not to say your prospects might not be a bit brighter in terms of sheer financial gain hitching onto the MS bandwagon - they're big, have name recognition, and it's often an easy sale. But don't assume that you need 10 languages under your belt. It helps, but it most likely won't instantly get you better results. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cool PHP Tricks/Features ?
Danny Shepherd wrote: > No, that's not a problem either! > > > Before ob_gzhandler() actually sends compressed data, it determines what > type of content encoding the browser will accept ("gzip", "deflate" or none > at all) and will return it's output accordingly. All browsers are supported > since it's up to the browser to send the correct header saying that it > accepts compressed web pages. > > It is a problem if you're bothering to support NS4 users, because they can't handle it properly. NS has a useful habit of re-requesting a 'page' from the server under many conditions (used to be even when resizing the window). Currently, the browser will issue another GET against the same URL, even if the page had been POSTed. It will not bring back the same info, so VIEWSOURCE and PRINTing are already messed up. But even PRINTing a regular page that is gzipped is hosed, because NS tells the server it can handle zipped data, but it doesn't unzip before printing, so you'll be printing out compressed data to your printer. Don't even bother flaming me about x% of your users still use NS4 and it's a great browser and IE sucks etc. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cool PHP Tricks/Features ?
George Whiffen wrote: > > 1. My biggest concern is the slowest user i.e. at the end of a modem > on the other side of the planet. I thought they would almost certainly > have modem compression so doing our own compression doesn't > really help them at all i.e. actual download speeds stay the same, it's > just we/they do the work rather than the modems. > Have you tried it? > In summary, I can't agree more that all pages should be compressed, > but don't feel it should be our job. Maybe I'm wrong and this is another > case of the poor old application developer having to do all the * work, > just because the rest of the computing industry is too busy counting its > profits to do its own job properly ;). Apache isn't making any profits directly from its technology, but there is a mod_gzip module for Apache. Why is it so hard to put in *one line* of code (probably in an include file?) Why do you consider this "all the work"? You probably spend more time fiddling with TABLE CELLPADDING than you would on putting this line in one place, but you seem to think it's *another burden*. I look at it the other way - I love having more things under my control, and regardless of whether a webserver has configured outgoing compression or not, I can control it. > > > What's everyone else think? > See above. :) Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Compatiblity: Zend-1.20 + PHP4.2.1
David J Jackson wrote: > Is my hosting company trying to "pull the wool over my eyes"? > There response to upgrading to 4.2.1, was that it isn't > compatible with Zind optomizer 1.20? > > The only *issue* I seen with 4.2.x is of course register_globals! > (which of course be changed in php.ini) > I don't have a problem with them holding off, but I do have a > problem with them trying to "blow smoke up my ***". > Dunno for certain, but it's entirely possible. If you followed the ZO stuff, you'll notice that it's pretty picky about what versions it works with. IIRC, it didn't used to be uncommon for the ZO to lag at least a few days behind PHP releases, and I wouldn't be surprised if that's still the case. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: css sheets in designs
Dennis Gearon wrote: > CSS sheets have to be in the document root somewhere, don't they? > > I'm trying to move as much, or at least what I consider security > related, from the phpnuke in the document root to a directory outside of > the document root. In our experience it's better to just have the HTML pages link to the style sheet files, and keep them in a directory that is publicly accessible. If your CSS files are large, you'll notice a reduction in bandwidth because most browsers will do another request, get a 304 from the server, and not have to download anything else. Same goes for javascript ".js" files. I noticed a site the other day that was over 80k to download. 38k was javascript and stylesheet stuff that was being reloaded on every page request. Bandwidth reduction by 50% wouldn't have been hard for them. Granted most people aren't worried about bandwidth costs, but a 50% reduction is page loading speed is something more people seem to notice. Michael Kimsal http://www.logicreate.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unhandled exception processing the ISAPI
Keith Ay wrote: > Hi all, I got a problem when using PHP > > Server: win2000(sp2) > Version: 4.2.0 > Application use: ODBC, sessions, oci8, oracle. > > I tried PHP ISAPI version (4.2.0) > I am using generic client socket(i.e. fsockopen()) to communicate with a > server. It work fine at the begin, but I found that if the server > suddenly shutdown. The follow error > occur: > > The HTTP server encountered an unhandled exception while processing the > ISAPI Application ' > php4ts!zend_strndup + 0x2B > + 0xA05E5983 > > and I have to reboot the system because IIS won't work!!! > > Would u please give me some help or advice? thx!!!! > This may seem a bit harsh, but don't use the ISAPI version. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Debugger
Rasmus Lerdorf wrote: > That's just not the case. The debugger in PHP 3 would not work at all in > PHP 4 and would need a complete rewrite. So, being cynical you might say > that someone should have written a debugger for PHP 4 and the fact that > nobody did was the conspiracy, but it makes no sense to say it was removed > for conspiracy reasons. I mean if the PHP 3 debugging code worked with > PHP 4, then you could just take the code from PHP 3 and use it. It's not > like it is deleted from CVS. > I'll stand corrected on that. I'd not looked at the code closely enough to know if there were major compatibility problems. Are there any movements to get things like the stack trace module and the Russian dbg debugger module into the standard PHP distribution? If there was at least some links on the PHP.net site, that would help people to know they're available. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: To all who replied to :Newbie question to everybody...PHP
R wrote: > Hey Guys, > I thank each and everyone one of you who replied, yeah, i got flamed a > couple of times from some of you for the "sleep" bit but need i remind you > that i am a newbie? You didn't get flamed because you're a newbie, you got flamed because it appeared you didn't do ANY research at all - you have a book but didn't seem to read it (I'd guess there's at least a mention of it there) but more importantly you didn't seem to even hit a basic search engine. Search google.com or the php.net site for 'sleep' and you'd have gotten exactly what you were looking for. You may have well asked if PHP has a way to do something "if" a condition is true. Abstract issues about arrays are a bit harder to get across in a search engine, because you're not looking for syntax but perhaps more a tutorial (I'd guess searching for 'php array tutorial' would net you exactly what you want though too). Use search engines first - you're bounch to find exactly what you're looking for in a fraction of a time it takes people multiple people to read and respond, then for you to get those responses. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Debugger
Jose Leon wrote: > > It would be nice that php itself incoporates a system to debug php > programs, like in PHP 3, in that way a development tool for php would > be enabled to debug modifying the php.ini with debug.enabled=true and > listening to a port. The system will work on any php distribution > because will be part of php itself. Why the debugger was removed from > PHP 3? I think it's pretty obvious it was removed during the PHP4 development so that Zend would have a 'value add' to sell later. That's the cynical part of me answering, obviously, and I've never heard an answer one way or another why it was removed, but the timing seems pretty remarkable. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Getting PHP on FreeBSD to talk to MSSQL Server 7...
Glenn Sieb wrote: > Hi.. it's me again :) > > We have a few different servers here, most of which are FreeBSD, > including our internal web server (Apache 1.3.24). We have PHP 4.2.0 > installed as well. > > Currently I'm running my MSSQL query scripts on a Win2k webserver, as I > can't seem to get PHP to talk to MSSQL on the FreeBSD side. I'd really > prefer to have my PHP scripts all running on the FreeBSD side, rather > than on Win2k. > > We do have Perl able to talk to the MSSQL server using FreeTDS and the > DBI::Sybase package on the same FreeBSD machine. > > My ./configure: > > ./configure --prefix=/usr/local > --with-apache=/home/src/Apache/Apachetoolbox > -1.5.56/apache_1.3.24 --enable-exif --enable-track-vars > --with-calendar=shared - > -enable-safe-mode --enable-magic-quotes --enable-trans-sid --enable-wddx > --enabl > e-ftp --with-gd=/usr/local --with-zlib --enable-gd-native-tt > --with-t1lib=/usr/l > ocal --with-jpeg-dir=/usr/local --with-png-dir=/usr/local > --with-zlib-dir=/usr - > -with-ttf --with-freetype-dir=/usr/local > --with-unixodbc=/usr/local/unixODBC --w > ith-openssl=/usr/local --with-curl=/usr/local --enable-apc > --with-mysql=/sw/mysq > l --with-mssql=/usr/local/etc/freetds --with-sybase=/usr/local/etc/freetds > > (built using ApacheToolbox, 1.5.56) > > FreeTDS' interfaces file is located in /usr/local/etc/freetds, which it > is/was my understanding that this is what's supposed to be there. Yet > not only does PHP give me: the --with-sybase= line needs to point to where freetds was compiled, not the interfaces file. We don't use the interfaces file, which seems to be primarily a way to map names to IPs. We just use the IP address directly in the mssql_connect() functions and it works. Michael Kimsal http://www.phphelpdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Training Course announcement
Good afternoon, We are currently taking sign-ups for our June 17th-21st 2002 week long PHP training course. If you feel you can make this course or if you would like to register for this session please register on our web site at: http://tapinternet.com/index.php/html/main/php-training-register.html The course is held in Ypsilanti, Michigan at the Eagle Crest Resort (http://www.eaglecrestresort.com). Pricing for the course is $2500 (discounts available to non-profit, government and educational institutions). Currently this is the only place we offer training but we do offer corporate on-site training for companies wishing to train more than one employee. More about our corporate training can be found here: http://tapinternet.com/index.php/html/main/php-training-corporate.html Thank you and I look forward to hearing from you if you can attend this session or require further information. -- Michael Kimsal Tap Internet, Inc. (734) 482-1371 Toll Free 1-866-745-3660 http://www.logicreate.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP compared to JSP
Ilia A. wrote: > Caching is not going against PHP as long as whenever the file is changed of > the 1st access it would be cached, rather then caching php scripts based on > some arbitrary timer. > > Ideally the caching script would on the 1st access of the script convert the > script to binary code which can then be executed right away without needing > to pass through an interpreter. Just like you would run a compiled C program. > I suspect such caching solution would greatly boost the speed of any PHP > page. Unfortunately, as far as I know no current PHP caching solution does > this. > It's not PHP's place to do this. Currently, it would be Zend's place to do this, as they have somewhat of a monopoly on the PHP engine. Obviously not a "monopoly" like, well, MS, but there's not any notable support or demand for alternative PHP engines. Current caches cache the zend 'opcodes' (as far as I can tell), and the Zend engine translates to machine code during execution. If anything was to do this, that's the place where it would/should happen. I'd read about someone planning a PHP -> C compiler, but haven't seen anything on it yet. This might alleviate speed problems for people (although it would introduce a longer write/compile/test cycle). Michael Kimsal http://www.logicreate.com/ 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if cant use header what should i use? or how to do this?
Mantas Kriauciunas wrote: because i have lots of outputs before it..and i need them all..so..what should i do? If you need them, why are you redirecting away from them? You can't 'need' to display something and simultaneously 'need' to redirect away from that same something. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP vs JSP
Paras Mukadam wrote: > Dear all, > How is PHP similar to / different than JSP ? I mean, in JSP the page is > compiled the first time it runs on the web-browser, then the next time it > finds the .class file and just runs it. i.e. the compiling is "just" the > first time !! How does it work in PHP? Does PHP has any way to figure out > whether it's first time ? that is does PHP compile .php file to some > .compiled_php type and then it gives the output ? > If you're using the Zend Accelerator, or PHPA from php-accelerator.co.uk, or APC from apc.communityconnect.com or bware from someone else (sorry, can't remember the URL) then the PHP process would only compile the first time and store the bytecode for execution on subsequent requests. 18 months ago, eweek did a ecommerce store benchmark comparison between CF, ASP, JSP and PHP. JSP, at the time, got 13 page requests per second. PHP had 47. PHP was NOT using any caching technology in that benchmark, but presumably JSP was. No doubt the JSP engine (Tomcat in that demo) has improved, but I would suggest PHP has improved as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure user authentication
Pedro Pontes wrote: > Hi Jon, > > I am considering doing that because any user can create a simple PHP script > with his/her object with the authenticated flag set to "authorized", > register that object with the session and then link to any of my pages, > which if they don't make any kind of password test, they will unsuspectly > accept the intrusion. > > What kind of test do you do in each of your pages? I just test if there is a > user object registered and if its type (group), set upon successfully login, > is allowed in the specified page. But if I create a separate script that > just creates a simmilar object (with the same fields), artificially > attribute a group and login to it, register it with the session and then > link to any of my pages (without passing through the login page), they won't > suspect that the access rights were forged. > What I can't figure out is why you're allowing people to just randomly put pages on your server. If someone was to randomly register a similar user object, etc - why bother? If I can put pages on your server and execute them, I'd do some something far more malicious than just pretend I'm "user X". Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best BBS
Austin Marshall wrote: > > To bring balance in the force, there is www.phpbb2.org. It has a few > arguments of why it is BAAADDD... I know i will never use phpbb2 > It's a pretty lame page/site that amounts to someone whining about the fact that 1. The phpbb website looks good, therefore they must have crap code and 2. They have a lot of includes/requires/constants and if/else If it's truly poor code, and the guy wants to criticize, then post some code samples and point out WHY it's bad. Personally, I agree - I had to do a bit of work with someone else's phpbb site a few weeks ago and thought it was a horrible mishmash of code/html. But I'm not going to post a whole website about how bad it is unless without giving specific examples. :) Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lookin for a Menuing System...
Mark Charette wrote: >-Original Message- >From: michael kimsal [mailto:[EMAIL PROTECTED]] > > >Similarly, can someone point me to a company that specifically disables >javascript as 'corporate policy'? >Ford, General Motors, and Chrysler specifically disallow running of >JavaScript, Java, and ActiveX via browsers on any computers connected to the >Internet. > > Seems kinda silly then that GM and Ford (didn't check dcx) would rely so heavily on javascript and fancy crap on their own public websites. Perhaps none of their tens of thousands of workers is allowed to view their website - or maybe you mean they reserve it separately on the inside. >IBM recommends that all scripting services be turned off but does not >disallow it. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lookin for a Menuing System...
Miguel Cruz wrote: >On Mon, 29 Apr 2002, michael kimsal wrote: > > >>Miguel Cruz wrote: >> >> >>>But take care - using JavaScript for site navigation is tricky business. >>>Some people don't use it, some people can't use it (not supported by their >>>browsers / hardware / corporate policy), and search engines certainly >>>won't follow those links. >>> >>> >>Can someone point me to hardware that is still in active use that can't >>handle javascript? >> >> > >Palm Pilot >Cell phones > > Those don't generally support HTML either, but some WML or something similar. Palm's proxy service for the palm vii would translate HTML on the fly to its own markup language. Call me crazy, but I have this funny feeling most people doing the kind of projects where javascript menus are even a consideration aren't also doing cell phone work. >WebTV >Lots of public internet kiosks > > I don't think I've seen a kiosk in the past 2 years that, if it allowed public browsing, didn't allow javascript. The only time it appears to be non-functioning is in 'locked down' kiosks, and at that point I can't tell if javascript is 'disabled' or if the designers simply didn't use it (moot point at that stage anyway). > > >>Similarly, can someone point me to a company that specifically disables >>javascript as 'corporate policy'? Back in 96-97, the 'no javascript' >>argument held, and probably holds today some if you're targetting >>handhelds and other 'non standard' devices. But if someone specifically >>disables Javascript these days, a good portion of their web experience >>will not be as robust as it would otherwise be, and they probably won't >>notice that using your site is any worse than any other site. >> >> > >I've done consulting in bank and government offices where application >proxies filtered out JavaScript. Given its frequent role as an attack >vector, this struck me as only the tiniest bit paranoid. > > More than a tiny bit, imo. Any 'attack' worth its salt has been through outlook - people should spend more time filtering email with VB attachments than "javascript" in html pages. >Go to any of the truly major sites, the ones that depend on getting large >numbers of people in and have mastered the art of doing it gracefully, and >you'll see that they don't depend on JavaScript. Even Microsoft's own >MSNBC.com works fine without it. Likewise Yahoo, CNN, eBay, Amazon, etc. > > I'm more than aware of the approach of large players. I was not advocating using JS exclusively to the point of not working without it, but it seemed the advice was 'don't use it at all'. That's what I was getting from it before. MSDN, on the other hand, pretty much demands "latest IE" only or else nothing works - their prerogative to do so, I guess. > > >>IMO, it's now like targetting only websafe colors because some people >>might only browse in 256 colors. If they do that, about 80% of the >>web's content will look like crap anyway, and they won't specifically >>think my stuff looks all that much worse than anyone else's. >> >> > >With current versions of Netscape and Mac browsers, I frequently see areas >of flat (HTML-specified) color not matching non-web-safe GIF and JPEG >colors. This creates unsightly seams (like not wearing a panty-liner, I >guess). > > PNGs cause more problem, ime, than anything else because IE doesn't render them properly. BTW, did you mean 'current version' of NS as '4.7x' or '6.x'. Just curious what people mean by 'current' NS these days. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lookin for a Menuing System...
Miguel Cruz wrote: >> >>Do it in JavaScript, it works and it's client side so it will be >>faster. > > > But take care - using JavaScript for site navigation is tricky business. > Some people don't use it, some people can't use it (not supported by their > browsers / hardware / corporate policy), and search engines certainly > won't follow those links. > Can someone point me to hardware that is still in active use that can't handle javascript? Similarly, can someone point me to a company that specifically disables javascript as 'corporate policy'? Back in 96-97, the 'no javascript' argument held, and probably holds today some if you're targetting handhelds and other 'non standard' devices. But if someone specifically disables Javascript these days, a good portion of their web experience will not be as robust as it would otherwise be, and they probably won't notice that using your site is any worse than any other site. IMO, it's now like targetting only websafe colors because some people might only browse in 256 colors. If they do that, about 80% of the web's content will look like crap anyway, and they won't specifically think my stuff looks all that much worse than anyone else's. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hey PHP PPL - Great Question !!!
Vins wrote: > Session Data. > > What is the best. > to save in database, or to save as file ??? > > let me know. > > Cheerz > Vins > > Sorry Vins, It's not a great question. It's too dependant on what you need to do, what your development level is, and a host of other factors. Start with files and when they don't do what you need, move to a database. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP is making errors for no apparents reason..?
if (!$chck) { $zquery = "SELECT name from users WHERE handle like '$row[handle]'; $zres = mysql_query($zquery); $zrow = mysql_fetch_array($zres); $user = $zrow[name]; $query = "INSERT into husers values (\'$row[handle]\' , \'$user\')"; mysql_query($query); } The first "select" line doesn't end its quotes properly. Michael Kimsal http://www.phphelpdesk.com Guanrateed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: web application development question
Erik Price wrote: > mysql> SELECT * FROM material_multiplier; > ++ > | multiplier | > ++ > | 1.50 | > ++ > 1 row in set (0.00 sec) > > I suppose I could store a table with two columns, one being VARNAME the > other being VALUE, and pull this kind of standalone data out of it, but > was curious what other people do when they need to store something like > this. Hello Erik, This is what our http://www.logicreate.com system does, except we go a step further and additionally pull in the variables related to a particular module being processed. There is a config table with module name, var name and value, and when you're using the 'forum' module, for example, all vars in the config table relating to 'forum' are extracted and made available to the forum module code. There is also a backend system to allow administrators to change those variables. Something like 'postsPerPage' in the forum module, for example, can easily be changed from 15 to 20, by someone who knows no FTP, no PHP, no HTML, no coding of any kind. Just a web-based 'change this value' screen. Yeah, subtle plug there :) but it *does* work - we've been using this strategy for over a year and it's a good middle ground giving flexibility without having to grant access to code to people who don't need it/shouldn't have it. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authentication
Brian Drexler wrote: > Use javascript and close the browser, that's all I can think of. > I wasn't aware you could close an entire browser - only a specific window. If the browser instance has any open windows, I believe the authentication will still be active. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authentication
Morten Ronseth wrote: > Anybody know how to revoke the HTTP authentication, i.e. log people out, > using PHP? > You can't ------- Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LogiCreate: looking for resellers
Richard Archer wrote: > At 7:57 PM -0400 22/4/02, Michael Kimsal wrote: > > >>you won't find a stronger combination of a solid development >>framework and professional support anywhere else. > > > In a word: Bollocks. > > This obviously an untrue claim for all but one company in the world. > And I find it very hard to believe that you could be that company. > > I would never purchase (or possibly even use) a product from someone > who lies and misleads in their promotional material. > > Thanks for the spam. > > ...R. Perhaps I should have clarified (and I thought it was evident) that we were referring to the PHP market, not the software development market in general. We still don't know anyone else who provides guaranteed PHP development support service or professional training courses for PHP. If you know of others in the US, please let me know. I apologize to you if you've felt misled - it was not the intention at all. Michael Kimsal http://www.logicreate.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] LogiCreate: looking for resellers
Hello all! My company, Tap Internet, has launched the latest version of our development platform - LogiCreate. The basic info can be found at http://www.logicreate.com, but I'm writing here specifically to solicit product resellers from the PHP developer community. The product itself has been tested in numerous deployments over the past 2 years, including ecommerce, extranet, intranet and CMS-oriented installations. Although there are numerous open source projects and toolkits you can base your development work on, we'd like to appeal to your commercial instincts. By becoming a LogiCreate reseller, you'll be getting much more than code and updates, including * Deployment experience and support. Our engineers have deployed large scale ecommerce sites (processing tens of millions of dollars per day) as well as handled migration from ColdFusion and ASP-based sites. * Sales support - if you need help developing proposals to go up against competitors, we can help. Whether it's the validity of PHP itself, or questions about open source security, we'll lend our support to your sales efforts. * Training - we offer the only professional PHP training course in the US, and as a reseller you get preferred rates on training courses (as well as at least one free class per year). While there's nothing wrong with the mailing lists and support forums on various free sites, you won't find a stronger combination of a solid development framework and professional support anywhere else. If you're ready to step up your development efforts with PHP, give us a call. - Michael Kimsal 734-480-9961 http://www.logicreate.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Not A PHP question but I need help in a big way...
Chuck Pup Payne wrote: > Hi, > > I just got finish will a meeting from HELL, I need to ask can some one tell > me is there an Apache Mailing List like this. I have to ask if I can do ASP > page on Apache, I know I know please don't flame me, I kept trying to get > them to switch to PHP, but I been told to shut my mouth and just find out > this information. So I am sorry that I am asking but I not sure where to > start. > > Chuck Payne > You don't need a mailing list so much as just going to google first - it'll point you to mailing lists or groups if they exist (hit 'groups' at the top too). I can give you the answer(s): Chilisoft makes an ASP interpreter which works with Apache, but it doesn't run everything. By ASP I'm assuming you mean VBScript. You will see reference to an ASP module for Apache - don't bother. It uses Perl and emulates some of the core ASP system objects. Unless your people are inclined to rewrite everything in Perl, don't bother even clicking those weblinks. So the short answer is pretty much 'no', with the exception of Chilisoft. If your ASP pages are extremely simple Hello World type stuff that don't use any external COM stuff, it'll work. Otherwise skip it. If you're on Windows, just stick with ASP/VBScript. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Better standards in PHP-coding
Mark Charette wrote: > Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into > memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years > in this business and still I hear them argue. > > Perhaps a cb style program for PHP so people can write any blasted style > they feel like and then have another programmer transform it into _their_ > OTB style. > > _My_ "coding standards" may not be _your_ coding standards, but mechanical > transformations can pretty much make it all moot. > Cool - thanks. I seem to have posted twice on accident, but you summed up much better what I tried to say, but quicker! :) This guy got on my few remaining nerves this evening. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Better standards in PHP-coding
Frank wrote: > For starters, just because GNU says something is what should be done doesn't mean it's the right way. They don't believe software should be licensed in particular ways, and I happen to believe it's up to the developer(s) of a package to decide that. Second, *HOW MANY* PHP statements can be followed by a { ? I can think of three if (foo) { function foo () { class foo { Maybe there's one more that I'm missing, but it seems pretty darn obvious to me that if I write if (foo) { if (bar) { echo "bar"; } } that when I see a } I can immediately trace it back up to the corresponding column and see the keyword "IF". The indentation still keeps things in order. Guess what other benefit *I* derive from this? I can see more lines on the screen at the same time. Sorry - I usually always see ~35. What I'm seeing are more *useful* lines of PHP code, not extra line breaks intended to satisfy some GNU standards definer. Personally, I enjoy being able to see more useful code than line breaks, and I am intelligent enough to be able, using intelligently indented code, to follow a } up the the statement which opened the { on the same line. "As teacher I know from experience that programmers has a harder time tracking their own block with a number of "{"s dancing far out of sight in the right side of the screen." Maybe they should be breaking up their IF logic into multiple lines (PHP's OK with whitespace issues) so that things aren't 'dancing' off the right side of the screen. if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) { oneStatement; The only people I've come across that like to use this oneStatement trick are smart enough not to type { in the first place. Myself, I never use that oneStatement style, and always put a { and matching } immediately below it when coding. Then I go back and put the logic between the { and } markers. "> Why, then, are functions not written as > > function foo(parameter1, foo(parameter1, parameter2, ... parameterN) { > statements > ... > } > " We write our functions like that. It seems many user comments in the PHP manual use the same style, as do many of the code snippets and samples on Zend. Trying to base if block {} usage on the supposed uniformity of function block {} usage doesn't hold much weight. :( "I have yet to see anybody write if expression begin statement; ... ... end; " I'm not sure if you're trolling, or just don't go back very far in computers, or what... BASIC seemed to be full of this stuff, and it made a decent name for itself as a computer language. Example: (note carefully the placement of "IF" and "THEN" and "END IF") FOR i% = 1 TO 10 IF yourScore% >= playerscore%(i%) THEN FOR ii% = 10 TO i% + 1 STEP -1 'Go backwards (i% < 10) playername$(ii%) = playername$(ii% - 1) playerscore%(ii%) = playerscore%(ii% - 1) NEXT ii% PRINT "Congratulations! You have made the top 10!" INPUT "What is your name? ", yourName$ playername$(i%) = yourName$ playerscore%(i%) = yourScore% EXIT FOR END IF NEXT i% (taken shamlessly from http://www.geocities.com/SiliconValley/Bay/5707/qbasic.html as I can't remeber much BASIC these days!) "As an amusing result of the weird practice it has been necessary to recommend a standard where the { }-pair is always used, even though there is only one statement following an if:" I don't find it amusing that, as a programming standard, one is encouraged to *ALWAYS* use { and }, regardless of if there's only oneStatement (see above). We teach PHP courses, and trying to explain to people that, "well, sometimes you can use { } blocks but you don't always need them" is just confusing as all get out to people just starting out with the language. Giving them a standard "use {} blocks" makes more sense to them and us. BTW, in the classes, we do show both if (foo) { echo "foo"; } and if (foo) { echo "foo"; } styles. I'd say about 60% or so wind up using option one, even though option 2 is presented more, and the examples generally use style 2. "We can only hope that some major standard-setters for PHP should make a rational decision about what standard to choose and not just keep "what we are used to" for the disadvantage of future generations of programmers." What if there IS a forthcoming 'rational decision' about {} usage from all the core PHP team, and they choose the way you don't like? Should they codify the parser to not work with certain styles? Why must there be some magical consensus on something which, ime, doesn't have as much impact on the language as ISAPI support, or better object handling, or stronger memory handling, or a myriad of other topics? Michael Kimsal http://www.phphelpdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: CMS -- central module handling
Lauri Vain wrote: > Hello there, Hello > > I'm seriously researching some aspects of writing a content management > system that would be 'relatively' easy to extend. > > My biggest problem is the ground level -- how should the central system > (that registers modules) work? Ideally, it should be possible to easily > extended the system -- running the install.php file (or something > similar) will tell (insert new database rows or will add new rows to the > configuration file) the central module that a new module was just added > and also gives instructions, how to use it, with which other modules it > integrates and where the new files are. I think you're attacking the wrong problem first, especially coming up with a system which defines what modules something else can 'integrate' with. If your modules are designed as essentially standalone pieces of code, any of them should be able to 'integrate' (or, perhaps a better term, interoperate) with each other with little pain, even if it's not what was originally designed for one or more of the pieces of code in question. You'd do better to focus on a common i/o system which the core system uses to talk to each module. > > The basic idea is that modifications to existing files (modules) > shouldn't be made (except the central module, which handles all others). > Each module should be totally *independent*, but should still integrate > with the rest of the modules (when marked as possible in the database). > What I mean by 'integrate' is the following: there are two modules, for > example, "image gallery" and "articles". Both of them should appear in > "What's new" part (when the appropriate checkbox will be checked). Also, > it would be nice when one could choose the option "Publish to articles" > when inserting a new image gallery (a client event for example -- story > in pictures). Yes, that's a simplified example. You need to better define a module, I guess. I our case (with http://www.logicreate.com) a 'module' is a separate section of code pieces. Sometimes as little as two (one logic/one display) and sometimes many more). Our 'forum' system, for example, has I believe 8 files. Your requirement about *never* changing any files is, imo, impossible. *something* will always need to be changed for various implementations, even if it's just one visual change someone wants. > > So, the problem is that there might only be the "article" module at > first. Later, the "articles" and "What's new" module will be added and > all three of them should now work together. I hope you catch my drift. > You could possibly look at phpgroupware.org to see how they implement the 'addition' of modules (different from how we handle it, but perhaps a bit more in line with what you're describing) > I have quite a few ideas, but I'm sure that our team is just > re-inventing the wheel. What are your experiences? Are there any good > books on the subject of creating an extendable content management system > (preferably from the coders point of view, but not language-specific). > > Thanks, > Lauri Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Querying Oracle from PHP
Jon wrote: > Hi, > > I am evaluating if it is posible to connect Oracle 8i from PHP, running a > > PL/SQL procedure and returning the results, avaible in a temp table, to > > HTML. Besides, I need to format the results of the query in PDF document and > > make a pie chart based on he results of the contents of the table I > > mentioned before. I looking for some adds-on to PHP that makes it posible to > > do this all.. > > Any suggestions would be appreciated. Thanks in advanced > > > Someone else suggested using http://www.aditus.nu/jpgraph/ which I'd aso highly recommend. This will do some pretty sophisticated charting/graphing. Also, instead of PDFLib, you may want to investigate htmldoc from easysw.com first. You don't get as much fine-grained detail control, but it's much easier to work with for pdf stuff you need to crank out quickly. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 Guaranteed PHP support when you need it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Nasty DoS in PHP
Dustin E. Childers wrote: > Hello. > > I have found something interesting that can kill the server. I'm not sure if this is >because of Apache or PHP. If you use PHP to send a header() inside of a while loop, >the httpd process will begin to use massive CPU and Memory until it is killed, or the >server is killed. Here is what I used: > >while(0<1) { > header("A"); > } > ?> > > We have tested this on apache 1.3.22, and apache 2.0.35, using php 4.1.2 and >4.2.0RC4. It was able to completly kill our servers (not apache, the entire server). >The loads of the server will reach 50+. I have contacted apache about this and they >said that it is PHP related. Did you have output buffering on or off? It seems that it would be somewhat dependant on the browser as well, but maybe I'm offbase here. If you just kept letting while(0<1) { echo "w"; } run as well, wouldn't that also lock things up? Aren't infinite loops in general a bad thing? Or is there something particular about the header() that you're thinking is going on? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Storing images in MySql
Mike Fifield wrote: > After posting my question about performance earlier this morning it was > suggested that I also store the jpg's in the database, (thanks Maxim). I did > a little research and got a lot of conflicting information on weather this > is a good idea or not. For example the following url states that you suffer > a 30% performance hit by doing it this way. > http://www.zend.com/zend/trick/tricks-sept-2001.php > <http://www.zend.com/zend/trick/tricks-sept-2001.php> > Is anyone out there running a website that stores images as binary data in > MySql that could comment on this? > Any and all comments are welcome. > > Mike *Storing* images in the database is only half the battle - you need to have another script to pull them out and display them. The only situation where this makes sense is if you want/need to programmatically control access to images. Just like you can control access to various other bits of data in the database, you can also control access to specific image data in a database - but it's an extra step to pull it out. An extra HTTP request, I should say. If you don't have a need to programmatically control access to image files, don't bother putting them in a database. Let the filesystem do what it's meant to do - serve files. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Definitive answer for large scale registration/authentication
Brad Hubbard wrote: > Can I get some feedback on the conventional wisdom as to the best solution > for high volume registration and authentication of users accessing a secure > site? I have worked before with database/session based methods as well as > htaccess. Which is preferred? Are there alternatives? > > Thanks for the feedback, > Brad I guess the first thing you should help us with is defining "high volume". :) 1/sec? 100 sec? Actually, this will probably have less impact on archictecture than hardware, but I'm always curious as to what 'high volume' is to different people (my own view has changed a lot over the years). ".htaccess" can be made to pull data from a database, so I don't think there's a clear distinction to be made there. Furthermore, if the .htaccess is using a textfile for password authentication, how many users are in it? 1,000? 1,000,000? 1,000,000,000? Using a database would be more flexible, I believe, should you need to change webservers in the future - you probably won't be moving to IIS, but hey, who knows? :) Manuel is right about the browser authentication method not being 'controllable'. If you log in with a 'challenge/response' password box, your browser will keep sending that information with every request (including graphics), and because it's in the browser, you have no easy way of forcing it to log out. Doing 'server-side' authentication and session handling is going to give you more flexibility. Our initial testing has show LDAP to be a bit faster in raw lookups for user authentication. Perhaps a combination of LDAP and a another database to store the session data would be your best bet. If you could give us more info on your hardware and requirements needs we can better assist you. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL Hosting services
Vins wrote: > you get unlimited traffic. > here it is very cheep. > so they can offer a great service. > > www.wthosting.cjb.net > > and they also don't pay for a domain. > so that means even more cheeper prices. > LOL > > they crazy. > I know they guy, his way of thinking is free is better for the client and > for them > client gets cheeper prices. > they get more moeny. > So, that $14.95/year he saves on his own domain name is split between, what, 10 clients and each one is saving $1.50/year? Wow! That's over 10 cents per month he's saving his clients!. Maybe he should get rid of the phone lines too - that would save even MORE money, and mean even CHEAPER prices for people! There's no end to how much money he can save us! > works, you should see what he drives > Did he pay cash? Or is he leasing? "Fake it till you make it" is quite a popular lifestyle for many people. :) Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: "What date/time was it 7 hours ago"?
Torkil Johnsen wrote: > "What date/time was it 7 hours ago"? > > I'm just trying to make a log using mysql/php > This log is kinda supposed to show the time, local to the user. > > So I store datetime on the format -MM-DD HH:MM:SS in a datetime field. > Using the php date function to get the date. > > This will store the time that right then ON THE SERVER. > > Now, when fetching data from the mysql table, I want to display what the > time WAS, LOCALLY (where I'm at, not the server) when the log entry was > made. > > So. How do I make a function that takes in -MM-DD HH:MM:SS and spits out > the -MM-DD HH:MM:SS minus... for instance, 7 hours? > > "What date/time was it 7 hours ago"? > > function timebefore($time,$hours=7) { $x = strtotime($time) - ($hours * 3600); return date("Y-m-d H:i:s A",$x); } Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chechking to see if a directory already exists
Kevin Stone wrote: > Wouldn't it be more helpful to assume that the individual is simply > uninformed? So isntead of flaming him and calling him stupid you could say, > "Check the PHP manual at www.php.net". > -Kevin > The definition of a question assumes the person is uninformed - else, why ask the question? Perhaps the list should have an autoreponse with 'check the php.net manual' as a canned response to every post. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: pages compressed with zlib
Levy Alves Carneiro Jr. wrote: > > Hello, > > inside php.ini file there's a special configuration: > > ; Transparent output compression using the zlib library > ; Valid values for this option are 'off', 'on', or a specific > ; buffer size to be used for compression (default is 4KB) > zlib.output_compression = On > > this way pages will be parsed, compressed, and then sent to the > browser. Does anybody know of pros & cons of using this > configuration? Which browsers support zlib compression? > > Thanks, > Levy > Netscape 4.x *says* it supports compression, but it doesn't uncompress when printing, so if you use the compression method, your netscape 4 users will be at a loss if they want to print. Maybe this will force them to upgrade (finally) but probably not. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Serializing Binary Data
Jeb Scarbrough wrote: > Is it possible to serialize binary data? An image for example. I am trying > to accomplish this: > > 1. Build web page. > 2. Retrieve dynamically built image from another physical server. > 3. Serialize the image and store it in some type of session variable > 4. Unserialize this image and display it inline with html around it. > > I realize this is terribly inefficient, but there are several factors as to > why it has to be accomplished this way. Not sure if serializing binary data directly would work, but you should be able to run base64_encode() and base64_decode() on the data first, then serialize it. Or heck, just store that ascii version that is the base64'd version directly - no need to serialize. Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: arguments against php / mysql?
Barry C. Hawkins wrote: > Mallen, It sounds like you might have some non-technical or > open-source execs to talk to, and that a non-MS platform is not an > option (yet :^) ). If so, here are some more "managerial"-type > arrows for your quiver: > > 1.) MySQL was one of the top 2 databases in a Ziff-Davis major vendor > "shootout" recently, ranking alongside Oracle 9i. See > > http://www.mysql.com/news/index.html > > under the heading "MySQL a winner in server database clash". They > like products more if they're mentioned in the same sentence as > Oracle. Oracle was on the SuperBowl, you know. :^) > > 2.) Actually, PHP doesn't officially say that CGI is the recommended > install for IIS. They simply issue a few caveats regarding SAPI. > Check it out at: > > http://www.php.net/manual/en/install.windows.php "Officially" perhaps but I think the overwhelming consensus has been that ISAPI under Windows just didn't work. It *does* work now, as long as you don't use any third party DLLs (like MySQL, GD, etc) rendering it pretty useless. Sorry, it's just anecdotal evidence, but you'll notice that no one in the PHP camp will unequivocally say that PHP under ISAPI is solid. The silence on ISAPI speaks volumes right now. > 3.) I have nothing to offer on the search engine issue. > > Now, I know that some of what I just said will incense some folks, > because yes, ideally this poor fellow would be able to use *nix with > Apache, MySQL, and PHP. But, since he may not have that luxury, > these items might put enough "spin" on things for him to get the Open > Source items in the door. Once that initial "yes" has been given, > the subsequent steps might come more easily. If the only way to get "open source" products in the door is to have them running half-crippled (running on OSes they weren't designed for) you're giving "open source" products a bad image. No one expects ASP to run on anything but IIS (chilisoft notwithstanding). If the server HAS to be Windows, use ActiveState's Perl or something else with a company behind it and just go down that road. Having PHP run poorly under Windows will just make PHP look bad, even if it's Windows' fault. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: arguments against php / mysql?
Mallen Baker wrote: > Hi - the company we're talking to about doing some work on a simple > site / database is trying hard to persuade us that Windows-based PHP > / mysql is not the route to go. The arguments are as follows: > Windows-based PHP might not be the way to go. We've deployed PHP as CGI under IIS, and, while it did work, there were things Linux/Apache gave us that you can't get under Windows (IIS or Apache) (good URL parsing, for a start). It was workable enough, but was not very fast. > 1. XXX's experience that MySQL is less than 100% stable when running > on a windows platform (main problem being unexpected database > shutdowns while applications are being used). If we're going on experiences, then our experiences is that *anything* on Windows doesn't stay up 100% of the time (not saying other OSs are necessarily better, but you'll find pros and cons on both sides). Just because something isn't 100% doesn't mean you shouldn't go with it. We've run various SQL Servers on Windows and normally had to reboot every 1-2 months as a preemptive strike against a crash. We had unexpected database crashes with MS products on MS servers. By XXX's logic, we shouldn't use MS SQL Server either. But people do use it. 2. The fact that the > recommended mode for running PHP on a windows platform (the CGI > binary) uses technology that is now reasonably old and will > consequently result in a hit to the server performance and memory > management and the associated possible lack of scalability. As others have said, the Apache module under Windows seems to work better. 3. Loss > of verity - the powerful search engine bundled with Cold Fusion. > Searches may be significantly slower on the new site. Depending on what you use. MySQL has full-text searching which, while not perfect, does a pretty good job with most of the stuff we've thrown at it so far (speed and size). > > I have had some experience using php/mysql on linux/apache - but > don't have enough information to know whether this advice is sound or > not. Can anyone please advise - is there anything in these arguments? > > > If so, are there ways around the problems. We very much want to use > these technologies due to the open source aspects. > There's always an answer - depends on how much work you want to do. Yeah, CF/Verity might be nice to start with, but who's doing the coding? If XXX is doing it up front, will they be around to make changes quickly/as needed? Or will the maintenance drop to you? They may have a reseller program which means they'll make a couple hundred bucks off the sale of CF and want to push that. (just a guess - you haven't given any more info). For the money you'd spend on CF, you could do worse than to buy a machine to run LAMP on and go with that. If they only want to push CF at you, and you want PHP, give us a call. :) Michael Kimsal http://www.phphelpdesk.com 734-480-9961 Guaranteed PHP support when you need it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Sessions/P3P Questions
Richard Spangenberg wrote: > Hi, > > I am using PHP Sessions in my coding. I have noticed that my cookies work > just fine in MSIE 6.0 if the browser's privacy setting is set to low. > However, in all other settings it is not responding. I bleive this is > because of the P3P privacy setting. Is this a major issue, or are the > higher P3P settings not really being used. > > What are others doing about this? Implimenting P3P at clients sites or > standing by and waiting? > Well, if you want to get a project done and get paid, you've got no choice but to jump into the P3P stuff. It's a major pain, let me tell you. Getting clients who take 3 weeks to determine what shade of blue they like to suddenly have to positively articulate a privacy policy just isn't my idea of fun. And don't think you can throw just anything in there. If your customer will use the client's info to call them about something, and you indicate in the P3P that no phone calls will be made to the user, you may be in trouble (or at least the site owner would be). The legal ramifications are unknown at this point, but given the big business at stake, and the litigious nature of our society (US anyway) nothing would surprise me at this point. The whole P3P gives too much control to users without requiring any education on their part. Sliding a bar to 'medium' without knowing precisely what it's doing causes nothing but support headaches for the sites. We went through this about 6 months ago. IE6 came out and about 6 percent of our client's users were using it after about a month. Support calls skyrocketed because suddenly a huge number of people couldn't use the site. Cookies weren't being accepted. In every case, it was an IE6 user who'd set their privacy settings up higher than 'low'. We had to hastily put up a P3P policy and modify it later. People were just paranoid about 'privacy', as if moving a slider made them safer. The sad thing is that the slime who *will* sell your name and email and whatever other info they gather will have no compunction about creating a false P3P policy file. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 Guaranteed PHP support when you need it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sablotron XMl XSLT
Matthew Luchak wrote: > PHP 4.1.2 > SunOS web-unix1 5.7 > apache_1.3.22 > > > I'm trying to parse XML/XSL on a shared box and I'm using : > > $xslthandler = xslt_create() or die("Can't create XSLT handle!"); > > to test for sablotron. Unfortunately I just get a "Call to undefined > function" error which I guess means no - there's no sablotron installed > - but I was wondering if there is another way to test for Sablotron? I > need a little quicker turnaround time then passing from voicemail to > voicemail at my ISP ;) > > thanks, > You could use function_exists() to test if xslt_create() is a defined function. If not, then error out. If so, carry on. It's not limited to sablotron checking - check for GD, PDF, etc. Michael Kimsal http://www.phphelpdesk.com PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: tired by linux - recompiling.._PHP SERVER
Septic Flesh wrote: > anyone found any webserver for linux to support HTML - PHP - SSL without > much/any compiling . . > just the binary to uncompress and run .??? > > I am really tired by linux.. > > Most Linux distributions come precompiled with PHP and SSL in Apache by default. RedHat and Mandrake do - at least there are options during installation. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ask for suggestion about printing
Eric Coleman wrote: > This can be done easily... > > And since when does PDFLIB cost money? I thought it was free... PDFLIB isn't free. A commercial PDFlib license is required for all uses of the software which are not explicitely covered by the Aladdin Free Public License (see bottom), for example: ? shipping a commercial product which contains PDFlib ? distributing (free or commercial) software based on PDFlib when the source code is not made available ? implementing commercial Web services with PDFlib ? you may develop free software with PDFlib, provided you make all of your own source code publicly available ? you may develop software for your own use with PDFlib as long as you don't sell it ? you may redistribute PDFlib non-commercially ? you may redistribute PDFlib on digital media for a fee if the complete contents of the media are freely redistributable. It's fine for some situations, but it's not *free* for all uses. There are actually quite a number of scenarios I come across where PDFLIB isn't a 'free' package, but requires someone to pay. "implementing commercial Web services with PDFlib" is pretty wide open, imo. Michael Kimsal http://www.phphelpdesk.com PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why?
Alberto Wagner wrote: > Why everyone uses $foo or $foobar as examples? > > > Why not? They are relatively benign words that are simply to type and aren't terribly language centric. $moo and $moocow would work just as well, or $asdf or $qwerty or others. As far as I know, they have no specific connotation, but they've been used as placement holder names since at least the early 80's when I started programming. Michael Kimsal http://www.phphelpdesk.com PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Drawing graphs - opinions
Lee P Reilly wrote: > Hi, > > I see there a number of PHP scripts/libraries out there for the purpose > of graphing data. Which one is considered to be the best, most powerful > / easiest to use? I need to plot X/Y graphs for some data sets with > vertical error margin lines going along the y-axis. Any recommendations? > By far the strongest I've seen/used is jpgraph. Others here have picked it up faster than I have - I can't say it's the easiest to learn, but definitely very powerful (rotated 3d pie charts?!) Have you looked at it? Is there something it's missing? -- Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Advice needed
If this is the explanation the other 7 got, I'm not surprised they're stumped. :) You don't seem to explain the formula to determine q100, q300, etc., which bugged me, but the text of your question seems to indicate we don't really need to know this. > Now the tricky part is $Quantity2 can either be blank or have a value > and if $Quantity2 has a value then $Quantity3 can either be blank or > have a value if ($Quantity2) { execute code ] if ($Quantity3) { execute code ] Am I missing something obvious? Do the values of quantity2 and 3 have some impact on the pricings of quantity1? Could you explain your problem in more detail (offlist is fine if you want). ------ Michael Kimsal http://www.phphelpdesk.com Guaranteed PHP support 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object reflection in php?
John Coggeshall wrote: > Why are you going through all of this trouble, exactly? > > If you are looking to store the instance of the object in the databaes, > why not just use serialize()/unserialize()?? > > John > > If you're trying to map each object property to a specific table column in a database, serializing wouldn't help. Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object reflection in php?
Erik Price wrote: > > On Monday, March 18, 2002, at 06:28 AM, Filippo Veneri wrote: > >> Just to make myself understood: >> >> class obj { >> var $field; >> function obj( $value ) { >> $this->field = $value; >> } >> } >> >> $o = new obj( "field value" ); >> >> How can i know, if possible, that the instance of >> obj pointed to by $o has a field named "field"? >> >> This would be useful to write an object to a database >> without knowing its structure 'a-priori'. > > > Couldn't you just add another method called "return_field_name()" to the > class? Then you could run this method from the script and you will be > given the value of the field name. Your code would look like this: I think you missed his point. With your example, you still need to know the field name, which is what he's trying to avoid. Filippo, I think what you're looking for is: get_object_vars more info at http://www.php.net/manual/en/function.get-object-vars.php Does that help? Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Get row number from mysql
Tyler Longren wrote: > Hello, > > How can I get the number of the current row, something like this: > > $sql = mysql_query("SELECT * FROM table ORDER BY id DESC"); > while ($row = mysql_fetch_array($sql)) { > $id = $row["id"]; > $name = $row["name"]; > print "$current_row_number. $name"; > } > ?> > I can't just use the id field, because the ID's might not always be 1, 2, 3, > 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. > > I need it to look like this: > 1. first person > 2. second person > 3. third person > > and so on and so forth. > > Can anyone advise me on how I should do this? > > thanks, > Tyler > > Why not just put a counter in there? while ($row = mysql_fetch_array($sql)) { ++$counter; $id = $row["id"]; $name = $row["name"]; print "$counter. $name"; } Michael Kimsal http://www.phphelpdesk.com PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A stupid question...
Chuck "Pup" Payne wrote: > I want to sort by a letter in a colomn. Let say I want to sort the colomn > last_name. I can do order by but I can do just the A's. > > http://www.myserver.com/mysort.php?Letter=A > > Like to create a link on a web "A" then sort only the last name are A. > > I hope that's helps. I can order by, but I can't so a sort like the example > above. > > Chuck Payne > Magi Design and Support One of two things to do: When you're inserting the data, figure out the first letter and store that as a separate column ("letter" perhaps) Second, probably easier to implement in your case with existing data, is to use LIKE. $sql = "select * from datatable where last_name like '$letter%'"; The % is a wildcard symbol, so if $letter is "a" then a last name of "adams", "aames", "aston", etc. would all match. I know there's someway to have mysql do a string manipulation to compare just part of a column's data with something, so you could do something similar to a 'substr' in PHP - but it's late and I can't remember off the top of my head. Hope that helps... -- Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can Anyone translate my script to php?
Ceyhun GüLer wrote: > I have a small picture and when I click on this image > image opens resimgoster.asp with "resimgoster.asp?res=main tumbled images > picture.jpg" > and this asp code includes > > <%@language="vbscript"%> > <%location=request.querystring("res") > location=replace(location, " ", "/") > %> > > > > > > this code gets "res" variable and replace " " fields with "/" > by this way I use only one file to enlarge of these picture... > but I need it in php now > > can any one translate my asp code to php code? > I'd probably do something like I'm relying on the fact that $res would be autodefined as a variable from the querystring. This behaviour is not standard in the latest version of PHP I believe, but most versions before have it come by default. The server admin may have disabled it, but by default that happens. If it's not on, you could add a line to make it: --- Michael Kimsal http://www.phphelpdesk.com/ Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with mysql persistent connections; already read the FAQ!
Dustin Puryear wrote: > We are running Apache 1.3.20 with PHP 4.0.6/rfc1876-patch built as a > module. We are using PHP on a load-sharing cluster with n web servers. > Our cluster supports an application that makes extensive use of mysql > connections via the PHP mysql_* functions. > > The application was tested on a single web server, and the programmers > are trying to use persistent connections to increase efficiency. > First, I want to confirm in my own mind whether this will have any > real benefit in our situation because we are using a cluster > environment, correct? > > Second, the programmers are using mysql_connect() and not > mysql_pconnect(). Does that mean they are in fact not using persistent > connections? (BTW, we do have persistent connections turned on in > php.ini.) If they are not using the mysql_pconnect functions, then you are not using persistent connections. The .ini file setting simply allows them to be used or not - no version I've seen has an option to override to always use them. > > Finally, the programmers showed me how they see that persistent > connections are in fact working. On the development server they are > doing the following: > > mysql_open() > mysql_query() > ... > mysql_close() > mysql_query() > > On their server the second mysql_query() works! What is the specific syntax they are using? Is there any chance that they have opened more than one handle to mysql? The mysql_close() would only close one, and if there are more than one handles open, only one will close and others will be free to handle _query() functions. I'm going to assume they are using mysql_connect() as I can't find refernce to a mysql_open() function. The mysql_query function *may* be simply reopening another connection with the previous information. From the manual: mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if mysql_connect() was called with no arguments, and use it. (They are using Apache > 1.3.20 as well, but I was told they may have compiled PHP into Apache > rather than as a module, and I'm not exactly sure of the version, but > I'm pretty sure it is 4.0.6.) But on the cluster the second > mysql_query() returns: > > Warning: 1 is not a valid MySQL-Link resource in /some/path/pers.php > on line 11 could not execute 'select zipcod from zip' Does that second machine have access to the database? The database may be only allowing 'localhost' connections or connections from a specific IP. > > Should this be working on our cluster? If not, what do we need to do. Yes > Can this work? Yes > Will persistent connections even be effective in a > cluster environment? It depends. In the Apache situation, using persistent connections will cause *each* Apache child to hold a connection open to MySQL. So if you have 150 apache processes on 3 servers, that's 450 connections the database server needs to have open for MySQL. ~50k per connection, that's about 23 meg - should be doable on most machines to start. If you're running lots of big queries, get loads of RAM. You'll need to tune mysql to handle more than the default 100 concurrent connections, and make sure your OS can handle the maximum resources it may require as well. Yes, they can be effective. On a fast network with a light loaded machine using mysql, you often can't tell much of a difference between pconnect and connect. As the load grows heavier, the pconnects come in more handy, but at a price of consuming resources you may otherwise need. If 150 apache processes are serving up HTML and PHP and graphics, one server may end up holding 150 persistant connections open for a long time, even though you may only be serving 10-20-30 PHP pages at any one time. Although the other Apache children are serving graphics/HTML, they may earlier have run a PHP script with pconnect and will now hold it open until they die. We tell Apache children to only handle 5000-1 requests and then specifically die, which should kill the connection to mysql (some drivers seem to not handle this - freetds had a problem letting go of handles on the apache exit cycle). In short, if you're looking to load balance a high load, pconnects can help, but smart web serving architecture can help too (possibly moreso all around). > > I did read the alt.comp.lang.php FAQ, but it didn't actually address > this issue. > > Any help or information is appreciated! Hope that helps some. -- Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Graphing Question
Chris Seymour wrote: > Hi All, > Does anyone know of a graphing package that will allow a line graph with > labels on the data points? > > Thanks in advance. > > Chris > Try JPGRAPH at: http://www.aditus.nu/jpgraph/ Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dbconnect
Josiah Wallingford wrote: > I have a file called dbconnect that stores all of my mysql information > (host, user, pass) up until now I have always just used localhost as the > hostname because it was on my local server. My question is what do I have to > do to connect to a different server? Do I just have to put in the computers > ip address? > > Yes. Except: If that server will allow a remote connection from yours, then you're all set. If that server doesn't allow remote MySQL connections, you'll need to have that mysql administrator allow remote connections for that mysql user and/or ip. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP vs object.record set
Rodrigo Peres wrote: > Hi list, > > I'm new to PHP, but I found it greate. But I have a question. Recently I've > saw a friend using asp and the object record set seems perfect, I mean the > function to count records, navigate in throw record (back and forth) > everything automatic is amazing. There's a way, to implement such things in > PHP?? > > Thank's in advance > > Rodrigo > Go look at adodb from http://php.weblogs.com. They have a PHP library that gives you much of the same functionality as the ADO system. Keep in mind that going 'back and forth' in a recordset comes at the expense of a great amount of speed. MS and others will tell you that for good performance you should use 'forward only' recordsets, so it's of limited value to many people anyway. -- Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mcrypt? - Can't find any good info
Nick Richardson wrote: > I'm getting this error: > > Warning: mcrypt module initialization failed in /home/www/common.php on line > 314 > > When running this code: > > function encryptPassword($password) { > $key = randomString(); > $code = mcrypt_ecb(MCRYPT_BLOWFISH_128, $key, $password, MCRYPT_ENCRYPT); > > print("$code = enc w/ $key"); > } > > encryptPassword("testing"); > ?> > > And i can't find any documentation on what might be causing this... anyone > out there know? > Is mcrypt installed in your PHP system? echo phpinfo(); and look for mcrypt Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: User accounts
David Johansen wrote: > I'm new to this php thing and I would like to set up a web page were the > users can login and edit their preferences and all that stuff. I have the > basic login stuff worked out and I was passing the username and password as > a hidden input in the form, but then the password can be seen with view > source. I know that there's a better way to do this, so could someone point > me to a good tutorial or example on how I could make it so that the user > could login and logout and then I wouldn't need to be passing the password > all around like this. Thanks, > Dave > Dave: Have a read up about sessions in the PHP manual to start. The basic idea is that you'd store the fact that someone is succesfully logged in or not (and who they are) in session information at the server. The client forms never have to have the username or password in them at that point (only when they submit their login data). Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: require v. includes
Joshua E Minnie wrote: > I was just wondering if anyone could tell me when would be the time to > choose require(), require_once(), or include(). I know a little bit about > using each one, but I am just not sure if there is one that is better than > the other in certain situations. > For all intents and purposes there's no real difference between the two. From the manual: require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, don't hesitate to use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well. require_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc. include_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc. Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Congrats to Rasmus?
It doesn't seem to have been mentioned here unless my newsfeed is very slow, but phpdeveloper.org has a quick mention of the new addition to Rasmus' family. http://www.phpdeveloper.org/ "Well, everyone's favorite PHP developer multiplied last night - Rasmus Lerdorf now has a son (9.0lbs, 19.25in. - a big boy) was born at 13:26 PDT on Wednesday March 6, 2002. If you'd like to see some pics from the family, check out this page - or to send congrats, email [EMAIL PROTECTED]" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include() and paths
Patrick Teague wrote: > ok, so this makes alot of since... if I move my website from one server to > another server I'll have to go through every single file & redo the > directory structure? Isn't this the reason for the includes... so you > don't have to go through every single file to make changes? Maybe I should > go back to ASP... > > #include virtual="/includes/myinclude.inc" > > or is there a way to get this to work via php on apache? Per http://www.php.net/manual/en/function.ini-set.php, PHP_INCLUDE_PATH is an 'ini' setting which you can change - you could either set it in your php.ini once, and point it to one common 'includes' direcotry. Or possibly set it per apache virtual server (via .htaccess perhaps in a main root directory). Another thought is to simply make all your include statements use a constant, such as DOCUMENT_ROOT or something else (we use something else but the idea is the same). Yes, all includes need to be written as include(MYDIRPATH."/relative/stuff.php"); Also, try ini_set(PHP_INCLUDE_PATH,DOCUMENT_ROOT); at the top of your page(s). That might do the trick. but it makes everything a heck of a lot more portable. Don't go back to ASP. If you really want to use stuff Apache supports that via .shtml files. There are probably ways of getting the two to work together (PHP and SSI) though I'm not sure why you'd want to do so. :) Remember ASP is a framework, and VBScript is the popular language there. VBScript doesn't support includes at all - it's ASP calling an SSI interpreter, include()ing things, then passing to the language. PHP is just a language. There are some pretty ugly, inelegant things going on under the hood with respect to includes under ASP - if you want gorey details let me know. :) After writing all this I see it's basically a rehash of the 9/2/2001 posting in the user comments under include at the php manual site. Is there a reason one of those 3 options isn't viable? Michael Kimsal http://www.phphelpdesk.com Taking the ? out of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HELP UNIX vs Windows
Christopher J. Crane wrote: > I am a PERL scripter and I am just getting into PHP. My first few pages are > simple but I am running into a few problems when changing OS. I included > below a piece of code that works fine in windows but not on a linux box. Not > sure what the differences would be > > The problem is that on the windows platform all information is returned. On > the linux platform the "$Details" variable is not populated. The nothing > changes...so what could it be. The only thing I can think of is that maybe > the version of php is different on the linux server. > > Here is the code.after reading in a file with "|" deliminations > while ($i < $length): >$tok = strtok($cartFile[$i],"|"); > $Category = $tok; $tok = strtok("|"); > $SKU = $tok;$tok = strtok("|"); > $Name = $tok;$tok = strtok("|"); > $SubCategory = $tok; $tok = strtok("|"); > $Price = $tok;$tok = strtok("|"); > $Image1 = $tok;$tok = strtok("|"); > $Image2 = $tok;$tok = strtok("|"); > $OnSale = $tok;$tok = strtok("|"); > $SalePrice = $tok; $tok = strtok("|"); > $Details = $tok; $tok = strtok("|"); > It could be a different version - what are the versions on the two systems? In the meantime, could you not use explode() or split() instead? list($category,$sku,$name,$sub,$price,$etc) = split("|",$cartFile[$i]); (might need to be "\|" instead of "|" - I can't remember, it's late, and I don't have easy access to test it. :0 --- Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How are they doing it?
Gary wrote: > Hello Everyone. > I saw a Perl script today that the owners of the site can send an email > and pages would update automatically update. How are they accomplishing > this? > > Gary > HOW: The mail goes to an address, which is passed to procmail, which passes the mail info to a script. In our case it's a PHP script. It could just as easily be a perl script, or python, or whatever. PHP EXAMPLES: We've done pretty much the same thing at http://www.updatebyemail.com. Recipesbyemail.com is doing something similar - processing a request by parsing an email, then sending results back. If anyone gets 'redbook' magazine, you may have read about pillowmail.com - again, a client of ours using PHP and parsing thousands of emails per day with procmail/PHP. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP-Based Authentication Security?
John Coggeshall wrote: > Hey all.. > > I've got a question -- I'd like to restrict access to entire directories > based on if the user has been authenticated or not. Basically, I'd like > to set up a auto-include *FROM APACHE* to run a PHP script prior to > sending any documents what-so-ever and only send the requested document > if the PHP script allows it. So.. > > Request Made -> PHP Script Runs -> PHP Checks Authentication -> PHP says > OK -> Apache sends file normally > > Or.. > > Request Made -> PHP Script Runs -> PHP Checks Authentication -> PHP says > NO -> Apache stops dead in it's tracks or displays a HTTP error > > Is this possible? It has to work for any document or MIME type and be > restrictable by directory... (i.e. I just want this happening in a > /secure/ directory) > > John > Not sure if you'll be able to do that, because PHP won't run unless Apache calls it. It wouldn't call the PHP interpreter unless it's a PHP file type (.php associated with 1 application type, jpg associated with a MIME type, etc). Two things spring to mind: 1. Do you mean 'authenticated' as in 'Apache-level' authentication, or PHP-level authentication? 2. If you need to have every request go through PHP, perhaps a URL rewriting solution would work - everything it rewritten to go through PHP, then it can decide whether to 'pass thru' the file or display an error message. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: FYI Using Qmail & PHP
Steven Walker wrote: > For some reason (I don't know why) qmail doesn't like the CRLF. > Probably because Dan Bernstein didn't invent it. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is there a "GoTo Page" Function?
Andre Dubuc wrote: > As a complete newbie to PHP, and relative novice to html, this one has me > stumped. Rather than wade through volumes of documentation, I thought I'd > risk asking it here. > > After inserting variables from a fill-out html form into my database, I would > like the form to "goto" the next html page, but I cannot figure out how to do > this basic function. I assume that when one clicks a "Submit" button, the > info is sent to the server, but how do you call a new page? [In my old > Paradox PAL days, this was accomplished very easily. I cannot find a > corresponding function either in PHP or html.] > > (I.e: Once a person clicks on <"Input type=submit value="Accept"> Is there a > function that can redirect the form to a new form?) > > Any help here would be greatly appreciated (or pointers to a good working > tutorial that covers this area!) > Usually people will do one of two things: Make the action of the form tag point to the new page directly. That page would take care of any form data processing that needed to happen. OR Have the form call itself, then when it's done, use a HEADER tag with location: to redirect header("Location: newpage.php"); Hope that helps. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Arrays/OOP
Joshua E Minnie wrote: > Michael Kimsal wrote: > > Attached you will find the class definition. Thanks in advance.. > > Joshua E Minnie > CIO > [EMAIL PROTECTED] > What version of PHP are you using? I took the file and it seemed to work OK in PHP 4.0.5. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Arrays/OOP
Joshua E Minnie wrote: > while(!feof($fp)) { > $temp = fgetcsv($fp, 1024, ":"); > $event_list[$i] = >$event_object->init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$temp[6],$temp[7],$temp[8]); > $i++; > } Without seeing more of the code, I can't say for certain, but I suspect that instead of $event_object->init you need to call $this->init. Does that do the trick? Wait - I looked above. $event_object = new event(). What is the class definition for "event"? Could you send more code? Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Non printable page
Lars Torben Wilson wrote: > On Fri, 2002-03-01 at 20:03, michael kimsal wrote: > >>Diana Castillo wrote: >> >>>Is there any way tomake a page that cannot be printed?? >>> >>> >> >>GZIP the page and force the end user to use Netscape. ??? >> > > No, still wouldn't work. If the data ever gets displayed, then it > is present on the viewer's machine, and can be printed. > > > It was meant as a jab at Netscape. Yes someone could take a screen shot and print, or grab to the clipboard and print the text, but hitting 'print' from netscape would cause it to go grab gzipped info and print out the zipped info - essentially printing garbage to the printer instead of what it's rendered on the screen earlier. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Non printable page
Diana Castillo wrote: > Is there any way tomake a page that cannot be printed?? > GZIP the page and force the end user to use Netscape. ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php