[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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Best String to Array Solution

2002-07-11 Thread Philip Hallstrom
take a look at explode() and split(). On Thu, 11 Jul 2002, Shane wrote: > Greetings, this may be simple, but it's late and my brain needs a hand. > > I have a string such as "first,second,third,fourth" > > I need a way to take each one of the items separated by the comma to be an item in >an ar

[PHP] Re: Development Tools

2002-07-10 Thread Philip Hallstrom
Well, this will start a war, but vim is available for windows... take a bit of getting used to, but once you do it's awesome. and if you end up on a unix box that has it you don't have to relearn anything. -philip On Wed, 10 Jul 2002, Mark McCulligh wrote: > I am looking for a good Development

[PHP] Re: Best Content Management METHOD...

2002-07-08 Thread Philip Hallstrom
> If there IS server load, you can have an option 3, which basically combines > option 1 and 2. Keep the raw article data in a database which is there > forever. Then run a program which batch-creates 'HTML' pages from templates > and the database, and publish a static website (as per option 2).

[PHP] Re: Survey: MySQL vs PostgreSQL for PHP

2002-07-08 Thread Philip Hallstrom
> > How many here feel PostgreSQL has surpassed MySQL as the better backend for > > PHP? This would be based on performance (speed, scalability, etc.) and > > features. > > I've been using MySQL/PHP for quite some time. Several months ago, I > wanted to port a project over to PostgreSQL. I foun

[PHP] Re: Survey: MySQL vs PostgreSQL for PHP

2002-07-08 Thread Philip Hallstrom
> PostgreSQL also has a number of things that it lacks when compared to MySQL. > For example, it does not support unsigned integers, which forces you to use > int8 to store timestamps, which will eventually reach 4.2 billion. In case Is there a reason you can't use the timestamp data type? It's

[PHP] Re: Survey: MySQL vs PostgreSQL for PHP

2002-07-08 Thread Philip Hallstrom
On Fri, 5 Jul 2002, [iso-8859-1] João Paulo Vasconcellos wrote: > I don't feel that. I run a web site with a big deal of traffic, and in speed > and scalability, MySQL is better than PGSQL or Sybase. I know because I tryed > each one of these before getting to MySQL in definitive. Sybase is WAA

[PHP] Re: uploading a file via php - i need some simple code

2002-07-03 Thread Philip Hallstrom
Read http://www.php.net/manual/en/features.file-upload.php On Wed, 3 Jul 2002, Phil Schwarzmann wrote: > I am having the worst trouble trying to write a tiny simple script that > will upload a file. Below is my code - can anyone tell me why it's not > working > > HTML > > enctype="multipar

[PHP] Re: Synchronize FTP sites with PHP?

2002-06-26 Thread Philip Hallstrom
I'm sure it's been done, but you might first look at wget and save some time. On Wed, 26 Jun 2002, Jeff Lewis wrote: > We're using a FTP Control program here but it's very old and I'm wondering > if anyone has used PHP to sync up FTP sites, to connect to a remote server > and check if there is a

[PHP] Re: Microsoft Bug come back to haunt?

2002-06-26 Thread Philip Hallstrom
I've had luck making the url look something like... http://server/path/to/dl.php?filename=filename.tar or http://server/path/to/dl.php/filename.tar (works with apache) The latter seems to work better for me. On Wed, 26 Jun 2002, Francis wrote: > Ok I posted a mail a couple of days ago abou

Re: [PHP] RE: GD Questions: Please help.

2002-06-13 Thread Philip Hallstrom
most definitely... I was assuming $id would be a number which would be looked up in a DB somewhere... in any event the realpath() function is your friend here :) On Thu, 13 Jun 2002, Stuart Dallas wrote: > On Thursday, June 13, 2002 at 10:39:51 PM, you wrote: > > if /path/to/image/cache/$id exis

[PHP] RE: GD Questions: Please help.

2002-06-13 Thread Philip Hallstrom
What you have below is the usual way to do it... if you want to get a bit fancier you can have your getimage.php script do something like this (pseudo code): --- figure out what image to display via the $id if /path/to/image/cache/$

