RE: [PHP] Trigger root script?

2005-09-26 Thread Michael Sims
Jeffrey Sambells wrote: I need a php script to trigger another script to run as root on a machine. Currently, the scripts run as the www-data user, but that means I can't modify any files on the system that aren't owned by www-data or world writable. I somehow need to trigger a php script to

RE: [PHP] Re: email validation (no regex)

2005-09-22 Thread Michael Sims
J B wrote: On 9/21/05, Michael Sims [EMAIL PROTECTED] wrote: Additionally, some mail servers unconditionally accept mail addressed to ANY username at their domain, whether that user actually exists or not. This is very bad practice, because it usually means the accepting MTA is a dumb host

RE: [PHP] Max execution time while doing DB queries

2005-09-22 Thread Michael Sims
Jeroen Geusebroek wrote: I was wondering how i can limit a script from waiting too long for a database query to return. The problem is that it will wait an infinite time while performing a query on a database when there is for example a lock on a table. I want it to exit/fail when a set

RE: [PHP] Max execution time while doing DB queries

2005-09-22 Thread Michael Sims
Jeroen Geusebroek wrote: For this application i'm using a MSSQL database. There is an ini setting (mssql.timeout) which should do what i want but afiak doesn't work. It defaults to 60 which i assume are seconds. My app has had times that it was waiting way longer then that before it died

RE: [PHP] email validation (no regex)

2005-09-21 Thread Michael Sims
Jim Moseby wrote: There's no requirement for an MX-record, so you'd need to check the A-record ($domain) too. Excellent answer. No requirement for MX record? [showing my ignorance] How does email routing happen if there is no mail exchanger in the zonefile for a particular domain?

RE: [PHP] Re: email validation (no regex)

2005-09-21 Thread Michael Sims
Philip Hallstrom wrote: but you could do what you want to do. however, it's going to be painful if you want it to match the rfc spec... Really? Why does it need to be painful? I just need to do a 'EHLO', 'Mail From:' and 'RCPT to:' and 'QUIT'. It's not going to actually send an email.

RE: [PHP] Re: Suggestions for class design

