Re: [PHP] Template system in PHP

2008-02-13 Thread Richard Heyes

 when I'm debugging I like to be as concise as possible.

Concise? Really?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] Better DB Class MySQL

2008-02-10 Thread Richard Heyes

// Terminator Style Function simply in coolness
public function Terminator($tbl) {
}


Terminator? Is this something I don't know about or is it simply a 
method that goes around killing other methods?


Anyhoo, you may want to look at this:

http://www.phpguru.org/article.php?ne_id=121
http://www.phpguru.org/pear_db_replacement/

It's a MySQL only database wrapper that mimics the PEAR::DB API, (which 
is, as I've been reminded a million times (roughly), obsolete), but is 
one sixth the size. Important if one of of your goals is speed. You 
could say if your goal is speed why use a wrapper at all? But it has the 
following advantages:


1. If you start off with PEAR::DB (for example) and then need to squeeze
   extra performance out of your site, the database wrapper is a good
   place to start (since it is generally used a lot).

2. It has useful methods (ie the get* methods) which speed up
   development time greatly.

3. I thought of others, but then subsequently forgot them. Doh.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] Better DB Class MySQL

2008-02-10 Thread Richard Heyes

Larry Garfield wrote:

http://www.php.net/pdo

All the cool kids are doing it.


Except that converting to converting PDO is, undoubtedly, far more work 
and will entail far more gotchas than the original poster wanted


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] Better DB Class MySQL

2008-02-10 Thread Richard Heyes

Jochem Maas wrote:

Larry Garfield schreef:

http://www.php.net/pdo

All the cool kids are doing it.


not true - some of them use firebird ;-)


Fire - what? :-)

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] PHP Source code protection

2008-02-08 Thread Richard Heyes

 accept the fact that it may get pirated.

It may do. But there's nothing wrong with making it as hard as possible 
to do so. Most people have better things to do than try to reverse 
engineer a piece of code.


Consider:

1. People who buy code will generally do so to solve a problem that they
   have in the process of making money.
2. Reverse engineering takes time, and therefore diverts their attention
   away from the process of making money.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] PHP Source code protection

2008-02-07 Thread Richard Heyes

Greg Donald wrote:

On 2/6/08, Richard Heyes [EMAIL PROTECTED] wrote:

There's the Zend Encoder at www.zend.com. Though it may be called
something else now.


Pointless.

http://www.phprecovery.com/


Pointless? I think it is exactly the answer to the original persons 
question.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Exception handling in PHP

2008-02-07 Thread Richard Heyes

Does that mean for every exception do we have to write
our custom exception and describe it from our own
message


If you mean Do I have to write custom exception classes?, the no. You 
could just use the PHP Exception class.


Eg.

class DBException extends Exception {}

try {
$connection = mysql_connect(...);

if (!$connection) {
throw new DBException('Failed to connect to database');
}

// Database exception handling code
} catch (DBException $e) {
// ...

// Generic Exception handling code (The Exception c
} catch Exception $e {
// ...
}

That's from memory, so there may be a few errors.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] Exception handling in PHP

2008-02-07 Thread Richard Heyes

// ...

That's from memory, so there may be a few errors.


Seems there was. Try this:

class DBException extends Exception {}

try {
$connection = mysql_connect(...);

if (!$connection) {
throw new DBException('Failed to connect to database');
}

// Database exception handling code
} catch (DBException $e) {
// ...

// Generic Exception handling code (The Exception class is
// built in to PHP)
} catch (Exception $e) {
// ...
}

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

 ** New Helpdesk demo now available **

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



Re: [PHP] PHP Source code protection

2008-02-06 Thread Richard Heyes
I'm building a C# application that connects to a server that has PHP scripts 
on it.


We need to deliver the complete solution to a firm, the C# is no problem 
because it is compiled...


But PHP is a problem bacause it is interpreted and we will have to deliver 
pure, unprotected script...


Is htere a way to secoure my code so when they put it on the server, they 
can't see it!


There's the Zend Encoder at www.zend.com. Though it may be called 
something else now.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Effecient mass mailings

2008-02-04 Thread Richard Heyes

I've always personally hated receiving email with large
attachments, preferring instead to get links to the content on the
web.  Plus, that cuts down on the bandwidth the server (as well as
mailservers, gateways, et cetera) are responsible for handling,
because the PDFs or other attachments would only be downloaded by
those who really wanted to have them.  However, I know nothing about
the business model with which Robert is working, so it may be neither
applicable or optional in his case.


No it's another perfectly viable option. Click here to view a HTML 
version of this email links I would say no, but for files, then why 
not? Also prevents pissing off the user by not having to download the 
attachment if they're not interested in it (and assuming it will be 
base64 encoded as most attachments are, don't forget it will grow in 
size by a third).


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Schedule tasks from server

2008-02-04 Thread Richard Heyes
I am using paradigmsolutions.co.za. I read about cronjobs, but aparently it 
is only available on unix or linux hosting, is this true?


Cron is a *nix thing yes. Though Windows has the task scheduler. You'll 
need to check with your ISP to see if it's available or if there's an 
alternative.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Efficient mass mailings

2008-02-04 Thread Richard Heyes
Whether you BCC or not does not affect the actual mail-server traffic. 
A Bcc'ed address is only one that isn't listed in To: header.


But it does affect how much data gets transferred to the mail server. If 
you Bcc: addresses the email will only be sent over the wire to the mail 
server once.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Schedule tasks from server

2008-02-04 Thread Richard Heyes

  your code should be portable

Except in reality, it probably isn't. Off the top of my head, think file
paths.


Which is why I mentioned the exec() family.  Otherwise, relative
paths for includes will work regardless of the slash style (*nix / vs
Windows \) preferred by the OS.  Or is my as-still non-caffeinated
brain missing something obvious here this morning?


Well exec() et-al aren't the only thing that use paths. You might have 
an include/require that begins with C:\ for example.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Schedule tasks from server

2008-02-04 Thread Richard Heyes

 your code should be portable

