[PHP] Text report templates a la Perl

2003-01-19 Thread Duncan Hill
I've been looking high and low, and haven't had much luck finding a way 
to mimic the @ templating capability of Perl.  Does a class or 
similar exist?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MySQL session handler.

2003-06-25 Thread Duncan Hill
Greetings,

I've been scouring Google, trying to find a working MySQL handler for the PHP 
session data.  Many places point to the PEAR one out on sourceforge, but the 
last time it was worked on was 2001, and the notes state the author was 
waiting for testing to make sure it worked properly.

Are there any other good session handlers floating around, or should I just 
buckle down and write my own?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How can MD5 HAsh be passed to db as pwd? was a Re: [PHP] Securing PHP code

2003-06-26 Thread Duncan Hill
On Thursday 26 June 2003 16:22, Jeff Harris wrote:
> http://www.php.net/md5
>
> Set the column type of password to be a char(32). Then, pass the password
> through md5 to mysql to store it. To verify it, pass the password through
> md5 then compare it to what's in the database.

Or, to avoid problems with MD5 weaknesses, use SHA1 :)  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] what is http://127.0.0.1?

2002-07-27 Thread Duncan Hill

On Sat, 27 Jul 2002, Matthew K. Gold wrote:

> ever since I put up a personal firewall, when I start MySQL I''ve been
> getting alerts that MySQL is trying to access this ip address when I start
> it...
> 
> what, exactly, is it, and is there any reason why MySQL would need to access
> the internet if I have apache on my own machine?

127.0.0.1 == your machine.

127.0.0.1 == something called the local loopback.

In other words, pretty safe to let mysql access it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: Protect PHP coding

2002-08-04 Thread Duncan Hill

On Sun, 4 Aug 2002, Acer wrote:

> Acknowledging the problem is the first step in recovery.

*plonk*


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] netscape user agent name...

2002-10-16 Thread Duncan Hill

On Wed, Oct 16, 2002 at 09:50:06PM +1100, Noodle Snacks wrote:
> my question is does Netscape 4.x send "Netscape 4.x" or "mozilla something"?

Copy sent offlist, so here's a copy for the list.

Google returns:
http://www.psychedelix.com/agents.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] sending 1000 emails to subscribed members via php?

2002-06-12 Thread Duncan Hill

On Wed, 12 Jun 2002, andy wrote:

> Hi there,
> 
> I am wondering whats wrong with my php script. I am trying to write a
> newsletter to 150 members. Therefore I did seperate the adresses with a ,
> After about 1 minute php gave up telling me mail has failed.

Why re-invent the wheel when there are perfectly good mailing list managers 
like Majordomo2, Listproc etc available?

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Accessing a form variable before the form is posted

2002-06-21 Thread Duncan Hill

On Fri, 21 Jun 2002, Ma Siva Kumar wrote:

> In one of the forms, there is a selection for City in the address details
> as well as one for the port of destination. If I use the function both the
> the select name will be form[city_id]. The port of destination selection
> overwrites the form[city_id] from the selection of City.

Use different variable names.  Or make your function return a value, and use 
assignment to handle it.

> In short is it possible to access a variable from the form before the form
> is posted?

In short, no.

The flow is like this:

Browser requests page.
Webserver serves page, after parsing (if needed).
Browser displays page to user, and essentially disconnects from webserver.
User fills in form.  Server has no clue as of yet.
User presses submit.  Browser connects to server and sends data.  Server now 
knows about the data.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Scree Resolution

2002-06-21 Thread Duncan Hill

On Fri, 21 Jun 2002, Edgar wrote:

> Hi,
> 
> Are there any way to know what screen resolution use a user in your monitor?

See javascript.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] is there a way to track downloads

2002-06-23 Thread Duncan Hill

On Sun, 23 Jun 2002, Kevin J wrote:

> Hey all,
> 
> I would like to place some files on my site and use PHP to track how many
> users have downloaded those files.
> 
> Is this possible?

Approach the problem logically:

1) You have a series of files that you want people to download.
2) You want to track which files are downloaded.
3) You don't want people accessing the files directly.

So, a file called download.php.
Accepts a parameter - the file name to make available.
Logs an entry of IP and file (and whatever else) to a file / database / 
whatever.
Makes the file available to the user - but the path is hidden / created on 
the fly so that a particular file cannot be pulled without going through the 
script.

The actual code is left as an excercise for the reader.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Re[2]: [PHP] is there a way to track downloads

2002-06-23 Thread Duncan Hill

On Sun, 23 Jun 2002, Kevin J wrote:

> Sorry for giving up, but it seems to hard for me, plus I only have about 2
> weeks to learn PhP, if I wanted to implement this... I don't think that is
> possible.

The manual abounds with examples on how to 
a) connect to a database
b) read / write data in files

Of course, the simpler way is to just analyse the web server logs for hits 
on the files in question.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Re: [PHP] How to put a "new line" character with fputs($birthday_file,$content);

2002-06-23 Thread Duncan Hill

On Fri, 21 Jun 2002, Alfredo wrote:

> Hi,
> 
> I am saving the result of a query on a text file.  Then I want to open it
> with excel.
> 
> At the moment, when I open it with excel, all results appear in one very
> long line.  How could I insert a "new line" character at the end of each
> record?

Unix considers a line feed to be \n

Windows/DOS use \r\n


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Compile error.

2002-06-24 Thread Duncan Hill

Using the 4.2.1 source available from the main downloads page, I'm getting:
php_functions.c:93:27: missing binary operator before '!'

Peculiar to me, or known problem?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Compile error.

2002-06-24 Thread Duncan Hill

On Mon, 24 Jun 2002, John Holmes wrote:

> > Using the 4.2.1 source available from the main downloads page, I'm
> > getting:
> > php_functions.c:93:27: missing binary operator before '!'
> 
> You get an error when you do what? Unzip the source, compile it, run it,
> load a .php page, crap your pants???

I would have though compile it would be obvious from the fact thats a gcc 
error.  I guess I thought wrong.  The compile is for apache 2 btw.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Duncan Hill

On Sat, 29 Jun 2002, Chris Shiflett wrote:

> 2) if not, try very specific queries that retrieve just the data you need,
> and carefully free all results as you finish - also try to use persistent
> connections if you forsee your site being under heavy load.

Something I haven't picked up in my reading of the manual:

Is a free required for every query?  Or can I go connect, query, query, 
query, free, close?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Duncan Hill

On Sat, 29 Jun 2002, Chris Shiflett wrote:

> Duncan Hill wrote:
> 
> >Is a free required for every query?  Or can I go connect, query, query, 
> >query, free, close?
> >
> 
> You never have to free your results if you don't want to. As I 
> understand it, doing so simply frees up the memory that is being taken 

*tip*  Ta.  Good programming practice then.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] ????????????????????????????????????????????

2002-07-09 Thread Duncan Hill

On Tue, 9 Jul 2002, Ben Ramsey wrote:

> I've just joined this mailing list this afternoon.  Does this kind of thing
> happen often?  If so, I'm going to leave the list.

Nope.. once in a long while occurence.  Same as a child throwing a tantrum 
really.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] (OT) News Reading

2002-07-10 Thread Duncan Hill

On Wed, 10 Jul 2002, Vincent Kruger wrote:

> I'm sick of outlook express handling this news on php and all the other
> lists i'm subscribed to...

Ahh, then you mean best for a W32 platform.  Options include Free Agent, 
Agent and Xnews.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Website templating schemes

2003-09-02 Thread Duncan Hill
> Search google for Smarty (I believe it's www.smarty.php) It's a great way
> of
> separating output from the logic using templates.

That'd be smarty.php.net ... didn't know .php was a tld :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql Pattern Matching

2003-09-04 Thread Duncan Hill
> From: "Ralph Guzman" <[EMAIL PROTECTED]>
>
>
>> I know this question is best for the mySQL mailing list, but I am unable
>> to subscribe to their list at this moment so perhaps somebody here can
>> help me out.
>>
>> I have a table with a field where amenities are listed together using a
>> comma delimiter like: pool,spa,fitness-center

Mmm.. I'm jumping in late, and without knowledge of your app, but why not
normalise that column to its own table:

recid   masterrecamenity
  122  pool
  222  spa
  312  fitness-center

And run a unique key across all three columns (or drop recid and use two
columns).

select masterrec from amenities where amenity = 

The query will still grow in length, but it may be easier to work with..
*shrug*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Do you really still pay for bandwidth?

2003-09-11 Thread Duncan Hill
On Thursday 11 Sep 2003 10:57, Kae Verens wrote:
> Dougd wrote:
> > Do you really still pay for bandwidth?
>
> I do. And that makes me very aware of bulky HTML and unnecessary images,
> which I believe improves my work by forcing me to be efficient.
>
> Kae

Ditto.  I pay for my time online.  Yes, I pay a flat rate for x hours, but 
large emails chew into my online time.  I just saw a 1k text email that was 
95k by the time the html was done.  No matter which way you slice it, that 
95k email is 95 times less efficient on my connection than the 1k.  Or 
something like that.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Types

2003-09-15 Thread Duncan Hill
On Monday 15 Sep 2003 14:23, Ed Curtis wrote:
> On Mon, 15 Sep 2003, Raditha Dissanayake wrote:
> > You don't need to look any further than mime.types files included in
> > your apache distro.
>
> Did that as well as googled for the list of extensions. Still can't seem
> to find the mime type for .pm7, .p65, .qxp and .pmd.

Didn't google hard enough :)

.pm5application/x-pagemaker
I'd guess that can be extended to pm7 and 65 - I've seen x-pagemaker5 as 
well.

pmd is also pagemaker according to filext.com, as well as some software I've 
never heard of.

QXP is a good one, and you may need to ask the manufacturer of the software 
what mime type is used.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using 'print <<

2003-09-16 Thread Duncan Hill
On Tuesday 16 Sep 2003 08:14, Rudi Starcevic wrote:
> Hi,
>
> When printing like this:
>
> print << Hello world
> END;
>
> Is it at all possible to use a function in the output ?
> For example:
>
> print << strtolower("Hello World")

IIRC, heredocs print everything contained within literally, unless a 
variable.  using {} around the function might work, but I really doubt it.  
This is where things like smarty templates come in handy.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SSO (Single Sign On) for multiple PHP apps

2003-09-18 Thread Duncan Hill
On Thursday 18 Sep 2003 10:29, BENARD Jean-philippe wrote:
>   We have multiple PHP apps running on different servers. We have
> an LDAP authentication based (today) on the apache .htpasswd file which
> obliged users to log on. This solution is not very "clean". Because we

> More over, there are some apps writed in JAVA (WebSphere & IBM HTTP SRV)
> technologies which are in the same workgroup for political reason (We
> can't imagine making them in PHP ...). If the first solution exist

You could change to PHP sessions, and use an SQL backend to store the 
session data.  Writing a Java handler to read the PHP session data would 
not be too hard.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] breaking a string into chunks

2003-09-19 Thread Duncan Hill
On Friday 19 Sep 2003 10:20, David T-G wrote:
> Hi, all --
>
> Now it's my turn to ask a simple question, or one that sure sounds like
> it should be...
>
> I have a 14-char date string like "20030917181909" and I need to break it
> into its component parts for a more readable "2003-09-17 18:19:09" view.
> How can I do that?  Do I really need to call substr half a dozen

In perl I'd do something like:
$time =~ m/(\d){4}(\d){2}(\d){2}(\d){2}(\d){2}(\d){2}/;
$ntime = "$1-$2-$3 $4:$5:$6";

I think php can do that with preg_match, using an array to hold the matches.

As the other poster said, if this is mysql, let mysql do the work for you :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RE : [PHP] PHP Editor - which to use?

2003-09-22 Thread Duncan Hill
On Monday 22 Sep 2003 11:35, BENARD Jean-philippe wrote:
> Not a "php-must-have-editors" but useful ones, for example, are phpEd
> and Zend Studio (text completion, functions library, ...). I found that
> Zend Studio is a good one because of internal CVS connexions, work on
> UNIX & Windows systems, Project managements, ... I think it's a good
> choice for a professional use.

Another vote for Zend.  I tend to use vi, but I'm loving the CVS integration 
and code completion capabilities of Zend.  Now to get my manager to buy me 
the full copy :)  Now, if only I could find out how to tell it that it 
doesn't need DB.php in the project, but to reference it as an external 
library!  (Where DB.php is the PEAR code.)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] IP to Postal Code CSV? anyone messed around with this and PHP

2003-09-23 Thread Duncan Hill
On Tuesday 23 Sep 2003 19:59, Joe Harman wrote:
> Is there a CSV file out there for this
>
> Does anyone know where I can aquire a file that has IP address with the
> corresponding Postal Code?

How do you handle dynamic IP pools that cover entire states (or countries) ? 
:>  (Some of AOL's IPs come to mind.)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mySQL vs pgSQL | php vs others

2003-09-24 Thread Duncan Hill
On Wednesday 24 Sep 2003 11:24, nabil wrote:
> Dear all;
>
> I have been using Mysql for a long time, but I have a benchmark Q.
>
> Is pgsql , better ? faster ? more reliable than mysql ?

How long is a piece of string?

> any comment ?
> Some people say that php is not for a very big enterprise, banking ,

How long is a longer piece of string?

:)