2005-09-20 Thread Michael Sims
Murray @ PlanetThoughtful wrote: Once he understands how to solve class abstraction problems such as the one he is asking about, he will be better equipped to deal with a wider range of application development tasks. I agree with this. This is not to trivialize your Metastorage project (or,

RE: [PHP] Tidying code for PHP5.0.5/PHP4.4.0

2005-09-20 Thread Michael Sims
Jochem Maas wrote: foo($a = 5); by definition the expression is evaluated _before_ the function is called - so the expression is not passed to the function, the result of the expression is passed ... I was under the impression that the the expression evaluates to a 'pointer' (I'm sure thats

RE: [PHP] Tidying code for PHP5.0.5/PHP4.4.0

2005-09-20 Thread Michael Sims
Rasmus Lerdorf wrote: Michael Sims wrote: When used as an expression, an assignment evaluates to whatever is on the right side of the assignment operator, not the left. Example: [...] foo($a = 5); and foo(5); are exactly the same... The value passed is the same, but when passed

RE: [PHP] Tidying code for PHP5.0.5/PHP4.4.0

2005-09-20 Thread Michael Sims
Jochem Maas wrote: Michael Sims wrote: So, as far as foo() knows: foo($a = 5); and foo(5); are exactly the same... I don't think they are, and you're examples don't prove it. Anyone care to come up with the proof. No, I was wrong, Rasmus corrected me. That's my one allowed mistake

RE: [PHP] Re: Suggestions for class design

2005-09-20 Thread Michael Sims
Murray @ PlanetThoughtful wrote: My post was not aimed at saying 'using packaged approaches to solve coding problems is bad', but to say 'the original poster is asking a fundamental learning question, so a packaged approach will possibly, maybe even probably, hamper his development as a

RE: [PHP] Suggestions for class design

2005-09-19 Thread Michael Sims
Chris W. Parker wrote: Let's take for example a class called 'Customer' that (obviously) manipulates customers in the database. Here is a very basic Customer class. (Data validation and the like are left out for brevity.) [snip] Where I get tripped up is when I realize I'll need to at some

RE: [PHP] PEAR and MSSQL

2005-08-17 Thread Michael Sims
Chris Boget wrote: We are using PEAR as our database abstraction layer for connectivity to MSSQL. It seems that, for some inexplicable reason, that our code is losing it's connection to the sql server. I've had similar problems in the past, only in my situation it was connecting from a Linux

RE: [PHP] REGEX for query

2005-08-11 Thread Michael Sims
Jay Blanchard wrote: [snip] Assuming unix, I'd do the following from the root of the application to get a list of files that contain queries: $ egrep =[:space:]*\.*\b(SELECT|INSERT|UPDATE)\b * -ril ... Anyway, that's how I'd do it. Hope you got something out of this... :) [/snip] That

RE: [PHP] REGEX for query

2005-08-10 Thread Michael Sims
Jay Blanchard wrote: I have a rather interesting issue. I need to locate every query in every PHP application we have for an integration project. I have started doing some research, but I wanted throw this out there as a little exercize because it is interesting. Several queries are written

RE: [PHP] parallel execution of php code?

2005-08-08 Thread Michael Sims
Martin van den Berg wrote: I have this piece of php-code which inserts data into a database. Before inserting it must verify if the data is unique. The php code looks something like: $query = SELECT id FROM mytable WHERE bla LIKE . $x .; $rows = execute( $query ) if ( $rows == 0 ) {

RE: [PHP] String to Stream

2005-08-05 Thread Michael Sims
Eric Gorr wrote: Again, I would like to treat the string as a stream. One possible way to accomplish this would be to simply write the string to a temporary file, open the file with fopen and then use fscanf, fseek, etc. to process the text. However, I am assuming there is an easier way

RE: [PHP] DAO/VO Pattern Help

2005-07-13 Thread Michael Sims
Jed R. Brubaker wrote: So I am running into a problem that I could really use some direction on: DAO/VO works great with single tables, but I tend to make my database work for its existance, and joins ar eeverywhere. What I don't understand is how to approach DAO/VO when table joins are

RE: [PHP] Find largest integer filename

2005-07-05 Thread Michael Sims
Richard Lynch wrote: Suppose I have a directory with a HUGE number of filenames, all of which happen to look like integers: [...] Now, in a PHP script, what's the most efficient way to find the largest filename, where largest means in the sense of an integer, not a string? [...] Is there

RE: [PHP] Bug in look-behind assertions in PCRE patterns ?

2005-03-23 Thread Michael Sims
Ian Thurlbeck wrote: Dear All Is this a bug ? [...] $line = '$res = $bar(ddd, dfdf);'; if (preg_match(/(?!\$)(bar)/, $line, $matches)) { echo Should NOT match \$bar, but found: .$matches[1]; } In the first preg_match() is correctly ignores the foobar function

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
[EMAIL PROTECTED] wrote: OK, this is off-topic like every other regex help post, but I know some of you enjoy these puzzles :) This isn't an exam question, is it? ;) I need a validation regex that will pass a string. The string can be no longer than some maximum length, and it can contain

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
Bret Hughes wrote: On Sat, 2005-01-29 at 08:58, Michael Sims wrote: [EMAIL PROTECTED] wrote: I need a validation regex that will pass a string. The string can be no longer than some maximum length, and it can contain any characters except two consecutive ampersands () anywhere in the string

RE: [PHP] Is this a mysql_connect() bug?

2005-01-29 Thread Michael Sims
tom soyer wrote: Thanks for the error handling code. I think PHP still has a basic problem. If mysql sever connection times out because wrong username or password was used, then mysql_connect() should return FALSE. It does, at least for me on PHP 4.3.10 connecting to a local MySQL 4.0.23

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Michael Sims
Burhan Khalid wrote: Michael Sims wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-27 Thread Michael Sims
Jochem Maas wrote: Michael Sims wrote: On a controller page (the C in MVC) that handles form submissions I create an array which defines what form variables are available and their default values if not entered. I then use array_merge() to combine that array with $_POST (or $_GET

RE: [PHP] Re: Avoiding NOTICEs on Array References

2005-01-26 Thread Michael Sims
Jochem Maas wrote: [EMAIL PROTECTED] wrote: If one must check the value and not just the existence of the checkbox entry, or for other uses, e.g. where a flag may or may not be present, one is saddled with clumsy constructs like: if (($isset($array['index']) ($array['index'] == 1)) ...

RE: [PHP] Seemingly weird regex problem

2005-01-20 Thread Michael Sims
Tim Boring wrote: On Thu, 2005-01-20 at 13:41, Jason Wong wrote: I suspect what you want to be doing is something like this: switch (TRUE) { case ANY_EXPRESSION_THAT_EVALUATES_TO_TRUE: ... } Thanks for the suggestion, but I'm not sure that does what I'm looking for. I really

RE: [PHP] strtotime time zone trouble

2005-01-18 Thread Michael Sims
Marcus Bointon wrote: Much of the point of using zone names rather than fixed numeric offsets is that it allows for correct daylight savings calculations (assuming that locale data is correct on the server). Let me rephrase the question - how can I get the current time in a named time zone

RE: [PHP] Inconsistent behavior, same code, different server

2005-01-18 Thread Michael Sims
Rob Tanner wrote: Granting the possibility that I may have unintentionally defined the variables differently, what might cause them to be treated one way on my development system and another on the production server given that the php.ini file is the same on both systems? Any clues? Compare

RE: [PHP] searching and sorting

2005-01-18 Thread Michael Sims
Richard Lynch wrote: Brian A. Anderson wrote: [...] I am thinking of incrementally adding the resultant hits into two associative arrays with the link to the data and a calculated relevance value, and sorting this array by these relevences. [...] One Axiom: Keep as much of the scoring/sorting

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
#this is only for testing a new cronjob, every minute * * * * * /usr/local/bin/php /www/r/rester/htdocs/phpList_cronjob/process_cronjob.php /www/r/rester/htdocs/phpList_cronjob/cron.log 21 The new one doesn't seem to want to run until after 3:01 or 3:02. Shouldn't the sever just run it

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
Erwin Kerk wrote: The CRON daemon only refreshes it's job list after a job in the current list is completed. Therefore, the CRON daemon won't notice the every-minute job until 3.01 pm. I'm not sure I understand what you're saying above. Can you provide a pointer to documentation about this?

RE: [PHP] question about a cron job

2005-01-17 Thread Michael Sims
Jochem Maas wrote: Michael Sims wrote: Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need

RE: [PHP] Help with encryption

2005-01-15 Thread Michael Sims
Greg Donald wrote: On Thu, 13 Jan 2005 13:53:30 -0800, Brian Dunning [EMAIL PROTECTED] wrote: Could anyone point me to a web page or other documentation that shows a SIMPLE example of encryption? I know absolutely nothing about encryption. There are like 6 people in the entire world who

RE: [PHP] PHP5 FreeTDS

2005-01-13 Thread Michael Sims
Craig Donnelly wrote: On the page where I connect to the MSSQL server I get the following error: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 172.16.xx.xxx in /var/ftpusers/tarot/tarot/admin/sqltest.php on line 4 A couple of things to try: (1) Try

RE: [PHP] quicker arrays as func args?

2005-01-13 Thread Michael Sims
Justin French wrote: Pretty sure this can't be done, but thought I'd ask any way... [...] foo(cat,dog,(a=1,b=2,c=3)); or foo(cat,dog,{a=1,b=2,c=3}); would be nice (Ruby has something like this), but I'm guessing it's not possible. No, can't do that. I'm used to stuff like that from Perl as

RE: [PHP] Identify which function called another

2005-01-12 Thread Michael Sims
Lars B. Jensen wrote: Is there any way, I from one function can identify which other function called it, without parameter passing the name manually ? You can get this information from debug_backtrace()... http://www.php.net/manual/en/function.debug-backtrace.php -- PHP General Mailing List

RE: [PHP] stdClass to array

2005-01-11 Thread Michael Sims
Cere Davis wrote: Hey folks, Does anyone know of a painless way to convert a stdClass object to an associative array in php? Just cast it: $arr = (array) $stdClassInstance; Also, I wonder, is there a way to flatten associative arrays in php? So say: $b=new array(s=S) $a=new

RE: [PHP] Fatal error: Call to a member function on a non-object

2004-12-22 Thread Michael Sims
Tim Burgan wrote: Fatal error: Call to a member function on a non-object in c:\XXX\inc\dbConnOpen.php on line 17 [...] The file in question contains code that forms a connection to the database. I've used this EXACT same code on this same website for the last 8 months (both on localhost and

RE: [PHP] Re: How to set register_globals=off in the script?

2004-12-21 Thread Michael Sims
Jason Barnett wrote: So I want to keep PHP register_globals=on in php.ini, but in local files set to off? How I can do this? You can change this, and other php.ini directives, with the PHP function ini_set register_globals cannot be changed with ini_set(). It is of type PHP_INI_PERDIR

RE: [PHP] Sort by string length...

2004-12-21 Thread Michael Sims
Russell P Jones wrote: Any idea how to sort an array by string length? Use usort() in conjunction with a user defined function that compares the length of both strings using strlen(). If brevity at the (possible) expense of clarity is your thing, you can even use create_function() as your

RE: [PHP] File Locking during *other* file operations

2004-12-17 Thread Michael Sims
Gerard Samuel wrote: Im talking about file locking during deleting, and moving files. Is it possible to perform file locking for these file operations? Yes, have your scripts attempt to lock a separate lock file before performing deleting or moving operations. -- PHP General Mailing List

RE: [PHP] Problem with loose typing

2004-12-17 Thread Michael Sims
Chris Boget wrote: function test() { static $i = 0; $i++; $retval = ( $i = 10 ) ? $i : ''; return $retval; } while( $bob = test()) { echo $bob . 'br'; } You would expect the while loop to go on forever just looking at the above code. I wouldn't,

RE: [PHP] Re: 4.3.10 breaking things? Back working after reverting to 4.3.9

2004-12-17 Thread Michael Sims
Ben wrote: Reverting back to 4.3.9 with the same build configuration options used in 4.3.10 has fixed the problems with the various scripts. Do you use Zend Optimizer? If so you should upgrade to the latest version: http://bugs.php.net/bug.php?id=31134 http://bugs.php.net/bug.php?id=31108 I

RE: [PHP] Spurious newlines when requesting empty php file

2004-12-11 Thread Michael Sims
Carl Michael Skog wrote: If I save the response of this command with lynx (lynx -dump http://www.formatemp.com/catalog/paynova-reply.php; somefile), I will get three newlines. Aha! I knew it. :) See: http://marc.theaimsgroup.com/?l=php-generalm=110272197009025w=2 Lynx adds the newlines.

RE: [PHP] Spurious newlines when requesting empty php file

2004-12-10 Thread Michael Sims
Richard Lynch wrote: Carl Michael Skog wrote: I would have thought that the response from a empty php file would also be empty, but, to my surprise, they consist of 3 newlines !!! I just tried this with an empty PHP file, and got exactly what I expected. A valid response with no content at

RE: [PHP] Multiple Inheritance

2004-12-10 Thread Michael Sims
Please note that I am specifically *not* weighing in on the OO vs. procedural religious war, but only wanted to make a couple of small comments. :) Richard Lynch wrote: I spend a *LOT* more time, digging through endless class files, of what are essentially name-spaces of singleton objects

RE: [PHP] null as function argumnent?

2004-12-08 Thread Michael Sims
Bas Jobsen wrote: Hi, I want to use a ?: statement. If not true de default function argument have to be used. How to do this ? function test($test='default') { echo $test; } test(($value==1)?'no default':null); What do i have to pass instead of null to get default print? Try

RE: [PHP] Re: automatic responder

2004-11-26 Thread Michael Sims
Matthew Weier O'Phinney wrote: * Manuel Lemos [EMAIL PROTECTED]: On 11/26/2004 03:58 PM, Alessandro Rosa wrote: How about coding an automatic responder via PHP ? The most portable solution is to have a POP3 mailbox associated with the e-mail address to which the messages are received and

RE: [PHP] Capturing phpinfo()

2004-11-23 Thread Michael Sims
John Holmes wrote: From: Ashley M. Kirchner [EMAIL PROTECTED] How can I stick phpinfo() at the bottom of a page in such a way that it doesn't display the data in the page, but instead creates a log file and dumps everything in there) The log file should either be appended to every time,

RE: [PHP] VOTE TODAY

2004-11-02 Thread Michael Sims
John Nichel wrote: ApexEleven wrote: I can't wait for the replies... cat $you /dev/null Or the slightly more destructive variant: cat /dev/null $you :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] An easier way? $_POST[] = $_SESSION[]

2004-11-01 Thread Michael Sims
Erich Kolb wrote: Is there an easier way to assign all post data from a form to session data? Eg., $_SESSION['first_name'] = $_POST['first_name']; $_SESSION['last_name'] = $_POST['last_name']; $_SESSION['email'] = $_POST['email']; You could do this: $_SESSION = array_merge($_SESSION,

RE: [PHP] Regex Lookbehind help

2004-10-26 Thread Michael Sims
Alex Hogan wrote: Hi All, I am trying to identify an email address in a page but I don't want to return the email if it's [EMAIL PROTECTED] Here's what I have; (\w[-._\w]*\w(?!webmaster)@\w[-._\w]*\w\.\w{2,3}) It returns nothing, however when I take out the lookbehind section; ([EMAIL

RE: [PHP] Is flock() necessary on a simple file append?

2004-10-26 Thread Michael Sims
Kevin Grigorenko wrote: Paul Fierro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] According to this post, you do not need to use flock() if you open a file in append mode: http://marc.theaimsgroup.com/?l=php-generalm=105165806915109w=2 That's exactly what I was looking for;

RE: [PHP] Regex Lookbehind help

2004-10-26 Thread Michael Sims
Alex Hogan wrote: I just tried this out and the first regex is actually working for me on php 4.3.8 (cli). Can you post some code? At this point all I'm trying to do is print the array with the addresses. $file=readfile('mypathto/myfile.html'); $patrn =

RE: [PHP] Mac OS X and Editor

2004-10-21 Thread Michael Sims
Philip Thompson wrote: I don't personally use Mac OS X, but let me throw in a recommendation for jEdit (www.jedit.org). It's Java based, hence [...] Just a side-comment: in general, OS X users enjoy/use Cocoa-based applications over Java-based. Cocoa provides the OS X Experience with the

RE: [PHP] Mac OS X and Editor

2004-10-20 Thread Michael Sims
Jonel Rienton wrote: Hi guys, I just like to ask those using Macs here as to what editor and/or IDE they are using for writing PHP codes. I don't personally use Mac OS X, but let me throw in a recommendation for jEdit (www.jedit.org). It's Java based, hence cross-platform, and extremely

RE: [PHP] proper method to do the following...

2004-10-06 Thread Michael Sims
Hugh Beaumont wrote: the following code outputs : Notice: Undefined index: exact in search.php on line 10 code : if (!isset($_POST['exact'])) { - line 10 $_POST['exact'] == false; } You have a typo in line 11. I'm assuming you want to use the assignment operator = instead of

RE: [PHP] Recursive Interpolation

2004-10-05 Thread Michael Sims
Chuck Wolber wrote: On Mon, 4 Oct 2004, Michael Sims wrote: What's ugly about it? I saw your earlier post I was actually planning on responding and suggesting something exactly like you just came up with. The main problem (aside from performance, which you addressed) is that it does

RE: [PHP] Recursive Interpolation

2004-10-04 Thread Michael Sims
Chuck Wolber wrote: The method I've come up with in the meantime, I believe is much more effective than heredocs, but still an ugly hack: function interpolate ($text, $msg_variable) { $msg_key = '_FP_VAR_'; foreach (array_keys($msg_variable) as $key) { $token =

RE: [PHP] Regular Expression - highlighting

2004-10-03 Thread Michael Sims
Aidan Lister wrote: Hello list, I'm pretty terrible with regular expressions, I was wondering if someone would be able to help me with this http://paste.phpfi.com/31964 The problem is detailed in the above link. Basically I need to match the contents of any HTML tag, except a link. I'm

RE: [PHP] successive imap_open calls result in failure

2004-10-01 Thread Michael Sims
[EMAIL PROTECTED] wrote: Quoting raditha dissanayake [EMAIL PROTECTED]: This probably means that your imap server is running under xinetd (or something similar) that has a rate limit or a limit on the number of connections from one client. You can find out how many connections are open with

RE: [PHP] List Etiquette

2004-09-21 Thread Michael Sims
Octavian Rasnita wrote: No, there is no way for customizing the headers Outlook Express use to put in the email messages. I wish there was, because I don't like them also... Although I haven't used it personally, OE-QuoteFix may help: http://home.in.tum.de/~jain/software/oe-quotefix/ I do

Re: [PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread Michael Sims
Michael Wallner wrote: Well, so here comes /the oddity/ connecting from debian to windows/exchange ~0.5 seconds connecting from debian to debian/courier ~0.2 (assumed to be somewhere at 0.x seconds) connecting from windows to debian/courier ~5 seconds connecting from windows to

RE: [PHP] Odd behaviour of non-existent keys?

2004-08-26 Thread Michael Sims
Geoff Caplan wrote: Michael Sims wrote: IMHO what you have described is a bug in PHP, and if I were you, I'd report it as such. If it's not a bug it at least has a very high WTF factor. Problem with reporting is that I am using Debian Test and the current PHP version is too old to report

RE: Re[2]: [PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread Michael Sims
Geoff Caplan wrote: I think you are probably right - but this behaviour causes problems. For example: $foo['one']['two'] = test-string ; // Evaluates to TRUE (not what's wanted!) isset( $foo['one']['two']['three'] ) ; I need a reliable way to test for the non-existence of a

RE: [PHP] RE: [SPAM] Re: [PHP] Sessions vs. IE security

2004-08-24 Thread Michael Sims
Stanislav Kuhn wrote: Thanks for help. I have set up p3p policy to my site.. I passed it trouth validator and IE can find privacy policy but it still doesn't allow me cookies... I can't find information what exactly to specify in privacy policy IE allows me third party cookies... Does

RE: [PHP] OO Theory Question

2004-08-17 Thread Michael Sims
Jed R. Brubaker wrote: Consider the following: I have a login class that is instantiated at the top of every page. It can log you in, check to see if you are logged in, etc. This class has an assortment of class variables such as userID, userType, etc. [...] A solution is to set all of these

RE: [PHP] Problem querying postgres

2004-08-13 Thread Michael Sims
Joshua Capy wrote: of PHPADMIN and try use pg_query() to do a select such as SELECT PersonID FROM person the string that is sent is select personid from person. Now this is a problem because in the data base the field PersonID is not the same case as in the select that is sent and I get the

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Michael Sims
Kim Steinhaug wrote: [snip] For some reason the above results in a blank mail, no $body at all, rest is fine. However, if I include a dummy for if all goes well : if(!$mail-Send()) { echo $lang_error['mailer_error'] . br\n; } else { // Why do I need this one??? }

RE: [PHP] PHP logic - Whats going on here?

2004-08-11 Thread Michael Sims
Michael Sims wrote: string at various points to see what it contains. You may need to drill down into the actual source code for the Send() method to see what it things the body string is. Errr... s/things/thinks/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

RE: [PHP] Re: Classes, instances and NULL

2004-07-29 Thread Michael Sims
Oliver Hitz wrote: Thank you. I know there is a `===' operator, but to me this doesn't make sense either. class A { } class B { var $x; } It is logical that an instance of `A' is not identical to null. However, why is an instance of `A' equal (`==' operator) to null, an instance of

RE: [PHP] help with regular expression

2004-07-29 Thread Michael Sims
Barbara Picci wrote: I've a script that must strip a string when it find the first word containing at least 4 characters; it must print the content of the string before that word, that word, a separator and the rest of the string. I've tried with ereg whit this script ([EMAIL PROTECTED] is

RE: [PHP] - operator and :: (formal names?)

2004-07-26 Thread Michael Sims
Katie Marquez wrote: Hi! I did a search of the PHP manual for these: - and :: I know what they are used for, but what I don't know is what they are formally called. Can someone tell me what they are called (short of using the symbol in the name)? I don't know what PHP's official name

RE: [PHP] background=#

2004-07-22 Thread Michael Sims
Tobias Brasier wrote: I have recently noticed a problem with our code or our webserver (Apache) when I execute a .php file. I have taken all php code out, but within an html td tag, I use background=#, which is used for older browsers such as Netscape 4.7 if you have a background color or

RE: [PHP] exec/system question..

2004-07-21 Thread Michael Sims
Justin Patrin wrote: On Wed, 21 Jul 2004 10:09:52 -0700, bruce [EMAIL PROTECTED] wrote: 2) i could run the perl script, and have it somehow run in the background this would ba good, if there's a way to essentially [...] AFAIK there's no way to do this. When the request ends (user hits

RE: [PHP] exec/system question..

2004-07-21 Thread Michael Sims
Michael Sims wrote: Justin Patrin wrote: On Wed, 21 Jul 2004 10:09:52 -0700, bruce [EMAIL PROTECTED] wrote: 2) i could run the perl script, and have it somehow run in the background this would ba good, if there's a way to essentially [...] AFAIK there's no way to do this. When

RE: [PHP] exec/system question..

2004-07-21 Thread Michael Sims
bruce wrote: my attempt (below) never seemed to work properly... php -r 'exec(perl /home/test/college.pl /dev/null 21 );' works, but doesn't return until the perl app completes... php -r 'exec(bash -c 'exec nohup perl /home/test/college.pl /dev/null 21 ');' can't get this to

RE: [PHP] exec/system question..

2004-07-21 Thread Michael Sims
Justin Patrin wrote: On Wed, 21 Jul 2004 13:55:37 -0500, Michael Sims [EMAIL PROTECTED] wrote: Sorry to followup to my own post, but I just did some quick testing and apparently none of the above (nohup, setsid) is really necessary. As long as the output of the command is redirected

RE: [PHP] exec/system question..

2004-07-21 Thread Michael Sims
bruce wrote: michael... something strange is happening/or i'm missing something basic... but here's the sys response from your suggestion... [EMAIL PROTECTED] test]# php -r 'exec(bash -c 'exec nohup perl /home/test/college.pl /dev/null 21 ');' [3] 2566 -bash: );: command not found Sorry,

RE: [PHP] Performance issues and trees

2004-07-20 Thread Michael Sims
Sven Riedel wrote: letters 0 and 1. My tree-traversal algorithm looks like this: $bit_array = str_split( $bitstring ); $tree_climber = $tree; // assign tree-climber to the tree root // main loop while( !is_null( $bit = array_shift( $bit_array ) ) ) { $tree_climber =

RE: [PHP] Re: using the mssql functions on a linux server

2004-07-14 Thread Michael Sims
Skippy wrote: Is this the only way around it? Can I get to mssql without using the mssql extension? I don't think so. Plus, the entire setup is a bit complicated and you need FreeTDS as well as UnixODBC installed, plus some /etc configuration magic. Why is UnixODBC necessary? I've been

RE: [PHP] php 4.3.7/5.0

2004-07-13 Thread Michael Sims
Josh Close wrote: $result = mssql_query($sql); $row = mssql_fetch_array($result); $var = $row[0]; So it should be an int. And if it's copied into a function it shouldn't be changed. But doing if($var) doesn't seem to work after I upgraded versions. Which is making me think that they

RE: [PHP] php 4.3.7/5.0

2004-07-13 Thread Michael Sims
Curt Zirzow wrote: * Thus wrote Josh Close: if($var) used to work for if($var != 0) or if($var != 0) but that doesn't seem to work since I upgrade. So I'm just going to do if((int)$var) I still think this is unnecessary if (0) { echo '0'; } if () { echo ''; } if (0) { echo 0; }

RE: [PHP] Client IP

2004-07-07 Thread Michael Sims
John W. Holmes wrote: IP adress not send ?!? And how server communicate with client ? A variety of ways. What I meant is that it's not sent in the browser's headers that it sends to the site, which is where getenv() and $_SERVER[] would snatch it from. Correct me if I'm wrong, but shouldn't

RE: [PHP] PHP page memory usage

2004-07-06 Thread Michael Sims
Michael Gale wrote: Hello, Is there a way to monitor or test out how much CPU / memory a php page uses ? I would like to find out how intensive some of my scripts are. Don't know about CPU, but you can get memory usage with this function:

RE: [PHP] Problem with session on first page loaded

2004-07-02 Thread Michael Sims
Jordi Canals wrote: the ISP changed a param in the PHP.INI, and they changed session.use_trans_sid setting it to 1. [...] Now I should talk to the provider to not set this parameter to ON by default, because the security risk on it (As stated on the manuals). If they allow you to use

RE: [PHP] session id changing all the time on some pc's

2004-07-02 Thread Michael Sims
Zilvinas Saltys wrote: The problem is as i understand IE is not accepting the cookie. So the session id allways regenerates. Everything works fine with mozilla. [...] The only thing i want to know is all the truth about IE (6?) and cookies :) Could it be a problem with IE6 and P3P

RE: [PHP] flock(), fclose() and O/S buffering

2004-07-01 Thread Michael Sims
Andrew Hill wrote: $fp = fopen(/tmp/lock.txt, w+); if (flock($fp, LOCK_EX)) { // do an exclusive lock fwrite($fp, $processName\n); flock($fp, LOCK_UN); // release the lock } else { echo Couldn't lock the file !; } fclose($fp); [...] In this case, although process B is the second

RE: [PHP] Comparison Operator

2004-07-01 Thread Michael Sims
Gabe wrote: I was looking at the comparison operators page and noticed that these two operators were listed as PHP4 only. Is that an error, or are they really not used in PHP5? I don't want to use them if they're going to break when I upgrade. And if they aren't included, then does

RE: [PHP] Help with array / list looping syntax

2004-06-29 Thread Michael Sims
Robb Kerr wrote: I need some help with a looping syntax. In english, a is used before words that begin with consonants - an is used before words that start with vowels. You are probably already aware of this, but that isn't strictly correct. The rule for deciding between a and an is based not

RE: [PHP] Best external app from php

2004-06-29 Thread Michael Sims
C.F. Scheidecker Antunes wrote: Hello all, I need to have a web application to call an external app that needs to execute on the background. (It is an *NIX server) [...] My question is this: Is it better to write the external app in PHP or Java? Assuming that you (or the developer(s) if

RE: [PHP] Construction

2004-06-27 Thread Michael Sims
Paul Bissex wrote: FWIW Python also requires child classes to call parent constructors manually. Not sure what the justification is for this design decision is, though, in either language. Anybody? Flexibility, I would guess. With PHP's current behavior one can: (1) Call the parent

RE: [PHP] Understanding behavior of 'directories below files'

2004-06-25 Thread Michael Sims
KEVIN ZEMBOWER wrote: If you go to this URL, you'll get a broken version of the main home page on our site: http://www.hcpartnership.org/index.php/search . We can't understand this, because 'index.php' is a file, not a directory. (The correct web page is just at

RE: [PHP] Testing if cookies are enabled

2004-06-21 Thread Michael Sims
Martin Schneider wrote: I saw this on some pages and want to do the same: - On one page the user can login. Before that no cookie is set! - On the next page they set the cookie and show either the user data or a warning that the user has disabled cookies and should enable them. I wasn't

RE: [PHP] sessions cookies

2004-06-19 Thread Michael Sims
Scott Taylor wrote: How exactly do sessions work? I've heard that if cookies are disabled that a session will then pass it's variables in the url (through GET). Yet when I manually disable cookies none of my pages work (because the $_SESSION variables do not seem to be working). The

RE: [PHP] Odd behavior with unset, array indexes, and types

2004-06-18 Thread Michael Sims
Curt Zirzow wrote: To simplify things: $a[2] = '1'; $k = (double)2; echo isset($a[$k]); unset($a[$k]); echo isset($a[$k]); echo - expect 1\n; Result: 11 - expect 1 Yeah, my version was just a wee bit verbose. :) It's the behavior that is specific to unset() that I'm

RE: [PHP] php

2004-06-18 Thread Michael Sims
[EMAIL PROTECTED] wrote: will retrieving data from files have a problem like if 2 person access the same file at the same time and causing the data to crush? If you're only going to be reading the file you should be fine. Otherwise you've got a bit of research to do. Here's a starting point:

[PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Michael Sims
Just noticed this today. The following script: quote $a = 2; $b = ceil(3 / 2); if ($a == $b) { print \$a and \$b are the same.\n; } $foo[$a] = '2'; if (isset($foo[$b])) { print \$foo[\$b] is set.\n; } unset($foo[$b]); print_r($foo); /quote Results in this output: quote $a and $b are

RE: [PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Michael Sims
Thomas Goyne wrote: On Thu, 17 Jun 2004 16:52:32 -0500, Michael Sims [EMAIL PROTECTED] wrote: ceil() returns a variable of type double. In the above script I expected $foo to become an empty array after calling unset(). But it seems that unset() will not remove an array element when you

  1   2   3   >