Except in reality, it probably isn't. Off the top of my head, think file 
paths.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Effecient mass mailings

2008-02-04 Thread Richard Heyes

I a currently re-writing a web app from ASP to PHP and have come to the
part where the app sends mass mailings to their customer base. This has
always been problematic for them with the existing setup and I am
looking for the best approach. While I've setup mailings with PHP, never
such mass mailings. They will be using a web form to send sometimes
2-5MB attachments to thousands of customers to advertise new products
with PDF's, etc. Using their Windows IIS SMTP virtual server smarthost
function, I send their mail off-site to our postfix mail gateway, but it
still bogs down and I'm sure a remote server is not the answer, but
still better than the errors they receive trying to use localhost and
IIS. Once the re-write, the app will be on to a Linux box where I can do
some tweaking to these and hope localhost will work better for these
mailings.

Can someone give some pointers at how I may want to approach such mass
mailings? Thanks in advance!


If you have attachments, you could use one or more cheap remote servers 
and Bcc: the recipients. Or use the local mail gateway. Bcc:ing will cut 
down on the amount of the amount of actual data transferred to the mail 
server; you can send to say 100 recipients at once but only transfer the 
attachment data once.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Resetting a session variable

2008-02-03 Thread Richard Heyes

unset($_SESSION);
or
$_SESSION = array();


This reset all of the session variables. To reset only one, try this:

?php
unset($_SESSION['key']);
?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6 (M$ forcing IE7)

2008-02-02 Thread Richard Heyes

Feb 12th is D-day.


[Microsoft] has posted guidelines on how to ward off the automatic update

Not exactly forcing if they've provided an alternative.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Redirecting STDERR to a file?

2008-02-02 Thread Richard Heyes

C would be the last resort. I suppose it would be easily done in Perl,
but most of my colleagues prefer PHP.
I love to make taking over the code easy, so PHP is more preferable to
me.

That makes perfect sense, but sometimes PHP is not the best/right
answer.

What I think you need to do is:

parent:   fork() your child process, then do whatever.
child:use proc_open to call your program and redirect stderr.


That's kind of odd, but seems to be the only way to workaround this...
Thanks for you help.


Having come to this rather late, I recently wrote some code that may be 
of some help to you which forks processes: 
http://www.phpguru.org/downloads/pcntl/


You need pcntl and it only works on *nix (I understand). It does make 
fork()ing somewhat easier though. Be careful of defunct processes though.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6

2008-02-01 Thread Richard Heyes

Daevid Vincent wrote:

I will be very sad in 15 days when M$ FORCES everyone
to it.


WT?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] Pass Variable Names to a Function

2008-02-01 Thread Richard Heyes

Bill Guion wrote:
I would like to use a function to check to see if a session variable is 
set and return the session variable if it is set, and return blank if 
not. Something like


You really don't need a function for this:

// Could use null instead of false
$variable = isset($_SESSION[$name]) ? $_SESSION[$name] : false;

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



[PHP] PEAR website and MSIE 6

2008-01-31 Thread Richard Heyes
Anyone have any trouble with this combination? It consistently crashes 
for me.


http://pear.php.net

Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6

2008-01-31 Thread Richard Heyes

firefox not an option?


Nope.

 or anything else that resembles a proper browser ;-)

Strange, IE has been working fine for me for the last eight years...

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6

2008-01-31 Thread Richard Heyes

Robert Cummings wrote:

On Thu, 2008-01-31 at 17:14 +0100, Jochem Maas wrote:

let's not forget that nobody outside of IT actually uses Opera


Please back up that st-ass-tistic please. Methinks you reached around
and pulled it out of your lightless nether regions.


I wouldn't say nobody, but certainly it's a rarity. 
http://www.thecounter.com reports Opera as having 1% of the market - 1% 
isn't exactly a lot.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6

2008-01-31 Thread Richard Heyes

Jochem Maas wrote:

Richard Heyes schreef:

firefox not an option?


Nope.

  or anything else that resembles a proper browser ;-)

Strange, IE has been working fine for me for the last eight years...


that's the kind of thing people say just after they hear they have 
prostrate cancer ;-)


Lol.


seriously though - why is FF (or any other browser) not an option?


I suppose it is, but I like Internet Explorer. Have done for ages.

 your
a web developer, I would imagine you should be running a complete 
arsenal of

different browsers as part of the job, no?


Yes. MSIE, Firefox, Opera etc.


and then there's the question as to why you don't upgrade to IE7. or maybe
rebuild the windows machine in question (hey it wouldn't be the first 
time something

like this was helped by a clean install right?)


I don't like the IE7 interface, in particular the font smoothing thing. 
And besides, I can't be arsed... :-)


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] PEAR website and MSIE 6

2008-01-31 Thread Richard Heyes

PHP is a server-side page generator.  It has NOTHING to do with the browser.
The PHP programmer determines the content of the resulting HTML and the
browser reacts to THAT.  Browsers never see a line of PHP script!


What's your point?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Richard Heyes

Christoph Boget wrote:

Constructors return the object, correct?  If so, how can I do this:

class Bob {
  private $blah;
  _construct( $blah ) {
$this-blah = $blah;
  }
  public getBlah() {
return $this-blah;
  }
}

echo Bob( 'Hello!' )-getBlah();

When I try that, I get the message Undefined function Bob.  I've also tried

echo new Bob( 'Hello!' )-getBlah();
echo (new Bob( 'Hello!' ))-getBlah();


Bob is a class, not a method. You could try this:

?php
$obj = new Bob();
$obj-getBlah();
?

It's not method chaining though.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299pa hosted for you -
no installation, no maintenance, new features automatic and free

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



Re: [PHP] avoid server folder reading

2008-01-20 Thread Richard Heyes

I would like to know how to avoid (using PHP code) any user to read the
content of my website folder ?
as my website is hosted by and external company, i do not have access to
apache conf file.


If your server's default file is index.php, you could use the following 
in an index.php file:


?php
header('Location: /');
?

If it's index.html, you could use the following:

script type=text/javascript
!--
location.href = '/';
--
/script

Try the PHP version first.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] avoid server folder reading

2008-01-20 Thread Richard Heyes

Will that not result in an infinite redirection loop?
Or am i missing something very obvious !


If it's placed in the root folder of the website, yes. But why do that? 
If, however, that's what is required just put an empty index.html file 
there.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-19 Thread Richard Heyes

Or even a simple text CAPTCHA What is 16 divided by 4?.

Careful though, I made a class which converted numbers to text
(TextualNumbers IIRC) and it got broken.


Almost any CAPTCHA can be broken if somebody wants it badly enough.

Some are easier than others, of course.

But you get rid of a LOT of bottom-feeders with a CAPTCHA.

CAPTCHA has serious usability drawbacks, however.

I would suggest NOT going for something really hard for a human to use
-- I believe that it won't make THAT much difference to the number of
junk eliminated.


When I introduced a CAPTCHA on my blog (http://www.phpguru.org) site it 
reduced comment spam by nearly 100%. Not completely; I still get maybe 1 
per month, but it was well worth adding.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net

2008-01-19 Thread Richard Heyes

Check out this blog post:
http://www.tagarga.com/blok/on/070116

I can't believe someone actually bothered writing this up.


why?  not everyone is as experienced as you - some people might
genuinely find this useful.

no?


Well, yeah, I guess so - it just seems so basic and something that most
people would know to solve with printf(). 
It's the sort of problem, where I can't help thinking if you can't work

this out on your own, should you really be programming?
Apologies if that sounds arrogant to you. 


Admittedly coming to the thread rather late, but this chap obviously 
hasn't come across the Console_Table class in PEAR.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Richard Heyes
I am wondering if there is a way to block out email addresses in specific 
format from a form?  We ahve a form that people have to enter an email 
address, and the form has been getting used by bots to send spam to a 
listserv.  The email address they enter is in this type of format 
[EMAIL PROTECTED], and of course it is always just a bit different every 
time.  Any help is greatly appreciated. 


Could add a CAPTCHA image (Type the letters in the image...) to your 
form. It eliminated comment junk when I added one to my website.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Richard Heyes

Or even a simple text CAPTCHA What is 16 divided by 4?.


Careful though, I made a class which converted numbers to text 
(TextualNumbers IIRC) and it got broken.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software that eases your support
burden and helps increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-17 Thread Richard Heyes
You can easily make a mail queue in php yourself with a daemon that 
checks the queue and sends waiting mail in batches of say 200 per 
minute. (provided you have access to the cli on the server)


Why when there MTAs?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Mailing list management service allowing you to reach your Customers
and increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Count

2008-01-17 Thread Richard Heyes

I am wanting to create an select menu for displaying the order of the item
on a page. I am guessing that I need to get the count of how many items are
in the db and them put them into a select menu.


Your question doesn't really make a great deal of sense. Your SQL could be:

SELECT COUNT(*) FROM your_table WHERE 1

Which will give you a single numeric value back (the number of rows). To 
put them into an HTML page:


select name=mySelect
optionChoose.../option
option value=1Foo/option
/select

This is a very basic select. You can simply loop through your query 
results adding more option tags to add more items to the select.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Mailing list management service allowing you to reach your Customers
and increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] re[PHP] gister_globals

2008-01-16 Thread Richard Heyes

I'm a newbie to php and i would like to set register_globals to 'on' from my
php script itself(eg:- index.php). Is there any way of doing this.


You can't do this from inside the script with ini_set() as 
register_globals has already had it's affect at that point, so you can 
put this in a .htaccess file if you're using Apache:


php_flag register_globals 1

--
Richard Heyes
http://www.websupportsolutions.co.uk

Mailing list management service allowing you to reach your Customers
and increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Richard Heyes
I'm having users enter dates in MM-DD- format.  is there a way to 
check if what they have entered is invalid (like if they enter 1-15-2008 
instead of 01-15-2008) ?


Something like this:

http://www.phpguru.org/date_preg/

?php
// Get this from where ever (format MM-DD-)
echo ($input  = '01-02-2008') . 'br /br /';

$result = preg_match('/(\d{2})-(\d{2})-(\d{4})/', $input, $matches);

$date  = $matches[2]; // Note month/date switched
$month = $matches[1]; // Note month/date switched
$year  = $matches[3];

if (!$result) {
// Doesn't match...
}

echo Date: {$date}br /;
echo Month: {$month}br /;
echo Year: {$year}br /;
?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Mailing list management service allowing you to reach your Customers
and increase your sales.

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] anaylyze email

2008-01-14 Thread Richard Heyes
 1) some body send email to me; for example; to [EMAIL PROTECTED] from 
[EMAIL PROTECTED]

 2)read it's email

The easiest way to do it is to get the emails deposited into a POP3 
email account and then read that, possibly with the Net_POP3 code in PEAR.


 3)return to [EMAIL PROTECTED]

After reading the email you can do pretty much anything. Have a look at 
the mail() function.


 I try to read pop3. I can not find any example!

Go to http://pear.php.net and get the Net_POP3 class which will allow 
you to read the contents of POP3 accounts.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Mailing list management, Knowledge Base and HelpDesk software
that can increase sales and cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-12 Thread Richard Heyes

Assuming you're talking delivery to a local MTA (which will
subsequently do the remote delivery), is speed really important?

For the amount of email I'm looking at (1000s, growing), yes.



Hmm, that's not quite what I was thinking of.  The amount of emails to
be delivered does not in my opinion affect how fast it needs to happen. 
Your local MTA will take a while to deliver those emails anyway, so the

time from script to user is mostly dependent on that, which means
you're left with reducing the time from script to MTA.  If you need to
finish the script fast (in order for some user-intercation to continue
perhaps), I would would just detach the script and carry on. 


