php-general Digest 7 Apr 2008 15:30:56 - Issue 5391
Topics (messages 272608 through 272644):
Re: Arbitrary mathematical relations, not just hashes
272608 by: Casey
272610 by: Mark J. Reed
272626 by: Jenda Krynicky
272627 by: Jenda Krynicky
272644 by:
Have you seen how PHP makes difference between private, protected and public
attributes of an object, into the session file ?
There are special caracters before them to recognize them.
So the question is : is PHP4 able to read such a session file ?
And how will it interpret them when we ask him
Have you seen how PHP makes difference between private, protected and public
attributes of an object, into the session file ?
There are special caracters before them to recognize them.
So the question is : is PHP4 able to read such a session file ?
And how will it interpret them when we ask him
PHP list,
I have a large set of PHP scripts of my own design that outputs any
errors to text log files.
These scripts are deployed on a few different sites, at different
virtual hosting services. On one, I keep seeing this error in my log files:
Error Handler message: session_start() [a
John Taylor-Johnston wrote:
$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Either http://php.net/strpos or http://php.net/stripos if your version
of PHP supports it.
-Stut
--
$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
Do you guys how search engines like cookies? One site I'm working on now
requires the user to select which region he/she is from on the start
page. That value is stored in a cookie. So without cookies you can't get
past the start page. Does this leave the search engines at the start
?php
$name = John Taylor;
if (strpos($name,'John') 0){
//you could use stripos for case insensitive search
echo found;
}
?
-Mensagem original-
De: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 7 de abril de 2008 10:25
Do a preg match to find one or preg_match_all to find all the john in the
string.
?php
$name = John Taylor;
$pattern = '/^John/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?
$name = John Taylor;
I want to verify if $name contains john, if yes
Thiago Pojda wrote:
?php
$name = John Taylor;
if (strpos($name,'John') 0){
//you could use stripos for case insensitive search
echo found;
}
?
This will not do what you expect it to. Since 'John' is the first thing
in the string strpos will return 0 causing the
Never late to learn new stuff, you're right Stut.
Thanks!
-Mensagem original-
De: Stut [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 7 de abril de 2008 10:42
Para: Thiago Pojda
Cc: 'John Taylor-Johnston'; 'PHP-General'
Assunto: Re: RES: [PHP] string
Thiago Pojda wrote:
?php
Hello, I have run into a problem when trying to get the ssh2 bindings to
run on PHP. I have successfully installed libssh2 and have gotten version
0.11 of ssh2 to compile correctly using the patch obtained through the
'package bugs' page. However, when I load php, I get the following error:
dyld:
On Mon, Apr 7, 2008 at 9:25 AM, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
John
?php
if(stristr($name,'john')) {
//
On Mon, Apr 7, 2008 at 10:16 AM, Michael Stroh [EMAIL PROTECTED] wrote:
Hello, I have run into a problem when trying to get the ssh2 bindings to
run on PHP. I have successfully installed libssh2 and have gotten version
0.11 of ssh2 to compile correctly using the patch obtained through the
Excellent. Thanks all!
John
Daniel Brown wrote:
On Mon, Apr 7, 2008 at 9:25 AM, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
On Mon, Apr 7, 2008 at 9:29 AM, Emil Edeholt [EMAIL PROTECTED] wrote:
Hi,
Do you guys how search engines like cookies? One site I'm working on now
requires the user to select which region he/she is from on the start page.
That value is stored in a cookie. So without cookies you can't get
From: Julian Leviston [EMAIL PROTECTED]
You could use ActiveRecord.
Without a database? I guess not. You'd still need at least SQLite.
But you are right, you could use ActiveRecord to obtain a nice object
oriented wrapper around the database so that it doesn't scare you.
Or, assuming you do
From: Kelly Jones [EMAIL PROTECTED]
Many programming languages (including Perl, Ruby, and PHP) support hashes:
$color['apple'] = 'red';
$color['ruby'] = 'red';
$type['apple'] = 'fruit';
$type['ruby'] = 'gem';
This quickly lets me find the color or type of a given item.
In this
Hi all,
My system is accessible through an index.php file. This file does a
bunch of includes to include global variables, which in function context
become available through the global keyword:
index.php
?php
require_once global_vars.php;
function f() {
global $global_var;
On Sun, Apr 6, 2008 at 10:36 PM, Richard Lee [EMAIL PROTECTED] wrote:
I am trying to open a big file and go through line by line while limiting
the resource on the system.
What is the best way to do it?
Does below read the entire file and store them in memory(not good if that's
the case)..
Search engines won't come past that page. How about setting a default
region when a user enters a different page then your main page?
Daniel Brown wrote:
On Mon, Apr 7, 2008 at 9:29 AM, Emil Edeholt [EMAIL PROTECTED] wrote:
Hi,
Do you guys how search engines like cookies? One site I'm
On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams [EMAIL PROTECTED] wrote:
This works:
include(file.inc.php);
This doesn't:
include(./file.inc.php);
That's pretty vague, Noah. Is it unable to locate the file?
What's the error message you're receiving?
Also, what happens
On Mon, Apr 7, 2008 at 9:30 AM, [EMAIL PROTECTED] wrote:
Do a preg match to find one or preg_match_all to find all the john in the
string.
preg_* is overkill if you're just searching for a literal string. use
it if you're searching for any strings matching a pattern, part of
which you don't
Daniel Brown wrote:
On Mon, Apr 7, 2008 at 9:25 AM, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
$name = John Taylor;
I want to verify if $name contains john, if yes echo found;
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
John
?php
On Fri, Apr 4, 2008 at 6:51 AM, Angelo Zanetti [EMAIL PROTECTED] wrote:
Hi all,
I am looking at options for creating a dynamic dropdown list.
Ok here is the scenario:
All values in the dropdown list (select/option field) are coming from the
database.
So there will be 2 dropdown
On Mon, Apr 7, 2008 at 10:42 AM, Jim Lucas [EMAIL PROTECTED] wrote:
I wonder if using strstr() with strtolower() would be faster or slower.
[snip=code]
Results:
Attempt #1
0.015728950500488
0.022881031036377
[snip!]
While I don't really care much for a single selection about the
Evert Lammerts wrote:
My system is accessible through an index.php file. This file does a
bunch of includes to include global variables, which in function context
become available through the global keyword:
index.php
?php
require_once global_vars.php;
function f() {
global $global_var;
In index.php rather than declaring vars like so...
$var = 'value';
...declare them in the $GLOBALS array like so...
$GLOBALS['var'] = 'value';
$var is then in the global scope regardless of where it was set.
-Stut
That would work. However I'm looking for a more generic solution,
Evert Lammerts wrote:
In index.php rather than declaring vars like so...
$var = 'value';
...declare them in the $GLOBALS array like so...
$GLOBALS['var'] = 'value';
$var is then in the global scope regardless of where it was set.
-Stut
That would work. However I'm looking for a more
On Apr 7, 2008, at 9:36 AM, Daniel Brown wrote:
On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams [EMAIL PROTECTED]
wrote:
This works:
include(file.inc.php);
This doesn't:
include(./file.inc.php);
That's pretty vague, Noah. Is it unable to locate the file?
What's the error
Philip Thompson wrote:
On Apr 7, 2008, at 9:36 AM, Daniel Brown wrote:
On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams
[EMAIL PROTECTED] wrote:
This works:
include(file.inc.php);
This doesn't:
include(./file.inc.php);
That's pretty vague, Noah. Is it unable to locate the file?
Thanks for your advice Daniel.
I installed the new version of Zend Optimizer but then received the
following error:
dyld: NSLinkModule() error
dyld: Symbol not found: _zend_extensions
Referenced from: /usr/local/Zend/lib/ZendExtensionManager.so
Expected in: flat namespace
Trace/BPT trap
I
I'm not sure what you mean. If you're saying you want to include a
file from inside a function but for all parts of it to behave as if it
were being included at the global scope then I don't believe there's a
way to do it.
Maybe it would be better if you tell us exactly what you're trying
On Mon, Apr 7, 2008 at 11:25 AM, Michael Stroh [EMAIL PROTECTED] wrote:
Thanks for your advice Daniel.
I checked the Zend forums and it is believed that they will not support
Mac OS 10.5 and thus the error. Is there another package I can use to
replace Zend for the purpose of ssh2?
On Sun, Apr 06, 2008 at 08:51:00PM -0700, Casey wrote:
I hit reply-all... now am I suddenly subscribed to Perl and Ruby lists!?!
Be careful. Next time you do it you'll be subscribed to Haskell, OCaml
and Smalltalk lists.
Bwahahaha!
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
On Mon, Apr 7, 2008 at 11:20 AM, Philip Thompson [EMAIL PROTECTED] wrote:
It's Windows. From experience, I know that it provides little to no error
reporting in some instances. For example, if you're missing a semi-colon and
you have error reporting turned on, all you get is a blank page - no
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the database,
CaldTime is timestamp and since it will not allow me to have 2 timestamps in
the same table I set the CallEnd varchar(12). Storing the data they seem to be
the same for
Daniel Brown wrote:
On Sun, Apr 6, 2008 at 10:36 PM, Richard Lee [EMAIL PROTECTED] wrote:
I am trying to open a big file and go through line by line while limiting
the resource on the system.
What is the best way to do it?
Does below read the entire file and store them in memory(not good
On Mon, Apr 7, 2008 at 11:44 AM, Richard Lee [EMAIL PROTECTED] wrote:
Daniel Brown wrote:
Was there a reason this was sent to the PHP list as well? Maybe
just a typo?
def a typo.. sorry about that
No problem at all. Just checking in case the PHP question was
missed or
On Mon, Apr 7, 2008 at 11:52 AM, Wolf [EMAIL PROTECTED] wrote:
Noah,
Looks like you need to be deciding on whether or not you are on windoze or
*Nix.
If on Windoze, your include path is \
If on *Nix, your include path is /
Notice the direction of the slashes and code appropriately in all
Daniel Brown [EMAIL PROTECTED] wrote:
On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams [EMAIL PROTECTED]
wrote:
This works:
include(file.inc.php);
This doesn't:
include(./file.inc.php);
That's pretty vague, Noah. Is it unable to locate the file?
What's the
On Mon, Apr 7, 2008 at 11:24 AM, Stut [EMAIL PROTECTED] wrote:
To the OP: Check that your include_path contains '.', if it doesn't add it
and see if that fixes your problem.
He has . in the include path
On Sun, Apr 6, 2008 at 2:17 PM, Noah Spitzer-Williams [EMAIL PROTECTED] wrote:
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the
database, CaldTime is timestamp and since it will not allow me to have 2
timestamps in the same table I set the CallEnd
I know popup windows are a client-side issue, but I can't figure how to
create and close a popup window from the server side only on condition,
otherwise display normal browser page.
What I want is to accept a form, check the input, if there are errors return
them to the browser, if there aren't
Daniel Brown [EMAIL PROTECTED] wrote:
On Mon, Apr 7, 2008 at 11:52 AM, Wolf [EMAIL PROTECTED] wrote:
Noah,
Looks like you need to be deciding on whether or not you are on windoze or
*Nix.
If on Windoze, your include path is \
If on *Nix, your include path is /
Wolf wrote:
Daniel Brown [EMAIL PROTECTED] wrote:
On Mon, Apr 7, 2008 at 11:52 AM, Wolf [EMAIL PROTECTED] wrote:
Noah,
Looks like you need to be deciding on whether or not you are on windoze or
*Nix.
If on Windoze, your include path is \
If on *Nix, your include path is /
Notice
Arno Kuhl [EMAIL PROTECTED] wrote:
I know popup windows are a client-side issue, but I can't figure how to
create and close a popup window from the server side only on condition,
otherwise display normal browser page.
What I want is to accept a form, check the input, if there are
On Apr 7, 2008, at 11:56 AM, Rian Hidayanto wrote:
hi,
I put a file setup.exe in a directory downloaddir\
I want to build PHP code, so that only registered users are able to
download the file.
How to make the directory / files only available to registered users
using
PHP code?
(So that
Here's the error I get:
*Warning*: include(.\file.inc.php)
[function.includehttp://www.emsplannertest.com/function.include]:
failed to open stream: No such file or directory in *
C:\Inetpub\httpdocs\test.php* on line *3*
*Warning*: include()
On Mon, Apr 7, 2008 at 11:56 AM, Rian Hidayanto [EMAIL PROTECTED] wrote:
hi,
I want to build PHP code, so that only registered users are able to
download the file.
(So that other users cannot download the file using direct url
http:\\www.abcd.org\downloaddir\setup.exe )
This is
Jason Pruim [EMAIL PROTECTED] wrote:
On Apr 7, 2008, at 11:56 AM, Rian Hidayanto wrote:
hi,
I put a file setup.exe in a directory downloaddir\
I want to build PHP code, so that only registered users are able to
download the file.
How to make the directory / files only
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
t the data is fed from the database, CaldTime is timestamp and since
it will not allow me to have 2 timestamps in
the same table
?? What database are you using? It sounds like it has a specific
meaning of timestamp - probably the last
Yes my mistake was looking at another record and published another.
But I figured it out now i can publish 1:45 like i wanted. Having a moment
there.
Thank you
Richard L. Buskirk
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have
On Mon, Apr 7, 2008 at 11:52 AM, Wolf [EMAIL PROTECTED] wrote:
Noah,
Looks like you need to be deciding on whether or not you are on windoze or
*Nix.
If on Windoze, your include path is \
If on *Nix, your include path is /
Notice the direction of the slashes and code appropriately
Thank you that is exactly what i did to figure it out.
Just was having a brain fart there for a minute.
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
t the data is fed from the database, CaldTime is timestamp and since
it will not allow me to have 2 timestamps in
the same table
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the
database, CaldTime is timestamp and since it will not allow me to have 2
timestamps in the same table I set the CallEnd
At 3:29 PM +0200 4/7/08, Emil Edeholt wrote:
Hi,
Do you guys how search engines like cookies? One site I'm working on
now requires the user to select which region he/she is from on the
start page. That value is stored in a cookie. So without cookies you
can't get past the start page. Does
On Mon, Apr 7, 2008 at 12:24 PM, Noah Spitzer-Williams [EMAIL PROTECTED]
wrote:
Here's the error I get:
Warning: include(.\file.inc.php) [function.include]: failed to open stream:
No such file or directory in C:\Inetpub\httpdocs\test.php on line 3
Warning: include() [function.include]:
Thanks so much! That seems to have done the trick. I commented out those
files in my php.ini file and then a reinstallation of ssh2 worked. Zend
must have been installed by some default setting.
Thanks again for your help Daniel!
Cheers,
Michael
On Mon, April 7, 2008 11:29 am, Daniel Brown
Dan I made a solution as below.
$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;
$TLength = date(i:s, strtotime(2008-01-01 01:00:$interval));
Result 01:45
Works perfect for me. Do you agree or disagree dan?
On Mon, Apr 7, 2008 at
hi,
I put a file setup.exe in a directory downloaddir\
I want to build PHP code, so that only registered users are able to
download the file.
How to make the directory / files only available to registered users using
PHP code?
(So that other users cannot download the file using direct url
On Mon, Apr 7, 2008 at 1:03 PM, [EMAIL PROTECTED] wrote:
Dan I made a solution as below.
$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;
$TLength = date(i:s, strtotime(2008-01-01 01:00:$interval));
Result 01:45
Works
Daniel Brown wrote:
On Mon, Apr 7, 2008 at 12:24 PM, Noah Spitzer-Williams [EMAIL PROTECTED]
wrote:
Here's the error I get:
Warning: include(.\file.inc.php) [function.include]: failed to open stream:
No such file or directory in C:\Inetpub\httpdocs\test.php on line 3
Warning: include()
On Mon, Apr 7, 2008 at 1:05 PM, Lester Caine [EMAIL PROTECTED] wrote:
People seem to be missing the point here. These are PUBLIC applications
that are failing to work for Noah. He should not need to re-write PHPMyAdmin
in order to get it to work?
Next people will be saying that we should
Lester Caine [EMAIL PROTECTED] wrote:
Daniel Brown wrote:
On Mon, Apr 7, 2008 at 12:24 PM, Noah Spitzer-Williams [EMAIL PROTECTED]
wrote:
Here's the error I get:
Warning: include(.\file.inc.php) [function.include]: failed to open stream:
No such file or directory in
Daylight Savings Time must die!
Oh, by the way, thanks for your reply.
So last night my clock went forward an hour on this cool DST-aware
dual alarm clock radio I bought in 1999. Apparently DST rules have
changed http://en.wikipedia.org/wiki/Year_2007_problem so now my clock
isn't as cool
On Mon, Jun 18, 2007 at 9:49 PM, Mike Frysinger [EMAIL PROTECTED] wrote:
On 6/9/07, Richard Lynch [EMAIL PROTECTED] wrote:
On Sat, June 9, 2007 4:27 pm, Mike Frysinger wrote:
anyone know of some software to generate images like this:
http://wh0rd.org/register.png
idea is i have a list
{sorry for top-posting, but outlook can't do better}
I executed cat /usr/local/lib/php.ini | grep -i session and found out that
there was already one entry for that conf option by default, and it was set
to 0.
It fixed it, sorry I was that dumb.
Just saw the source and it is adding the
Hello,
I am mostly familiar with php for serving up web pages; however,
recently I have been writing a local command line script on my WinXP
machine. I have spent the better part of this last week and all of
today trying to figure out a way to send a mouse click to a particular
window on
PHP list,
Solving my own issue:
It turns out that some PHP scripts had an extra carriage return
character at the end of the file. Once I removed these, the problem went
away.
Strange that it only happened on some servers, not others, but there it is.
--
Dave M G
Articlass - open source CMS
Daniel Kolbo wrote:
Hello,
I am mostly familiar with php for serving up web pages; however,
recently I have been writing a local command line script on my WinXP
machine. I have spent the better part of this last week and all of
today trying to figure out a way to send a mouse click to a
On Tue, Apr 8, 2008 at 12:00 AM, hce [EMAIL PROTECTED] wrote:
Hi,
Is it possible for an array to point a function:
Asignmanet
$ArrayPointer = $this-MyFunction;
Invoke:
$ArraryPointer();
i would recommend you investigate variable functions
1.
On Tue, 2008-04-08 at 14:00 +1000, hce wrote:
Hi,
Is it possible for an array to point a function:
Asignmanet
$ArrayPointer = $this-MyFunction;
Invoke:
$ArraryPointer();
No, you can't do what you've done above. What you can do is...
?php
$ptr = array( 'obj' = $this,
Hi,
I'm working with serveral PHP editors, each has it own restrictions.
So umm, What editors do you recommend and what special functions and
dis/adventages they have (maybe im overkilling my own back).
Thanks In Advance,
Nitsan
On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
Hi,
I'm working with serveral PHP editors, each has it own restrictions.
So umm, What editors do you recommend and what special functions and
dis/adventages they have (maybe im overkilling my own back).
This comes up almost once a
75 matches
Mail list logo