The questions, as they stand, are too vague.  Better at what, faster at 
what?  More reliable in what configuration?  PHP alone, PHP + Zend, PHP + 
Zend + caching?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WHAT IS PEAR?

2003-09-24 Thread Duncan Hill
On Wednesday 24 Sep 2003 13:48, Webmaster wrote:
> I checked the PEAR HOMEPAGE but still I don't quite understand what the
> project is about.
> I am familiar with writing classes and functions.
> Now, I can not figure out what the deal is. Does Pear consist of a class
> library that comes with the installation?

PEAR is a set of libraries - DB, Authentication etc.  It might also be 
considered a coding style for various values of considered.

> There is a directory "pear" which is full of rar archives. How does that
> come into play.

Rar archives?  Haven't seen those in my dirs.

> Does the standard installation provide SMARTY support or does it need
> additional configuration?

Smarty is an additional package to be downloaded.

> If it does is there some some sort of crash course how to use it? Also an
> overview of what actually is available would come in handy.

The documentation.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Databases

2003-09-25 Thread Duncan Hill
On Thursday 25 Sep 2003 08:14, Shaun van den Berg wrote:
> Hi
>
> Im kinda new to php. I have a linux server witch has our website on it. I
> want to make a download page. If a person clicks on a link , they must be
> able to download from our server. How difficult is this , can you send me
> an example ?

How long is a piece of string?

Too vague a question.  Authenticated downloads?  Downloads of files not in 
the web tree?  Both have been covered in the past 2 weeks or so, and can be 
found in the archives.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] alphanumeric randomized image

2003-09-25 Thread Duncan Hill
On Thursday 25 Sep 2003 23:10, Michael P. Carel wrote:
> Hi to all,
>
> I'm looking for a alphanumeric randomized image script.
> Can anyone give me a good link or an example for this?

This was covered not more than 24 hours ago, and is in the archives.  It's 
also been covered in the past two weeks...

http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=+blurry+images+&q=b

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SQL injection

2003-10-17 Thread Duncan Hill
> Hi i read many thing on sql injection but i just cant sumarize all the
> information.
>
> Most site (PHPadvisory.com, phpsecure.info, other found on google) dont
> talk to mutch on how to prevent SQL injection.

One of the things I tend to do to limit any damage is tell the backend SQL
server to not let the web user execute things like drop table.  Ie, limit the
allowed commands to select, insert, update, delete.  Yes, data can be messed
with, but it's just another layer of protection.  Combined with proper quoting
of input, and making sure that numeric input is numeric etc, life is
reasonably sane.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SESSION Not behaving II: permission denied(13)

2003-10-18 Thread Duncan Hill
>
>
> That would be one solution, but I am on a shared hosting server. I cannot
> change the folder permissions.
>
> I've asked tech support to look into this.
>
> Does anyone know where I can get a class that will save the session vars
> to mysql?

I ended up modifying the example of a postgres handler to work in mysql.  I
haven't validated it for heavy usage though, nor whether the garbage
collection works properly.  More than willing to share if you want it... oh,
and it isn't a class.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] String to Array or Hash Table

2003-10-19 Thread Duncan Hill
sun zheng said:
>>tx for the reply.. ya, it is what i am looking for.. however, your solution
>>is not the right one.. please help me to adjust it a lot..
>>
>>let us come back to the initial string ..
>>"approved=yes&error=&authnumber=025968&transactionnumber=313869";
>
>>I definately want to get something like
>>$value_array['approved'] is "yes"
>>$value_array['error'] is ""
>>$value_array['authnumber'] is "025968"
>>$value_array['transactionnumber'] is "313869"

> If it's just a string, something like:
> $data_array = split('&', $string);
> foreach ($data_array as $key) {
> list($mykey, $value) = split('=', $key);
> $value_array[$mykey] = $value;
> }
> ###
>
> thank you.. but .. it is still different as what i expect... :(
>
> ya, it is only a string, not a link which could be captured by $_get[].. :(
> "approved=yes&error=&authnumber=025968&transactionnumber=313869"
>
> let's just take a look at your final array "$value_array[$mykey] = $value;"
>
> key <-> content will be
> 0 -  approved
> 1 - yes
> 2 - error
> 3 - null
> 4 - authnumber
> 5 - 025968
> 6 - transactionnumber
> 7 - 313869

I stated that the code was untested.  If I didn't, oops.  Massaging it into a
format you can use is left as an excercise for the reader - it is not my aim
to provide fully working, tested code when I have better ways to spend my time
:)

print_r($var) is your friend, apply liberally at critical stages to see if the
data is in the format you want.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Dealing with session expiry

2003-10-19 Thread Duncan Hill
Radek Zajkowski said:
> I use it with skins on a web page, users coming in can pick a theme and for
> the duration of their visit they have the theme(it's an illustrator website)
>
> the problem that I having is that session expiry will cause that site to
> fall apart after idle time.
>
> I notice sites using login detect expiry automatically and refrest the pages
> + session, I just don't quite know how to apprach it.

Then set your session timeouts to be much higher.  If, however, you want a
setting that will stay across browsers being closed, use a proper cookie, not
a session cookie.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SSH and php

2003-11-17 Thread Duncan Hill
On Monday 17 November 2003 15:02, Ryan A wrote:
> So I guess my question gets cut down to basically "any good place/program
> to learn/use SSH?"

No such thing as an 'ssh command' really.. apart from the command used to 
invoke SSH.  SSH (crudely) is an encrypted form of telnet.

You need a beginner's guide on unix shell commands - cd, ls, etc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] when to use \n in forms

2003-11-25 Thread Duncan Hill
On Monday 24 November 2003 04:02, Nigel Jones wrote:
> Not to offend anyone BUT
>
> What the  is DHTML and JS (and VB for that matter) meant to do, we can
> use  PHP instead who needs onLoad="Gimmethedampopups()" - not me anyway i

http://www.kryogenix.org/code/browser/sorttable/ is a neat bit of JS (and 
posssibly DHTML) that alleviates DB engine hits when sorting data.

JS is also useful for client-side validation.  Don't rely on it, but it does 
provide a first-level of defence against users.

As for DHTML - http://www.quirksmode.org/ is all I'll say :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Add Reply-To to this list(s)

2003-11-25 Thread Duncan Hill
Thomas Svenson said:
> Hi,
>
> It would be nice if the moderator of this, and the other PHP-lists could fix
> so the listserver automatically add a Reply-To header to all the mails.
>
> When I hit Reply my message would then automatically reply to the list and
> not the author. Less hassle for me when replying and less risk of forgetting
> it.

Much better to just switch to a mail client that understands the list headers
in the mail, and supports reply to list.  KMail (KDE) and Squirrelmail (web)
are two that spring to mind.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Add Reply-To to this list(s)

2003-11-26 Thread Duncan Hill
On Wednesday 26 November 2003 10:04, Nigel Jones wrote:

> IMHO we'd be better off having a PHP Forum on php.net and scrub the Mailing
> List altogether. That would just about suit everyone. You get to subscribe
> to Topics you want to, you can subscribe to whole forums if you want to,
> less Privacy Issues.

"Meep!"

That would instantly see me not reading, or posting.  Having the system 
delivered to my door, not bogged down by markup etc is wonderful.  Moreover, 
the data is archived world wide with e-mail.  Web forums don't (imo) lend 
themselves to that as easily.

However, propose away :)  I just wouldn't use it.  E-mail + threading + no 
markup bloat is my choice of receiving the info from the list.