Sorry, yes the time of delivery is not so important as the time to pump 
the messages to the MTA. As long as the MTA has them and they get 
delivered in a reasonable time frame I'm happy. The application is all 
about mail delivery and the script has to return immediately, so I'll be 
launching a separate process to insert the addresses into a minimal 
mail_queue table in my db, and then a 5 minutely cron script which 
will pass them to the MTA.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-12 Thread Richard Heyes

1. Using mail(), same email sent to 1000 users.

Script finished in 200ms (1000 emails delivered to local MTA). 
Delivery to target MTA over 100Mbit LAN took about 6s.


That settles it then. The mail() command will be more than fast enough 
for my needs.


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-12 Thread Richard Heyes
Note - this was one call to mail():  


mail(user1,user2,user3 ..,subject,text);


Granted, but as long as the email stays the same size when you compare 
mail() and something like SMTP, I wouldn't imagine the relative speeds 
varying significantly. Or maybe they would, I'll compare and see.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] PHP shell commands

2008-01-11 Thread Richard Heyes

Some php applications store database passwords into files which can be
read by the user www-data.
So, a malicious user which can write php scripts could read those passwords.
What should I do to prevent users from viewing those passwords?


You could encode your file(s) using something like the Zend Encoder. 
This turns them into byte code IIRC, so it's hard (not totally 
impossible I think) to get the clear text.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



[PHP] Browser cache setting

2008-01-11 Thread Richard Heyes

Hi,

What's the default setting for caching in browsers? With IE is it 
Automatically as I think it is? And what about other browsers? Some 
equivalent?


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Browser cache setting

2008-01-11 Thread Richard Heyes

I'm pretty certain it's automatic in most. I think Firefox has a default
50Mb of cache-space. 


Great, thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-11 Thread Richard Heyes
Bearing in mind I haven't yet done any benchmarks, which do you think 
is faster - SMTP with multiple RCPT commands or the PHP mail() 
function (with it launching a separate sendmail process for each 
mail() function call)?


No brainer, SMTP will almost certainly be faster. My mailing list system 
(written in PHP obviously) can dump 600k customised emails to the local 
SMTP server in a couple of hours. Doing the same with the mail command 
took over 24 hours. How much slower will depend a lot on how you have 
configured sendmail, but it's never going to be faster than a socket 
connection to the local SMTP server.


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-11 Thread Richard Heyes

I used to use htmlMimeMail, but now I use Zend_Mail as it has a better
API and is also faster in regards to the quoted printable encoding.


IIRC htmlMimeMail use the PHP built in function to do quoted printable 
encoding.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Re: SMTP vs mail()

2008-01-11 Thread Richard Heyes

If you have your sendmail equivalent program properly configured, no
SMTP connection is used when queueing messages using the sendmail program.


What about when you take into consideration this program could be 
sending 1000's of emails, say, 100 per SMTP connection?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-11 Thread Richard Heyes

Assuming you're talking delivery to a local MTA (which will subsequently
do the remote delivery), is speed really important?


For the amount of email I'm looking at (1000s, growing), yes.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] SMTP vs mail()

2008-01-11 Thread Richard Heyes

There is no such thing. :)


Perhaps not then... :-)

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



[PHP] SMTP vs mail()

2008-01-11 Thread Richard Heyes

Hi,

Bearing in mind I haven't yet done any benchmarks, which do you think is 
faster - SMTP with multiple RCPT commands or the PHP mail() function 
(with it launching a separate sendmail process for each mail() function 
call)?


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] ereg help!

2008-01-09 Thread Richard Heyes

$out = basename($file, .html) . .com;

fairly limited i think, but simple.


Nothing wrong with being simple, and therefore both fast and easy to 
understand by a wider audience. The only downer I can immediately think 
of though is that whitespace isn't accommodated, but who really ends a 
file name with white space?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



[PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes
Does anyone have a URL for it? Naturally Google returns a lot of pages 
which are about the actual function.


Thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes

Do you mean phpsysinfo? http://phpsysinfo.sf.net/


Bingo, thanks.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] PHPInfo - the application

2008-01-09 Thread Richard Heyes

Lester Caine wrote:

Richard Heyes wrote:
Does anyone have a URL for it? Naturally Google returns a lot of pages 
which are about the actual function.


http://www.php.net/
just put phpinfo into the 'search for' and you will get the REAL data 
for it.


Google is never the best starting point when you know what you are 
looking for!


Did you actually read my email? The subject is a rather good hint too.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] global address collection

2008-01-08 Thread Richard Heyes

The best design for a form comes from using it.


To a certain extent, but I think the best design for a form stems from 
watching someone else use it.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] global address collection

2008-01-08 Thread Richard Heyes

Nathan Nobbe wrote:

On Jan 8, 2008 2:04 PM, Richard Heyes [EMAIL PROTECTED] wrote:


this is not only convenient from a user perspective in the user
interface, but also
on the server side.

It's not so convenient when you consider Google (and presumably others)
toolbars auto fill.



fortunately i dont have those installed ;)


Why is that fortunate? I find the Google toolbar very useful. Besides, 
your users might be using it. Anything you can do to increase the 
usability of your site should be done IMO.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] global address collection

2008-01-08 Thread Richard Heyes
this is not only convenient from a user perspective in the user 
interface, but also

on the server side.


It's not so convenient when you consider Google (and presumably others) 
toolbars auto fill.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Re: website tree

2008-01-08 Thread Richard Heyes

John Gunther wrote:

Get the various parts from the $_SERVER superglobal variable:
1) scheme (e.g. http://) from $_SERVER['HTTPS'] (https if on)
2) host:port (e.g. bucksvsbytes.com) from $_SERVER['HTTP_HOST']
3) /path/page?query part (e.g. /catalog/index.php?pid=444) from 
$_SERVER['REQUEST_URI']


There's also $_SERVER['PHP_SELF']. Probably others too. Simply:

?php
print_r($_SERVER);
?

This will show you what's available to you.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] global address collection

2008-01-08 Thread Richard Heyes

tedd wrote:

At 8:23 PM +0100 1/8/08, Per Jessen wrote:

Richard Heyes wrote:


 Nathan Nobbe wrote:

 On Jan 8, 2008 2:04 PM, Richard Heyes [EMAIL PROTECTED] wrote:


 this is not only convenient from a user perspective in the user
 interface, but also
 on the server side.

 It's not so convenient when you consider Google (and presumably

  others) toolbars auto fill.
 


 fortunately i dont have those installed ;)


 Why is that fortunate? I find the Google toolbar very useful. Besides,
 your users might be using it. Anything you can do to increase the
 usability of your site should be done IMO.


Trying to think of (and maybe even accommodate) what non-standard and
third-party tools your potential user may or may not have installed,
goes a bit too far, IMO.


Without usage stats, and given that it's third party and non-standard, I 
would guess that it's mighty popular (with it bearing the Google brand), 
and therefore worth accommodating.


In addition, I don't think that having an auto-fill for a credit card 
number is ideal.


So? People use it.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] global address collection

2008-01-07 Thread Richard Heyes
In other words, in the USA we ask for name, address, city, state, zip, 
and phone number. What would be a global equivalent that could cover all 
(or most) address and phone numbers?


Full name (optionally forename/surname)
Address 1
Address 2 (optional)
Address 3 (optional)
Town/City
County/State
Postal/Zip code
Country

Full international phone number (eg. 0044 1623 123456)

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Just to confirm...

2007-12-22 Thread Richard Heyes
I wish I could block IE users. They almost are more trouble than they 
are worth. Luckily only about 20% of my users still use IE6. :p


Technically you can, not that I can understand why you would want to 
block what is the most popular browser out there. My personal sites 
stats show that IE makes up roughly 37-40% of users, and being a 
technically orientated site they probably aren't representative of the 
Interweb at large, for that you might be better looking at 
thecounter.com (http://www.thecounter.com/stats/). That shows 80%, which 
is probably closer to actual usage.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Just to confirm...

2007-12-20 Thread Richard Heyes

Bah!  You're right, I changed it to just be an easter egg in the
code.  The original (now commented out) was:
?
if(stristr($_SERVER['HTTP_USER_AGENT'],msie)) {
die(No friend of Internet Exploder is a friend of mine.);
}
?

It initially started to try to stop cURL, wget, Lynx, and other
automated clients from grabbing the content from the page.  Again, I
know that headers can be spoofed, but that's a different topic.  I try
to make a joke and Stut shoots me in the ass.  ;-P


I've got to ask, why on earth would you want to do this? Robots and 
things like wget I could understand more, but purposefully cutting out a 
large chunk of your audience?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread Richard Heyes

I always store database handler in $GLOBALS.
I think that's the best place to save request-level-global.
I wonder where other people save that kind of data.


how about a static variable inside a function or a static member of a class.

e.g.

function getDB($args) {
static $conn = array();

$key = serialize($args);
if (!isset($conn[ $key ])
$conn[ $key ] = new DBConn($args);

return $conn[ $key ];
}


That's surprisingly similar to how I do it. Then it's a simple matter to 
call getDB() (which you can do no matter what the current scope is) to 
get the database object.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Just to confirm...

2007-12-19 Thread Richard Heyes

 I think that any MTA or client that doesn't work with the
Reply-To header isn't worth beans.


very very true


Well the Reply-To: header isn't for bounces.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Re: [PHP-DB] force to download file

2007-12-18 Thread Richard Heyes

i have this on top of my php page:

header(Content-Type: application/vnd.ms-excel);
header(Content-Disposition: inline; filename=excelfile.xls);

but it is not prompt to save the file instead it opens right in IE.

my question is how do i force the browser prompts to save the file?


?php
header('Content-Disposition: attachment; filename='.$filename.'');
?

That should do the trick, but if not then try adding the Content-Type 
header from below.



?
function force_download($filename,$dir='./') {
if ((isset($file))(file_exists($dir.$file))) {
header(Content-type: application/force-download);
header('Content-Disposition: inline; filename='.$dir.$filename.'');
header(Content-Transfer-Encoding: Binary);
header(Content-length: .filesize($dir.$filename));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename.'');
readfile($dir.$filename);
} else {
echo No file selected;
}
}
?


FYI You have Content-Disposition twice; you only need the second.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



[PHP] Just to confirm...

2007-12-18 Thread Richard Heyes
Emails that bounce get sent back to the address in the Return-Path: 
header. Correct?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Just to confirm...

2007-12-18 Thread Richard Heyes

Daniel Brown wrote:

On Dec 18, 2007 10:17 AM, Richard Heyes [EMAIL PROTECTED] wrote:

Emails that bounce get sent back to the address in the Return-Path:
header. Correct?


Yes, sir.


Thanks. Is there usually a delay? Eg the mail server tries again after 4 
hours.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] nested array...

2007-12-17 Thread Richard Heyes

print_r($nestedarray):
 Array(
 [0]=Array([id]=1 [name]=name1 [etc]=etc1)
 [1]=Array([id]=2 [name]=name2 [etc]=etc2)
 [3]=Array([id]=3 [name]=name3 [etc]=etc3)
 )

if I want to check whether id=5 is in that $nestedarray, how to do that?!?!

i'd really appreciate the help..


?php
foreach ($nestedarray as $v) {
if ($v['id'] == 5) {
$in_array = true;
break;
}
}
?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Session timeout

2007-12-13 Thread Richard Heyes
I've read a bit about PHP session timeout. Is it configurable?? I mean, 
If i want user logged out after 10 minutes of innactivity... where i can 
to set it up?? Is it possible to expire session configuring php.ini.

I know i will have to write code to do whatever when the session expires...


There are various configuration options for this (which you change in 
the php.ini or by using the ini_set() function):


session.gc_maxlifetime
session.cookie_lifetime

Read all about sessions here:

http://uk.php.net/manual/en/ref.session.php

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Session timeout

2007-12-13 Thread Richard Heyes
There are various configuration options for this (which you change in 
the php.ini or by using the ini_set() function):


session.gc_maxlifetime
session.cookie_lifetime