[PHP] RE: Thumbnails from mySQL binary data

2002-06-12 Thread Philip Hallstrom
ait for the server side code to crunch? > > Thanks again group!!! > - NorthBayShane > > -----Original Message- > From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 12, 2002 12:56 PM > To: Shane > Cc: php > Subject: Re: Thumbnails f

[PHP] Re: Thumbnails from mySQL binary data

2002-06-12 Thread Philip Hallstrom
start with this: http://www.php.net/manual/en/function.imagecreatefromstring.php On Wed, 12 Jun 2002, Shane wrote: > Greetings, I just started playing with the GD functions. (FUN!!!) And I am looking >for advice or scripts on how to turn binary data from my DB into thumbnails. > > I understand

[PHP] Re: Equivalent of this in php

2002-06-12 Thread Philip Hallstrom
not checked, but something like: $fp = popen("|$Openssl_cmd req -new -config /usr/lib/openssl.cnf " . "-key $cert_dir/key -days $days -out $cert_dir/request 1>&2") || return("doh!"); fputs($fp, $subject['C'] . "\n"); ... ... ... pclose($fp); On Wed, 12 Jun 2002 [EMAIL PROTECTED] wrote

Re[2]: [PHP] Re: strip_tags bug ?

2002-06-07 Thread Philip Hallstrom
It sure would :) But if you're going to have HTML such as: < valid_tag > blah blah < this isn't a tag > < /valid_tag > then you've got problems no matter what you do :) On Fri, 7 Jun 2002, Stuart Dallas wrote: > On Friday, June 7, 2002 at 10:23:08 PM, you wrote: > > > Hmm... you could always

Re: [PHP] Re: strip_tags bug ?

2002-06-07 Thread Philip Hallstrom
uot;, " > ", $nt); maybe? On Fri, 7 Jun 2002, Mikhail Avrekh wrote: > Same thing happens: > > $t = "Everyone knows that 2 < 3, > but some people still think that 2 > 3"; > > $nt = strip_tags($t,'< >'); // i've also tried 

[PHP] Re: strip_tags bug ?

2002-06-07 Thread Philip Hallstrom
I haven't looked at the code, but doesn't strip_tags strip everything b/n < and >? In which case it's doing what it should below... The only solution I see would be to change the code to look for every possible HTML tag that exists and only do those, but with all the nonstandard tags I don't thi

[PHP] Re: text file

2002-06-05 Thread Philip Hallstrom
Take a look at following functions: http://www.php.net/manual/en/function.file.php http://www.php.net/manual/en/function.array-unshift.php -philip On Wed, 5 Jun 2002, John Taylor-Johnston wrote: > I want to open a text file which has 12 lines and > (1) insert a new line at line[0] > (2) re-sav

[PHP] Re: Stopping multiple votes by IP

2002-06-05 Thread Philip Hallstrom
> * and then Miguel Cruz declared > > So decide how much hassle it's worth making it (both for yourself and for > > your users) and run with it. My feeling would be that a cookie + email > > token is enough for anything but high-security or money-based operations; > > after those measures the

[PHP] Re: Previous & Next Navigation

2002-06-03 Thread Philip Hallstrom
look on phpbuilder.com and/or zend.com... I've seen articles on this very subject. On Mon, 3 Jun 2002, Jay Blanchard wrote: > Howdy! > > I am working on a project where approximately 3k - 5k records are returned > and need to be displayed 30 per page with 'previous' and 'next' navigation > at th

[PHP] Re: Is PHP used by U.S. Government? By U.S. DoD?

2002-05-31 Thread Philip Hallstrom
U.S. Naval Research Laboratory's Intranet relies on PHP http://www.zend.com/zend/cs/csnavalready.php On Fri, 31 May 2002, John Christopher wrote: > > I would like to use PHP in a project for a United States > Government client. The client is skeptical because PHP > is not a Microsoft product.

[PHP] Re: Why cant i refer to $userfile and $userfile_name?

