[PHP] can you prompt for variables in command-line CGI?

2001-08-26 Thread Derek Sivers
for a SHELL SCRIPT using php binary: in bash I would do this: #!/bin/bash echo -n "username: " read username echo -n "password: " read password echo $username echo $password Run on the command-line, it would stop and ask me for the username and password, then continue the bash shell script. B

[PHP] use NEWLY-ASSIGNED SESSION id?

2001-04-05 Thread Derek Sivers
My PHP script (with --trans-sid enabled) assigns a session ID for people without cookies. No big deal, right? BUT THE BIG QUESTION IS: Can I immediately know what long string PHP assigned to the session, without having to click to a different page first? I want one single PHP page to #1 - a

Re: [PHP] sessions broken when redirected?

2001-03-29 Thread Derek Sivers
I had this same problem and it constantly broke our whole site. So I tried a different approach and this has been working great: Instead of Consider: It works flawlessly, always, and maintains your session. Because my site ( a shopping cart/store ) is so dependent on sessions, I stopped us

Re: [PHP] files with html extension

2001-03-20 Thread Derek Sivers
>I recommend people don't do this unless their web server is going >to serve only(or mostly) php pages, and very few straight html pages. >the increase in overhead isn't really worth it. I've tried this in many real-world examples. I have PHP parsing ALL files on ALL of my 8 Linux servers.

Re: [PHP] Classes and Object Oriented Programming

2001-03-17 Thread Derek Sivers
>Is there a good tutorial on Classes? http://www.zend.com/zend/tut/class-intro.php That's a really good one. -- 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-

Re: [PHP] Statistics function

2001-03-15 Thread Derek Sivers
>the connection will close when you hit cancel but the PHP >code can continue running if you choose. Really?!? How do you choose to have the PHP script continue even if a browser leaves/dumps? I've always wanted to do that. Didn't know it was possible. -- PHP General Mailing List (http:/

[PHP] normal for Apache to hang?

2001-03-14 Thread Derek Sivers
Does your Apache hang? Is that normal? To have commands sitting for 1-2 minutes? Using Apache 1.3.17 + PHP 4.0.4pl1 + newest MySQL on a Debian Linux box. I use PHP for pretty much everything. So I have Apache set to parse all files as PHP. But that's never been a problem before. (This is a new s

[PHP] spidering dynamic pages

2001-03-11 Thread Derek Sivers
>if I move everything to php and just use a different text file for each >page for the main body of text and load each text file depending on what >page the user wants, would the search engine search though those text >files and just link to those and not to the php file? Would it even be >spide

Re: [PHP] Sending "pretty" email

2001-03-11 Thread Derek Sivers
At 07:49 AM 3/11/01 , Richard Scott Crawford wrote: >The first thing to do is to take two aspirin and lie down until the >temptation to do this passes. It may be cool, but those of us who use >Eudora or Pine for our e-mail don't read HTML-encoded mail, don't *want* >to read HTML-encoded mail,

Re: [PHP] Sending "pretty" email

2001-03-10 Thread Derek Sivers
>I often receive email from commercial sites (e.g. ZDnet) that looks like >a Web page. How can I do that with Sendmail in PHP? The man page for "mail" gives an example of it. http://www.php.net/mail It's just one "$header" line, stating HTML, then the rest of your message should be in HTML:

Re: [PHP] How to protect my scripts ???

2001-03-10 Thread Derek Sivers
>Can't the files be put into a directory that Apache has access to and >the users don't, and just ask the users to include them? Or put them >into a global prepend in a directory same as above? This isn't PERFECT, but I do this: #1 - make a user/group called "www" #2 - Set Apache to run as th

Re: [PHP] payment - the death of CyberCash

2001-03-09 Thread Derek Sivers
Everyone so far has been recommending ClearCommerce: http://www.clearcommerce.com/ Since my site is 100% PHP and depends on CyberCash for sales, I'll let everyone here know what I find out about getting PHP to work with ClearCommerce or anyone else. -- PHP General Mailing List (http://www.

Re: [PHP] include() & require()

2001-03-07 Thread Derek Sivers
>Which is the main difference between include() and >require() functions? "include" is optional you can put it inside an "IF" like this: if (0) { /* THIS WILL NOT SHOW... */ include "optional_file.php"; } but "require" happens every time, even if it is inside an "IF" that does no

[PHP] PARANOID PERMISSIONS for apache?

2001-02-13 Thread Derek Sivers
Can anyone think of any downside to this idea? Set Apache to run as user/group "www:www" Set ownership of PHP files and folders to "www:www" And set permissions to 700 So that ONLY Apache can read them. Now - even if I give someone shell access to my box, or someone finds my personal login pas

Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Derek Sivers
>I'd really appreciate a clear statement whether to use better >$foo = array('bar' => 'boing'); > doWhatSoEver($foo[bar]); >or >$foo = array('bar' => 'boing'); > doWhatSoEver($foo['bar']); I had heard someone on the list say that it's always best to use quotes, for the same rea

[PHP] HOWTO: Installation on Cobalt RaQ (RaQ3 or RaQ4)

2001-01-24 Thread Derek Sivers
I run about 8 Cobalt RaQ3 and RaQ4 boxes, and this is the installation procedure that always works for me. Don't use the Cobalt RPMs. They're bad & out of date. - GET THE SOURCE TARBALLS for MySQL and PHP4 from the command line: lynx h

[PHP] where does "MAKE INSTALL" put PHP things?

2001-01-11 Thread Derek Sivers
When you do a standard PHP4 "apxs" configure... ./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql where does it put files when you do a 'MAKE INSTALL' ?? (Or - how would I find out?) -- I have a Linux box that's having C-compiler problems. But since it's the EXACT sam