[PHP] Re: PHP_AUTH_USER failing, please help me...

2002-11-25 Thread Philip Hallstrom
Just a quick guess that register_globals is probably turned off (check with a phpinfo() to be sure) and therefore $PHP_AUTH_USER and $PHP_AUTH_PW are not being set. Or, try $_SERVER[PHP_AUTH_USER], etc... On Mon, 25 Nov 2002, Larry Brown wrote: > I just built a new server and loaded with RH8. I

[PHP] Re: Comment Threading

2002-12-02 Thread Philip Hallstrom
Your best bet would be to look at how some of the other apps do it :) (taking licensing issues into account that is :) This might help as well.. not sure how efficient it is on a really long list, but it works for my little stuff... http://stuff.adhesivemedia.com/php/heirarchial-sorting.php On T

[PHP] Re: understanding headers

2002-12-11 Thread Philip Hallstrom
Where/How do you set $data? Everything else looks fine, but without knowing that we can't help much. On Wed, 11 Dec 2002, Colin Bossen wrote: > Hello: > > I am trying to use the header function to enable users to download > files. I am able to get files to download. Unfortunately, the wrong file

[PHP] Re: Re: understanding headers

2002-12-11 Thread Philip Hallstrom
ot;rb"); > > $data = fread($fp, $size); > > fclose($fp); > > > > Colin > > > > On Wednesday, December 11, 2002, at 06:21 PM, Philip Hallstrom wrote: > > > >> Where/How do you set $data? Everything else looks fine, but without > >>

[PHP] Re: A little regex help

2002-12-13 Thread Philip Hallstrom
Why not... $url = ereg_replace("See ([^ ]*) for", "See \1 for", $original_string) or something close to that. On Fri, 13 Dec 2002, Gareth Hastings wrote: > Hi, > > I'm trying to work out the regex needed to split either one of the > following lines > > Windows 2000 Hotfix (Pre-SP4) See Q322842

[PHP] Re: query join 2 databases? or match up arrays?

2003-01-03 Thread Philip Hallstrom
Any chance you can do a somewhat frequent export from informix into mysql or the other way around so all your stuff is in one database? -philip On Fri, 3 Jan 2003, Jeff Bluemel wrote: > ok - here's my problem. I have some data in mysql, and other data in > informix. > > here is my application.

[PHP] Re: query join 2 databases? or match up arrays?

2003-01-03 Thread Philip Hallstrom
ecord at a time > upon request which won't be too frequent. > > hoping there's another solution I'm not aware of, or over looked. > > Jeff > > "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTE

[PHP] Re: query join 2 databases? or match up arrays?

2003-01-03 Thread Philip Hallstrom
inking about is just not giving the distributors > access to this information, but restricting it to users with permissions to > the entire batch only. > > thanks, > > Jeff > > "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">

[PHP] Re: HEEELP...please

2003-01-09 Thread Philip Hallstrom
Is register_globals on or off? If it's off on the new machine that explains why $DOCUMENT_ROOT is evaluating to "" which would produce the error message you are getting... On Thu, 9 Jan 2003 [EMAIL PROTECTED] wrote: > I absolutely cannot understand the include_path directive. > Can somebody, ple

[PHP] Re: Persistent global data ?

2003-01-14 Thread Philip Hallstrom
http://www.php.net/manual/en/ref.shmop.php On Tue, 14 Jan 2003, Mathias Rockel wrote: > Hi all ! > > It seems I did not state exactly enough what I need ... if I use the > $_SESSION functions or write the stuff myself makes no difference, actually > then I can just leave it in the database and re

[PHP] Re: PHP receiving e-mail

2003-01-14 Thread Philip Hallstrom
You could use fetchmail to get the mail and pipe it into your php script which would see it as standard input... Or look on zend.com for a POP class... On Tue, 14 Jan 2003, David Russell wrote: > Hi all, > > I want to develop a script that can read an e-mail from a pop account, > and then perfor

[PHP] Re: Acessing $DOCUMENT_ROOT

2003-01-17 Thread Philip Hallstrom
$_SERVER[DOCUMENT_ROOT] On Fri, 17 Jan 2003, Don wrote: > Hi, > > How do I access $DOCUMENT_ROOT when register_gobals is set off? I think > there's an array, something like $HTTP_ENV_VARS['DOCUMENT_ROOT'] but I can't > find it in the documentation. > > Thanks, > Don > > > --- > Outgoing mail is

[PHP] Re: Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Philip Hallstrom
I wonder if appending time() would be better... granular to a second and you save the filesystem lookup effort?? On Mon, 20 Jan 2003, Jim Lucas wrote: > I would add the modification time of the file in question with > > filetime($filename); > > that way you will be sure to get a unique argurment.