If you really want a forum interface, work out how to tie in a web based NNTP 
interface that'll do that :>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Does anyone have Upload meter php codes?

2003-11-28 Thread Duncan Hill
On Thursday 27 November 2003 18:21, Ryan A wrote:
> > http://pear.php.net/package/HTML_Progress
>
> Very nice,
> But seems to have a problem with Netscape Communicator 4.75

Quote: Your browser should accept DHTML feature.

Last I checked, Netscape 4.x weren't very good at that.
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] start

2002-01-26 Thread Duncan Hill

On Fri, 3 Jan 1997, El Ucalito wrote:

> im introducing to php and i need to know (under windows98) if are free
> /and where can i download it/ the software needed to program and test
> php4

www.php.net will answer all.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Posting to a form - When user hits BACK button all thedata is gone

2002-05-30 Thread Duncan Hill

On Thu, 30 May 2002, Ed Gorski wrote:

> At 02:43 PM 5/30/2002 -0400, Phil Schwarzmann wrote:
> >When a user is posting data to a form and hits SUBMIT the user is taken
> >to another page.  But when the user hits the BACK button on his browser,
> >all the posted data is gone.
> >
> >How can I get this data to remain there when a user hits BACK ?

I've noticed that this behaviour varies between browsers.  Moreover, some 
browsers (IE) do it intermittently.  Go figure.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] I need a random number eather one or two

2002-02-23 Thread Duncan Hill

On Sun, 24 Feb 2002, Philip J. Newman wrote:

> I'm trying to make a random number kind of a coin toss, 
> 
> heads = 1 = left
> tales = 2 = right

Google is your friend.

'php rand'

http://www.alt-php-faq.org/local/90/

Other details in PHP manual, Mathematical functions section.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] define new window

2002-03-07 Thread Duncan Hill

On Thu, 7 Mar 2002, Administration@myclassguide wrote:

> This line opens in a new window.  How can i define the size of the window,
> scroll options etc.

Javascript.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] SPAM SPAM SPAM

2002-03-30 Thread Duncan Hill

On Sat, 30 Mar 2002, vins wrote:

> SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM

*plonk*



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread Duncan Hill

On Wed, 24 Oct 2001 [EMAIL PROTECTED] wrote:

> To print: 
> Click here or Select File
> and then Print from your browser's menu.
>
> Is there an equivelant bit of code to do this printer shortcut with
> php?

PHP - _server_ side
Javascript - _client_ side

PHP cannot affect your client like Javascript can.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how many data can a session hold?

2001-10-25 Thread Duncan Hill

On Thu, 25 Oct 2001, Christian Dechery wrote:

> I want to know how many data can a session (treated as cookie) can
> hold...

If you're using cookies, the limit is the cookie spec.  I /think/ 4096
bytes for a cookie.  Go find the spec to be sure.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How do I prevent remote loading of jpegs from my site

2001-10-28 Thread Duncan Hill

On Sun, 28 Oct 2001, rodrigo wrote:

> So, the question is, how do I prevent this remoting loading from
> happening.

Go to the Apache site (assuming you use apache) and look at the 
rewriting and so on.  You'll find your answer in there.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A way to simulate modem speeds?

2001-10-31 Thread Duncan Hill

On Wed, 31 Oct 2001, Michael Hall wrote:

> I'm looking for a way to clamp down a network machine (we're on a
> T1) to modem speeds (28 to 52 K) for testing purposes.

Well, mod_throttle on the server side will do this for you.  Client 
side.. hrum.  A linux box with bandwidth controls, a packeteer.  There 
is throttling software for Win, I've seen it in use - I just have no 
clue what it was called.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Installing Apache, mySql and php

2001-11-19 Thread Duncan Hill

On Mon, 19 Nov 2001, Douglas McKenzie wrote:

> That file is there. The web root is var/www/html
> 
> So the question is, when I put a .php file there, why doesn't it run?
> Why does it return the page as code?

Edit the httpd.conf file.  Look for .php .  You'll probably find the line 
that loads the actualy interpreter to extension map is commented out.  
Uncomment, save, restart Apache.  Try page again.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to check what country the user is comming from ?

2001-11-20 Thread Duncan Hill

On Tue, 20 Nov 2001, Fly wrote:

> thx Kamil Muszynski

Practically, you can't.

Technically, you can.  Take the IP, run it through whois.arin.net.  If that 
returns apnic, ripe etc, run it through those.. you might get the answer you 
want.  Calls to apnic etc are probably blocking calls - slowing down your 
page load.  Or make this a standalone daemon that feeds a DB.

If there are built in PHP commands, I don't know of them.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pulling information out of a MySQL database

2001-11-25 Thread Duncan Hill

On Sun, 25 Nov 2001, Tim Thorburn wrote:

> the proper information? My immediate thought is a cookie, but I have no 
> idea how to do this ... can anyone offer any other suggestions, or if a 
> cookie is the way to go - can someone point me in the right direction?

Hidden form variable, assign the previous values.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.
Never attribute to malice that which can be adequately explained by stupidity.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] converting Word documents to something sensible

2001-06-24 Thread Duncan Hill

On Sun, 24 Jun 2001, Phil Driscoll wrote:

> determined to translate them to something sensible (html, rtf or pdf
> will do)  at the server. The server is a Linux box so there's no
> opportunity to play any tricks with COM.
>
> Has anyone come across any tools to do this, using php or otherwise?

Google reveals
http://www.logictran.com/

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] reset mysql root password

2001-07-03 Thread Duncan Hill

