[PHP] Re: Number Format

2001-12-20 Thread Philip Hallstrom
Like the other guy said or take a look at the sprintf() function. On Thu, 20 Dec 2001, phantom wrote: I would like to format numbers to be a fixed width. I want all numbers to be 2 characters in width to the left of the decimal point. 1 should be 01 2 should be 02 3 should be 03 How

[PHP] Re: Re: Global Arrays ?

2001-12-20 Thread Philip Hallstrom
an not for local variables? You probably are right, I don't imply you aren't, but why is a reset needed in local scope when using global variables? Is it possible to start an each() in a function and continue it in another for global arrays? Philip Hallstrom wrote: Add a reset($g_months) right before

[PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Philip Hallstrom
2. Please enter your age: 25; drop database mysql Does this actually work? [...] So I decided I had to test this: I wrote the code exactly as in the example; I provided the exact dangerous input (well, to be honest, I tried a select instead of drop mysql). When I tried it, the presumably

Re: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Philip Hallstrom
At 06:03 PM 12/20/2001 -0800, Philip Hallstrom wrote: I've done something similar in the past just for kicks, and I got the same result you did (i.e. an error). I believe this is because mysql_query() expects ONE query at a time and will break if you send two or more. I could

[PHP] Re: How should I do this site...?

2001-12-19 Thread Philip Hallstrom
I just did this for a site awhile back. All the pages use the same template, but you could modify pretty easily.Build out an array like the one below that defines your entire site heirarchy. In my example, I set the url, title, alttext (for the image button), the image name (for javascript

[PHP] RE: How should I do this site...?

2001-12-19 Thread Philip Hallstrom
unset will unset a varialbe. In the case I had I used to make sure that my $subAry was being unset before using it (I use it several places since several sections had sub sections). And yes, you can nest this as deep as you want since it is really just a tree. You start at the top and walk all

[PHP] Re: mySQL INSERT question

2001-12-17 Thread Philip Hallstrom
Maybe I'm reading your question wrong, but what you are asking isn't possible and more importantly doesn't make sense. I think you're thinking of a database table as you'd think about say an excel worksheet (in that it's ordered). tables aren't ordered in that way. Think about a table as

[PHP] Re: electronic postcard recommendation?

2001-12-17 Thread Philip Hallstrom
Check www.zend.com and php.resourceindex.com and you'll probably find something... On Mon, 17 Dec 2001, Brian Tully wrote: hi there :) i've been asked to implement an electronic postcard app for a client's website, and was wondering if anyone can recommend an existing implementation, be

[PHP] The peacock logo... and others...

2001-12-13 Thread Philip Hallstrom
Not to throw a wrench into the plans and it's not clear that it really matters, but O'Reilly uses a peacock for an XML book. http://www.oreilly.com/catalog/xmlnut/ and a pelican for this book. http://www.oreilly.com/catalog/webclient/ I suspect that most animals are probably being used by

Re: [PHP] The peacock logo... and others...

2001-12-13 Thread Philip Hallstrom
- when will those pesky Microsoft junkies ever learn :-) ~kurth The O'Reilly animal for PHP is a cuckoo bird. On Thu, 13 Dec 2001, Philip Hallstrom wrote: Not to throw a wrench into the plans and it's not clear that it really matters, but O'Reilly uses a peacock for an XML book

[PHP] Re: How do I do this

2001-12-13 Thread Philip Hallstrom
This is untested, but something like... $str = [hi] there, this is me [HI] there, this is me; $newstring = ereg_replace((\[[A-Z]*]), br\\1, $str); should do it. using the Perl regexe's might make it easier, but that should work. On Thu, 13 Dec 2001, Boget, Chris wrote: I've got the

RE: [PHP] Re: How do I do this

2001-12-13 Thread Philip Hallstrom
Probably something like this... $str = [hi] there, this is me [HI][HI] there, this is me; $newstring = ereg_replace((\[[A-Z]*][^]]), br\\1, $str); I'm not sure if the [^]] should be [^\]] or not, but that might work. If it doesn't you could always do: $str = [hi] there, this is me [HI][HI]

[PHP] Re: Application.cfm like mechanism in PHP?