[PHP] Re: fscanf

2003-01-21 Thread Philip Hallstrom
Why not: $array = split("[ ,]", $line); ? On Wed, 22 Jan 2003, Kris wrote: > Hi > > I'm having dramers with fscanf > I have a line: > text, text, text > > I can't work out how to scan removing the comma and whitespace. > the text can be absolutle anything. > > at the moment I have > $array = fs

[PHP] Re: Need Coding Help With getdate()

2003-01-24 Thread Philip Hallstrom
Replace your last line with this... $date = $month . $mday . $year Or take a look at the date() command... something like: $date = date("mdy", time()); would do the same thing (check the man page for sure). On Fri, 24 Jan 2003, Guru Geek wrote: > Hello, > > I'm trying to use getdate() and th

[PHP] Re: linux cpu usage

2003-01-24 Thread Philip Hallstrom
does it hog the CPU and stop other things from running or is it just using 100% of the CPU? If the latter, that's fine. If the former, read the man page for nice or renice (it's renice on freebsd) -philip On Fri, 24 Jan 2003, Gareth Thomas wrote: > Hi all, > > I have a command line PHP script

[PHP] Re: multiple entry forms !!

2003-01-27 Thread Philip Hallstrom
Use several smaller forms and store the results of each into a session variable. Also store a "got-results-for-form-1" (through 7) that gets set for each of the 7 forms. Once all 7 are set you can do the final processing. Set the action of each form to say "save.php" and pass in a "saving_what"

[PHP] Re: output of fread() is blank

2003-01-27 Thread Philip Hallstrom
I could be wrong, but I'd guess that filesize fails for remote files. If all you're doing is spitting out the text, why not use readfile()? -philip On Mon, 27 Jan 2003, Guru Geek wrote: > Hello, > > I'm a recent convert from CGI/Perl and so am still getting my feet wet > in PHP. > > Here's my c

[PHP] Re: mail () format

2003-01-27 Thread Philip Hallstrom
Something like... $body = "blah blah blah\n"; $body .= "Name = $name\n"; $body .= "Address = $address\n"; $body .= "Comments = $comments\n"; mail("[EMAIL PROTECTED]", "subject", $body); would do it. On Tue, 28 Jan 2003, Bruce Levick wrote: > I have a number of field entries that I am trying t

[PHP] Re: PHP vs Perl for system scripts (non-web)

2003-01-27 Thread Philip Hallstrom
Unless you've got a compelling reason to switch to Perl, I wouldn't. I like Perl, but like you have used PHP a lot more often in the last couple of years. Where I find it really nice is when my cron scripts need to use the same libraries as my web scripts... -philip On Mon, 27 Jan 2003, Paul Ch

[PHP] Re: __PHP_Incomplete_Class Object

2003-01-29 Thread Philip Hallstrom
I don't see where you include() your class definition in that second file... add include("nycmgMail.php") right before the session_start() line and see if that makes a difference. -philip On Thu, 30 Jan 2003, Weston Houghton wrote: > > Ok, now I'm frustrated. > > I'm trying to register an objec

[PHP] Re: php question - query string

2003-01-30 Thread Philip Hallstrom
You've got it right... look at the man page for parse_str() for more info on the QUERY_STRING stuff as well as the register_globals configuration option. Looking at the script below, there is nothing special about setting $addjoke to 1. It's just important that it is set to *something* (because o

[PHP] Re: exec() in safe mode

2003-02-03 Thread Philip Hallstrom
Add the directory that contains the script you want to run to safe_mode_exec_dir (check the docs to confirm this) -philip On Tue, 4 Feb 2003, [ISO-8859-2] Bc. Radek Krejèa wrote: > Hello, > > I need use function exec or backtick operator, but i have PHP in > safe mode. I need use it only for

[PHP] Re: Bi-weekly pay period

2003-02-03 Thread Philip Hallstrom
> I'm writing a quick little thing to act as a time clock since people are > writing out by hand and it's not so accurate. It's basically click a button > to clock in and click a button to clock out. > > What I also want to do is create a report (well I've already created the > report) but I want t

[PHP] Re: reading file into a keyword-indexed array

2003-02-04 Thread Philip Hallstrom
You could just serialize $param and write it out to a file then read it back in and unserialize it... simpler in PHP... not sure whether it's more efficient or not. On Tue, 4 Feb 2003, Durwood Gafford wrote: > I would like to read and write user-settings to a keyword-value file and be > able to

[PHP] Re: How do I force a 'timeout' in a loop for that itteration, orconversley how to timeout a 'ping" request?