On Tue, 3 Jul 2001, Daniel Guerrier wrote:

> How do I reset the root mysql password if I don't know
> what it is in the first place.  I don't care if I lose data.

Go read the manual, specifically section 21.10:
http://www.mysql.com/doc/R/e/Resetting_permissions.html

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP/mySQL Query

2001-07-05 Thread Duncan Hill

On Thu, 5 Jul 2001, Jeff Lewis wrote:

> owners
> -ownerID
> -teamname
> -more fields
>
> teampages
> -ownerID
> -bio
>
> Anyway, I'm doing a select on the database like this: select ownerID,
> last_update FROM teampages ORDER BY last_update DESC LIMIT 10
>
> The thing is, I want to get the team name from the other table as well.  Can
> anyone help me out?

SELECT owners.ownerID, ??.last_update
FROM owners, teampages
WHERE owners.ownerID = teampages.ownerID
ORDER BY last_update DESC  LIMIT 10

_should_ work.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The Salty Marine's eMail eMuster Subscription

2001-09-18 Thread Duncan Hill

On 18 Sep 2001 [EMAIL PROTECTED] wrote:

>
> Thank you for subscribing to the Salty Marine's eMail eMuster newsletter,

Ooh.. some other mad list that doesn't have validation of subscribed
accounts.  Or someone being bored.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Assistance Wanted Time:11:58:28 AM

2001-10-01 Thread Duncan Hill

On Mon, 1 Oct 2001 [EMAIL PROTECTED] wrote:

> FROM:  MARIAM ABACHA
>
> Dear friend,

*snicker*  They aren't content with good old postal mail (my parents'
company used to get these ALL the time!) - they've gone electronic!
Wonder if I can create a killfile for that kind of mail.  Wonder how
many people use nigeria and money in the same email...

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Dated/Timed actions

2001-10-02 Thread Duncan Hill

On Tue, 2 Oct 2001, paharito wrote:

> But what if your server can't give you cron perms?
>
> It would be useful if I could send an e·mail every monday... but can
> I do this without the cron?

Try  at   instead.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Rebuild PHP

2001-10-02 Thread Duncan Hill

On Tue, 2 Oct 2001, Eric G. wrote:

> If I rebuild PHP, do I need to rebuild my apache???

I_think_ that this is dependent on whether you use the DSO feature of
Apache.  IIRC, I've been able to do an upgrade on PHP and just reloaded
apache to take advantage of the new library module.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sprintf and arrays.

2005-04-06 Thread Duncan Hill
I have a snippet of code that looks something like:
if (is_array($p_sub_values)) {
foreach ($p_sub_values as $i => $v) {
 $p_sub_values_str[$i] = "'$v'";
}
$s = join(',', $p_sub_values_str);
$r = htmlentities(sprintf($tmp[0], $s, ENT_QUOTES);
}

$tmp[0] in this case contains a string like 'Fred likes %1$s on his %2$s', 
taking advantage of positional substitution with sprintf.

The function call to this snippet can have an optional array passed.  My 
need/desire is to substitute each element of the array into the appropriate 
position with sprintf.  So far I've tried:
$r = htmlentities(sprintf($tmp[0], $s, ENT_QUOTES);
$r = htmlentities(sprintf($tmp[0], ${$s}, ENT_QUOTES);

and a few other bits and pieces, all to no avail (error is about not enough 
arguments).

Is there any way to accomplish this in PHP, or do I need to roll my own 
substitution code?  The array can obviously be anything from a single value 
to 'unlimited' (though in practice will probably be less than 5).

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] secure document : solution wanted

2005-04-06 Thread Duncan Hill
On Wednesday 06 April 2005 16:23, Charles Hamel typed:
> Hi
>
> I am bulding a secure intranet.(php, mysql, apache)
> I am using a session and Mysql to handel the user accounts. Everythying
> works fine with that.
>
> The client now needs to share word/pdf document with the registered user. I
> created a secure directory using .htaccess for this purpose and it works as
> well  the user are promt to enter a username password.

> I was expecting this to work ...
> http://username:[EMAIL PROTECTED]/safeDir/Word.doc  but it isn't.

IE dropped support (or severely neutered it) for username:password in URLs a 
while back.

One way to handle this is to write a wrapper script that accepts the file name 
as a parameter.  The script verifies that the user is allowed to access the 
file, and sends back the file with appropriate content type etc.  Files can 
then be stored outside of the document root, preventing access even if you 
guess the file name.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] secure document : solution wanted

2005-04-06 Thread Duncan Hill
On Wednesday 06 April 2005 16:32, Eric Gorr typed:
> Perhaps, https?

HTTPS is a transport security layer, not an authentication or access control 
layer.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] secure document : solution wanted

2005-04-06 Thread Duncan Hill
On Wednesday 06 April 2005 17:02, Charles Hamel wrote:
> "Duncan Hill" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > One way to handle this is to write a wrapper script that accepts the file
> > name
> > as a parameter.  The script verifies that the user is allowed to access

> Can you provide a little more infos about wrapper scripts ... first time
> earing about this expession.
>
> Can this script be written in php ... or it is some kind of cgi?  Any

http://lists.evolt.org/archive/Week-of-Mon-20011224/064591.html has some 
sample code to do with forcing IE to download a file where it can't determine 
the mime type properly.  This forms the core of being able to feed a file to 
a browser when a .php file is called.

The rough flow of the code would be:
1) Check that the user is authenticated.  Kick them out if they aren't.
2) (Optional) Check that the user is allowed to access the file being 
requested.  This might be a MySQL DB lookup, a secret word request, whatever.
3) Check that the file exists.  Even better, rather than feed a file name, 
store a mapping of a unique ID to real file name in a data source of some 
type, and throw the ID around.  You can enforce the format of the ID etc to 
avoid attacks against your system.
4) If all is good, use the code linked above (in some form) to feed the file 
to the browser.  The user will get a Save dialog box in pretty much any 
browser.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf and arrays.

