[PHP] Re: looking for a PHP editor
"Carsten Gehling" <[EMAIL PROTECTED]> writes: > From: "Teodor Cimpoesu" <[EMAIL PROTECTED]> > Sent: Tuesday, January 09, 2001 10:40 AM > > > as for assembly, it's a good start in understanding PHP, really. Start > from > > the bottom. > > Real programmers do "copy con >filename.exe" (well at least in > dos/windows... :-) Well, on some other mailing list a while ago the concensus was that Real Programmers do "cat /dev/audio > filename" and then hiss machine code into the microphone. p.s. Real programmers do `cp', not `copy'. ;^P -- Arcady Genkin Don't read everything you believe. -- 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] Re: looking for a PHP editor
"Sabina Huang" <[EMAIL PROTECTED]> writes: > Yes, there is. > I was recently testing CodeCharge (www.codecharge.com) and it is the best > (or maybe the only :-) tool that creates PHP automatically, so you don't > need to code :-) LOL! Their website comes up with a huge horizontal scroll-bar, and is terribly misalligned (the background on the right, all the content to the left of it, off-screen). If this is the kind of websites it generates, I wish you best of luck. ;^) (Netscape 4.7, UNIX) -- Arcady Genkin Don't read everything you believe. -- 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] Use
I have noticed that 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] Re: Use
"mOrP" <[EMAIL PROTECTED]> writes: [badly formatted message fixed] > > I have noticed that > in documentation, how safe is it to use it? > > Can someone point me to the documentation of ' know what it does. See http://www.php.net/manual/en/language.basic-syntax.php -- Arcady Genkin Don't read everything you believe. -- 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] User login using session algorithm
I'm planning to write a simple user login module. I want it to be a stand-alone class, and not rely on cookies (I'm passing all variables via GET method anyways, so I just want to pass a session ID in the URL). Before I go ahead and do some mistake, could somebody have a look at the outline of the algorithm I've come up with? Any opinions greately appreciated. http://www.thpoon.com/~antipode/tmp/user_auth.png The algorithm is presented as a flowchart. p.s. I'd like to "roll my own", even though I know that there is authentication code available. Many thanks, -- Arcady Genkin Nostalgia isn't what it used to be. -- 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] Life of environment variable set put putenv()
I could not find this in the docs, but maybe I've been looking in the wrong place. Could someone give me an authorative answer or point me to it someplace else, to the question: When you set an environment variable with putenv(), is there a chance that it would be visible to any other PHP script served by the same apache child? Many thanks, -- Arcady Genkin -- 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] Life of environment variable set put putenv()
[EMAIL PROTECTED] ("elias") writes: > "Arcady Genkin" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I could not find this in the docs, but maybe I've been looking in the > > wrong place. Could someone give me an authorative answer or point me > > to it someplace else, to the question: > > > > When you set an environment variable with putenv(), is there a chance > > that it would be visible to any other PHP script served by the same > > apache child? > > never tried it though...but through my experience i would say: > The Environment values that are set within a script can be seen only within > child scripts (ie when script1.php spwans scrip2.php) In case anyone was following, the issue has been resolved. Have a look at http://www.php.net/bugs.php?id=10970 Awesome bug resolution turnaround! -- Arcady Genkin -- 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] session_unset() and session_destroy()
I don't think that I grasp the difference between session_unset() and session_destroy() functions. Would anyone explain? Also, suppose that I want to totally wipe out an existing session, and then start a new one. Can I still do session_register() after I do session_unset() or session_destroy() or both? Many thanks, -- Arcady Genkin -- 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] Error: symbol _erealloc not found, PHP 4.0.6 under Solaris/Sparc
When trying to load Zend optimizer, the following error gets logged: Failed loading /var/www/lib/ZendOptimizer.so: ld.so.1: \ /opt/apache/bin/httpd: fatal: relocation error: file \ /var/www/lib/ZendOptimizer.so: symbol _erealloc: referenced \ symbol not found It seems from whatever little bits I could find on the Net, that the _erealloc symbol should be defined in the PHP itself. The PHP is installed as a module with Apache 1.3.22, compiled from sources, and is (otherwise) working perfectly fine. Any ideas on how to overcome this problem? Many thanks, -- Arcady Genkin Don't read everything you believe. -- 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] pg_fetch_object() and composite field names
Suppose I have a query like this: $query = "select A.id, B.id from foo A, bar B where A.bleh=B.blob;"; $result = pg_exec( $db, $query); $obj = pg_fetch_object( $result, 0 ); My question is: How do I access the field names in the $obj now? I know that I can transform the query to avoid this problem, or use a function other than pg_fetch_object. But I'm interested whether pg_fetch_object _can_ be used here. Many thanks, -- Arcady Genkin -- 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] Email verification (was: [PHP] Removing Invalid Users)
"Steve Werby" <[EMAIL PROTECTED]> writes: > "Arcady Genkin" <[EMAIL PROTECTED]> wrote: > > If I understand correctly, vrfy does not wholy depend on that > > functionality to be supported by the server. I think that it simply > > connects to the smtp port of the mail exchanger and emulates an email > > delivery, aborting halfway. > > I hadn't used the tool until after this thread started, but it appears it > uses the vrfy command when checking an email address, other flags let you > check a domain's mx record or attempt to use the etrn command. [...] > IMO, it makes more sense to use PHP's built in functions that can do > the same, but YMMV. vrfy does appear to be a decent tool, my point > was that when checking email addresses (not domains) most servers > will deny the vrfy command and so it won't be very useful. In fact, > I tried a number of different email addresses on different hosts and > all reported "Command Unimplemented". You are right, by default the proggie is not very useful. The "-n" option is probably of the most utility: -n Many non-sendmail hosts do not, or incorrectly or incompletely, implement the VRFY command. Other systems have VRFY or EXPN disabled for privacy reasons. This option uses an alternative protocol suite with the regular HELO, MAIL, RCPT and RSET commands. This gives only a global indication whether the recipient is valid. Recursive mode is not possible, and will be disabled. I've tried it with a number of email addresses, and it worked. Of course, this can be coded in the PHP script, but it would require elementary knowledge of SMTP protocol and more code to debug and maintain. For many people relying on an external utility like that may have more advantages. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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: Protecting from session hijacking
"Ian Bagley" <[EMAIL PROTECTED]> writes: > Indeed, SSL is the only way to properly protect from 'stealing' a > SID, but still, the MD5 solution does tend to protect the integrity > of the query string. Yes, I like the MD5 trick very much. It seems that if using Cookies and POST employing it would be quite cumbersome... I wish PHP did that for me automatically. :) -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] error_log not obeyed
[message format fixed] "..s.c.o.t.t.." <[EMAIL PROTECTED]> writes: > > I'm trying to send PHP errors into a separate log file. I have the > > following in php.ini: > > > > log_errors = On > > error_log = /var/www/logs/php-errors.log > > > > After apache restarted the errors are now being sent to apache's error > > log, but not the one I specified. Any ideas? > > does the directory exist? This is the same directory where Apache writes its own logs. It' only writeable to root, but I thought that the controlling apache process would be responsible for creating the file (controlling apache runs as root). > does php or apache have the right to create new files > in /var/www/logs/? > > if the file exists, are the permissions set correctly on it? > > keep in mind that the user that owns apache usually > has very limited powers Well, see above. If Apache can write its own logs there, it should be able to write PHP's logs there too, right? What worries me is that the logs are directed into apache's error logs. This makes me think that the problem is not with permissions... Any further ideas, anyone? Thanks, -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] news.php.net -- will it work?
I used to read this list via the newsserver news.php.net. It has been down for a while: is the news service going to be restored eventually? Thanks, -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Protecting from session hijacking
Is there any real way to protect against possibility of session hijacking? I thought of checking IP address on subsequent requests, but apparently this cannot be relied on because of HTTP proxies etc. Any wizdom on the matter? (I'm already saving the session files in a directory protected from unwanted eyes.) -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] iterating over /etc/group
Does PHP provide no high-level means of iterating over the UNIX /etc/group file, a la getgrent() C function? The task is to figure out all groups that a user is in on a system with PHP in _safe mode_ (hence, cannot read from /etc/group directly). Am I overlooking something? Many thanks, -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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 Run Command Line
"Matt Simpson" <[EMAIL PROTECTED]> writes: > I need to let PHP run a command as SU... is there any way it can be done? I > need it to let Courier compile it's makeuserdb and makemaildir. Any help > would be great. If you *really* want to do that, you can install `sudo' package, and configure it to allow running a particular command as root to whatever user Apache runs as. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Using PHP + GD to make bar graphs?
While taking a university course I needed to ``squash the competition'' by hacking together quick bar-charts with PHP. These are not very sophisticated, but I liked my approach because they generate very little graphics (read: fast downloads), and when you roll a mouse over a bar, you get numeric value for it. Have a look at: http://www.thpoon.com/408/barchart.php Input is taken from a text file. If anyone is interested in the source code, let me know and I'll release it. The code is rather trivial, though. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Using PHP + GD to make bar graphs?
"Robert L. Yelvington" <[EMAIL PROTECTED]> writes: > on 7/5/01 10:15 AM, Arcady Genkin at [EMAIL PROTECTED] wrote: > > > While taking a university course I needed to ``squash the competition'' by > > hacking together quick bar-charts with PHP. These are not very > > sophisticated, but I liked my approach because they generate very > > little graphics (read: fast downloads), and when you roll a mouse over > > a bar, you get numeric value for it. Have a look at: > > http://www.thpoon.com/408/barchart.php > > Input is taken from a text file. If anyone is interested in the > > source code, let me know and I'll release it. The code is rather > > trivial, though. > > They look very nice and usable...just the way i like 'em. > > I'd be interested in seeing the source code...you can reply directly to my > email account if you like! are you using a graphic package like GD? or are > you using the 'poor mans bar graph' method using tables and percentage > widths? Each individual bar is generated with GD, and arranged in a table. The images are stored in subdirectory "bars" (should be writeable to Apache). Each bar is given a name like bar_NNN.png, where NNN is its height in pixels. If a bar of a given name already exists, it is not re-generated. I never intended to release the code, so it has some stuff hard-coded, like the number of columns and the colors, and not commented. Shouldn't be hard to change, though. Ideally the whole thing would be organised in a class. If anyone takes the time to rearrange the code, or improve it otherwise, I'd like to see the results (although you don't really have to). All functions are in a file "barchart.inc": http://www.thpoon.com/408/barchart.inc.phps Example of using the functions are in this file: http://www.thpoon.com/408/barchart.phps Example input file is here: http://www.thpoon.com/408/sqattl.txt Have fun, -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Email verification (was: [PHP] Removing Invalid Users)
"Steve Werby" <[EMAIL PROTECTED]> writes: > So unfortunately vrfy will only be useful when checking servers that haven't > disabled that command. :-( If I understand correctly, vrfy does not wholy depend on that functionality to be supported by the server. I think that it simply connects to the smtp port of the mail exchanger and emulates an email delivery, aborting halfway. Basically it wants to determine whether the mail exchanger would accept email for a given domain. In most cases it won't give you 100% certainty that the email addy is legit, but at least you know that the domain part is not faked, and there is a mail exchanger willing to serve it. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] preg_match
"Daniel Reichenbach" <[EMAIL PROTECTED]> writes: > i've got a string which looks like "<[EMAIL PROTECTED]>". Now i wanted > to check it with preg_match like this: > > if ( preg_match( > '/[\<][a-z]([-a-z0-9_.])*@([-a-z0-9_]*\.)+[a-z]{2, }[\>]/i', $value ) ) { > print "Valid mail address"; > } else { > print "Invalid mail address"; > } > > Unfortunatly this doesn't work. I think, i have to use a different syntax > for the "<" and ">" braces. Can somebody give me a hint? According to the manual, "<" or ">" are not metacharacters, so no use escaping them. In any case, your expression can be simlified somewhat using Perl's \w sequence. Don't forget to designate beginning and end of string. Try the following: '/^<\w[\w.-]*@([\w-]+\.)+\w{2,}>$/i' -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Security of PHP code
"Hankley, Chip" <[EMAIL PROTECTED]> writes: > Is it possible to have such a function on your site w/o giving access to ALL > of your documents... On top of everything the other users recommended, you can enable safe mode. It will protect you from sloppy programming. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Executing UNIX commands with PHP
"Tim Taubert" <[EMAIL PROTECTED]> writes: > how can i execute a UNIX command like > 'newuser "Tim Taubert" tim password' > ? and am i able to fetch the results of such commands? Since someone else replied to your question, I'll just mention that running such command may be a really bad idea. If someone runs `ps' at the same time, he'll be able to see the password for user `tim' in clear text. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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 escapes shell commands for me?
PHP version 4.0.5 under: SunOS 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-Enterprise magic_quotes_gpc = On magic_quotes_runtime = Off It appears that PHP by default escapes arguments of any commands passed to exec() and friends (passthru(), popen()). As a result I am not able to pass an argument consisting of two tokens, separated by space, as one argument. Is this intended behavior? Is this inflicted by some option in php.ini? I have another server running FreeBSD with virtually identical php.ini file, and it doesn't exhibit such misbehavior. Many thanks for any ideas, -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] Email verification (was: [PHP] Removing Invalid Users)
"Steve Werby" <[EMAIL PROTECTED]> writes: > "Clayton Dukes" <[EMAIL PROTECTED]> wrote: > > How can I write code that will search the database and check the > > validity > of an email address, and if it's bad, to remove that > > entry from the database? > > Like Tom said, use regex to check the email is of a valid format. A small > percentage of servers can be contacted to find whether an email address is > valid, but fewer and fewer are allowing this so it's completely unreliable. There's a nifty little open source program called `vrfy' which does nice things about email veryfication. Finding it is left as an exercise to the interested (I found it in FreeBSD's ports). Excerpt from the man page: NAME vrfy - Verify electronic mail addresses SYNTAX vrfy [options] [-v] address [host] vrfy [options] [-v] -f [file] [host] vrfy [options] [-v] -p domain vrfy [options] [-v] -T domain [name] DESCRIPTION vrfy is a tool to verify electronic mail addresses. The only required parameter is the address to be verified. The actual verification will be carried out at the remote machine where mail to the given address would normally be delivered. This may be a mail exchange host and not the final destination host. If an explicit host is given as the second argument on the command line, the specified address is verified at that machine. The output of the program shows whether or not the address can be handled at the contacted host. Error messages will be printed if the address is invalid. If the address is recognized, the output shows the remote host's notion of the (possibly translated) address. If it represents a local user at that host, additional information about the user may be displayed. Note that if the address is accepted by the contacted host, but this is not the final destination host, one still cannot be sure that the address represents a valid recipient. It is a handy tool to verify local mail addresses. If you have set up a .forward file, you can verify your own address to check that the forwarding is done properly. If you specify an arbitrary name, you can check whether this resolves to any valid recipients. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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] iterating over /etc/group
[EMAIL PROTECTED] writes: > On Wed, 04 Jul 2001, Arcady Genkin wrote: > > > Does PHP provide no high-level means of iterating over the UNIX > > /etc/group file, a la getgrent() C function? The task is to figure > > out all groups that a user is in on a system with PHP in _safe mode_ > > (hence, cannot read from /etc/group directly). > > Am I overlooking something? > > > system ("/usr/bin/id $user -G"); Thanks, but this would not work in safe mode. I solved the problem by having a cron job making a local copy of /etc/group once in a while; my script then goes through it line by line to extract the groups. But this is a hack... I could, of course, install `id' in the safe_mode_exec_dir, but the sys admin is rather reluctant to have too many executables in there, and I understand him. I just wish that PHP had a posix_getgrent() function. Maybe I should file a feature request... I'll go do that now. -- Arcady Genkin i=1; while 1, hilb(i); i=i+1; end -- 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]