2003-02-07 Thread Philip Hallstrom
Not sure on linux, but on freebsd ping's man page says: -t timeout Specify a timeout, in seconds, before ping exits regardless of how many packets have been recieved. On Fri, 7 Feb 2003, Daevid Vincent wrote: > I'm trying to automate finding pingable domains given an IP or a domain. > The proble

[PHP] Re: Array sorting

2003-02-07 Thread Philip Hallstrom
never done it, but check out: http://www.php.net/manual/en/function.array-multisort.php On Sat, 8 Feb 2003, Zydox wrote: > My question is if anyone have any idé on how to sort this array so that the > names and ages are sorted after Close Friend, Friend, Wife and last > Family... > > $A[] = arra

[PHP] Re: Anyone? more info...

2003-02-10 Thread Philip Hallstrom
That is the right answer though... along with the various magic_quotes flags in the configuration. You need to look at your existing settings and then create a simple test where you type in something such as: x'x"x\x and then spit it out and save it and generally see at what point slashes are bein

[PHP] Re: $$ Variable?

2003-02-12 Thread Philip Hallstrom
Check the manual for sure, but assuming: $cookie = array("foo" => "bar", "red" => "blue") once this is done you'll have the following variable defined: $foo = "bar"; $red = "blue"; I think that's how it works anyway. On Wed, 12 Feb 2003 [EMAIL PROTECTED] wrote: > I'm trying to piece apart som

[PHP] Re: MD5 Password Login Driving me Crazy

2003-02-17 Thread Philip Hallstrom
see the trim() function... not sure if that will solve your problem, but that's the function you're looking for. On Mon, 17 Feb 2003, Vernon wrote: > For what ever reason I cannot seem to get a user to login using MD5. The > user creates the password on log and it works fine, password encrypted a

[PHP] Re: sending uploaded images as mail attachments

2003-02-19 Thread Philip Hallstrom
http://www.phpguru.org/mime.mail.html makes it pretty easy. On Wed, 19 Feb 2003, David Feldman wrote: > I'm working on a script that allows the user to upload several images, > then base64 encodes them and attaches them to an email to me. I'm > having trouble getting the images readable on the o

[PHP] Re: Date/Time Logic

2003-02-19 Thread Philip Hallstrom
Store the timestamp of their first login to a database. Also store the number of days (3, 90, 365) that there account is valid. Setup a script to nightly go through the database and for any records where: first_login_timstamp + number_of_days < right_now is true invalidate their login and send

[PHP] Re: Getting PHP to handle other HTTP methods

2003-02-19 Thread Philip Hallstrom
If you're using apache you can do it by twiddling with the Action and Handler configuration options... -philip On Thu, 20 Feb 2003, Sam Minnee wrote: > Hi, > > I want to get PHP to handle the HTTP methods PROPFIND, PUT, DELETE, MKCOL, > RENAME, MOVE, and COPY. I've coded up a WebDAV server in P

[PHP] Re: Derive bottom-most dir from string???

2003-02-20 Thread Philip Hallstrom
see the basename() function On Thu, 20 Feb 2003, Shawn McKenzie wrote: > Is there an easy way to derive the bottom-most directory from a string > containing a path? > > Example: $somepath = "html/testsite/templates/shopping"; > > Becomes: "shopping" > > TIA > -Shawn > > > > -- > PHP General Mai

[PHP] Re: Forms and MySql date

2003-02-20 Thread Philip Hallstrom
You could use the TO_DATE function to convert that text string into a date, or reformat it in PHP to -mm-dd which mysql will take automatically (at least I think so) On Thu, 20 Feb 2003, Mike Tuller wrote: > I have a form that I want to enter a date into a MySql database. I > currently have t

[PHP] Re: $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread Philip Hallstrom
Try sql = ".'" . $_POST['jersey_id'][$x] . "',. Also make sure you're form is being submitted with POST and not GET... -philip On Tue, 25 Feb 2003, CF High wrote: > Hey all. > > Got a problem with this sql statement -- php vars are evaluated (e.g. the > $date var), but not the $_POST a

[PHP] Re: date, "first of next month"?

2003-02-26 Thread Philip Hallstrom
> On Wed, 26 Feb 2003, 1LT John W. Holmes wrote: > > |You would think strtotime("first of next month") would work, but it doesn't. > |This does: > | > |$t = mktime(0,0,0,date('m')+1,1,date('Y')); > | > |Gives you timestamp of first day, next month. Format accordingly with > |date(). > > Thats great

[PHP] Re: Restate: using php to rotate ad banners