2005-04-06 Thread Duncan Hill
On Wednesday 06 April 2005 16:40, Brent Baisley wrote:
> For one, you are missing a right parenthesis ) in all of your examples.
> htmlentities(  sprintf( $tmp[0], $s, ENT_QUOTES )

Meh, syntax blip from the cut and paste.

> Second, the string you are trying to format only has one variable
> argument: $s.
> Fred likes %1$s on his %2$s

The source array in this case has two entries.  My whole aim is to pass an 
array of n entries, unroll the array into a string and somehow interpolate 
the string into the sprintf call so that life is groovy.  I realise $s looks 
like a single variable to PHP at that point sprintf() is called, and this is 
what I'm trying to work around - some way to get sprintf to realise that $s 
is actually two strings.  Ie, I need a double level of interpolation on the 
$s value so that sprintf($tmp[0], $s) turns into sprintf(tmp[0], $array[0], 
$array[1]).  I'm starting to get the feeling that this will be impossible.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf and arrays.

2005-04-07 Thread Duncan Hill
On Wednesday 06 April 2005 18:05, Brent Baisley typed:
> You want to have sprintf look at the contents of the variable instead
> of the variable itself. Anytime you want to do something like this you
> use the eval() function to evaluate the contents of the variable.

Woot!

$begin_string = 'htmlentities(sprintf($tmp[0],';
foreach ($p_sub_values as $k => $v) {
 $mid_string[] = "\$p_sub_values[$k]";
}
$mid_string = join(',', $mid_string);
$end_string = '), ENT_QUOTES);';
// Eval will stick the three strings together and then execute them.  Neat 
trick, hint from
// [EMAIL PROTECTED]
eval ("\$r = $begin_string$mid_string$end_string");

Works a treat.  Thanks Brent.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Web Site Security Hole

2005-04-07 Thread Duncan Hill
On Thursday 07 April 2005 14:55, Don typed:
> I was feeling pretty secure until a friend reminded me you can download
> complete sites by importing them with such tools as FrontPage and
> Dreamweaver. That way, the "protection" provided by the PHP server is
> non-existant.

This is only possible in limited cases, normally when WEBDAV is enabled.  Any 
other attempts to scrape the site will just get the parsed output, not the 
raw code.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Simple Problem

2005-04-12 Thread Duncan Hill
On Tuesday 12 April 2005 16:24, PartyPosters typed:
> $sql="SELECT products.productID, products.title, products.number_per_box,
> products.stock_level, products.image, users.username, users.email,
> users.userID FROM users, products  WHERE products.userID = $userID";
> $mysql_result=mysql_query($sql,$connection);
> $num_rows=mysql_num_rows($mysql_result);

You don't specify how the query should join the tables users and products.

WHERE products.userID = users.userID and users.userID = $userID

I'll assume you do validation on the userID ahead of time to ensure that it's 
the right format.

-- 
My mind not only wanders, it sometimes leaves completely.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Last visitors

2005-04-19 Thread Duncan Hill
On Tuesday 19 April 2005 14:27, Ryan A typed:

> SELECT * FROM profile_visits WHERE user='adam' ORDER by time_of_visit
> DESC LIMIT 10
> As for cleaning up... that's the bit that I can't figure out myself :(.
> */
>
> Hey,
> Thanks for replying.
>
> > ah! i see. sorry for misunderstanding you.
>
> No problem, I guess i didnt explain it well enough, and you dont have to
> help me but you are trying, so thank you.
>
> > As for cleaning up... that's the bit that I can't figure out myself :(.
>
> exactly, I came to the same part as youbut then i would have a LOT of
> wasted records without the cleanup... just cant figure it out.

Create a cron job that gets a list of profiles, and selects the # of records 
associated with that profile.  If the number is > 10, identify the 10th 
record and delete records older than that record.

Once a week, optimize your tables to reclaim the space.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Replacement Question.

2005-04-20 Thread Duncan Hill
On Wednesday 20 April 2005 15:22, Bob Palma typed:
> I have a database field that I need to read and do some conversion on.
> Here is what the raw data from the database looks like:
>
> --
> 1084751309jpenaDisney Vignette Fleximon disk utilization
> alert C:\ at 85%1084799703bpalmafixed.1084799713bpalmaclosed
> --

Are the group delimiters different from the field delimiters?

Ie, can you do:
$array_of_groups = explode('group_delim', $in_string);
foreach ($array_of_groups as $i) {
 $array_of_fields = explode('field_delim', $i);
 $date = date('m/j/y g:i:a', $array_of_fields[0]);
 print "$date {$a_o_f[1]}{$a_o_f[2]}\n";
}

YMMV of course.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Replacement Question.

2005-04-20 Thread Duncan Hill
On Wednesday 20 April 2005 16:01, Bob Palma typed:
> Wow!  Thanks.. That works great.  Just one small hitch though.  After it
> prints all of the data properly, it adds one more '$date' on the end
> which gets printed as '12/31/69 7:00:pm'.  Is there a way to do all
> groups - 1 ?

No reason for it to do that unless your data is a bit weird.

Use print_r() or var_dump to see what each array contains - you might find you 
have a blank entry being tacked on somehow (which you could detect with an 
if).

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Between Query (0T)

2005-05-08 Thread Duncan Hill
On Sunday 08 May 2005 14:20, Ryan A wrote:
> Hi,
> Sorry I know this is OT but I'm hoping someone will still help...it should
> be quite simple :-)
> I have a field in the database called "age" which is a DATE field.

http://dev.mysql.com/doc/mysql/en/comparison-operators.html

'BETWEEN'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] str_replace on words?

2005-05-11 Thread Duncan Hill
On Wednesday 11 May 2005 17:13, Merlin wrote:
> Hi there,
>
> I am trying to strip some words from a sentence. I tried it with
> str_replace like described here:
> http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_us
>ing_str_replace.htm
>
> Unfortunatelly it does not work the way I want, because if I want to
> replace the word "in" all passages containing the characters "in" are
> replaced. For example Singapore.

You need to tokenize your input and do exact matching.  Alternately, 
preg_match / preg_replace may work with \b to specify word boundries.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and PayPal

2005-05-18 Thread Duncan Hill
On Wednesday 18 May 2005 16:33, Robert Meyer wrote:

> Here is one way I would like it to work:
>
> 1) User fills out a form (user email address, etc.) then clicks the "Buy
> Key" button.
> 2) User, along with a link, unique ID (not Key), cost, and form data is
> sent to PayPal.

Paypal document this in their developer SDK.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Duncan Hill
On Friday 20 May 2005 09:21, Mário Gamito typed:
> Hi,
>
> I'm making this middle-range site (i. e., not so little, bit not so big,
> either), and i want users that subscribe to my site to have their
> confirmation made by email.
>
> Does anyone sugests a simple, yet effective way to do this ?

When the user subs, generate a token in a DB table.

Send the token to the user via email with a URL to click.  Use 
mime/alternative if you want to send html and plain text so their client can 
choose the rendering method.

If you get the click where the token matches (and perhaps first name or 
similar), they've confirmed their desire to subscribe.  Do what you need to 
do with the confirmation and remove the token from the table.  Record a 
history of IP etc to show that they DID indeed confirm their sub.  Gives you 
proof that they asked for it if they contend it's spam.

