RE: [PHP] Question about creating php files from a form

2010-05-15 Thread Lawrance Shepstone
Kevin wrote:
>>> I am having some issues with connecting to a SQLite database right now
>>> ... I'm getting the following error "Fatal Error: 'sqlite_open' is an
>>> unknown function"
>>> But I'm putting that on the side right now.
>>
>> I think the docs are still screwed up. Try sqlite3_open() instead and
>> see if that works. Also, check phpinfo() to see if the SQLite/SQLite3
>> modules are loaded.
>>
> I tried with sqlite3_open() and it gave the same error.

  THEN ... 'check phpinfo()'
Obviously sqlite extension is not actually loaded.
You don't aey which OS ... On windows there are a list of extensions in the 
php.ini file, just 'uncomment' the one(s) you need ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

__

There is no sqlite3_open() - there is only an OOP interface for php_sqlite3.

I wrote to the list in frustration about this choice not too long ago, and
concluded that the only way to accomplish this is to:

1.) Use php-sqlite3 extension (not to be confused with the php_sqlite3 -
dash vs underscore) - but this isn't a great solution because it would mean
you would need to ask your host to enable a custom extension, which they
usually don't do. If you're hosting this app on your own server, then give
it a bash.

2.) Otherwise, get involved in PECL development and help give php_sqlite3 a
procedural interface.

Of course, if you're looking for basic database storage, then SQLite2
(php_sqlite) would work fine.

Best of luck,
Lawrance


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



RE: [PHP] Parse question

2010-05-13 Thread Lawrance Shepstone
-Original Message-
From: Ron Piggott [mailto:ron.pigg...@actsministries.org] 
Sent: 13 May 2010 06:34 AM
To: PHP General
Subject: [PHP] Parse question


If $message_body contains:

$message_body="You are subscribed using u...@domain. To update";

How do I capture just the e-mail address?

Ron

__

Regular Expressions ... They're great at this sort of thing!

I'd suggest starting here:

http://www.regular-expressions.info/email.html

Then take a look at the PHP regular expression manual:

http://www.php.net/manual/en/book.pcre.php

Have fun!
Lawrance


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



RE: [PHP] stristr query trouble

2010-05-13 Thread Lawrance Shepstone
On 13 May 2010 10:08, Lawrance Shepstone  wrote:
> -Original Message-
> From: Ron Piggott [mailto:ron@actsministries.org]
> Sent: 13 May 2010 06:02 AM
> To: PHP General
> Subject: [PHP] stristr query trouble
>
> I am not understanding why 'true' isn't the result of this syntax because
> $subjects equals:
>
> $subjects = "Delivery Status Notification(Failure)";
>
> Here is my syntax:
>
> if ( stristr( $subjects, "Delivery Status Notifcation(Failure)" ) ) {
> $TIRSFlag = true;
> echo "true";
> }
>
> _
>
> You have misspelled 'Notification' in your comparison ...
>
> You should probably use Regular Expressions for this kind of thing.
>

Regexes are best used when what you need to match is dynamic or in a
dynamic string. When you know what the output will be and can match
it, the str* functions are much better as they are much more
efficient.

Regards
Peter



Agreed ;-)


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



RE: [PHP] stristr query trouble

2010-05-13 Thread Lawrance Shepstone
-Original Message-
From: Ron Piggott [mailto:ron@actsministries.org] 
Sent: 13 May 2010 06:02 AM
To: PHP General
Subject: [PHP] stristr query trouble

I am not understanding why 'true' isn't the result of this syntax because
$subjects equals:

$subjects = "Delivery Status Notification(Failure)";

Here is my syntax:

if ( stristr( $subjects, "Delivery Status Notifcation(Failure)" ) ) {
$TIRSFlag = true; 
echo "true";
}

_

You have misspelled 'Notification' in your comparison ...

You should probably use Regular Expressions for this kind of thing.

Best of luck,
Lawrance


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



RE: [PHP] __call and recursion

2010-05-12 Thread Lawrance Shepstone
Hi Daniel,

Could you please tell us what version of PHP and OS you're using.

The following code fragment runs as expected on my PHP 5.3.2/Windows/XP/32bit:

method_a('argument');

$a->method_b('argument');

?>

Results in:

private method_a('argument') called ...
method 'method_b' either does not exist, or is not callable ...


Perhaps if you provided some code we could spot the problem.

I would guess there's something fishy in your __call() method.

Best of luck,
Lawrance

-Original Message-
From: Richard Quadling [mailto:rquadl...@googlemail.com] 
Sent: 12 May 2010 12:28 PM
To: Daniel Kolbo
Cc: PHP General
Subject: Re: [PHP] __call and recursion

On 9 May 2010 22:21, Daniel Kolbo  wrote:
> Hello,
>
> I've defined a __call() method inside a class.  Within the __call()
> method (after testing that the method exists and is callable I am using:
>
> call_user_func_array(array($this,$method), $args);
>
> However, this seems to be an infinite loop (and is crashing my test
> apache server).  How, could I still use the __call() method and avoid an
> infinite loop of calling?
>
> Thanks,
> dK

__call() is receiving $method.

Do you alter $method in any way?

If not, calling call_user_func(array($this, $method), $args) will
simply call the non-existent function.




-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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


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