2003-03-03 Thread Philip Hallstrom
> > The other problem is that if I open two browser > > windows to your site, one after the other, and see > > two banners, and then click on the first one, am > > I going to go to the site for the second one? > > Yes, that is one of the main problems. Would using > sessions help end this? No, sin

[PHP] Re: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
Here's how I think about it... CREATE_RECORDS = 1 in decimal and 0001 in binary. ALTER_RECORDS = 4 in decimal and 0101 in binary. that line returns a binary string where *any* of the bits are 1, so line them up: 0001 | 0101 = 0101 which is 5. On Mon, 3 Mar 2003, Dan Sabo wrote: > Hi, > >

[PHP] RE: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
Yes. Oops. -philip On Mon, 3 Mar 2003, Dan Sabo wrote: > Hi Phillip, > > Don't U mean > > 0001 > | 0100 > = 0101 > > ? > > Dan > > -Original Message- > From: Philip Hallstrom [mailto:[EMAIL PROTECTED] > Sent: Monday,

[PHP] Re: query strings

2003-03-03 Thread Philip Hallstrom
Spaces usually get converted to %20 when passed around in urls... take a look at the urldecode() and parse_str() functions... http://www.php.net/manual/en/function.urldecode.php http://www.php.net/manual/en/function.parse-str.php On Mon, 3 Mar 2003, Sunfire wrote: > i have a might i say a very v