Before sending my first mail, i've changed those parameters... and 
nothing seems to change. I set up also session.cache_expire... but... 
nothing happens... session does not expire


If you change them in your php.ini don't forget you'll need to restart 
your web server.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Session timeout

2007-12-13 Thread Richard Heyes

You can simulate that, because not always you'll be able to do init_set


ini_set(), and when?

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes

You use a session variable for that?


Why not?


That's entirely the wrong place to
store something like which database API is installed.


Not really. You could even wrap a function called (for example) 
Feature() around it.


 It should a class

variable or global configuration variable. Heck, I'd say it's more
appropriate to do extension_loaded( 'mysqli' ) on every call than to use
a session variable.


Why? It's very unlikely to be changing between calls. And even if it 
does, it's once in a blue moon. Granted though, I can't see it being a 
particularly intensive function call, so I can't see the harm in calling 
it on every invocation.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes

Because it's not user data, it's server data.


So? It's there - use it.


That's entirely the wrong place to
store something like which database API is installed.


Not really. You could even wrap a function called (for example) 
Feature() around it.


Yeah, really.  Sessions are for user data. If it's the same for all 
users then it doesn't belong in the session, it belongs in a server-wide 
cache.



Sessions are for whatever you choose to put in them. And why implement a 
cache when you've got something perfectly usable (sessions) already?


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes

So? It's there - use it.


So are cookies, would you stuff this into a cookie? No, because that's 
not what cookies are there for.


Not because it's not what cookies are for - but because sessions are a 
more efficient and easier to use storage medium.


You could potentially be pointlessly duplicating that data hundreds or 
thousands of times depending on how busy your site is.


Well as always, if that's a concern then more thought would be required. 
But storage constraints are rarely a concern nowadays.


Also, in this 
particular example there is no need to cache that information beyond the 
request level because asking PHP for it is not an expensive operation, 
or at the very least is no more expensive than maintaining it in a session.


Granted.

One other thing to note is that putting it in the session will survive a 
rebuild of PHP to add/remove modules and a restart of the web server. 
It's probably not likely to happen but that could seriously break your 
application.


Then use the function directly.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes

Sre, sessions are for whatever you choose to put in them. That's
like saying bodies are for whatever a crazed murderer chooses to put in
them...


No it's not.

 the statement is true, but it's not optimal.

Real life is rarely optimal.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes

Real life is rarely optimal.


That's not a valid excuse for taking the sloppy pig route to
development. Sloppy pig's give conscientious developers a bad name. And
when they use PHP to create their slop, they give PHP a bad name.


Well I err towards actually doing something useful. Businesses can 
rarely wait while developers create a technically perfect application. 
Those that do are rarely successful. As always there's a balance to be 
struck between writing technically perfect code and getting the job done.



You would think you would lean towards conscientiousness since you use
an email address with phpguru in it. But I guess anyone can claim
whatever they want... it doesn't make it true. Maybe you could see if
phpsloppypig.org is available (it is btw).


Ah personal insults. Always a good argument.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-11 Thread Richard Heyes
I don't see a reason to compromise. It would take no longer to call 
extension_loaded on each page request than it will to put the variable 
in the session. You're right in saying that there's a balance to be 
struck, but in this particular case I personally see a right way and a 
wrong way and no compromise needed to do it properly.


I think the discussion has moved beyond extension_loaded(), but in 
that case, yes, personally I would use extension_loaded() directly. 
Probably in a factory type function which returns the appropriate type 
of object.


I couldn't care less what your domain name is, you're still advocating a 
poor choice IMHO.


Practical though. And I'm conscientious as far as business allows.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain?

2007-12-10 Thread Richard Heyes
One is based on the assumption that mysqli is as likely not to be 
available as it is to be installed. In this case I should write my 
scripts to test whether it exists and then use either mysqli or straight 
mysql commands as appropriate. If this is the way to go, what do I do to 
test for the existence of mysqli from within a PHP script?


The other is to assume that recent installs and upgrades of PHP  5 
should have mysqli because that's the currently preferred way of doing 
things, and therefore I should contact the web host and ask that they 
install it, or I find a different host.


Which assumption should I be proceeding with?


You can:

1. Change your program to use the much more common mysql extension and
   forget about mnysqli for the time being (this is what I would do).
   You can switch to mysqli when its use becomes prevalent.
2. State that mysqli is required and not change anything (not advisable)
3. Alter your program to support both - use mysqi if it's avilable,
   mysql if it's not. If you use an API and not the mysqli functions
   directly this won't be too much hassle.

Your last option to to assume that it's installed is very bad indeed. 
You shouldn't ever make assumptions, particularly when your dealing with 
software distributions.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Mysqli support - test or complain?

2007-12-10 Thread Richard Heyes

How exactly do I test for the presence of mysqli from within a script?


IIRC there's a function called extension_loaded(). Or something similar.


Or are you saying I have two different versions of my script?


Not at all.  Taking PEAR::DB for example, you could test for the 
existence of mysqli, and use one DSN if it's there. If not, use another. 
This is one of the reasons abstraction layers exist.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] How to create multipart e-mail bodies?

2007-12-07 Thread Richard Heyes
Thanks, but unfortunately my ISP does not implemented PEAR, and uses PHP 
4.3.10.


You can view the source code on http://pear.php.net and use that. Your 
ISP doesn't have to support PEAR.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] How to create multipart e-mail bodies?

2007-12-07 Thread Richard Heyes

I don't know if it is a PHP question, but I give it a try.

I've been trying this subject for a while, but with less success.
Now I can create mail bodies like this:


http://www.phpguru.org/downloads/html.mime.mail/

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] convert hex message to ascii msg, How?

2007-12-07 Thread Richard Heyes

How could I convert a hex msg to ascii msg?
Is there a php function or sth?


Try posting a small example.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Calendar

2007-12-06 Thread Richard Heyes

On Dec 5, 2007 6:09 AM, Richard Heyes [EMAIL PROTECTED] wrote:

There is not much simple about a calendar, especially when you start
dealing with recurring events. How far into the future your calendar
allow events to recur will depend at least in part on how you intend
to store them. For instance, you can store them in a database where
you create a separate event row for each occurrence (though still be
linked by a common ID as you said), but you'll probably set your
limits based on storage to prevent adding a daily event for the next
10 years.

Stipulating an event to be daily could be as simple as a 0 or 1 flag. So
where's the storage concern?


The storage concern comes if you opt to store one copy of the event
for every day for as long as the event recurs. Why? Perhaps you want
to provide the ability to alter the time of a specific instance of a
recurring event (or delete one instance altogether) without changing
the other instances.


So you could have a table which contains events, and a table which 
contains exceptions. Simple and minimal storage requirements. Since 
exceptions will be, as their name suggests, exceptional, storage 
requirements will be small.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Calendar

2007-12-05 Thread Richard Heyes

There is not much simple about a calendar, especially when you start
dealing with recurring events. How far into the future your calendar
allow events to recur will depend at least in part on how you intend
to store them. For instance, you can store them in a database where
you create a separate event row for each occurrence (though still be
linked by a common ID as you said), but you'll probably set your
limits based on storage to prevent adding a daily event for the next
10 years.


Stipulating an event to be daily could be as simple as a 0 or 1 flag. So 
where's the storage concern?


 You could also store a single event record that includes the

rules for recurrence and then calculate the dates of each instance as
needed, but that could get pretty CPU intensive. (I'm assuming you
want to stick with simple periodic recursion, not more complex
things like the date for Easter or events that don't have any set
pattern.)


I really don't see anything CPU intensive about this. At most you're 
going to be storing some set dates that the event should occur on. 
Nothing CPU intensive about that.



I know this probably muddies your original question even further, but
I'll say again -- there is not much simple when it comes to
calendars.


Calendars can be simple, or they can account for a lot and be complex.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] Calendar

2007-12-03 Thread Richard Heyes
I'm about to add some simple calendar functions to my application, and 
I'm thinking of how I should implement recurring events. Are there one 
standard way most people use that works well? I guess you have some kind 
of emitter event that creates the recurring events and a group id that 
holds the events together. How long forward does one usually create the 
events. Two-three years...?


Sorry if I'm a bit blury. But any ideas on recurring events are welcome. 
I guess I could just hack something together, but it would be fun to do 
it right.


If you're on Unix you will need a cron job that runs every x minutes. 
That could check a database for jobs/tasks that need running, using the 
current time and an option like run this job every 10 minutes to 
determine what needs running, (ie in that case if the current time isn't 
divisible by ten then don't run it).


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] calculate a varchar

2007-12-03 Thread Richard Heyes

Is there a calculation function?

I'm using an e-commerce shopping cart. I want to tweak the code. The 
author is using a varchar(100) field to store prices.


Taking advantage of there being a varchar, instead of entering a price, 
I would like to enter a calculation.


(24*2.2)+(24*2.2*.1) 24 is my unit price in British pounds. 2.2 is the 
exchange rate into Canadian dollars. etc.


The exchange rate changes frequently. Instead of recalculating and 
entering a new price every few days, it would be useful to enter a 
calculation in any price field.


I had a look at: http://ca3.php.net/manual-lookup.php?pattern=calc
http://ca3.php.net/manual-lookup.php?pattern=calculate
http://ca3.php.net/manual-lookup.php?pattern=calculation
but I see no function, although I'm sure there is one.

So how could I do this?

$price = (24*2.2)+(24*2.2*.1);

if $price is not an integer, verify if it is a calculation. If so, give 
me an integer and round it off to two decimal points:


$price = 58.08;


You may want to look at eval().

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] include config.php does not work anymore after PHP 5.2

2007-12-02 Thread Richard Heyes

I never never thought my config.php might have problem. I have used
this config.php for almost 6 years and never had problem (the first
time I have forgotten to add it 6 years ago because I had migrated
from ASP. I have copied this wrong config.php to some other projects.


Have you ever migrated from PHP 4.x to PHP 5.x? This is a major upgrade 
so you should expect things to stop working. Using the long version of 
the open tags (ie ?php ) has been best practice for a long time.


--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



Re: [PHP] URL Parsing...

2007-11-26 Thread Richard Heyes

Chris wrote:

Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it 
somone
then I don't think str_replace() is the correct function. what's to 
say a script

doesn't exist called 'my.cfm.php'?


How does this:

/\.cfm$/

take into account that?


$ in regex's means 'end of string' - so it will only match .cfm at the 
very end of the string.


Indeed, so how does the regex take into account .cfm.php? It doesn't. 
If it doesn't have a .cfm extension, it won't match.


--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes

one of these should give you something to go on:

echo preg_replace('\.cfm$', '-meta.cfm', parse_url($_SERVER['REQUEST_URI'], 
PHP_URL_PATH)), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']), \n;


Anything would be helpful.  :)


You don't need the overhead of PCRE, though it is the fastest to write, 
since it's already above for you...


Or parse_url(). basename(__FILE__) will get you the filename.

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes

well if you take a string (filename) and wish to change the end of it somone
then I don't think str_replace() is the correct function. what's to say a script
doesn't exist called 'my.cfm.php'?


How does this:

/\.cfm$/

take into account that?

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] Logic Help please

2007-11-22 Thread Richard Heyes

Hi, I am doing an online calendar for holiday application.

Now I got a table with these fields among many others.

  `req_id` int(11) NOT NULL auto_increment,
  `req_date` date NOT NULL,
  `username` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `days_off` int(11) NOT NULL,


With start_date is something like [ 1 - 10 - 2007 ] and end_date  is like [ 20 
- 10 -2007 ].

I am thinking whats the best way to present such data ? and how to show 
overlapping days between users ?


Something like:

  Jan  Feb
1 2 3 4  1 2 3 4 ...
   +
Richard|o o o o  o o o o
   Fred|x x o o  o o o o
Mohamed|o o o x  x o o o