2001-12-11 Thread Philip Hallstrom
Sure... sort of :) This is what I do... - in your webserver config file set auto_prepend.php to point to the following file: --- ?php # # This file is the first one read for every *.php request. It includes

[PHP] Re: how to get multiple checkbox values in a results page?

2001-12-01 Thread Philip Hallstrom
Rename your form name to befname[] Then you'll get them all... this is in the manual somewhere if you need more info on it... don't remember exactly where. -philip On Sun, 2 Dec 2001, Ivan Carey wrote: Hello, I have a form with multiple checkboxes. Their names are the same ie all are

[PHP] Re: How can you determine if you on the last result?

2001-11-28 Thread Philip Hallstrom
You could use whatever OCI function returns the number of rows returned and then keep a counter or you could do it this way: while(OCIFetchInto ($curs, $data)) { # do normal stuff for *ALL* rows } # do some stuff with $data which now contains the last row. -philip On Wed, 28 Nov 2001,

[PHP] Re: Re: How do I convert from perl to php?

2001-11-20 Thread Philip Hallstrom
You could do something like this... there are lots of ways to validate your data... while( list($key, $value) = each($HTTP_POST_VARS) ) { if( empty($value) ) { print(Sorry, you left $key empty.); } } This is assuming the form method is POST. If it's GET,

[PHP] Re: Re: Re: How do I convert from perl to php?

2001-11-20 Thread Philip Hallstrom
= array('name','address','phone'); while ( list($key, $value) = each ($required) ) { if ( empty($value) ) { print(Sorry, you left $key empty.); } } - Original Message - From: Philip Hallstrom [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 2:22

[PHP] Re: Tree View

2001-10-30 Thread Philip Hallstrom
Check www.zend.com in the code gallery... On Tue, 30 Oct 2001, Ing. Gustavo Edelstein wrote: Hi, Has anybody a snippet or something to build a treeview with data from a MySQL table ? Thanks, Ing. Gustavo A. Edelstein Tech. Mgr. Equiplus Argentina S.A.

[PHP] Re: Calendar

2001-10-26 Thread Philip Hallstrom
Check www.zend.com in the code gallery... I'm sure they have something along these lines. On Fri, 26 Oct 2001, Chip wrote: Does anyone know of a php script that will display a monthly calendar in a graphical format? I have a client that would prefer that over the typical list of dates which

[PHP] Re: Detect if javascript is enabled

2001-09-20 Thread Philip Hallstrom
You could also have Javscript do something like: script document.location.href = theyvegotjavascript.php; /script other wise they don't... -philip On Thu, 20 Sep 2001, Mark wrote: On Thu, 20 Sep 2001 19:41:55 +0200, Ole Victor wrote: Hi, Does anyone know a simple trick to get PHP detect

[PHP] Re: Determining file types of uploaded files

2001-09-20 Thread Philip Hallstrom
read: http://www.php.net/manual/en/features.file-upload.php You either want: $userfile_type or $HTTP_POST_FILES['userfile']['type'] -philip On Thu, 20 Sep 2001, Ezra Freedman wrote: Is there a way to determine the file type of a file uploaded via an INPUT TYPE=file form? I know that

[PHP] Re: Warning: stat failed - Why does it appear?

2001-09-18 Thread Philip Hallstrom
I am using 4.0.7-dev and I too now get this error on unix (FreeBSD 4.3-STABLE). So it's happening all over. I think it's a good thing cause it helps remind you that you're trying to stat something that doesn't exist... and if you're doing that on a file that might or might not exist then your

[PHP] Re: Graphs...

2001-09-13 Thread Philip Hallstrom
http://www.aditus.nu/jpgraph/ http://vagrant.sourceforge.net/ haven't used either of them though... but they sure look nice. On Fri, 10 Aug 2001, Nic Skitt wrote: Anybody got any tuts/examples of a working graph with PHP? Cheers Nic -- PHP General Mailing List (http://www.php.net/)

[PHP] Re: run a script for any HTTP request (was: run a script on accessto a directory)

2001-09-07 Thread Philip Hallstrom
What's wrong with rewriting urls? The other alternative is to make sure that none of the urls you are accessing actually exist and then setup an ErrorDocument handler which calls the php script of your choice... which can then do whatever you want... -philip On Fri, 7 Sep 2001, Enrique Vadillo

[PHP] Documentation for snapshot releases?

2001-08-30 Thread Philip Hallstrom
Hi - Is it possible to get documentation for the snapshopt releases? Or something newer than 4.0.6? All pointers appreciated. Thanks! -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

[PHP] Re: How give a 'timed' online quiz?

2001-08-13 Thread Philip Hallstrom
I would use javascript... have javascript sleep for the time period, then switch a hidden variable to indicate they didn't finish, then submit the form. It's not bullet proof in that I could just turn javascript off on my machine, but it works... -philip In article [EMAIL PROTECTED], Tom Henry

[PHP] Re: Example high-profile PHP sites

2001-07-26 Thread Philip Hallstrom
I'd probably suggest using more of a What PHP can do tactic rather than Who's using PHP. I'm sorry, but the latter tactic seems like a jumping on the bandwagon approach. Yeah, but if you're trying to convince a pointy haired boss, this is the route you have to take. It's sad, but it's true.

[PHP] Re: Formatting problem...

2001-07-25 Thread Philip Hallstrom
I'm not sure I understand your problem... this is what it looks like on my machine (your url that is) http://www.adhesivemedia.com/~philip/gigs.gif IE 5.5 on w2k On Wed, 25 Jul 2001, Chris Cocuzzo wrote: hey- this is a little bit off topic, but it relates. I'm pulling a field called info

[PHP] Re: Learning PHP

2001-07-25 Thread Philip Hallstrom
I learned from various sites and the manual and just by doing it which usually meant it would fail cause I'd used Perl's syntax so I'd go find the PHP equivalent :) However, I bought Professional PHP Programming for some of our developers who like books. I skimmed it and it's pretty good. I

[PHP] Re: Apache/phpinfo

2001-07-24 Thread Philip Hallstrom
http://www.php.net/manual/en/function.php-sapi-name.php On Tue, 24 Jul 2001, Tom Malone wrote: How can you tell if your host has PHP installed as mod_php or in CGI mode on the webserver (Apache in my case)? Is it in phpinfo.php? If so, where - I couldn't find it... Thanks Tom Malone --

[PHP] Re: bad word filter

2001-07-24 Thread Philip Hallstrom
I missed the first part of this, but I'm assuming it's for a message board of some sort? Why not implement a big brother system where other posters can indicate that the post contains inappropriate content. If enough people do this, then just kill the post, and record the author. If enough of

[PHP] Re: telnetty/phpy/unixy thing

2001-07-24 Thread Philip Hallstrom
I don't remember the exact terms, but telnet won't work unless it's connected to a tty (ie, you're running it from a command prompt). That's why it works when you run it with the PHP binary. If you're intent on using this method, there's a couple of programs to look at: socket, and netcat.

[PHP] Re: Turning a filehandle into an array

2001-07-24 Thread Philip Hallstrom
Take a look at the file() function. It does exactly this. On Tue, 24 Jul 2001, Gonyou, Austin wrote: What is the best way to turn a filehandle into an array? This is the code I've got now, but I don't like it because it's rather in efficient for my purposes. I can format this to be much

[PHP] Re: A good PHP auto-reply system

2001-07-19 Thread Philip Hallstrom
If each user has an actual account on the system you could have php integrate with the vacation program (man vacation) On Thu, 19 Jul 2001, scott [gts] wrote: Can anyone reccomend a good PHP (or perl) Web-based email auto-reply thingy. I work at a company that hosts websites and provides

[PHP] Re: PHP based statistics/Graphs

2001-07-18 Thread Philip Hallstrom
There's also http://www.aditus.nu/jpgraph/ (never used it) On Tue, 17 Jul 2001, Rasmus Lerdorf wrote: I like Vagrant. See http://vagrant.sourceforge.net -Rasmus On Wed, 18 Jul 2001, Chris Aitken wrote: Hi everyone.. Just wondering if anyone can suggest any methods, or even

[PHP] Re: a simple question

2001-07-17 Thread Philip Hallstrom
you can't. at least the last time I wanted to you couldn't. I think Rasmus said it would require a lot of work in the parser... If I'm wrong, I'll be very happy. On Wed, 18 Jul 2001, Hamed wrote: Hi, Can anyone tell me please what is the equivelant of this statement from perl, in PHP?

[PHP] Re: Time Taken to Process

2001-07-16 Thread Philip Hallstrom
Look at the recent subject entitled echo vs printf. There's code to do exactly what you want. I don't think there's anything built in, but I could be wrong. On Mon, 16 Jul 2001, Phil Spitler wrote: Does anyone know an easy way to tell how long a page takes to run in ms. Maybe some variable

[PHP] Re: regex question

2001-07-16 Thread Philip Hallstrom
You could do it using the strpos() function to find the index of the first occurance of i and strrpos() for the last occurence. Then use substr() to grab what you want... On Mon, 16 Jul 2001, Julian Simpson wrote: I'm trying to parse an existing html file using php. I need to use regex to

[PHP] Re: How to convert a string into a mathematical expression?

2001-07-13 Thread Philip Hallstrom
Take a look at the eval() function. On Fri, 13 Jul 2001, Christodoulou Demetris wrote: Hi list. I have string variables that contain mathematical expressions. These strings are submitted through forms. For example if a user inserts the following- 1+cos(0.3)*x into a text field with name

[PHP] Re: Export to Excel

2001-07-13 Thread Philip Hallstrom
Instead of the comma-separated suggestions mentioned in other posts, I'd recommend using a tab-separated file so that you don't have any confusion for entries such as addresses that might look like Seattle, WA. The other reason is that it's *really* hard to enter a TAB in an HTML form so it's

[PHP] RE: building a search engine ??

2001-07-12 Thread Philip Hallstrom
You might also take a look at: http://www.php.net/manual/en/ref.mnogo.php On Thu, 12 Jul 2001, scott [gts] wrote: and to answer one of the previous questions, yes... it is *very* resource intensive to scan an entire directory tree full of files every single time a user wants to search

[PHP] Re: How do I get PHP's User-Agent?

2001-07-11 Thread Philip Hallstrom
You could have PHP open a URL that contained the phpinfo(); function and then just look through that... -philip On Wed, 11 Jul 2001, Nathan wrote: I need to create an authentication hash based on the user agent, to connect to a server but I need PHP’s User Agent, which is usually something

Re: [PHP] Re: How do I get PHP's User-Agent?

2001-07-11 Thread Philip Hallstrom
/bar.php'); So it looks like it's PHP/ followed by your version. -philip On Wed, 11 Jul 2001, Francis Fillion wrote: Just that: $HTTP_USER_AGENT Philip Hallstrom wrote: You could have PHP open a URL that contained the phpinfo(); function and then just look through that... -philip

[PHP] Re: Rename a File?

2001-07-11 Thread Philip Hallstrom
You can also do rename(moo.php, foo.php); provided that both are on the same filsystem. On Wed, 11 Jul 2001, Alex Black wrote: in article [EMAIL PROTECTED], Randy Johnson at [EMAIL PROTECTED] wrote on 7/13/01 10:53 AM: How do I rename a file on Linux in PHP? Thanks Randy $err

[PHP] Re: Redirect

2001-07-06 Thread Philip Hallstrom
Header(Location: whereveryouwanttogo.html); On Fri, 6 Jul 2001, [iso-8859-1] Victor Spång Arthursson wrote: Hi! Still new on PHP, converting from vb$cript, I wonder how I do a redirect... In vbscript: % response.redirect(page.extension) % In PHP??? Sincerely Victor -- PHP

[PHP] Re: how can I call a link? ??

2001-07-05 Thread Philip Hallstrom
Use javascript. Have that first page return HTML that contains javascript along the following: html script top.leftframe.document.href = 'http://serverview_cart.php?add=4ffqe45'; top.rightframe.document.href = 'http://server/pdf/ex1.pdf'; /script /html You'll need to change the

[PHP] Re: Iterating varibales

2001-07-05 Thread Philip Hallstrom
Take a look at $HTTP_POST_VARS and $HTTP_GET_VARS. They will make this a lot easier. On Thu, 5 Jul 2001, Brian Ricks wrote: I have a site which uses two pages. The first page generates an HTML form with multiple rows which is then POSTed to the second page. Sometimes on the first

Re: [PHP] Enter to BR

2001-06-26 Thread Philip Hallstrom
See the nl2br() function. In article 9h8ct3$n0t$[EMAIL PROTECTED] you write: How can I get an Enter typed in a HTML textfield to be inerpreted as a BR or a P tag? Someone sugested I use the split() function, but I wouldn't know how... Joeri Vankelst -- PHP General Mailing List

Re: [PHP] redirect from aframe to the whole page!

2001-06-21 Thread Philip Hallstrom
I don't remember for sure, but I think for IE you can do this: Header(Window-target: targetgoeshere); Header(Location: /whereyouwanttogo.html); and it will work. I'm pretty sure that works, but maybe I'm not remembering right. -philip In article [EMAIL PROTECTED] you write: Hi! how cann i

Re: [PHP] Recursively create directories

2001-05-15 Thread Philip Hallstrom
If you're on unix, and don't mind a system call you could do: system(/bin/mkdir -p $dir); From the man page for mkdir. -p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already exist. Intermediate directories are

Re: [PHP] Recursive SQL Queries: Web Directory Categories

2001-05-09 Thread Philip Hallstrom
It's a book to buy... On Wed, 9 May 2001, Gyozo Papp wrote: Hello, Joe Celko's 'SQL for Smarties'. Is it a book ( to buy :( ) or is it available on the web (download :) )? If the latter stands please can you give me a link to it? - Original Message - From: Philip Hallstrom

Re: [PHP] Recursive SQL Queries: Web Directory Categories

2001-05-08 Thread Philip Hallstrom
Also take a look at Joe Celko's 'SQL for Smarties'. There's a whole chapter on this. It gets kind if burly, but it's pretty cool. It's all done by converting your schema below into a tree structure... (no, i don't have any code since I've just read about it never done it :) -philip In

Re: [PHP] Redirect With Authentication Question

2001-05-03 Thread Philip Hallstrom
Take a look at: ftp://ftp.isi.edu/in-notes/rfc2617.txt To receive authorization, the client sends the userid and password, separated by a single colon (:) character, within a base64 [7] encoded string in the credentials. basic-credentials = base64-user-pass base64-user-pass =

Re: [PHP] using an array with form list values

2001-05-03 Thread Philip Hallstrom
Something like this should help: if( is_array($preferred_location) ) { #your code goes here. } In article 9csden$8qu$[EMAIL PROTECTED] you write: I need to check that a form entry defined as an array contains a value before initiating the foreach code in my script. I have my form

Re: [PHP] Dynamic Pages and Google ???

2001-04-17 Thread Philip Hallstrom
I'm not an expert in this, but I suspect that some search engines will probably ignore URL's that look like this: /path/to/dynamic.php?arg=1foo=bar because it sees the ? and knows that it's a dynamic result and perhaps very likely to change. I had always assumed that's why many sites (such as

Re: [PHP] ROUND inconsistency

2001-04-13 Thread Philip Hallstrom
In article 9b6c4v$m41$[EMAIL PROTECTED] you write: Correction, MySQL is not returning floor, since it returns 2 for round(1.5). - I didn't see it. MySQL should not return 2 for round(2.5), but it should return 3. I think it's MySQL bug. How about ask in MySQL mailing list? I don't think it's

Re: [PHP] Paying BIG e-dollars for older php source!!!

2001-03-30 Thread Philip Hallstrom
In article [EMAIL PROTECTED] you write: I have no money, but is someone willing to provide php-4.0.3pl1.tar.gz or just anything 4.0.4pl1 and 4.0.0. Please just email if possible. http://www.adhesivemedia.com/~philip/php-4.0.2.tar.gz It will stay there for awhile (ie. until I clean

Re: [PHP] tutorials on good database design

2001-03-13 Thread Philip Hallstrom
You could try the book SQL for Smarties by Joe Celko... I'm not through it yet, but it's got some theory (but not enough to make your head hurt) and goes over all the various SQL commands... in the TOC there's stuff on how to implement directed graphs (such as the organizational path from you to

<    1   2   3   4   5