[PHP] RE: RE: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
7;t see it, It's > not the or operator that's summing up the two binary values is it? > > Dan > > -Original Message- > From: Philip Hallstrom [mailto:[EMAIL PROTECTED] > Sent: Monday, March 03, 2003 3:53 PM > To: Dan Sabo > Cc: [EMAIL PROTECTED] > Subj

[PHP] Re: deciperhing oop

2003-03-03 Thread Philip Hallstrom
Haven't evaluated the below thouroughly, but in your setDBase() function be sure to use $this->db instead of $db (which is undefined). -philip On Mon, 3 Mar 2003, Larry Brown wrote: > Can someone who is used to using php oop help me figure out why this fails? > I know there are probably a thousa

[PHP] Re: PHP & NNTP w/o IMAP?

2003-03-04 Thread Philip Hallstrom
http://php.resourceindex.com/ search for NNTP. On Tue, 4 Mar 2003, Mike Walsh wrote: > I am looking for some PHP code that implements an NNTP interface that > doesn't require IMAP. > > I do not need a full featured NNTP implementation and it only needs to > support read access. If anyone knows

[PHP] Re: Date Question.

2003-03-05 Thread Philip Hallstrom
Strip off the H:i:s part using explode() and use date() to get an equivalent string for right now and if they match, today's the day. On Wed, 5 Mar 2003, Sebastian wrote: > I have a date field in mysql in this format: Y-m-d H:i:s > > I would like to echo "Today" if the date is today, can someone

[PHP] Re: google, php-created pages and link farm exclusion

2003-03-12 Thread Philip Hallstrom
If you're using apache you could look into the PATH_INFO aspects... basically converting URLS like: domain.com/path/to/page.php?id=3 to domain.com/path/to/page.php/id=3 then using PATH_INFO and substr() and parse_str() to get to $id = 3.. and you can always add more stuff so it looks like plai

[PHP] Re: How to break out of nested loops

2003-03-17 Thread Philip Hallstrom
http://www.php.net/manual/en/control-structures.break.php -philip On Mon, 17 Mar 2003, Bix wrote: > I have a for loop within a for loop, and need to break out of both > together... > > for ( blah ) { > for ( blah ) { > if ( true ) { break; } // only breaks out of this loop, how can I break it

[PHP] Re: Which is quicker, if-else statements

2003-03-18 Thread Philip Hallstrom
> Is it just as quick to do: > > if($r == 0) { > } else if($r != 0) { > } > > than to do: > > if($r == 0) { > } else { > } > > The reason I like the former method is because, in a large IF-ELSE > block, it's clear what belongs to what IF and what's going on. But does > this make it lag? And, if so,

[PHP] Re: date problem

2003-03-19 Thread Philip Hallstrom
Try: $ts = time(); $i = 0; while( $i < 2 ) { $day = date("dS", $ts + $i * 86400); print("$day"); $i++; } On Wed, 19 Mar 2003, shaun wrote: > hi, > > using date(dS); how can i can increase the days so that it shows > > 19th 20th 21st > > I have tried > > while ($i < 2){ >

[PHP] Re: Formatting code.

2003-03-25 Thread Philip Hallstrom
here's one. http://utvikler.start.no/code/php_coding_standard.html google will probably find a lot more... maybe not all PHP specific, but still relevant. On Wed, 26 Mar 2003, Philip J. Newman wrote: > Is there any documents on how code should be layed out? > > > -- > Philip J. Newman. > He

[PHP] RE: Mac IE File download problem - any solutions?

2003-03-26 Thread Philip Hallstrom
You might try... header("Content-Disposition: attachment; filename=$filename"); maybe? On Tue, 25 Mar 2003, Daniel Leighton wrote: > Actually, I think you may have misunderstood. On Mozilla (Mac), Netscape (Mac) and > Safari the script works exactly as I have intended: sending the "Content-Ty

[PHP] Re: directory size?

2003-04-03 Thread Philip Hallstrom
If you are on unix take a look at the "du" command. On Thu, 3 Apr 2003, Mantas Kriauciunas wrote: > Hey > I looked up in the manual but found only > Disk_total_space > Disk_free_space > > Is there anything like total_space for directory? > Or I will have to think of something else? > Like countin

[PHP] Re: PHP Rounding Time

2003-04-04 Thread Philip Hallstrom
I haven't quite thought this through, but I think something like this: $remainder = $ts % 60; if( $remainder < 15 ) { $ts = $ts - $remainder; }else if( $remainder > 15 && $remainder < 30 ) { $ts = $ts + (30 - $remainder); }else if( $remainder > 30 && $remainder < 45 ) { $t

[PHP] Re: Found a bug in 4.2.3 re: and echo vs.

2003-04-04 Thread Philip Hallstrom
It's a coding error... at least I think so. change alarmLightMySQL just return the results not "echo" them... echoing them doesn't make much sense inside another echo statement... On Fri, 4 Apr 2003, Daevid Vincent wrote: > Here, try this bullshit... > > I can't upgrade to a more recent version

[PHP] Re: ORDER BY from 2 tables

2002-07-29 Thread Philip Hallstrom
See if your database supports the UNION clause... On Mon, 29 Jul 2002, Georgie Casey wrote: > i assume this is a simple question... > > how can I SELECT * FROM 2 different tables in the same query, ORDER BYing > the 'hits' column, which both tables have. > > eg, 2 tables i have are similiar and

[PHP] Re: attachements in mail()

2002-08-01 Thread Philip Hallstrom
You can't (in the sense that there's an $attachment argument), but I've seen several classes that will let you do it. Check zend.com and php.resourceindex.com for the classes. On Thu, 1 Aug 2002, Danny wall wrote: > I've looked, and can not find out how you send attachments using the mail() > f

[PHP] Re: randomize etc?

2002-08-01 Thread Philip Hallstrom
split should work fine... Just do something like: $teamMembersArray = split(" ,;", $textarea); That will give you an array of the team members. Of course I'm assuming that their names don't include spaces and that you'll separate them with either a space, comma, or semi-colon. And you'll want

[PHP] Re: problems with random again

2002-08-01 Thread Philip Hallstrom
No... that wouldn't really be random then would it? :) But you could always keep track of the previous random numbers and if you've seen it ask for another one. On Thu, 1 Aug 2002, Hawk wrote: > Is there some easy way to make rand() only use each number once in a loop, > to avoid getting the sa

[PHP] Re: sucking news out of the usenet

2002-08-08 Thread Philip Hallstrom
I'm not on expert on usenet, but I'd recommend reading the RFC that defines the message headers. In particular you're going to need to look at the Message-ID, References, Xref, In-Reply-To, Subject, and Date headers and do what you can to try and sort them out... good luck! -philip On Thu, 8 A

[PHP] RE: Open 10 http connections in parallel

2002-08-08 Thread Philip Hallstrom
What about the PCNTL functions? http://www.php.net/manual/en/ref.pcntl.php I haven't used them, but there's a fork function in there... On Fri, 9 Aug 2002, Martin Towell wrote: > use C and fork() > php (AFAIK) can't do parallel programming > > -Original Message- > From: NoWhErEMan [mai

[PHP] Re: Newbie question about SQL result formatting

2002-08-09 Thread Philip Hallstrom
see nl2br(). You might also want to convert spaces to  's On Fri, 9 Aug 2002, Kristoffer Strom wrote: > Ok, this is totally newbie but I just started messing around with PHP after > programming IBM's NetData for a while. > > My first big problem I haven't been able to solve myself is how to for

[PHP] Re: ADVANCED PHP (SOCKETS)

2002-08-14 Thread Philip Hallstrom
Take a look at the pcntl functions. In particular the pcntl_fork() function. On Wed, 14 Aug 2002, Gustavo Almeida wrote: > > > I would like to know, what I have to do to make my application handle > multiple connections? > > My current application only handle one user per time. > > Sorry about

[PHP] Re: ereg_replace()

2002-08-14 Thread Philip Hallstrom
I'd do something like this: $str = " User : [EMAIL PROTECTED] Dir : /home/eXtremail/mbox/i-redlands.net/3/1/liam Forward : Copy : Account mapping : User Disk Quota : 0 Disk Space Used : 0 Max In Mail Size : 0 Max Out Mail Size : 0 Autoreply : No Mailbox Access : POP,IMAP Created : Sat Jul 6 09:21

[PHP] Re: progress bar for uploading files

2002-08-16 Thread Philip Hallstrom
You're best bet would be to make an animated gif that looks like a progres bar (or twirling icon or whatever). Then when the users hits submit, "turn it on"... in the same way you do image rollovers, etc... Then it will spin until the form is submitted... On Fri, 16 Aug 2002, electroteque wrote

[PHP] Re: progress bar for uploading files

2002-08-16 Thread Philip Hallstrom
This wouldn't work for uploading files however since the long part of the process is the act of uploading the file and until that completes your "save.php" (or whatever) isn't called. So in regards to file uploading it has to be done with Javascript. What you do below is great for scripts that j

[PHP] Re: Image library

2002-08-21 Thread Philip Hallstrom
Lots of good ideas. One other thing to consider when designing this is the possibility of multiple web server accessing a single database server. If you use the file system method which assumes that the web/db are on the same server as soon as you want to have multiple web servers you'll run int

[PHP] RE: Image library

2002-08-21 Thread Philip Hallstrom
> [snip] > > Having a large number of files in a single directory does affect > performance, > > the degree of which depends on the filesystem. > > This is generally accepted wisdom for dealing with large numbers of files - > but what number is considered "large"? > Any rules of thumb, for differe

[PHP] Re: SeparatingWords

2002-08-21 Thread Philip Hallstrom
This works. $word = "SoftwareVersionThingy"; $word = ereg_replace("([A-Z])", " \\1", $word); $word = ltrim($word); -philip On Thu, 22 Aug 2002, Hessu wrote: > Hi, > > I have strings like FileName, SoftwareVersion etc. > How can I add space between words? Somehow with preg_replace perhaps? > Fi

Re: [PHP] Re: SeparatingWords

2002-08-21 Thread Philip Hallstrom
Yes, it would and yes you can, but I'll leave that up to you :) On Wed, 21 Aug 2002, DL Neil wrote: > Philip, > What about "SoftwareVersion Thingy"? > Won't that end up as "Software Version Thingy" - with two spaces before the > "T"? > Can the RegEx be 'turned off' if the u/case letter is alrea

[PHP] Re: filter files in a directory

2002-08-26 Thread Philip Hallstrom
Try adding && !ereg("*.config", $files) -philip On Mon, 26 Aug 2002 [EMAIL PROTECTED] wrote: > I am showing a directory of files and I don't what all the files to > show on the screen. I was able to get the . and the .. not to show > with what I have below but there are some other files in the

[PHP] Re: file reading

2002-08-27 Thread Philip Hallstrom
You want "r" instead of "w+". I'd suggest reading the Filesystem Functions section of the manual again... good luck! -philip On Tue, 27 Aug 2002, phper wrote: > how do I read the contents of a file. > > $FileStream = fopen("webmaster/forum".$Forum."/forumtopics.txt", "w+"); > $line = fgetss

[PHP] Re: wish list for my host's new compile

2002-08-29 Thread Philip Hallstrom
On Thu, 29 Aug 2002, Justin French wrote: > Hi all, > > My host is putting together a new linux box at the moment for hosting, and I > want to make sure that they include a few things that I've needed, but > weren't available on the current server. I've got about 15 domains with > them, so it's

[PHP] Re: Getting local domain name in CLI

2002-08-29 Thread Philip Hallstrom
What about... $hostname = `/bin/hostname`; or something along those lines... On Thu, 29 Aug 2002, Geranium wrote: > I need to get the domain name of the local machine. > I'm running a CLI script in PHP 4.3-cvs (on OpenBSD) so I have no HTTP > or other global vars to look at. The posix_uname co

[PHP] Re: Output php code

2002-08-29 Thread Philip Hallstrom
http://www.php.net/manual/en/function.show-source.php On Thu, 29 Aug 2002, apollo wrote: > Is there any function in php to show source code like this: > http://www.php.net/source.php?url=/index.php > > How do they do this ? I mean all these colors. > > > > -- > PHP General Mailing List (http:/

[PHP] Re: Server Setup Walkthrough?

2002-08-30 Thread Philip Hallstrom
Check the manual at www.php.net. There are installation instructions in it... On Sat, 31 Aug 2002, Kris wrote: > Hi All, > > Relatively new to PHP and Apache. I've had some trouble setting up my own > web server for learning on - I basically have no idea where to start in > order to get them bo

[PHP] Re: Regular expression question

2002-08-30 Thread Philip Hallstrom
$str = "jeD1GLal"; $str = ereg_replace("[1LIO0lio]", "", $str); something like that... On Fri, 30 Aug 2002, Jeff Lewis wrote: > Is there a regular expression that will remove 1, L, I, O, 0 and the > lowercase equivilants from a varialbe? > > I am not horribly well versed in regular expressions.

[PHP] Re: Simple one... Please look.

2002-08-30 Thread Philip Hallstrom
http://www.php.net/manual/en/function.file.php On Fri, 30 Aug 2002, Shane wrote: > Greetings. Can someone please enlighten me on the best way to get information from a >comma delimited file, to a variable? > > Example. A client updates a comma delimited list of names to a directory on a >serve

[PHP] Re: PHP OOP

2002-09-03 Thread Philip Hallstrom
Not tested, but what if you change $b[0] = new one(); $b[1] = new one(); to: $this->b[0] = new one(); $this->b[1] = new one(); On Tue, 3 Sep 2002, Rodrigo Dominguez wrote: > I have a problem, I can't create an array of classes into a class, for > example: >

[PHP] Re: Please help with fresh fish.

2002-09-03 Thread Philip Hallstrom
Read everything at the following sites :-) www.php.net www.zend.com www.phpbuilder.com In particular read the manuals, tips, tricks, examples, and links to other sites sections. Lots of good info there and will point to more sites. On Tue, 3 Sep 2002, Anh wrote: > Hello everyone, > > I would