With HTML you could use colours to represent days/weeks off making it 
more apparent, eg. nothing/white for no holiday booked, and red for one 
booked. And if you're going to go to the day granularity, an IFRAME 
might be needed with left/right scrolling.


--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] freeing resourses after the end of the session

2007-11-19 Thread Richard Heyes
   I made a image validation code, wich generate a image every time the 
user enters a page.


   The name of the image uses the session id, and I save it in a 
temporary directory.


   When the user close the browser (or leave the site) I would have to 
delete the image (or else I will start to have many garbage images in 
the temp directory).


   Is there any way to do that? From PHP?


http://uk.php.net/manual/en/function.register-shutdown-function.php

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] Looking for a navigation recommendation

2007-11-17 Thread Richard Heyes

I'm working on a project wherein I need to be able to navigate to previous and 
next

 sections of data.  I'm wondering what the best way to code for this

would be.

When I enter the page, I'd like it to use something in the MySQL SELECT such as



LIMIT 0,25, but the 0 portion needs to change with the appropriate 
selections of
Next or Prev.  I thought that setting Next or Prev as an anchor back to the 
same page
would let me pass along data, but it doesn't seem to be happening, at least, 
not in
the $_POST variables.

Any suggestions for me?  Or maybe a recommendation for a similar page I could 
view and

 learn from?

The PEAR Pager class can do this for you. Together with the 
Pager_Sliding package it works very well.


http://pear.php.net/package/Pager

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] Tree-like structure in PHP?

2007-11-16 Thread Richard Heyes

What is the most obvious way to implement a tree-like structure in PHP?


Use someone elses code that already works. :) Array based tree class is 
here:


http://www.phpguru.org/Tree/Tree.phps

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] Open Source BTS??

2007-11-16 Thread Richard Heyes
I am needing to install a bug tracking system on a web server and looking for 
a good PHP open source solution. Looking for a pretty mature system that 
still has active development. Thanks for any suggestions.


The only one I have had experience of is Mantis:

http://www.mantisbt.org/

No complaints here.

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] Generating sequence of AlphaNumber

2007-11-15 Thread Richard Heyes
I am having trouble generating a sequence of numbers from the following start 
value:

AX0001

what I have done so far is loop through each character and check if its a 
alphabet and separating the characters and digits.


But when I increment the digits, its strips of the leading zeros. How can I 
get a sequence of values like:


AX0001
AX0002
AX0003
AX0004
.
AX0099
AX0100

and so on ?


?php
for ($i=0; $i=100; $i++) {
echo 'AX' . sprintf('%04d', $i) . 'br /';
}
?

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] PHP ide?

2007-11-08 Thread Richard Heyes

Eclipse with PDT plugin


Scite. Not quite an IDE per-se, but still very very good and extremely 
versatile.



IDE of champions ;)


That somewhat subjective... :)

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] PHP installation

2007-10-31 Thread Richard Heyes

...
Thanks for the help. I've got it installed now. In the end I found that 
the server came with 5.1.6 installed (:/), which despite not being 
5.2.x, is still a jump from the 5.0.x I had before.


--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



[PHP] PHP installation

2007-10-30 Thread Richard Heyes

Hi,

Trying to install PHP, however it's failing with the following:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/lib64
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for 
details.



The following is in config.log:

configure:20028: checking whether libxml build works
configure:20055: gcc -o conftest -g -O2   conftest.c

 -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 15
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
configure: failed program was:
#line 20044 configure
#include confdefs.h


char xmlInitParser();
int main() {
  xmlInitParser();
  return 0;
}



If it helps, this is a bit of an `ls -l` of /usr/lib64:

libxml2.so - libxml2.so.2.6.27
libxml2.so.2 - libxml2.so.2.6.27
libxml2.so.2.6.19
libxml2.so.2.6.27

And this is what's at the end of my config.log:

configure:19793: checking whether to enable LIBXML support
configure:19841: checking libxml2 install dir
configure:19870: checking for xml2-config path
configure:20028: checking whether libxml build works
configure:20055: gcc -o conftest -g -O2   conftest.c

 -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 15
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
configure: failed program was:
#line 20044 configure
#include confdefs.h


char xmlInitParser();
int main() {
  xmlInitParser();
  return 0;
}


Thanks.


--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] PHP installation

2007-10-30 Thread Richard Heyes

Per Jessen wrote:

Richard Heyes wrote:


The following is in config.log:

configure:20028: checking whether libxml build works
configure:20055: gcc -o conftest -g -O2   conftest.c

  -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 15
/usr/bin/ld: cannot find -lz


Looks like you need to install libz. 


I installed various zlib and zlib-devel packages, but finally went with 
an rpm, but when I run `apachectl configtest` I get this:


Cannot load /usr/lib64/httpd/modules/libphp5.so into server: 
/usr/lib64/httpd/modules/libphp5.so: undefined symbol: apr_pool_cleanup_null


Umm help?

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] PHP installation

2007-10-30 Thread Richard Heyes

Richard Heyes wrote:

Per Jessen wrote:

Richard Heyes wrote:


The following is in config.log:

configure:20028: checking whether libxml build works
configure:20055: gcc -o conftest -g -O2   conftest.c

  -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 15
/usr/bin/ld: cannot find -lz


Looks like you need to install libz. 


I installed various zlib and zlib-devel packages, but finally went with 
an rpm, but when I run `apachectl configtest` I get this:


Cannot load /usr/lib64/httpd/modules/libphp5.so into server: 
/usr/lib64/httpd/modules/libphp5.so: undefined symbol: 
apr_pool_cleanup_null


OK so now I'm back to compiling PHP after the ridiculous nightmare of 
rpms. I checked /lib and have the following:


[EMAIL PROTECTED] php-5.2.4]# ls -l /lib/libz.so.1.2.3
-rwxr-xr-x 1 root root 71744 Sep 21 19:23 /lib/libz.so.1.2.3

Is PHP looking for a different file?

Thanks.

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



<    2   3   4   5   6   7   8   9   >