Re: [PHP] If PHP4 existed in 1995 we would of taken over the worldby now
I don't think "we" need "spies" - the ASP stuff is pretty out in the open as to where they're going. Visit www.ibuyspy.com to get some tutorials on how to use ASP+ in a commerce environment. There's some neat things, but most of it seems overkill, and some of the neat things still seem to lock you into a "web page" mentality (what if I want to output WML instead of HTML? - the "template system" idea seems suited ONLY to HTML imo). http://www.aspng.com/ is another site with a lot of info on the new ASP stuff. Bob wrote: >Do we have spies on the ASP list? What are they doing on their end? Now don't get me >wrong, I've been coding with PHP and have read every tutorial and article I can get my >hands on in regards to PHP so I don't want to see my time invested go to waste. Maybe >I should be asking on the developers list but I just want to hear some strategic >direction or preview for PHP5. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP on Solaris / Linux with MSSQL Server 7.0 or 2000 on Win2K
Boaz Yahav wrote: >Hi > >I'm currently using PHP 4 on Solaris on a front end server with MySQL on >Solaris as a db server. >Since I'm having weird problems with MySQL (3.23.41) on very active >tables (a 700,000 records table with lots >or reads and writes) . > >I want to work with MSSQL Server 2000 instead of MySQL, does anyone have >experience with working with such >a combination? PHP4 on Solaris as front and Win2K with MSSQL Server 2000 >as db? > >Sincerely > > berber > We use freetds under linux to connect to NT4/SQL7 on the backend. My understanding is that the freetds project *will* work on Sun, and that if you are using basic column type, it'll work with SQL2000. freetds.org - their FAQ may have some questions on SQL2000, but I haven't checked it in awhile. There weren't too many protocol changes between 7 and 2000 (from what I hear) so the basic stuff should work the same. What types of 'weird problems' are you having? - michael kimsal http://www.tapinternet.com/php/ php training courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Stress Testing.
Goalposts change. The zdnet eweek article from last november showed PHP being *THE* fastest between JSP, ASP, CF and PHP. PHP was 47 pages/second. ASP was 43, CF was 25 or 26, and JSP was 13. The benchmark was a ecommerce store - each system had functionally equivalent code, and ran on the same hardware. CF got 'top honors' because of its 'ease of use'. PHP was hands down faster than everything else. ASP was close, and became way faster when MS rewrote the code, but I suspect someone rewriting the PHP could have optimized it to see a 100% improvement as well. Part of the point here is that people will knock it for any reason they can, even if they don't know any better. We have a client (running PHP) who was in a meeting with one of their clients. Trying to demo a new service, they went to his site, which was responding very slowly (turns out there was some routing problems along the way - I *think* in the client's own office). Their "IT" guy (to use the term loosely) noticed the ".php" and said "Oh well, there's your problem - PHP isn't multithreaded - of course it's going to run really slow. You should use our __ system" (I forget if it was Java or MS). The guy was full of it, but everyone in the meeting got the impression that PHP sucked and was slow because it's not "multithreaded" (as if ANYONE in that room, including that dweeb, even understood the term, much less it's impact on performance). So what do you want to benchmark? Whatever it is, you really should get others from other camps to develop similar code - get an ASP person (who is good) to write a similar app, do the same with Java, etc. If you want to contact me privately, I would be interested in discussing this further (organizing, etc) Andy Woolley wrote: >Guys, > >Has anyone ever tested PHP, MySQL on Apache to see just how well it will >work when put under serious pressure. > >Seems that people all over the world are saying how PHP doesnt cut it when >pushed to the limit, question is what is the limit? > >Anyone interested in setting up a stress test, to try and prove how good PHP >really is. > >Andy. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] remote scripting objects
The javascript would have to call a PHP script on the server instead of an ASP script. It's nothing specific to MS stuff. MailingLists wrote: > I don't know if it's IIS or ASP that handles this, but there's a beast > called a remote scripting object. It combines JavaScript and ASP to > call a remote script on your server without having to submit your > browser or load a new page. SO I can add a value to a form field and > in the onchange event for that form call a function which resides in a > script on the server, it hits a database or whatever and then returns > a value that I can display on the same page. > > Is there any way to do this within a PHP script on Linux? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cybercash compiling as shared module
I'm trying this specifically with the cybercash module. When I just do ./configure --with-cybercash=/path/to/mck, it works (well, it gets thru configure and make anyway). ./configure --with-cybercash=/path/to/mck,shared and ./configure --with-cybercash=shared,/path/to/mck both don't work. Is Cybercash not something that can be compiled as a shared object? Rasmus Lerdorf wrote: >>That's not allowing me to simply dl() an SO file, because I don't have the >>SO file to start with - that's what I was trying to get at. If I have >>to reconfigure >>everything, there's not much point, I don't think. Unless I'm missing >>something >>obvious. I'd like to be able to simply have an SO file I can dl() >>without recompiling. >>Or are you saying that that configure statement WILL create an SO file >>that can >>be dl()ed later, without recompiling PHP? >> > >Exactly. When you do ./configure --with-foo=shared; make >then modules/foo.so will appear magically and you can dl() that or load it >using "extension=foo.so" in your php.ini. You don't have to recompile >PHP. > >-Rasmus > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: a general perl like pares of the query string...
Aaron, CC Zona wrote before that: If track_vars is on (always true if version >= 4.0.3), then the global vars $HTTP_GET_VARS['bob'] and $HTTP_GET_VARS['phil'] are already set. And if register_globals is on, then the global vars $bob and $phil are also already set. -- Taking from your original post - file.php?bob=manager&phil=employ If you create a file.php in your server, and hit it with file.php?bob=manager, you should just be able to say and you'll get "manager" printed out for you. Most installations of PHP, by default, create variables for you from the GET string parameters. There can be a security concern if you're not careful to validate the data that you get in from those GET strings, but this 'ease of use' (not having to use that Perl stuff from below, or firing up CGI.pm every request) is one of the main attractions to PHP for beginning developers. CC Zona also wrote that you can use the $HTTP_GET_VARS array (which would be the equivalent to the $fields{} array that is created below. One really nifty thing about PHP that isn't addressed in your Perl snippet below is arrays - file.php?name[]=mike&name[]=dave&name[]=keith would give me an array called $name with 3 elements in it. There's most likely a Perl module to handle that (does CGI.pm handle that) but it's handled automatically in PHP. Aaron Moore wrote: >Well hers teh perl version of the the parser... how do i convert this to php > >$tmp = $ENV{'QUERY_STRING'}; >@pairs = split(/&/, $tmp); > >foreach $item (@pairs) { > ($key, $content) = split(/=/,$item,2); > $content =~ tr/+/ /; > $content =~ s/%(..)/pack("c",hex($1))/ge; > $fields{$key} = $content; >} > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Assigning output of include() to a variable
file() probably won't do it, unless you call an http:// file request to your webserver - PHP won't execute other PHP code in another file when pulled in thru file(). What you are looking for is most likely output buffering. Read up on ob_start at php.net/ob_start. Basically turn output buffering on, include() the file, grab the contents from the output buffer, put them into $x, and clear the buffer. There should be an example or 2 at the website. zend.com also had an article on output buffering. -------- Michael Kimsal http://www.tapinternet.com 734-480-9961 On Mon, 10 Sep 2001, Jason Brooke wrote: > > Hi, > > > > I've been trying to figure this thing out for 3 hours now. Lets say we > have > > a variable $x. Now I need to assign $x with similar output that comes from > > an include function. > > > > For anyone who did not understand me --> Instead of the stupid include() > > function outputing the file contents to the browser I need it to assign it > > to variable x. > > > > I am pretty sure inlude() cannot do it but is there any other function > > similar to include() that will process the file and then assign the output > > to a variable. > > > > Thanks in advance > > > > SID > > there's a stupid function called file() that does that > it's in the stupid manual - which also explains the behaviour of include for > you as well > > jason > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Redirect in the middle of code?
As others have mentioned, output buffering is what you want to look at. I've been doing some minor research on CF the past couple weeks, and it seems that CF, by default, always has output buffering on. While it's great for allowing redirects/header info to be pushed out wherever in a script, it apparently also consumes more memory, as the engine needs to keep a full copy of the output in memory before pushing it down. While there are definitely systems where this is desired, it's an option in PHP, but doesn't seem to be one in CF. (If anyone can tell me differently - which CF tag to use to toggle it on/off - please let me know). http://www.php.net/ob_start would be a place to start reading about output buffering, and the zend.com article is good as well. Andrew Penniman wrote: >I am trying to figure out how to use PHP to redirect the user to a new >location *after* processing and most likely outputting a bunch of code. >Because this redirection would happen late in the game I can't use >header("Location: ".$redirect_to); > >I come from a ColdFusion background and am used to CFAS' >tag. Does PHP have an equivalent function? > >I am really hoping not to use JavaScript, I want this redirection to >happen at the server and not the client. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Redirect in the middle of code?
Good to hear. How's fusebox working for you? Andrew Penniman wrote: >The Steve Edberg (option #2) and Michael Kimsal suggestions to use >ob_start() output buffering work like a charm. Thanks so much! I would >have been a long time coming before I mad this connection on my own. >Guess I need to hone my archive querying skills... > >I think it would be _really_ swell if the documention for header() >mentioned output buffering as a means of tweaking the headers, >especially header("Location: ".$redirect_to), in mid-code. > >I Fusebox my pages (www.fusebox.org) so I only need to add a single >ob_start() and ob_end_flush() call to my source tree. If I'm >redirecting then I call ob_end_clean(); header("Location: >".$redirect_to); and everything works like a charm! > >Cheers! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Training Course
Hello all. This is just another reminder for anyone who may have missed it that we have another PHP training course coming up very soon. October 1-5, 2001, in Ann Arbor, Michigan, Tap Internet will be offering a PHP training course. The course will feature material aimed at beginners to intermediate PHP developers, with an emphasis on hands-on training. Each student will get their own net-connected terminal, with 5 full days of instruction. What you should know before you come: Basic knowledge of programming - variables, conditionals (if/else), etc. Basic knowledge of the web (relationship between browser and server) Basic understanding of HTML (simple forms creation, tables, etc) What you can expect to learn PHP syntax Database usage PHP/forms interaction Creating custom functions Basic session management Classes/objects overview Templating techniques Graphics creation More information can be found at http://www.tapinternet.com/php/ or you can call 1-866-745-3660 (toll free in US) or 734-480-9961 if you have more questions. We offer discounts to students and educational/government/nonprofit organizations, as well as group discounts. I look forward to hearing from everyone out there. :) --- Michael Kimsal http://www.tapinternet.com/php 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] User Authentication / only 1 login per user at any time
Hi there: We have this functionality built into our core framework with our custom session handling. The basic premise is that you don't store a 1/0 in a 'logged in' flag, but store the session key with the username. When someone logs in, assign their session key to that username. The previous session key associated with that username will be overwritten, and that user will no longer be able to do anything, because they have no data associated with their session. To do it like this, you'd need to come up with your own mechanism for deciding if someone was no longer valid - we tie that to session data. No session data, no access. If I log in with your username, you are guaranteed to be 'kicked off'. Hope that helps... Lewi Hirvela wrote: >Hi, > >With most of my scripts, when I am about to write something, I have it in my >head on how to do it exactly.. But with only 1 login per user at anytime, I >havent found any good ways to do it, > >All I can think of is to set a mysql field called ³logged_in² to ³1² or ³0² >if logged in or not, but the problem with that is if you close the browser , >it will stay ³logged_in=1² , > >Is the way around that problem to do some sort of timeout code that checks >all ³logged_in² in the whole table and also a field where it logged the last >time the user accesses a page, to see if the user has accessed a page within >20 minutes .. Or is there a better way to do it? >Thanks, >Lewi > Michael Kimsal http://www.tapinternet.com/php PHP Training Courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: More thoughts about PHP: Taglibs
Perhaps you should just use cold fusion then, if you're that hot and heavy into tag-based languages. tagservlet.com has a Java/CF hybrid which may hold some interest. PHP's strength, IMO, is that it's NOT a tag-based language. You can create any functions you want and call them already from a combination Separating code/content is a much stronger idea, with just variable replacements in the 'template'. In the examples below, how do you gracefully handle errors? You don't - not without addding more code to the file. Or look more into XML/XSLT stuff. nicolas costes wrote: >maybe one day, PHP will implement user defined tags >this could be an idea, if this is prooved to be useful. > > > >(°-Nayco, >//\[EMAIL PROTECTED] >v_/_ http://nayco.free.fr > >ORIGINAL MESSAGE-> > >Yep this is not bad! > >> >>Hello, . Your last login was . >> >> > >and now using PHP's short tags, you can make it even prettier: > > > Hello, . Your last login was . > > >Right? > >"Dr. Evil" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >>It seems to me that one of the problems with PHP is that you have to >>include code in your HTML pages. Even with the cleanest design, you >>end up with HTML that looks like this: >> >> >>Hello, . Your last login was >showlastlogin(); ?>. >> >> >>This is ok, but it seems to me that java taglibs provide a more >>elegant way to do the same things: >> >> >>Hello, . Your last login was . >> >> >>This lets the backend stuff be completely separated from the html >>design part of things. What do people think of this? I'm just now >>learning JSP so I'm thinking about the differences between PHP and >>JSP. >> >>In general, both are powerful ways of creating dynamic websites, but >>they have different characteristics and are better for different >>things. I'm learning java but I will continue to use both, depending >>on the task. >> > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] More thoughts about PHP: Taglibs
Dr. Evil wrote: >It seems to me that one of the problems with PHP is that you have to >include code in your HTML pages. Even with the cleanest design, you >end up with HTML that looks like this: > > >Hello, . Your last login was showlastlogin(); ?>. > > No, you don't. Have a script file that processes your information, then include() a template file that would have drop in replacements file1.php template.html Hello your last login was . Your PHP file can get fancy. file1.php 60 days) { $template="foolate.html"; } include($template); ?> You can check conditionals, handle errors, etc., in your PHP file, without putting any function calls in your HTML template. We try to avoid putting function calls in the templates at all costs. variables - yes. logic (if/else/etc) - yes (on occasion). function calls? No. > >This is ok, but it seems to me that java taglibs provide a more >elegant way to do the same things: > > >Hello, . Your last login was . > > Again - what if showlastlogin returned an error for some reason? How would you handle that there? If the 'elegance' is simply saving a few keystrokes, that's not really doing much. :( > >This lets the backend stuff be completely separated from the html >design part of things. What do people think of this? I'm just now >learning JSP so I'm thinking about the differences between PHP and >JSP. > It's not separated enough if you're possibly pulling back stuff from functions which you haven't error checked. You would do that error checking in the template then, which doesn't strike me as very efficient in most cases. > >In general, both are powerful ways of creating dynamic websites, but >they have different characteristics and are better for different >things. I'm learning java but I will continue to use both, depending >on the task. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Performance: PHP vs. Visual Basic
Much as I don't like to defend MS, I'll take a stab here. By 40-50 people in an office, I presume you're talking about an intranet of some type - 40-50 aren't constantly hitting it (meaning 40-50 requests per second all the time), but 40-50 are using it throughout the day for various tasks. You don't give the machine specs, but I'd hazard to say, if it's moderate equipment, that there's some DB optimization (or VB optimization) that could be done. 40 people lightly hitting a machine shouldn't cause much of a problem regardless of language used, unless there's some extremely bad coding going on. Are you closing DB connections? Are you avoiding putting objects in session and/or application scope? Are the DB queries optimized properly (proper indices on tables, etc)? Those are just a few things I'd look for. Yeah it'd be great to have you switch to PHP, but some optimization issues are universal, and if it's written poorly in one language, chances are it'll be written poorly in another. Regardless of this, we still recommened PHP to most clients because of the cost issue as well. However, since you've already paid for this software you're running (right?) it's probably worth it to take a while to optimize what you've got first. Michael Kimsal http://www.tapinternet.com 734-480-9961 On Sun, 16 Sep 2001, Masami Kawakami wrote: > Maybe this is one of FAQ, Please give me a URL of this kind of comparison > page, or your experience. > > A web server program is running in my office. It consists of Visual > Basic, IIS, and MS SQL Server on Windows 2000. although the performance > is confortable for few users, it is terribly slow for 40-50 users. Once > all of them start to use, it takes more than 20 seconds to open a page > in client browser. > > To improve the performance, we have an idea to use, instead of Microsoft, > PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be the > improvement? > > We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 3rd > for IIS or Apaches. Which has better scalability, VB or PHP? > > > > -- > Masami Kawakami <[EMAIL PROTECTED]> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MSSQL Support
Jason Wilson wrote: >I'm compiling PHP and have a request from one of my developers for MSSQL >support in mod_php (4.0.6). However, I don't see a configure option for >MSSQL. Is there a *secret* configure option or are the MSSQL functions >built in by default? > >+---+ >| +-+ Digitally Enhanced| >| |-O-O-| Portrait of: | >| | % | Jason Wilson, | >| | --- | Systems Administrator | >| +-+ Nextron, Inc. | >+---+ > No offense, but I hope that's not a good likeness. :) There's no secret - there's no *real* way of doing MSSQL stuff from linux/unix, which it seems you're trying to do - ("mod_php"). PHP doesn't include anything by default (bear with me) - it basically access other code libraries for their functionality. Obviously for basic stuff like variable manipulation it does it itself - but things like PDF creation, database handling, etc. - those are all libraries that get compiled in. MS doesn't make DB libraries available for unix platforms. I know some larger companies buy access to them and create their own commercial products, but there's no official MS stuff out there. That's why I said 'real' way. However... Our local genius Brian Bruns reverse engineered the TDS protocol which is what MS uses to talk between clients and servers. His project is located at freetds.org. We've used it fine talking from a RedHat 6.2 box to multiple SQL7.0 machines on NT4. I say he's our local genius cause he presents at our local LUG and PHP user groups on occasion. One hell of a nice guy. :) FreeTDS will be sufficient for most of your MSSQL needs if you need to connect from Linux/Unix. Good luck. :) Michael Kimsal http://www.tapinternet.com/php/ PHP Training Courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: event cache management (no, not code cache) -- W32/Nimda filter
Sean Straw / PSE wrote: > > The design consideration here is that an SQL dependance means anyone > who might want to use the module (this is for dealing with CodeRed and > W32/Nimda and no doubt the next IIS worm that strikes) must do SQL > setup for a new database, etc. > > oh, and after verifying that the whois protocol is indeed as trivial > as I thought is was, I've dealt with that - so at the moment, my > script isn't dependant upon any external utilities (obviously, support > for updating a firewall would require an external script (fired up > from cron), but that isn't required unless you're going to actually > enable the firewalling capability, and it still isn't something that > is exec'd from the PHP script). Just to throw my two cents in, I'd agree with Richard that SQL would make this much easier. Yes, you'd need to set up a db or table for the SQL stuff, but it's going to be much more scaleable, and my hunch is most people that are concerned enough about nimda and future worms/viruses/etc are either going to have some SQL database at their disposal, or will expend the time/effort to get one. Also, consider those with multiple web servers - each of them logging distinct data would be overkill - a separate DB machine would take the load off them (network only, no disk) and keep a centralized copy of logs. Good luck. Michael Kimsal http://www.tapinternet.com/php/ PHP training courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] chat with php
Edney Marcel Imm wrote: >HI. > >Anyone have a chat with php? > >tks > ME: Hello PHP PHP: Hello M: How are you? P: Tell me more about you. M: I'm just a guy living in Michigan P: Are you sure? M: Yes P: How does that make you feel? M: I dunno... Sorry - I couldn't resist. Visions of old ELIZA popped into my head when I read your question. There's a list of some chat software at http://www.zend.com/search_app.php?key=chat&CID=9 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]