2002-05-22 Thread Philip Hallstrom
Read this section of the manual... http://www.php.net/manual/en/features.file-upload.php Assuming your form input looks like this: then you'll want to use: $_FILES['userfile']['name'] The original name of the file on the client machine. $_FILES['userfile']['type'] The mime type of the file,

[PHP] Re: Getting only 255 chars from SQL Server

2002-05-21 Thread Philip Hallstrom
A long time ago I had this problem and discovered a checkbox in the ODBC configuration wizard with NT where you could specify how many chars of a varcar to return... you might look there... On Mon, 20 May 2002, Tim Greenleaf wrote: > FYI: MS SQL Server 7 and greater, Varchar is a max of 8000 c

[PHP] Re: Sane path? Avoiding people climbing in directory structure ../../

2002-05-20 Thread Philip Hallstrom
You could also use the realpath() function... realpath -- Returns canonicalized absolute pathname realpath() expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input path and return the canonicalized absolute pathname. The resulting path will have

[PHP] Re: imagecopy() no errors, but does nothing :-(

2002-05-20 Thread Philip Hallstrom
take a look at ImageAlphaBlending() On Mon, 20 May 2002, Evan wrote: > Here is how i fixed the problem: > > //Adding logo > $dst_im = @ImageCreateFromJPEG("../".$pathImg.$NomeFile); > $src_im = @ImageCreateFromPNG("../imgsite/logoxmail.png"); > $dst_size = GetImageSize("../".$pathImg.$Nome

[PHP] Re: Current URL is http or https?

2002-05-17 Thread Philip Hallstrom
I would guess you want $_SERVER["SERVER_PROTOCOL"] which returns "HTTP/1.1" for me and probably "HTTPS..." for https connections... also if you're using apache I think it sets some SSL_* variables that exist only when using https. On Fri, 17 May 2002, Steven Walker wrote: > Hi, > > I'm trying to

[PHP] Re: One more Regular Expression Question...

2002-05-13 Thread Philip Hallstrom
$string1 = "Here's the Schedule"; ereg(">(.*)", $string1, $matches); $string2 = $matches[1]; Something close to that anyway... On Mon, 13 May 2002, Brad Melendy wrote: > Hello, > I'm pretty stuck here. I wish to assign a variable the value of a > particular substrint of text from a second var

[PHP] Re: why doesn't $books[$val][display] show the value

2002-05-09 Thread Philip Hallstrom
It has to do with precedence (I think). When inside a double quoted string PHP evalutes "$books[$val]" *first* and doesn't catch that there's more to it... You can do this: $html.= " Yaddda yadda " . $books[$val][display]; And I think this (or something close to it): $html.= " Yaddda yadda {$

[PHP] Re: how do you route?

2002-05-02 Thread Philip Hallstrom
The following will make *every* request to this specific virtual host go through /path-to/script.php.This include .gifs, etc... everything. ServerName myserver.mydomain.org DocumentRoot /usr/local/www/myserver Action php-parse /path-to/script.php Action php-parse /p

[PHP] Re: file upload / no tmp name or size?

2002-05-01 Thread Philip Hallstrom
Just a guess, but is the file you are uploading larger than 3000 bytes? If so, then what you are seeing is normal since PHP is rejecting it because it's too large. -philip On Wed, 1 May 2002, Nick Wilson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > * and then 1LT John W. Holme

[PHP] Re: Help! Transparency using GD with PNGs!

2002-05-01 Thread Philip Hallstrom
You might look at the "ImageColorTransparent" function... good luck On Tue, 30 Apr 2002, Cam wrote: > I've got PHP 4.2 and what I believe to be the newest version of the GD > library up and running.. For some reason, my PNG images do not preserve > their transparencies but rather have a white

[PHP] Re: BBS system

2002-04-26 Thread Philip Hallstrom
if by bbs you mean message board type stuff... www.phorum.org is good and free. On Sat, 27 Apr 2002, r wrote: > Hey all, > > Just a small q, > does anybody know of any particular good BBS system that is free? (I aint > rich :-( ) Been to hotscripts.com can you recomend any? > > (Actually if i

[PHP] RE: Load Balancing and PHP Sessions

2002-04-25 Thread Philip Hallstrom
Or save it to a common database... and it could have something to do with session.cooke_domain. A cooke set explicity to www1.test.com won't be viewable on www2.test.com, but if you set the domain to ".test.com" it will... On Thu, 25 Apr 2002, Dan Harrington wrote: > > Couldn't you store the se

[PHP] Re: mod_rewrite

2002-04-22 Thread Philip Hallstrom
You could also do something like this: Configure Apache so that *every* request on a virtual host would be handled by a single PHP script. ServerName myserver.mydomain.org DocumentRoot /usr/local/www/myserver Action php-parse /path-to/script.php Action php-parse /path-to/script.php SetHan

[PHP] Re: Variable wildcards

2002-04-11 Thread Philip Hallstrom
If you want to process the list when they submit the form you can do something like this: foreach($_REQUEST as $key => $value ) { if( ereg("user([0-9]*)", $key, $match_ary) ) { #go crazy; } } ?? -philip On Thu, 11 Apr 2002, Jason Bell wrote: > Yeah, I thought so

[PHP] What's the difference b/n WBMP and BMP (regarding GD)?

2002-04-04 Thread Philip Hallstrom
Hi - I need to be able to generate 1-bit BMP's... and I'd like to do it all from within PHP using GD, but there's that annoying little W in front of what I want. As far as I can tell WBMP's *are* 1-bit only which is fine for me. Are there other differences or WBMP's really just 1-bit BMP

[PHP] Re: included file name

2002-04-03 Thread Philip Hallstrom
Check the constants section of the manual... __FILE__ (case-insensitive) The name of the script file presently being parsed. If used within a file which has been included or required, then the name of the included file is given, and not the name of the parent file. On Wed, 3 Apr 2002, Mikhail

[PHP] Re: Code Bulk

2002-03-26 Thread Philip Hallstrom
Why not just take that file and remove anything that isn't a function (so nothing actually executes) and then do something like: print microtime(); include "thatfile.php"; print microtime(); and see how long it took to parse 3000 lines... one more line isn't going to make that much difference.

[PHP] Re: how to get server os?

2002-03-22 Thread Philip Hallstrom
Create a script that looks like this: and then look at the output of that for your operating system... odds are you'll find a $_SERVER variable that gives you what you want. On Fri, 22 Mar 2002, Prachait Saxena wrote: > Hello Friends > > Can any one tell me how can i get the server operating

[PHP] Re: Phpfx, what is it?

2002-03-20 Thread Philip Hallstrom
Dont' know about phpfx, but there's www.phorum.org for a bulletin board system... On Wed, 20 Mar 2002, Chuck "PUP" Payne wrote: > Hi, > > I was sourgeforge.net looking at the PHP stuff, I saw something call phpfx, > but it not clear what it is or what it does. Has anyone mess with it? > > Also I

[PHP] Re: Return the column names of MySQL table?

2002-03-19 Thread Philip Hallstrom
Or if you want to do this within PHP use the mysql_list_fields function. On Tue, 19 Mar 2002, Geoff Hankerson wrote: > I believe it is: > describe tablename; > - Original Message - > From: "Kevin Stone" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 19, 2002 4:43 PM

[PHP] Re: How do I make tab spaces in a mail?

2002-03-19 Thread Philip Hallstrom
Use "\t" in your string. \t is will put in a tab. On Tue, 19 Mar 2002, [iso-8859-1] Jan Grafström wrote: > Hi! > I have read several tricks of how to remove white spaces but how to create > them? > > I wan´t to build a normal textmail like this: > $message=" > productitemspriceamoun

[PHP] Re: eregi()

2002-03-19 Thread Philip Hallstrom
Try www.zend.com in the application/code gallery. I've seen code that does this... On Tue, 19 Mar 2002, Vlad Kulchitski wrote: > Hi, > > Can any1 send a small script of how to valiade a username using eregi(). > > I want username to consist only a-zA-Z1-0, "_", and "-" > > I can't get it to wor

[PHP] Re: Problems with ftp_get

2002-03-18 Thread Philip Hallstrom
I would double check the values of $newName and $oldName and make sure that you have read permission on the one and write permission on the other... seems like the error should tell you what file it's having problems with, but maybe not. -philip On Mon, 18 Mar 2002, Ian Wayne wrote: > I'm getti

[PHP] Re: Mini CMS (content management system) (plase cc me, I'm on digest)

2002-03-13 Thread Philip Hallstrom
If the webserver is Apache you can do this: ServerName myserver.mydomain.org DocumentRoot /usr/local/www/myserver Action php-parse /path-to/script.php Action php-parse /path-to/script.php SetHandler php-parse SetHandler "application/x-httpd-php" *Every* request (whether the file

[PHP] Re: Targetted redirection?

2002-03-13 Thread Philip Hallstrom
Some browsers (IE I think) understand a "Window-target: targetname" header. I don't think it works very reliably nor do I remember exactly what versions, but if you search for "Window-target" you might find some more info. I'd go the javascript route if you can or find another solution... On We

[PHP] Re: HTML Buffer

2002-03-08 Thread Philip Hallstrom
Take a look at flush(). It might help... it might not if the web server doesn't want to send the data until it's buffers are full... at least that's my undertanding. On Fri, 8 Mar 2002, Mario Montoya [iso-8859-1] Martínez wrote: > Well, yes. But I think I may still need to output things to the

[PHP] Re: Crontab

2002-03-06 Thread Philip Hallstrom
Try... lynx -dump -philip On Thu, 7 Mar 2002, Uma Shankari T. wrote: > > > Hello, > > I am facing some problem in the crontab...Can anyone tell me how to > solve this > > Actually i have written the php script to send mail to the users after a > week.In the crontab i have made a ent

[PHP] Re: Looking for a combo of include() and eval() ????

2002-03-06 Thread Philip Hallstrom
eature request for > this exact thing... > > http://bugs.php.net/bug.php?id=5435 > > Not that this helps *me*, but there's more than one of us :) > > On Wed, 6 Mar 2002, Philip Hallstrom wrote: > > > Hi - > > Here's my dilema. > > > > inclu

[PHP] Re: Looking for a combo of include() and eval() ????

2002-03-06 Thread Philip Hallstrom
Looking around, I see someone else has submitted a feature request for this exact thing... http://bugs.php.net/bug.php?id=5435 Not that this helps *me*, but there's more than one of us :) On Wed, 6 Mar 2002, Philip Hallstrom wrote: > Hi - > Here's my dilema. > > in

[PHP] Looking for a combo of include() and eval() ????

2002-03-06 Thread Philip Hallstrom
Hi - Here's my dilema. include() will include a *file* and if there are PHP tags in it will run that PHP code, otherwise pass it along as is. eval() will parse a *string* of PHP code, but assumes it's valid PHP code. I want to something like this: - read a file that contains a mixture

[PHP] Re: OOP .. I just don't get it.

2002-03-05 Thread Philip Hallstrom
I'm not an OOP master, but I'll give it a shot. In your example below you don't gain much from using OOP. However, consider this example (all pseudo code)... class animal ( function eat() ... function sleep() ... function walk() ... ); class bird extends animal (

[PHP] Re: Reading unusual stdin

2002-03-04 Thread Philip Hallstrom
(not tested) $fd = fopen("php://stdin", "r"); while( !feof($fd) ) { $line = fgets($fd, 8192); } fclose($fd); On Mon, 4 Mar 2002, Ken Tossell wrote: > How would you read a multi-line stdin in php? The scripts I see all break > after one line. > > > > -- > PHP General Mailin

[PHP] Re: Parsing out attachments in mail.

2002-03-04 Thread Philip Hallstrom
http://www.phpguru.org/pear/contents.html and look at the mimeDecode.php script. Or browse through the PEAR files that come with PHP... Or, if your PHP is compiled with imap support check out some of the imap functions. -philip On Mon, 4 Mar 2002, Seth Northrop wrote: > > Does anyone know th

[PHP] Re: Parsing Content

2002-03-04 Thread Philip Hallstrom
You're best bet might be to see if your favorite sites have RDF/RSS files that you can use... See here for more info... http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html On Mon, 4 Mar 2002, Jonathan Duncan wrote: > I want to make a web site that displays news headlines from my favorite

[PHP] Re: arithmatic operation inconsistant

2002-02-28 Thread Philip Hallstrom
The reason that $ns1 is getting set to 1 so many times is because you are doing this: picking a random number between 90 and 120. using number_format to convert that number into a string such as 900,000 or 1,200,000. Then using that *string* in a mathmatical operation. So, for as soon as

[PHP] Re: How many files can be in one directory?

2002-02-26 Thread Philip Hallstrom
True, but by putting them in multiple directories if you ran out of room you could move one of those directories to a new disk/filesystem thereby making more room... On Tue, 26 Feb 2002, Andy wrote: > So this means, that I can not increas the amount by splitting the files into > more than 1 dire

[PHP] Re: preg_replace("/^\//".. doesnt work?

2002-02-20 Thread Philip Hallstrom
$a = "/test/"; $a = preg_replace("/^\//", "", $a); echo $a; Notice the difference in the second line... On Wed, 20 Feb 2002, John Ericson wrote: > Im having a weird regexp problem in PHP that I think is correct but it > doesnt appear to work. > > The code is this: > >

[PHP] Re: Weather Scripts

2002-02-19 Thread Philip Hallstrom
you could take a look around here... http://weather.noaa.gov/pub/data/forecasts/city/ http://weather.noaa.gov/pub/data/forecasts/state/ Somewhere on the site they say it's free, but they ask you not to bang on their servers too hard... -p On Wed, 20 Feb 2002, Shannon Doyle wrote: > > Hi Peopl

[PHP] Re: When should I use gethostbyaddr () if I want to monitoring theusers

2002-02-19 Thread Philip Hallstrom
Yes... you definately want to wait to check the domains until later. gethostbyaddr() (or any dns lookup) can be extremely slow... Also, you're doing it *every* time even for the same visitor... if you waited until you were parsing the log files you could do it *once* per visitor (by caching the r

[PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Philip Hallstrom
Not that I'm an ASP expert, but I asked someone about this once and was told that the application object is really just a session for that section of the website. In other words you configure IIS so that say "/foobar" is an application. Then in /foobar/global.asa you do some stuff that sets up th

[PHP] Re: Implement @-domains with PHP?

2002-02-12 Thread Philip Hallstrom
> In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Christian Blichmann) wrote: > > > "Cc Zona" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > You can look over the environment vars available to you with a quick call > > > to phpinfo()

[PHP] Re: Increment alphabetical character (simple question)

2002-02-12 Thread Philip Hallstrom
Take a look at the ord() and chr() functions. They'll do what you want. On Tue, 12 Feb 2002, phantom wrote: > How do I get the ASCII value of a character increment it by one... > and convert back to a character. > > For example: > > I want to grab a char such as "C" and increment it to "D"

[PHP] Re: Implement @-domains with PHP?

2002-02-12 Thread Philip Hallstrom
I don't think that string actually gets sent unless the browser receives a 401 Auth Required (I think that's it) header. Even if you have that setup and put a page with phpinfo() in it you'll notice that none of the environment variables will look like the url you've got below. The browser pulls

[PHP] Re: Math rounding problem

2002-02-08 Thread Philip Hallstrom
Something like this...? if( $n % 100 != 0 ) { $n += 100 - ($n % 100); } Although I don't think your example is any messier... maybe ceil/floor should have a precision field added... -philip On Fri, 8 Feb 2002, Charlie Killian wrote: > For an arbitrary large number I need to round() it up

[PHP] Re: Content Management

2002-02-08 Thread Philip Hallstrom
check the application section of www.zend.com -philip On Sat, 9 Feb 2002, karthikeyan wrote: > Hi, > > How should i go about to developing a php application to manage the content of a >web site OR is there allready some ready made script available which i can use in my >project. > > Looki

[PHP] Re: mktime() Algorithm

2002-02-06 Thread Philip Hallstrom
You could look at the source code for PHP On Wed, 6 Feb 2002, David A Dickson wrote: > I need to create a function in another programming language that takes the > same input as the php mktime() function and produces the exact same output > as the php mktime() function. Does anybody out ther

[PHP] Re: General question...

2002-02-04 Thread Philip Hallstrom
Something along the lines of: if( ereg("/confirm.php", $_SERVER['HTTP_REFERER']) ) { Header("Location: thanks.php"); exit; }else { Header("Location: index.php"); exit; } You might want to do some additional checking as well.. the above would match both "/path/to/

[PHP] Re: PHP vs Java reliability

2002-01-21 Thread Philip Hallstrom
http://www.zend.com/zend/art/php-over-java.php the "Why PHP" on zend.com is a great place to go for this sort of stuff... On Mon, 21 Jan 2002, Geoff Caplan wrote: > Hi folks > > Just putting together a brochure for a product authored in PHP, and making > the case for LAMP (Linux/Apache/MySQL/PH

[PHP] Re: MySQL and PHP

2002-01-17 Thread Philip Hallstrom
Does your query have a semicolon in it when you run it in PHP? Or did you paste the below from a mysql session? -p On Thu, 17 Jan 2002, Brandon Orther wrote: > Hello, > > I am trying to use mysql through php. When I try to run the following > query it does nothing. I am trying to figure out

[PHP] Re: encrypting passwords, how to decrypt?

2002-01-17 Thread Philip Hallstrom
If you are going to us encrypted passwords, then it goes something more like this: - user fills out form picking a login and a password. - php encrypts the password using say md5 and puts the encrypted form into the database. - user tries to login typing in their login and password. - php encry

[PHP] Re: security benefits of predefined variables

2002-01-16 Thread Philip Hallstrom
> > Erik > > > On Wednesday, January 16, 2002, at 04:21 PM, Philip Hallstrom wrote: > > > My advice would be to do it like this: > > > > $variable = $_POST['variable']; > > // some PHP code that validates that $variable is something reasonable &

[PHP] Re: security benefits of predefined variables

2002-01-16 Thread Philip Hallstrom
My advice would be to do it like this: $variable = $_POST['variable']; // some PHP code that validates that $variable is something reasonable $sql = "SELECT table.column FROM table WHERE criteria LIKE $variable"; If you just do this: $sql = "SELECT table.column FROM table WHERE criteria LIKE ${

[PHP] Re: Need a quick tip...

2002-01-16 Thread Philip Hallstrom
$m = 11; $y = 2001; $ts = mktime(0, 0, 0, $m, 1, $y); $rightNowTs = time(); while( $ts < $rightNowTs ) { print( date("F j, Y", $ts) . ""); $m += 1; $ts = mktime(0, 0, 0, $m, 1, $y); } will print out: November 1, 2001 December 1, 2001 January 1, 2002 On Wed, 16 Jan 2002

[PHP] Re: using eregi - what regular expression rules does it use ? worksin linux ( grep ) but not PHP - help needed

2002-01-16 Thread Philip Hallstrom
from the manual: These functions all take a regular expression string as their first argument. PHP uses the POSIX extended regular expressions as defined by POSIX 1003.2. For a full description of POSIX regular expressions see the regex man pages included in the regex directory in the PHP distrib

[PHP] Re: Search Engine

2002-01-15 Thread Philip Hallstrom
Take a look at htdig and mngosearch (which has a PHP interface). Also take a look at www.devshed.com and search for "search php" and you'll find some how-to articles. On Tue, 15 Jan 2002, Yogesh Mahadnac wrote: > Hi all! I want to develop a search engine in PHP for a portal that I'm working

[PHP] How long can the session ID be?

2002-01-09 Thread Philip Hallstrom
Hi - How long can the session ID be? Infinitely long? It seems to always be 32 characters on my system, but it looks like it's built from the PID and the time and some other stuff which can change... so I'm assuming it can too... Can I safely assume it won't get larger than say 64 chara

[PHP] Re: How reliable is the 'user' in http://user@somehost.com/???

2002-01-09 Thread Philip Hallstrom
TP/1.0 401 Unauthorized"); exit; } But in this case you have to supply both a user and password... Rats. -philip On Tue, 8 Jan 2002, Philip Hallstrom wrote: > Hi - > For one of my projects I need to pass around a bit of information > to all the pages. The information is th

[PHP] Re: PHP vs. ASP

2002-01-09 Thread Philip Hallstrom
I don't want to start a war, but last time I looked PHP had native support for every database I'd ever heard of including Oracle, SQLServer, etc... Just don't want the guy doing the report that php is database limited... On Wed, 9 Jan 2002, Robert Klinkenberg wrote: > Well, I personally prefer

[PHP] Re: Apache virtualhosts with different user

2002-01-08 Thread Philip Hallstrom
You could also run separate instances of the httpd binary with different configs telling them what ip/port to bind/listen to...then run the server as that user... not very efficient for a lot of users, but it would work for a small set. On Wed, 9 Jan 2002, Rich Buggy wrote: > > > if I define 'u

[PHP] How reliable is the 'user' in http://user@somehost.com/???

2002-01-08 Thread Philip Hallstrom
Hi - For one of my projects I need to pass around a bit of information to all the pages. The information is the same throughout and is the same for groups of clients. Right now I just pass it on the query string, but it's getting cumbersome so I started looking into sessions and I see th

[PHP] Re: ' and " in sql query

2002-01-04 Thread Philip Hallstrom
addslashes() would work... or use an ereg_replace to do it. Provided that you only use single quotes in your SQL (which is a good idea anyway since other db's only allow you to use single quotes) then you only have a problem with single quotes and not double quotes. On Thu, 3 Jan 2002, Daniel Ha

Re: [PHP] Re: User-friendly URI's

2002-01-04 Thread Philip Hallstrom
AddType application/x-httpd-php .php .php3 .whatever -philip On Fri, 4 Jan 2002, Jamie Fields wrote: > How do you set up apache to recognize .whatever as a php extension? > > - Original Message - > From: "Philip Hallstrom" <[EMAIL PROTECTED]> > To:

[PHP] Re: User-friendly URI's

2002-01-03 Thread Philip Hallstrom
r, and less ugly, and also > provides a sense of security (even if it is only a faint sense) through > obscurity. > > Mike > > Philip Hallstrom wrote: > > > Why not just make the script name "news.php" and not worry about it? > > > > On Thu, 3 Jan 2002,

[PHP] RE: User-friendly URI's

2002-01-03 Thread Philip Hallstrom
I don't know... not that I know of, but maybe. The one time I did it I wasn't really interested in the apache logs (the logging all happened in the db). I think your best bet is to use news.php, or configure apache to force "news" to be interpreted by PHP, or use mod_rewrite to rewrite the urls

[PHP] RE: User-friendly URI's

2002-01-03 Thread Philip Hallstrom
True, but if I remember right, the hit will end up in your error_log not in your access_log. -philip On Fri, 4 Jan 2002, Jason Murray wrote: > > A 404 ErrorDoc would still reply with a 404 code, which could mess up > > some search engines. > > Not true, try this: www.inww.com/ifdbnifoudbvfd > >

[PHP] Re: User-friendly URI's

2002-01-03 Thread Philip Hallstrom
Why not just make the script name "news.php" and not worry about it? On Thu, 3 Jan 2002, Mike Eheler wrote: > A 404 ErrorDoc would still reply with a 404 code, which could mess up > some search engines. > > I was thinking of the .htaccess solution, but I'm not sure if that's > possible to force

[PHP] Re: how can I add a variable to this sample

2002-01-03 Thread Philip Hallstrom
$service_type_insert = $x[${key}service_type]; should work. On Thu, 3 Jan 2002, Tom Beidler wrote: > I have a large form that I would like to edit a number of records. I'm > putting all of the fields into one array and then I would like to pull the > fields independently from a loop. > > > Here

[PHP] Re: Recursive Threading

2002-01-03 Thread Philip Hallstrom
There's a couple of ways you could do this... - search zend.com and other PHP sites for something similar :) - pick up Joe Celko's "SQL for Smarties" which talks about building trees and graphs in SQL (which is what this is)... this can get kind of complicated though. or... - modify your tabl

<    1   2   3   4   5   >