-- 
My mind not only wanders, it sometimes leaves completely.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP5 binaries

2005-05-20 Thread Duncan Hill
On Friday 20 May 2005 17:58, Marcus Bointon wrote:
> It seems that none of the current major Linux distros provide PHP5  
> binary installation packages. By major I mean, RedHat, Fedora (it  
> will be in F4 when released), Mandriva, Debian, Ubuntu, possibly  
> others. Seriously, none have standard PHP5 packages, even optional  
> ones. Does no-one use PHP5??? It's not exactly bleeding edge, having  
> made a final release nearly a year ago.

Kubuntu (ie, Ubuntu with KDE as default) has php5 available as a standard i386 
package according to aptitude.  No amd64 binary package by the looks though.

And depending on whether you consider gentoo 'major' or not.. php5 has been 
the default for the past 3 releases or so.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to do this?

2004-04-10 Thread Duncan Hill
On Saturday 10 April 2004 14:36, Mike Mapsnac wrote:

> So I need to gather the information about each entry and update database. I
> cannot access the variable from $_POST because parameter is not static and
> $_POST is not working like this $_POST['$id'];

$_POST["$id"]

" does variable substitution, ' does not.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie Form Question

2006-08-04 Thread Duncan Hill
On Friday 04 August 2006 13:27, Jay Blanchard wrote:
> [snip]
> I was wondering how simple it would be to set up a script to provide a
> subscribe/unsubscribe form for a list serve. The form would send an
> email to
> the subscribe address or unsubscribe address as selected.
> [/snip]
>
> I wondered about that the other day myself and came to the conclusion
> that it would be really simple. It must be, others have done it.

Not terribly difficult at all.  One SMTP library for PHP and you're away.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] writing to fild on another server

2006-08-04 Thread Duncan Hill
On Friday 04 August 2006 15:50, blackwater dev wrote:
> I have a web server and an images server.  My web server doesn't have
> enought space for the images, hence the images server.  I have to download
> properties from a realty database hourly and the data goes in to a db on my
> webserver while the image needs to be taken from a MSSQL db and written to
> the images server as an actual .jpg or .gif file.  Fopen, however, won't
> let me write using the http protocol.  How can I open and write files

NFS/CIFS mount?

Write locally, scripted FTP across?

Write locally, scripted rsync across?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] shebang line drive me nuts.

2006-08-07 Thread Duncan Hill
On Monday 07 August 2006 09:11, Jochem Maas wrote:
> hi Robert,
>
> thanks for thinking with me 

If the FS permissions to the binary are correct, odds are the file system is 
actually mounted noexec.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Altering subject of email in a pop3 mailbox

2006-02-23 Thread Duncan Hill
On Thursday 23 February 2006 11:49, IG wrote:
> > IG wrote:
> >> Is it possible to alter a subject line (or body for that matter) of an
> >> email in a pop3 mailbox?

> Thanks- I completely see your point.
>
> How do antispam filters work on client's computers? They seem to have no
> problem with adding to subjects. Also our hosting provider uses a spam
> filter which adds it to the subject line. However I am finding that not
> particularly good.

ISP Mailbox -> POP3 over TCP/IP -> client filter app -> client pc mailbox

Once the data is in mid-stream across the net, the filtering app can affect it 
any way it likes.

Ditto for the ISP method, they just tend to do it as the mail is received and 
before it gets written to the mail spool.

You can change things on a POP server, if you have access to the OS on the POP 
server and can edit the mail spool.  Not normally available to anyone but the 
system administrator(s).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] loop Q

2006-02-24 Thread Duncan Hill
On Friday 24 February 2006 10:34, William Stokes wrote:
> What does this do in a for loop?
>
> $counter+=1

Increments $counter.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: setcookie security concerns [medium]

2006-03-17 Thread Duncan Hill
On Friday 17 March 2006 15:10, Kevin Davies - Bonhurst Consulting wrote:
> I just picked up this thread, so excuse me if I'm repeating or have totally
> missed the point.
>
> Another concern I picked up from a PHP security book is using '--' - which
> simply comments out the remainder of the line (with MySQL anyway).
> Therefore if your SQL is "SELECT * FROM table WHERE user = '$user' AND pass
> = '$pass'" a malicious visitor could enter a valid username followed by '--
> which may allow them entry to that person's account by creating the
> following:
>
> SELECT * FROM table WHERE user = 'valid_user'--' AND pass = '$pass'

A benefit to using something like PEAR::DB is access to the quotesmart() 
function, which quotes the input for you.  Your query can then look like

SELECT * FROM table WHERE user=$q_user AND pass=$q_pass

q_user and q_pass are derived from form input which is passed to quotesmart().  
Even if funky characters like ' and -- are included, the quoting should help 
prevent injection.

Validating input helps, but some input literally can be most characters under 
the sun.  It's easier to defend the entire system with some general purpose 
protections than try to guess every attack (imo).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] private $foo

2006-03-29 Thread Duncan Hill
On Wednesday 29 March 2006 15:43, Philip Thompson wrote:
> > Of course, I remember programming with rocks and that was before we  
> > had zero's. We only had one's and that was a programming nightmare.  
> > You new guys at least have 1's and 0's to work with.
> > tedd
>
> I laughed my head off about your 'rocks' statement! Thanks for that.  
> For those of you who didn't pick up on my sarcasm previously, do so  
> now. =D I'm not *that* young. Hehe

Rocks!  You had rocks!?

When I was a programmer, we had nothing but primeval chaos to program with.  
Worse than herding cats, and prone to returning random values whether your 
cat was dead or alive.  We would have killed to have rocks (let alone one's)!

:)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file Upload - checking file size before uploading

2006-05-10 Thread Duncan Hill
On Wednesday 10 May 2006 13:39, Jay Blanchard wrote:
> [snip]
> Is there anyway to check the size of a file before it starts uploading
> it?
> For instance, if the file is huge, and takes ages to upload, and is then
> rejected by the server, the user will be somewhat annoyed!
> [/snip]
>
> PHP is server-side and cannot check anything client-side. You cold use
> something client-side, like JavaScript, to check the file size and then
> deliver a warning if the file is too large.

Alternately ... "This service only accepts files up to 10 MB.  Uploading 
anything larger will fail."

Assumes comprehension unfortunately.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Fatal error: Call to undefined function mysql_create_db()

2006-05-27 Thread Duncan Hill
On Sat, May 27, 2006 11:02, Mark Sargent wrote:
> Hi All,
>
>
> I get the following,
>
>
> *Fatal error*: Call to undefined function mysql_create_db() in
> */usr/local/apache2/htdocs/createmovie.php* on line 6