[PHP] Re: simple problem

2002-09-04 Thread Philip Hallstrom
add the following: if( $i % 3 == 0 ) { print("something else"); } You might need to vary the zero in that equation to get it to print at the "right time" by which I mean, the above will print "something else" on the first iteration of the below loop. -philip On Wed, 4 Sep 2002, Cirkit

[PHP] Re: whitespace...

2002-09-04 Thread Philip Hallstrom
I'm not sure I fully understand your question, but given the following PHP file: all the browse will see is this (minus the dashed lines). -- hello -- On We

[PHP] Re: syntax question - eregi()

2002-09-19 Thread Philip Hallstrom
If memory serves, $match will contain an array whose 0th element is the entire string and whose 1st element contains whatever is matched in the first (), 2nd element matches the second () and so on. Check the manpage for more... and when testing things like this out try adding the following for

[PHP] Re: All Queries TRUE even when they should be FALSE

2002-09-20 Thread Philip Hallstrom
Could be wrong, but the fact that $result isn't empty doesn't mean there are rows... it would be better to say: if ( !empty($result) ) { echo "VALID QUERY"; } else { echo "INVALID QUERY"; } Although you should probably check $result against TRUE and FALSE instead. If you want to know h

[PHP] Re: Sockets

2002-09-23 Thread Philip Hallstrom
Yes. See the online manual notes in the Socket Functions section for links to examples. On Mon, 23 Sep 2002, Martin W Jørgensen wrote: > Is it possible to read and write to multiple sockets at once with php? > > Can anyone please answer that question? > > > > -- > PHP General Mailing List (http

[PHP] Re: Cronjob

2002-09-25 Thread Philip Hallstrom
You could setup cron to run lynx or some other command line web browser... something like: 0 * * * * /path/to/lynx -dump http://server/path/to/script.php >/dev/null 2>&1 Then as the first thing in that script you will probably want to set the time limit to 0 so it doesn't time out... On Wed,

Re: [PHP] Re: Cronjob

2002-09-25 Thread Philip Hallstrom
-dump is an option to lynx to tell it to output the page and quits. the rest of it says send all output (and errors) to /dev/null On Wed, 25 Sep 2002, Daren Cotter wrote: > What does the "-dump" and ">/dev/null 2>&1" stuff do? > > --- Philip Hallstrom &

[PHP] Re: Re: Cronjob

2002-09-25 Thread Philip Hallstrom
Then try a script with: in it and run it as: % php script.php arg1 arg2 arg3 and then search the output for arg1 and find out where it is. It's got to be there somewhere. -philip On Wed, 25 Sep 2002, Daren Cotter wrote: > Don, > > It was not there anywhere. > > --- Don Read <[EMAIL PROTEC

[PHP] Re: Explorer-like "drill down" interface

2002-09-25 Thread Philip Hallstrom
On Wed, 25 Sep 2002, Mike Dunlop wrote: > >I have two questions: > > > >2. I have allowed packets through my firewall destined for port > >3306, the mysql server. So I can connect to the server from a remote > >machine. Are there any known security vulnerabilities in the mySQL > >server? > I wou

[PHP] Re: Can I pass the ftp transfer mode in a string?

2002-09-30 Thread Philip Hallstrom
Why not do... $filetype = FTP_ASCII; $upload = ftp_fput($conid, $dfile, $sfile, $filetype); On Mon, 30 Sep 2002, John Kelly wrote: > Can I pass the ftp transfer mode in a string like ... > > $filetype = "FTP_ASCII"; > $upload = ftp_fput($conid, $dfile, $sfile, $filetype); > > I ask as when I d

[PHP] Re: Math problem (222)

2002-10-02 Thread Philip Hallstrom
Well, since it's for school I'll only point out a couple of issues... - your for loop will never test the number 987 even though it should. - add the following line rightr after you compute $numtotal: print("$numtotal = $num1 + $num2 + $num3 + $num4 + $num5 + $num6\n"); and you'll see that you

[PHP] Re: Include

2002-10-03 Thread Philip Hallstrom
To my knowledge you can include as many files as you want. If by commenting out the clean() function, I'd say you have a syntax error in that function and you're just not seeing the error message. Turn on full error reporting and see what happens. -philip On Thu, 3 Oct 2002, Matias Silva wrote

[PHP] Re: Code management

2002-10-15 Thread Philip Hallstrom
I'd separate out your shared PHP files and put them all in a directory named say "my_php_lib". Organize it like PEAR if you want... Then for each of your sites set up the directory structure something like this: /path/to/site/htdocs /path/to/site/my_php_lib where you've cvs-co'd my_php_lib. T

[PHP] Re: Odd finding while researching $_FILES

2002-10-16 Thread Philip Hallstrom
I think that's because there are five keys for _$FILES['picname']. According to the manual: -- The contents of $_FILES from our example script is as follows. Note that this assumes the use of the file upload name userfile, as use

[PHP] Here's a quick script to generate IE bookmarks of the functionreference.

2002-10-16 Thread Philip Hallstrom
Hi all - I find I spend a lot of time looking up functions in the manual and even with my local copy it takes awhile (click click, page down, click). So I wrote a script to run through the PHP documentation and generate a heiarchial directory of IE bookmarks for all of the functions. I j

[PHP] Re: Quick way to test series of integers

2002-10-24 Thread Philip Hallstrom
Just add zero to the variables in your processing script... ie... $var_1 += 0; $var_2 += 0; That way if they are set to one, no difference. if they are set to "" then they become zero. It's worked for me in the past. On Thu, 24 Oct 2002, Paul Kaiser wrote: > Hey there, > > I have around 50 c

[PHP] Re: Cleaning pasted Word text

2002-10-29 Thread Philip Hallstrom
You might look at the htmlentities() function... On Tue, 29 Oct 2002, a.h.s. boy wrote: > I'm working on a PHP-based CMS that allows users to post lengthy > article texts by submitting through a form. The short version of my > quandary is this: How can I create a conversion routine that reliably

[PHP] Yahoo Moving to PHP (seen on slashdot)

2002-10-29 Thread Philip Hallstrom
Figured this was important enough to share... Yahoo Moving to PHP http://developers.slashdot.org/article.pl?sid=02/10/29/2052239&mode=thread&tid=169 Erek Dyskant writes "Yahoo has decided to switch from a proprietary system written in C/C++ to PHP for their backend scripting. Here's the notes fro

[PHP] Re: Dazed and Confused

2002-10-30 Thread Philip Hallstrom
Yes... for the most part... think about it this way... (and please correct me if I'm wrong :) An associative array isn't ordered. It's key based. Think of it like a dictionary, but one whose first and last several pages have been removed. You wouldn't have any way of telling me the definition fo

[PHP] Re: Convince teh boss

2002-11-07 Thread Philip Hallstrom
You should also take a look at some of the case studies on zend.com as well. I seem to remember articles on the Navy and the Indy500. Also, search the archives for "Yahoo Moves to PHP" for some articles and slides on Yahoo's decision to start using PHP for new stuff. -philip On Wed, 6 Nov 2002,

[PHP] RE: Why $ on variable names?

2002-11-12 Thread Philip Hallstrom
It could have, but what does "array" consist of below? variable = "foo"; array[variable] = variable; Is it "variable" => "variable", or "foo" => "foo" or "variable" => "foo" or ? By using $ you keep things simpler... at least to me :) -philip On Tue, 12 Nov 2002, brucedickey wrote: > Thanks f

  1   2   3   4   5   >