Sounds like you don't have the MySQL component of PHP installed.  If
you're using the packaged version for your OS (of PHP), check that you
installed the php-mysql package (your package manager should let you
search for it).

If you're using a self-compiled PHP, sounds like you didn't compile in
MySQL(i) support.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] loosing var in class / function

2004-02-04 Thread Duncan Hill
On Wednesday 04 February 2004 17:52, Harry.de wrote:
> How can i save a variable in a function?
> The lower example doesn't work.
> The var is always an empty string!
> Anyone any solution?
>
> ---
>
> $some_var = "foobar";
>
> require('something.php');
>
> class SOMECLASS
> {
> function SomeFunction()
> {
> $this->AnotherFunction($some_var);
> }
> }

$this->AnotherFunction($this->some_var);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to search for a date

2004-02-05 Thread Duncan Hill
On Thursday 05 February 2004 15:45, Brian Dunning wrote:
> Sorry this is such a basic question - but I couldn't find it online.
>
> I have a date field in MySQL: -00-00. I'm trying to insert or
> search for the current date, and I can't find the way to state that in
> the SQL. This is wrong, can someone please tell me what's correct?
>
>INSERT INTO mytable (dateField) VALUE (CURRENT_DATE);
>
>SELECT * FROM mytable WHERE dateField = CURRENT_DATE;

NOW() is the mysql function for the current date.  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whoa!!! e-Mail virus from bugs.php.net!

2004-02-06 Thread Duncan Hill
On Friday 06 February 2004 14:06, Scott Fletcher wrote:
> Whoa!!  Just got an email today right from bugs.php.net and it was
> intercepted by the Spam Firewall because it contain the Worm.SCO.A virus
> and was removed before being send to me.  The email goes like this here
>
> --snip--
> Title: VIRUS (Worm.SCO.A) IN MAIL TO YOU (from <[EMAIL PROTECTED]>)
>

That's mydoom - forging virus.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] post variables

2004-02-19 Thread Duncan Hill
On Thursday 19 February 2004 13:32, julian haffegee wrote:
> Hi all,
>
>
> I solved this today. It seems odd.
>
> If you define an action it DOES NOT work, but if you skip that entirely the
> POST variables are sent!
>
> so
>  works
>  doesn't work.

I have -never- seen that behaviour.  In fact, I use explicit actions all the 
time, and have no problem with $_POST.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: hello

2004-02-23 Thread Duncan Hill
On Monday 23 February 2004 17:27, Ben Ramsey wrote:
> I would advise against sending attachments to the list with the message
> "read it immediately."  Chances are, it won't be opened or looked at.
> Please include a description of the problem you are facing, as well as
> the code you are using in your message body--not in an attachment.

Even better chances that that was a neutered virus.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Take post values

2004-03-17 Thread Duncan Hill
On Wednesday 17 March 2004 09:07, Tassos T wrote:
> Hello,
>
> I use a simple form and I cannot take the values when I do submit. I use
> post method.
>
> How I take te post values ?
>
>
> Thanks
>
> Tassos t

http://www.php.net/manual/el/language.variables.predefined.php
http://www.php.net/manual/el/reserved.variables.php#reserved.variables.post

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cron Jobs and php as apache module

2004-03-17 Thread Duncan Hill
On Wednesday 17 March 2004 11:03, Daryl Meese wrote:
> Hello all,
>
> Ok,  I run php as an apache module but need to have some php scripts called
> from a cron.  Since you can't have php installed as a cgi & apache module I
> don't know how to do this.
>
> Any help would be appreciated.
>
> TIA
>
> Daryl Meese

PHP CLI executable.  Builds whenever I do a manual install.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] what is the best idea to make mirror for mysql database

2004-03-22 Thread Duncan Hill
On Monday 22 March 2004 23:20, QT wrote:
> do you know best mysql newsgroup address?

http://lists.mysql.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] API Documentation Via Comments

2004-03-24 Thread Duncan Hill
On Wednesday 24 March 2004 11:37, Hawkes, Richard wrote:
> Hi,
>
> As you may be aware, languages like Java allow you to add comments in a
> certain format, which can then be translated into a full HTML API Document
> later. Does PHP have a facility like this? If not, has anyone written
> anything to do something similar? I hope so?!

phpdoc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re:

2004-03-30 Thread Duncan Hill
On Tuesday 30 March 2004 09:40, Ketvin wrote:
> Dear all,
>
>
> i just move my previous php script to a new server and found that it is not
> working on the new machine. funny thing is that previously, say i am
> putting form items like
>
> 

Manual: Register globals.  $_POST, $_GET

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Hinding URL

2004-03-31 Thread Duncan Hill
On Wednesday 31 March 2004 14:38, Will wrote:
> Hello all,
>
> I am hoping someone can help me.
>
> When someone brings up a page in the browser, is there a way to hide the
> URL in the browser bar to a set URL??

Why should a remote server have control over what a local client can display?

The closest you can come is to hide the entire location bar by using 
javascript to open a new window with no location bar, but that'll fail on any 
client that has JS disabled, or has rules set to override JS messing around 
with the browser (like my browsers are configured to do).

Alternately, you can use frames, but that's a whole other can of worms.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extension problem

2004-04-05 Thread Duncan Hill
On Monday 05 April 2004 10:37, Enrico Comini wrote:
> I use php without problem, but my file is processed by php only if the
> extension is .php , why ?
> If I have for example a index.html with " file is not parsed by php and I have to rename in index.php
> Thanks, Enrico

Apache (and other webservers) have a config option that maps file extensions 
to parsers (ie, .php to mod_php).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] (new question on this) http referer

2004-04-08 Thread Duncan Hill
On Thursday 08 April 2004 17:31, Joe Szilagyi wrote:
> Just a follow up on this one--I've seen where consistently that
> $HTTP_REFERER will only show local referers, but not stuff from other
> sites/hostnames. This is on mod_php... any workaround for that?

Referrer is a function of the browser.  If it chooses to not give it to you, 
you don't get it.  Proxomitron, at one point, shipped with a setting that 
gave the browser as SpaceBison, and the referrer as the URL being visited.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Auto-acks on posting.

2004-04-08 Thread Duncan Hill
Anyone else getting auto-acks from "<[EMAIL PROTECTED]>" and 
"<[EMAIL PROTECTED]>", originating on host76.ipowerweb.com 
when they post here?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Auto-acks on posting.

2004-04-08 Thread Duncan Hill
On Thursday 08 April 2004 17:35, Arthur Radulescu wrote:
> Yes I get the same emails here

Ho hum, then into the bit bucket they go.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >