Re: [PHP] Ini files for CLI only on non Win32 platform

2013-09-13 Thread Kevin Kinsey
Date: Fri, 13 Sep 2013 11:40:27 +0100
From: Richard Quadling rquadl...@gmail.com
To: PHP General list php-general@lists.php.net
Subject: [PHP] Ini files for CLI only on non Win32 platform.

I've got an instance of PHP that is looking for additional ini files in
/etc/php.d

This seems to work well.

I now need to make one of the ini files only accessible if the SAPI is CGI.

So, I renamed the file ... mv /etc/php.d/my.ini /etc/php.d/my-cgi.ini

If I do a ...

php --ini

I still see the ini file.

Is the -SAPI filtering performed on the additional files?

It doesn't seem to and I can't really tell from the dox if it is supposed
to.

Shouldn't the file name be php-cgi.ini ?

Manual: If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for 
example, php-cli.ini or 
php-apache.ini), it is used instead of php.ini. The SAPI name can be determined 
with php_sapi_name().

I'm in CLI mode here; note that my-cli.ini is ignored but php-cli.ini
is not:

[1016] Fri 13.Sep.2013 13:52:05
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:  /usr/local/etc/php/extensions.ini

[1017] Fri 13.Sep.2013 13:52:08
[kadmin@freebsd-devel][/www/data/]  
 
sudo touch /usr/local/etc/php-cgi.ini

[1018] Fri 13.Sep.2013 13:52:26
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/php-cli.ini

[1019] Fri 13.Sep.2013 13:52:32
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/my-cli.ini

[1020] Fri 13.Sep.2013 13:52:44
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php-cli.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:  /usr/local/etc/php/extensions.ini


I apologize if I'm missing the point or am obtuse or irrelevant;
I don't play with the INI files very often.

Kevin Kinsey

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



Re: [PHP] Finally....

2013-08-17 Thread Kevin Kinsey
Date: Fri, 16 Aug 2013 11:23:18 -0400
From: Daniel Brown danbr...@php.net
To: PHP General php-general@lists.php.net
Subject: [PHP] Finally

# ezmlm-list ~ezmlm/php-general | grep skynet
supp...@skynet.be

# ezmlm-unsub ~ezmlm/php-general supp...@skynet.be

# ezmlm-list ~ezmlm/php-general | grep skynet
#

No more of those Your e-mail concerning our products and
services autoreplies from the Belgacom Webteam.  Sorry it took me
this long to realize it and get around to it.

Happy Friday.

Aunt AMaViS says, What autoreplies?

;) ;)

Kevin Kinsey

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



[PHP] Compiler for the PHP code

2013-03-19 Thread Kevin Peterson
My webcode written in PHP and it is running in the interpreted way. My problem 
is it is not giving the desired performance so want to try the compiler if any. 
Please suggest if we have any compiler option available for the PHP code and 
more important is this new option.



Re: [PHP] Type of a variable in PHP

2013-03-16 Thread Kevin Peterson
Thanks
Nora


On Fri, Mar 15, 2013 at 4:34 PM, Sebastian Krebs krebs@gmail.comwrote:




 2013/3/15 Kevin Peterson qh.res...@gmail.com

 Have two questions -
 1. How to find type of a variable in PHP.


 gettype(), or one of the is_*()-functions. But for me more interesting for
 me: Why do you _need_ this?


 2. How to find the type of an array in PHP.


 An array is of type array :) is_array() or again gettype().


 Can you maybe describe what you want to achieve? In a dynamically typed
 language it is rarely _required_, that you know the _concrete_ type.



 Please help.




 --
 github.com/KingCrunch



[PHP] Type of a variable in PHP

2013-03-15 Thread Kevin Peterson
Have two questions -
1. How to find type of a variable in PHP.
2. How to find the type of an array in PHP.

Please help.



[PHP] mysql custom global defined variable

2013-03-13 Thread Kevin Peterson
In my database design, I tend to store some variable that is meant to be acting 
as a ROLE or TYPE as SMALLINT. For example : 

CREATE TABLE `house` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `type` smallint(11) NOT NULL,
)


And in php, I do

define('HOUSE_SMALL_TYPE', '0');
define('HOUSE_MEDIUM_TYPE', '1');

So in php, in SELECT queries I do :

$this-db-query(SELECT * FROM house  
WHERE type=?;, HOUSE_SMALL_TYPE);

My questions are : 
1. In the php part, is there is a better way to do this ? 
2. In the mysql itself, does mysql also has global define functionality (like 
the define in php) ? I also want to do kind of SELECT * FROM house WHERE type = 
HOUSE_SMALL_TYPE in mysql query.



Re: [PHP] variable placeholders in a text file

2013-01-04 Thread Kevin Kinsey
On Mon, Dec 31, 2012 at 02:29:38PM -0600, Nelson Green wrote:
 
 On Mon, 31 Dec 2012 19:59:02, Ashley Sheridan wrote:
 ___
   
  On Mon, 2012-12-31 at 13:39 -0600, Nelson Green wrote: 
 

snip snip

Nelson (et al),

I've enjoyed reading this thread and apologize for dredging it up.
It's interesting to see your progression of thought and the templating
discussion is indeed a worthy one.

However, I wanted to answer this objection from your initial message:

The reason I ask is because I am going to want to do three substitutions,
and I'd rather not do three str_replace calls if I don't have to.

You *don't* have to; str_replace() is perfectly capable of handling
arrays:

=
$replace = array(USER,SITENAME,SOME_CONSTANT); 
$replacements = array($user,$site_name,$foo);

$replaced = 
str_replace($replace,$replacements,file_get_contents(/somefile.txt));
=

This, of course, doesn't negate a good templating system* ... but it's
handy to know and you'll probably use it sooner or later.

Kevin Kinsey

P.S. *assuming that's not an oxymoron!

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



Re: [PHP] Turning a string into a condition

2012-02-16 Thread Kevin Kinsey
On Thu, Feb 16, 2012 at 04:37:18PM -0500, Marc Guay wrote:
  It shouldn't be that hard to parse this type of expressions.
 
 I appreciate your concern, and will do my best to validate the input,
 but there are two things:
 
 1)  The application will only be used by selected users.
 and
 2)  The range of possibilities are broader than I indicated.  They
 would like to be able to enter conditions of all sorts.  i.e.
 
 ($x / $y)  0.5
 (($a+$b+$c) / $d)  .75
 
 etc.
 
 If you have any suggestions on how to increase the security while
 maintaning the flexibility, I'd be happy to hear it.
 
 Marc

You might try making a list of dirty words (in this case, not
the 4-letter type, but things you wouldn't want the user to be
able to do (mail() calls, filesystem type calls, etc.).

Another possibility might be to explode the contents of the
expression and run a call to function_exists() on it ... but
that might be a tad too broad as well.

HTH,

Kevin Kinsey

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



Re: [PHP] Need Part-time Coder

2011-12-28 Thread Kevin Kinsey
You'll want your PHP code to be proprietary and encoded,
of course.

Run this script, save the output, and then run *that*.

?php

$helloworld = 'Hello World';
$n = 30;
for($i=0; $i$n; $i++)
{$helloworld = base64_encode($helloworld);
}
echo '?php\n$h=';
echo chunk_split($helloworld);
echo ';';
echo 'for($i=0;$i'.$n.'; $i++)';
echo '{$h = base64_decode($h);}';
echo 'echo $h;';


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



[PHP] Am I missing something about escapeshellarg

2011-03-07 Thread Kevin Chadwick
I just posted the following at

http://stackoverflow.com/questions/3481880/what-php-extensions-are-preferred-and-what-about-security-preferences/5223539#5223539;

Am I missing anything or are all these guides and hosts either not
disabling enough functions or disabling security aids to give warning
messages with dangerous results.

_
Why do so many hosts and guides disable escapeshell[arg|cmd] which are
security aids and leave shell_exec enabled.

Leads to opening up your servers to untrusted execution due to things
like this.

http://www.silverstripe.org/hosting-requirements/show/10777;

The only thing I can think of is using it twice might cause problems
and safe mode used to be widespread and so would apply escapeshellcmd
automatically And now the hosts just copy configs blindly and in error
and don't understand and so trust the 100s of threads that say you
should do this.

Yeah, use it as reference, I'm looking at it, but don't trust it
because some good host uses it
__

Surely this matters more than removing safe mode despite defence in
depth because users believe it to be a safety blanket and may not also
use chroot and permissions etc.

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



Re: [PHP] Is it possible to install PHP on IIS?

2010-11-16 Thread Kevin Kinsey

Richard Quadling wrote:

On 16 November 2010 13:21, Jay Blanchard jblanch...@pocket.com wrote:

[snip]

Hi Folks, is it possible to install PHP on IIS? If yes, can someone

please guide me on how to go about doing it? Thanks
[/snip]

http://www.wampserver.com/en/


Jay, if that had been wimpserver ...



I think it's a good point.

Windows + IIS + MySQL + PHP == WINP(y) server :-P

KDK

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



Re: [PHP] php-general-digest-unsubscr...@lists.php.net not working?

2010-11-04 Thread Kevin Kinsey

Paul M Foster wrote:

On Thu, Nov 04, 2010 at 12:34:35PM -0400, Daniel P. Brown wrote:


On Thu, Nov 4, 2010 at 12:33, Daniel P. Brown daniel.br...@parasane.net wrote:

   If you continue to have issues, let me know and I will remove you.

From the list, that is, to be clear.  Not the Earth.


Dang! I was just about to send you a list of people to remove! ;-}

Paul


Lord-a-mercy, yes!!! Daniel, what license for this service?  BSD?
CC?  GPL?  :-D

Kevin Kinsey


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



Re: [PHP] form post question

2010-10-28 Thread Kevin Kinsey

Bastien Koert wrote:

On Thu, Oct 28, 2010 at 10:12 AM, Jack jacklistm...@gmail.com wrote:

I have a form which has the following: ( quick clip )

 form id=form1 name=form1 method=post
action=http://www.abc.com/processing/process_form.php; onSubmit=return
preSubmit();

label
   input name=area_interest type=checkbox id=field13
value=Peer Guide /
   Peer Guide/label
 br /
 label
input type=submit value=Submit /

When the form runs process_form.php it emails the content and has several
other fields from the form, but I have some fields like the one above that
don't show up in the result.  The script that builds the message looks like
the below

$temp_message .= Area(s) of Interest: .
$_POST['area_interest'] .\n;

Is there anything obvious that I am missing?

Is there a way for me to show all the fields from the form, and their field
names which are received by process_form?

Thanks!
Jack



Check boxes (assuming you have more than one in the set) are generally
coming in as an array. You can see this by running this

echo pre;
print_r($_POST);
echo /pre;

to see the entire post array


+1 for Bastien; print_r() and var_dump() are the keys to debugging.
See http://www.phpbuilder.com/board/showthread.php?s=threadid=10240608
for a decent overview of same.

And I guess you could reinvent the wheel, or actually process your
POSTed data, with foreach():

// Roll your own print_r()
   foreach ($_POST as $p = $q) {
  echo $p. -.$q. br /;
   }

// Or do_something_useful()
   foreach ($_POST as $p = $q) {
  do_something_useful($p,$q);
   }


HTH,
KDK

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



Re: [PHP] PHP Question

2010-10-28 Thread Kevin Kinsey

Paulo Work wrote:

Hello, Paulo!


I am building a website with basic CMS functionality.
My problem is that in one of the pages I am using Easyslider to display 
small comments about the clients.


These comments are divided in 3 per slide.
ex:(li
pcomment 1/p
pcomment 1/p
pcomment 1/p
/li)

I am pulling the comments from the db and I would like to know if i can 
split that array in 3's (array_slice) perhaps?


My goal is to within a foreach loop output 3 comments within a 
slide(wrapped in li), so first 3 would output:


(li
pcomment 1/p
pcomment 2/p
pcomment 3/p
/li)
Then another 3


I'm a hacker, so this is a HACK:

?php

$data=(li
pcomment 1/p
pcomment 2/p
pcomment 3/p
/li);

$lines=explode(\n,$data);
array_shift($lines);
array_pop($lines);
print_r($lines);

?

I'll leave it to the big boys to debate and devise more elegant
solutions.

Kevin Kinsey

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



Re: [PHP] Array problem

2010-10-27 Thread Kevin Kinsey

Marc Guay wrote:

As Nicholas pointed out, the extra underscore in the key is the issue.


That's way too easy a fix.  I think he should check to make sure his
version of PHP was compiled with the right extensions and that the
browser isn't doing something unpredictably bizarre when submitting
the form.


Just checked the card file, today's cause is: Sunspots.

KDK

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



Re: [PHP] Re: 1984 (Big Brother)

2010-09-14 Thread Kevin Kinsey

Gary wrote:

tedd wrote:

I have a client who wants his employees' access to their online business
database restricted to only times when he is logged on. (Don't ask why)


Simply put a dead man's handle under his seat which turns on the power
to the server when he sits on it.



I figured we'd get here sooner or later, esp. after I saw Daniel B. talking
about lawnmowers.

And now you can tell the client with a straight face ... if you want any
work to get done today you'd best sit your @$$ down right here

Then, of course, for fun, you could encourage PHB to bounce up  down a
few times a day to keep the employees on their toes.  He'd dig it, I'm
sure, and you'd pick up a good parcel of extra work recovering DB's ...
and disks.

Richard Quadling:

You get all the employees in a room, with the boss.

And then you tell them that when the boss isn't in, they don't have to
do any work.

I'm pretty sure the employees will be your new BFFs.


+11.

We should ABSOLUTELY copy Scot Adams on this.

Wait a minute, maybe Tedd's client IS Scot Adams.

Kevin Kinsey

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



Re: [PHP] exec in different directory where PHP is Installed

2010-05-24 Thread Kevin Kinsey

loki wrote:

Hello,

PHP is installed in c:\program files\php
the PHP script are in network drive \\xxx.xxx.xxx.xxx\scriptdir\
in the PHP script, we try to launch the command @exec(...) with a 
executable located in c:\program files\ourexecutable\

it's not work :(

but if we move the PHP script from \\xxx.xxx.xxx.xxx\scriptdir\
to c:\scriptdir\ then it's work !!

everything work good EXCEPT the @EXEC command ...
Safe mode in PHP is OFF ...


Hello,

   Can you show us the script?  The first thing I'd do is
call is_file(\\xxx.xxx.xxx.xxx\scriptdir\foo.php) ... are
you doing that?

Kevin Kinsey

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



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

2010-05-14 Thread Kevin

Paul M Foster wrote:

On Thu, May 13, 2010 at 11:53:54PM -0400, Kevin wrote:

snip

  

/On a side note:
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.

Paul

  

Thanks Paul,
I tried with sqlite3_open() and it gave the same error.

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



[PHP] Question about creating php files from a form

2010-05-13 Thread Kevin

Hello All,

I am trying to figure out how to create files when a user submits a form ...
I have seen something about '*fopen*' , is that the direction I should 
be going?


Here is what I am trying to accomplish:

I am creating a program to keep track of recipes for my wife. I have 
have page set up where she can put the name of the recipe, the 
ingredients, and the amounts of each ingredient.

Then she clicks Submit

I would like a html file with the name of the recipe to be created ie 
*cookies.html  *with a link to the cookies.html created on another page.

*
*I hope this makes sense,  and thank you all for your time...

- - Kevin

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



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

2010-05-13 Thread Kevin

Ashley Sheridan wrote:

On Thu, 2010-05-13 at 23:07 -0400, Kevin wrote:

Hello All,

I am trying to figure out how to create files when a user submits a form ...
I have seen something about '*fopen*' , is that the direction I should 
be going?


Here is what I am trying to accomplish:

I am creating a program to keep track of recipes for my wife. I have 
have page set up where she can put the name of the recipe, the 
ingredients, and the amounts of each ingredient.

Then she clicks Submit

I would like a html file with the name of the recipe to be created ie 
*cookies.html  *with a link to the cookies.html created on another page.

*
*I hope this makes sense,  and thank you all for your time...

- - Kevin




It might sound overkill, but I'd use a database for this. All the 
recipes can be stored in a MySQL database, and then you can use a 
simple couple of queries to produce the recipe list and the recipe 
pages dynamically. This also has the advantage that it's very easy to 
search the recipe list when it becomes larger, and if you ever want to 
change the layout/presentation of the whole system you won't have to 
recreate all the recipe pages.


The DB could have several columns labelled: id, name, ingredients, method

So, the form page (lets assume it's called add.php) could submit to 
itself which then adds the recipe to the DB with a query like:


INSERT INTO recipes(name, ingredients, method) VALUES($name, 
$ingredients, $method)


This is only a very simple example which could be extended to use 
another table for ingredients for a recipe. Don't forget to sanitise 
any input coming from the form with mysql_real_escape_string() for 
inserting it into the DB.


The list.php page could just use a simple query like:

SELECT id, name FROM recipes

And then create a link to each recipe in the form: 
recipe.php?recipe=id (where id is the numerical value used in the DB) 
and that would then use a query like:


SELECT * FROM recipe WHERE id=$recipe

MySQL is available on most hosting that you'll find has support for 
PHP, and every Linux distribution I've seen has it too.


Thanks,
Ash
http://www.ashleysheridan.co.uk



Thank you Ash for the quick reply.

I was actually looking at using a database too... and I am testing out a 
few different ones (SQLite and MySQL)

I appreciate the extra information, it will be helpful in the future :-)

/On a side note:
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 wanted to try a different approach by just creating  the recipes in  
individual  html files for the time being.

Do happen to know how to create html files from a php form?

Thank you.



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



Re: [PHP] PHP Application Structre

2010-05-12 Thread Kevin Kinsey

Peter Lind wrote:

On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote:

Ashley Sheridan wrote:

On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote:


Hi all,

mod rewrite was actually inrduced to have search engne frendly urls.
hnce if you want a seo site then you have to use options 1  2. using
smarty or any templating engine for readibility is not total  true.
one of the major advantages of using template engines is caching


I've read some {disparaging?) comments on option 2, but I've
got a question, or point, about that.  I'm not at all sure that
you have to use mod_rewrite at all, can't you just use a
FORCETYPE directive on your handler script(s)?

I've certainly got some work in the form:

somesite.com/scriptname/var1/var2/var3

that seems to work well with no use of the rewrite module.



And why wouldn't you want to use mod_rewrite? It's an extremely
powerful tool that does the job really well.


Well, again, I'm not purporting to be an authority, but the
first thing that comes to mind is that my reasoning would be
much the same as my reasoning in building stuff:  I've got a nice
STIHL chainsaw, but I don't need it to cut two-by-fours, and
I've got access to a Hole Hawg but don't need it to make a
path for a CAT5 cable.  I guess you could call the concept
avoiding overkill, but I'm not cognizant enough with the
inner workings of Apache to know really how much of a hit
the rewrite module makes.  I suppose, in terms of computing, it's
kind of similar to a Unix philosophy:  small tools that
do one job without extra fluff.

KDK

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



Re: [PHP] PHP Application Structre

2010-05-11 Thread Kevin Kinsey

Ashley Sheridan wrote:

On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote:


Hi all,

mod rewrite was actually inrduced to have search engne frendly urls.
hnce if you want a seo site then you have to use options 1  2. using
smarty or any templating engine for readibility is not total  true.
one of the major advantages of using template engines is caching



I've read some {disparaging?) comments on option 2, but I've
got a question, or point, about that.  I'm not at all sure that
you have to use mod_rewrite at all, can't you just use a
FORCETYPE directive on your handler script(s)?

I've certainly got some work in the form:

somesite.com/scriptname/var1/var2/var3

that seems to work well with no use of the rewrite module.



Aside from the fact that I've yet to find any actual evidence that
search engines treat what most people consider 'search engine friendly'
urls any different from the 'unfriendly dynamic' ones. Next time you
search for something online have a look at the URLs and see how many
belong to forums with dynamic URLs. More than you'd think I would
imagine, but it does go a long way to prove that most search engines
don't give much credence to the URL these days.

Of course, it does help if your keywords are in the URL, but I've not
noticed much of a difference between:

somesite.com/page-about-subject
and
somesite.com/?page=page-about-subject


I think that this may be an artifact of an earlier time.  There
was a time when SE's didn't do so well with query strings, but it'd
be a little silly to think their owners didn't realize this and left
things exactly the way they were back in 2002 ... wouldn't it?

My $0.02,

Kevin Kinsey

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



Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Kevin Kinsey

Richard Quadling wrote:

On 25 April 2010 14:16, tedd t...@sperling.com wrote:

What's your game?


Ooh, do we *have* to tell?

I've got interest in the AOE stuff, but haven't played in
a while.  Haven't purchased AOE3.  If I'm *really* bored,
I've got freecell.exe running on every O.S. I run

I'm also a Player Moderator in a large MMORPG, but
I'm not sure I should say which one ... Mods there
are big targets; suffice it to say it's a love/hate
relationship, and I either need counseling or to go
work on my combat skills RIGHT AWAY!!!

KDK

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



Re: [PHP] PHP not being read?

2010-04-25 Thread Kevin Kinsey

Gary wrote:

Peter

Check that the php module is loaded by Apache on the 'bad' machine and
that the proper handler is set. Should be a line like:
AddHandler application/x-httpd-php .php .phtml .php3

I have been looking through some of the files, but frankly it is a 
combination hunt and peek and a guessing game, I'm just not sure which 
file to look in or where to find that file. I have done a few searches 
for addhandler and have not found it.


Could you point me in the right direction?


Find the file httpd.conf.  I've no idea what OS you're on;
a classical location might be something like:

{/usr/local}/etc/apache/httpd.conf

HTH,

Kevin Kinsey

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



Re: [PHP] Re: replying to list (I give up)

2010-04-23 Thread Kevin Kinsey

Bobby Pejman wrote:
I must say, I never heard or even thought of the idea of calling it 

 LookOut. Hahaha.  It made me laugh for a good 10 minutes and
 if that term is open source, I will be using it ;)

I've still got a Win98 box in service somewhere around here; I use
it for audio recording.  Someone (possibly even me) renamed most
of the desktop icons ... OE's shortcut is Outluck Depress.  :-)

Kevin D. Kinsey

FWIW:  Lists that set reply to sender:  All FreeBSD.org lists
Lists that set reply to group:  All Yahoo Groups lists
My prefs:  I couldn't care less, really.


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



Re: [PHP] Mail Function Using PEAR Issues

2010-04-18 Thread Kevin Kinsey

Karl DeSaulniers wrote:

Hey Alice,
Again, try throwing the MIME in.

$headers  = 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=utf-8' . \r\n;


Also:

$headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n;

  Which I suggested on your previous thread.  Also, I see you have
$from set to equal localhost.  Many SMTP servers will reject this
I *think*, because localhost is a hostname, not a working mailbox.
Try making $from equal to a real working address - possibly the same
one as your Errors-to: header..

My $0.02,

KDK



On Apr 18, 2010, at 10:11 AM, Alice Wei wrote:



Hi,

  After several days, I have rebuilt my system on Linux using Ubuntu, 
installed PEAR and such. Thankfully, when I execute the code, it no 
longer gives me the error that the class is not found. Yet, when I 
submit the form now, I can always see the confirmation message telling 
me that my message has been sent, but I cannot see it even in another 
mailbox.


Here is the code:

require_once(Mail.php);
$mail = Mail::factory(mail);

$your_name = $_POST['your_name'];
$email = $_POST['email'];
$question = $_POST['question'];
$comments= $_POST['comments'];
$submit = $_POST['submit'];

$from = localhost;
$to =  $email;
$subject = Comments;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: 
$question\n Comments:\n $comments;


$host = localhost;
$headers = array ('From' = $from,'To' = $to,'Subject' = $subject);
$mail -send($to, $headers, $body);
if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p;
else {
   echo pMessage successfully sent!/p div id='main'
   h1Thank You For Contacting Us/h1
   pWe will contact you within the next b24 business 
hours/b./p

   pHere is what you have input:/p
   ulliYour Name is b . $your_name .  /b/li
   liYour Email is b . $email . /b/li
   liYou contacted us because you have a b . $question . 
/b/li

   liHere are your comments: b . $comments . /b/li/ul
 h1Have a Nice Day!/h1/div;
  }
}

Can anyone on the list please give me some pointers on what might have 
been wrong here? I have not edited anything in the php.ini file 
regarding SMTP.


Thanks.

Alice



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



Re: [PHP] Mail Function Using PEAR Issues

2010-04-18 Thread Kevin Kinsey

Alice Wei wrote:



Date: Sun, 18 Apr 2010 21:02:29 -0500
From: k...@daleco.biz
To: aj...@alumni.iu.edu
CC: k...@designdrumm.com; php-general@lists.php.net
Subject: Re: [PHP] Mail Function Using PEAR Issues

Karl DeSaulniers wrote:

Hey Alice,
Again, try throwing the MIME in.

$headers  = 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=utf-8' . \r\n;

Also:

$headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n;

   Which I suggested on your previous thread.  Also, I see you have
$from set to equal localhost.  Many SMTP servers will reject this
I *think*, because localhost is a hostname, not a working mailbox.
Try making $from equal to a real working address - possibly the same
one as your Errors-to: header..

My $0.02,

KDK


On Apr 18, 2010, at 10:11 AM, Alice Wei wrote:


Hi,

  After several days, I have rebuilt my system on Linux using Ubuntu, 
installed PEAR and such. Thankfully, when I execute the code, it no 
longer gives me the error that the class is not found. Yet, when I 
submit the form now, I can always see the confirmation message telling 
me that my message has been sent, but I cannot see it even in another 
mailbox.


Here is the code:

require_once(Mail.php);
$mail = Mail::factory(mail);

$your_name = $_POST['your_name'];
$email = $_POST['email'];
$question = $_POST['question'];
$comments= $_POST['comments'];
$submit = $_POST['submit'];

$from = localhost;
$to =  $email;
$subject = Comments;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: 
$question\n Comments:\n $comments;


$host = localhost;
$headers = array ('From' = $from,'To' = $to,'Subject' = $subject);
$mail -send($to, $headers, $body);
if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p;
else {
   echo pMessage successfully sent!/p div id='main'
   h1Thank You For Contacting Us/h1
   pWe will contact you within the next b24 business 
hours/b./p

   pHere is what you have input:/p
   ulliYour Name is b . $your_name .  /b/li
   liYour Email is b . $email . /b/li
   liYou contacted us because you have a b . $question . 
/b/li

   liHere are your comments: b . $comments . /b/li/ul
 h1Have a Nice Day!/h1/div;
  }
}

Can anyone on the list please give me some pointers on what might have 
been wrong here? I have not edited anything in the php.ini file 
regarding SMTP.


Thanks.

Alice


Hi, 

Here is the revised version, and I don't think I have experienced any  

 changes in terms of the output on the screen. Plus, I still get no email.


?php

require_once(Mail.php);
$mail = Mail::factory(mail);
$your_name = $_POST['your_name'];
$email = $_POST['email'];
$question = $_POST['question'];
$comments= $_POST['comments'];
$submit = $_POST['submit'];
$from = aj...@alumni.iu.edu;
$to =  elite.engl...@gmail.com;
$subject = Comments;

$body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n
 Comments:\n $comments; 


$headers =  'MIME-Version: 1.0' . \r\n;

$headers .= 'Content-type: text/html; charset=utf-8' . \r\n;

$headers .= 'Errors-to: elite.engl...@gmail.com' . \r\n;

$mail -send($to, $headers, $body);

if (PEAR::isError($mail)) echo p . $mail-getMessage() . 
/p;


else {

   echo pMessage successfully sent!/p div 
id='main' 


   h1Thank You For Contacting Us/h1

   pHere is what you have input:/p

   ulliYour Name is b . $your_name .  
/b/li


   liYour Email is b . $email . 
/b/li


   liYou contacted us because you have a b . 
$question . /b/li


   liHere are your comments: b . $comments . 
/b/li/ul


 h1Have a Nice Day!/h1/div;

  } 

I have made sure that my $from and $to addresses are different, 

 Could there be anything else wrong here? I have not edited
 anything in php.ini regarding this issue. Would I need to?

Well, it's a Good Thing(tm) to know what those settings are.
Have they changed since your last thread?

KDK


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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Kevin Kinsey

Paul M Foster wrote:


Sorry, I just get cranky with people who won't follow the rules.



?php

$pauls_post++;

?

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Kevin Kinsey

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:40 PM, Robert Cummings rob...@interjinn.comwrote


I had a pair-a-dimes one time. Unfortunately I was a nickel short of a
quarter to put in the slot.

But the question is... were they outside the box?




Nah, the question is, since the slot was intended to accept a quarter,
why the heck didn't it take two dimes and a nickel ... or just two dimes,
and throw a nickel in gratis?

I must be getting old.  We have toilets that flush themselves now.
WTF happened to grown up being equal to taking responsibility
for things?

KDK

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



Re: [PHP] Mail Function Problem

2010-04-12 Thread Kevin Kinsey

Alice Wei wrote:

Hi!
You have the following php.ini params:SMTP = smtp.live.com

smtp_port = 587
live.com not support relay and it requires authentication.


Is there an email account that I could try? I thought 

 most email accounts requires authentication anyway.

Well, therein lies the rub, as the Bard said (maybe).
PHP's mail() was built on a general assumption that
there would be a local SMTP server.  It supports remote
SMTP, but I'm not aware of any ability to do SMTP auth,
even in the PEAR packages.

You might just wanna read up on mail in general.  The
php.net/mail page lists several relevant RFC's, and
has links to most of the PEAR mail classes, etc.

You should definitely read up on live.com's email
configuration.  If they use SMTP auth, I'm not sure
you can do this (per above).  If it uses, say, POP
before SMTP for authorization, you might be able to
hack something together with the PHP IMAP functions, or
even sockets, but you're getting into a big lotta work
for what seems a small thing.

Kevin Kinsey

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



Re: [PHP] Mail Function Problem

2010-04-12 Thread Kevin Kinsey

kranthi wrote:

PEAR's mail package does support authentication.
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm



I will say mea culpa on this one; apparently I didn't
dig deep enough into the PEAR docs to figure this out.
It's certainly not mentioned on the manpage at php.net,
but, of course, the PEAR stuff is elsewhere.  I read over
the first page linked from the PHP manpage, so it must
have been a lil' deeper than that.  If it's only available
at about.com (lol), I'd suggest filing a PR with the PEAR
folk's documentation team, eh?

But, this time I'll do what I shoulda mentioned before and
include the IANAE disclaimer on all things PEAR, many
things PHP, and some things SMTP.

Kevin Kinsey

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



Re: [PHP] Mail Function Problem

2010-04-11 Thread Kevin Kinsey

Alice Wei wrote:
Hi, 

I have an issue here where I see no PHP errors on my mail 

 function usage, and yet I am not getting the mail in the
 desired account. Here is what I have for my PHP code:


$headers = From: aj...@alumni.iu.edu;
$to = aj...@alumni.iu.edu ;
$subject = Comments Regarding My Studio;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n 
$comments;
mail($to, $subject, $body,$headers);


I don't see any way for you to know if there are any errors.

Try this as a very basic start:

$headers = From: aj...@alumni.iu.edu;
$to = aj...@alumni.iu.edu ;
$subject = Comments Regarding My Studio;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n 
$comments;
$success=mail($to, $subject, $body,$headers);

if ($success) {
   echo Mail was sent successfully!;
} else {
   echo Sending of mail failed!;
}




This is what I have in my PHP.ini:

[mail function]
; For Win32 only.
SMTP = smtp.live.com
smtp_port = 587

; For Win32 only.
sendmail_from = aj...@alumni.iu.edu

; For Unix only.  You may supply arguments as well (default: sendmail -t -i).
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra 
parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can

 anyone on the list please give me some pointers on what I may have done wrong 
here?

Thanks for your help.


Thanks to the worldwide brotherhood of crooks known as spammers,
sending e-mail these days isn't nearly as easy as PHP makes it look.
You might wanna look into an errors-to header to help debug any
problems with sender authorization, bad ports, etc.

HTH,

KDK

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



Re: [PHP] Greate day for you,

2010-04-07 Thread Kevin Kinsey

Nilesh Govindarajan wrote:

On 04/07/10 21:41, Chris G wrote:

http://sites.google.com/site/vfgbyuhoi6/kewe2w





snip


Is there no spam filter at lists.php.net ?


Does your filter catch 101% of all of it?  That's
the only one I've seen in a Long Time(tm).

Just asking :-)

Kevin Kinsey



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



Re: [PHP] Re: Logical reason for strtotime('east') and strtotime('west') returning valid results?

2010-04-06 Thread Kevin Kinsey

Colin Guthrie wrote:

'Twas brillig, and Kevin Kinsey at 05/04/10 19:15 did gyre and gimble:

Nonetheless, I'm suspecting the programmers had something
like this in mind. 


Yeah I guess that's why it interprets these terms. Good thinking :)


Isn't strtotime() based on some GNU utility?


Yeah, that's why I said the relevant authorities. I couldn't remember
off-hand where it came from so figured I'd not blame PHP just yet :p


Apparently these strings are being recognized as TZ stamps, but the underlying
logic is not fully implemented: see
http://www.gnu.org/s/libc/manual/html_node/Low_002dLevel-Time-String-Parsing.html

Try it with some TZ stamps ... I'm pretty sure that in the previous
example it was taking East to be EST, as I observed (rather by
accident) earlier.

Kevin Kinsey

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



Re: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) - established connection failed because connected host has failed to respond

2010-04-03 Thread Kevin Kinsey

SumarliĆ°i Einar DaĆ°ason wrote:


I have setup PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit)  with success.
phpinfo() shows the MySQL extension loaded, but when I try to use
mysql_connect( $host, $user, $password ) in a PHP script I get following
error:

PHP Warning:  mysql_connect() [a
href='function.mysql-connect'function.mysql-connect/a]: [2002] A
connection attempt failed because the connected party did not  (trying to
connect via tcp://localhost:3306) in C:\inetpub\wwwroot\old\index.php on
line 29

I have search on the Internet for a solution for this but without any luck.
Any ideas?


Yes, first check that MySQL is actually listening on port 3306
(Netstat should do that trick), and, if it is, try turning your
firewall off.  What is the value of $host?

KDK



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



Re: [PHP] How to know which PHP is used by Apache

2010-04-01 Thread Kevin Kinsey

Devendra Jadhav wrote:



I am still confused. As per Nilesh php's binary is not required and as per
Ashley it is required.
Which one is correct?
And I am not able to find which php's binary is used by using phpinfo().


Anyone confident about either of the two answers?


Pretty confident about all of them.  Nilesh probably misunderstood,
or we are misunderstanding him.  PHP has to have a binary file,
whether it's the CLI interpreter or the Apache module.

Run a script with phpinfo() in it.  Look for the line that says
Server API.  If this reads something like Apache $N.$N Handler,
then the PHP interpreter binary is something like libphp$n.so.
If the line reads Command Line Interface, then you are using
something like /usr/bin/php, /usr/local/bin/php, etc. (I'm from
a BSD background, your $penguin_path may vary).

If you are talking about actually having two different versions
of PHP installed, and not sure which is actually being called,
you might find out something with the Linux equivalent of the
BSD `pkg_which`:

[31] Thu 01.Apr.2010 10:39:24
[ad...@archangel][/usr/local/bin]
sudo pkg_which /usr/local/bin/php
php5-5.2.11

This command is highly dependent on your Linux distro:  on
RH I think it's rpm, dpkg on Debian, urpmf on Mandriva,
etc.

If you have two installations of the same version, $deity
help you :-)

HTH,

Kevin Kinsey

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



Re: [PHP] How to know which PHP is used by Apache

2010-04-01 Thread Kevin Kinsey

Nilesh Govindarajan wrote:

libphp5.so doesn't need the php binary.


You're right, and of course not.  libphp5.so
*is* a PHP binary  :-)


I've confirmed this using a test.

My local apache is configured to use libphp5.so

I moved /usr/bin/php to /root, then started apache and ran drupal. It 
worked.


This confirms that libphp5.so is independent of the php binary in 
/usr/bin as I suggested earlier.


No one was questioning that .. or at least, I wasn't.
One is an executable binary file ... a program.

The other is also a binary file, but it's a _library_.

What I said was you need one or the other.  A binary
file, either the Apache SO or the binary interpreter...

It's possible to configure Apache to use a PHP executable
(CGI), and the CGI and CLI executables are similar, if
not identical.

I dunno if anyone actually does that anymore, though.  :-)

Ashley said The libphp5.so is the Apache module that
links PHP into Apache. You need this and PHP installed
if you want to use PHP in Apache.  Devendra apparently
misinterpreted this to mean that you need both the SO and
the binary interpreter, but you don't.  You DO need the
rest of the PHP extensions, libraries, config files, etc.
 ... a PHP installation, whether or not your have the
CLI binary is not that important, although I always do
since I like to run system scripts in PHP via cron, etc.

Kevin Kinsey

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



Re: [PHP] File encryption under PHP

2010-04-01 Thread Kevin Kinsey

Paul M Foster wrote:

Folks:

If I wanted to encrypt a file in PHP and then write it out to disk
(one-way encryption, requiring a password), what PHP built-ins might you
recommend to encrypt the contents of the file before writing it out to
disk?

Paul


Here's a very generic mcrypt example.  IANAE
where security is concerned, but from what I've
read, BLOWFISH should be a fairly decent algorithm
for most applications.  This isn't my work, can't
remember whose ... uses 3DES.

KDK


?php
$plaintext = Four score and seven years ago;
$cipher = MCRYPT_TRIPLEDES;
$mode = MCRYPT_MODE_ECB;
$rand_src = MCRYPT_DEV_RANDOM; //MCRYPT_DEV_RANDOM
$password = 'Extra secret password';

print (Plaintext: $plaintext\n);

// OK, let's encrypt the data
$handle = mcrypt_module_open ($cipher, '', $mode, '');
if (!$handle)
die (Couldn't locate open mcrypt module for '$cipher' algorithm);
$iv_size = mcrypt_enc_get_iv_size ($handle);
$ivector = mcrypt_create_iv ($iv_size, $rand_src);
if (mcrypt_generic_init ($handle, $password, $ivector) == -1)
die (Error: mcrypt_generic_init() failed.);
$ciphertext = mcrypt_generic ($handle, $plaintext);
mcrypt_generic_end ($handle);

echo br Ciphertext:  . bin2hex ($ciphertext) . \n;

// Now let's decrypt it
$handle = mcrypt_module_open ($cipher, '', $mode, '');
if (!$handle) die (Couldn't locate open mcrypt module for '$cipher' 
algorithm);

if (mcrypt_generic_init ($handle, $password, $ivector) == -1)
   die (Error: mcrypt_generic_init() failed.);
$plaintext = mdecrypt_generic ($handle, $ciphertext);
mcrypt_generic_end ($handle);

echo br Plaintext: $plaintext\n);
?

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



Re: [PHP] open source bookshop

2010-03-17 Thread Kevin Kinsey

Ali Reza Sajedi wrote:

Hello all,

Does anybody know a good open source bookshop/bookstore system written 
in php+mysql?


Google and sourceforge search didn't yield good results.

Any hint would be very much appreciated.


SAM'S published a PHP book some years ago that had just
such an app in demo form, on CD, included.  A big purple
book.  The app was basically a shopping cart system, but
it was specifically for books.  Might be a good way to
learn something and a good framework for further customization.

Given that it's a few years old, though, you'd want to
definitely do some reading on security best procedures
and changes since PHP 4

As for the rest of the discussion, a bookshop could
easily be most of the standard cart-type apps.  Since
they have only a few characteristics, it's much easier
than, for example, retail clothing ;-)

HTH,

Kevin Kinsey

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



Re: [PHP] PHP Sessions

2010-03-12 Thread Kevin Kinsey

Martine Osias wrote:

Hi:

I need to store variables to send then between pages. I don't need the 
variables in a database so I try to send them with sessions. The 
variables don't seem to be there when I try to get them. What could be 
the problem. Here are the pages where I store and retrieve the variables.


Page 1 (variables stored):

?php

session_start();

$_SESSION['scripture_text']  = $row_scripture['ScriptureText'];
$_SESSION['scripture_ref']  = $row_scripture['ScriptureRef'];


Do sessions work at all?  Something simple, like


?php
//a.php

session_start();
$_SESSION['test']=foo;
echo 'a href=b.phpClick me/a';
?

?php
//b.php

session_start();
echo $_SESSION['test'];  // should say foo
?
*

 ... would be a good 1st test.

If that works, I'd suspect that $row_scripture['ScriptureText']
and friends are empty.

If it doesn't, I'd suspect a combination of very strict
browser privacy settings (disallow all cookies) with lame server
config (use_only_cookies), or that session support is missing
or disabled.

HTH,

KDK

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



Re: [PHP] PHP Sessions

2010-03-12 Thread Kevin Kinsey


Forgot to mention, you could check into the privacy
vs. server settings by doing:

   session_start();
   echo session_id();

on both pages.  If they're different, then
this is the problem.

KDK

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



Re: [PHP] PHP MySQL Insert Statements

2010-03-11 Thread Kevin Kinsey

Martine Osias wrote:

Hi,

My insert statements on this web page don't execute. The select 
statements do work. This tells me that the database connection is 
working. The username and password are the administrator's. What else 
could prevent the insert statements from executing?


Thank you.


Martine



Should be trivial to find out what's happening.  Something
like:

$success=mysql_query($insert_statement) or die(Uh-oh, mysql 
said:.mysql.error());


HTH,

Kevin Kinsey

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



Re: [PHP] EHLO error 554: what can it be?

2010-03-09 Thread Kevin Kinsey

Thilo Klein wrote:

Kevin Kinsey schrieb:

Andre Polykanine wrote:

Hello everyone,

I'm writing a class to send mail via an SMTP server with authorization.
Everything seems to work but I get an EHLO error:
554 SMTP synchronization error
Where should I look to avoid this?
Thanks!




Be polite :-D

Make sure your class waits for the other server's greeting
before you send HELO/EHLO.  ;-)

HTH,

Kevin Kinsey


He is polite. You are not.



I'm afraid that you've misinterpreted at the very least.

I'm not accusing him of being impolite, but saying that
what is probably happening is that his script is sending
HELO/EHLO before the receiving server sends its greeting.

Im comparing that to talking when you should be listening,
which is impolite in general conversation, at least where
I live.

If Andre really thought I meant he was impolite, I apologize.
I did not.  That is, incidentally, the reason there is a
smiley there.

Also, I have to beg this question:  if I am impolite,
then why am I the only person who has attempted to
answer his question thus far?  ;-)

KDK

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



Re: [PHP] EHLO error 554: what can it be?

2010-03-08 Thread Kevin Kinsey

Andre Polykanine wrote:

Hello everyone,

I'm writing a class to send mail via an SMTP server with authorization.
Everything seems to work but I get an EHLO error:
554 SMTP synchronization error
Where should I look to avoid this?
Thanks!




Be polite :-D

Make sure your class waits for the other server's greeting
before you send HELO/EHLO.  ;-)

HTH,

Kevin Kinsey

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



Re: [PHP] Mail Function In PHP

2010-03-06 Thread Kevin Kinsey

Kannan wrote:

Hello
   I am creating a application for our college using the
php.In that i want to send mail to all who are all the list.

For that i am just simply use the mail function in php without
configuring any mail system in the system.But the mail didn't send.
For sending the mails wat are requirements and if u have any tutorials
send it to me?

Thanks..


Hello,

Read the manual page for the mail() function ...

http://www.php.net/mail

Mail() requires an operating SMTP server.  This can be set
in php.ini, and possibly via the ini_set() function.  These
might be worth looking into:

$config1=ini_set(sendmail_path,/usr/sbin/sendmail -t -i);
$config2=ini_set(SMTP,localhost);
$config3=ini_set(smtp_port,25);

If you absolutely can't run an SMTP server or use a
remote server, you'd probably have to hack something
together with sockets or streams.

My $0.02,

Kevin Kinsey

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



Re: [PHP] Parse a string containing name and email

2010-03-06 Thread Kevin Kinsey

Don wrote:

Hi,

I am pulling email values out of a database and the format is as follows:

John Smithjohn.sm...@somedomain.com

I need to parse the string into two variables as such

$name = John Smith
$email = john.sm...@somedomain.com

What would be the easiest way to do this?

Thanks. 


[36] Sun 07.Mar.2010 0:27:35
[kad...@archangel][~/scripts] cat split
?php
$data=John Smithj...@foo.com;
list($name,$email)=explode(,str_replace(,,$data));
echo $name's email address is $email;
?

[37] Sun 07.Mar.2010 0:27:40
[kad...@archangel][~/scripts] php split
John Smith's email address is j...@foo.com

Throw in a foreach() and some data writes or w/e, and you're done.

Kevin Kinsey

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



Re: [PHP] How to get the 'return type' of a function?

2010-02-23 Thread Kevin Kinsey

Ashley Sheridan wrote:

is_quantum() is pretty useful as well, if you want to see if it's sort
of there and not at the same time. Probably turns into a cat in a box at
some point too, everything quantum has cats in...

Thanks,
Ash


So, should we add to the list:

is_schrodingers_cat_alive()

??

KDK

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



Re: [PHP] PHP6 Stable Release Schedule

2009-09-05 Thread Kevin Waterson
On Sat, 2009-09-05 at 16:11 +0100, Richard Heyes wrote:
 Hi (again),
 
  ?php
   error_reporting(E_STRICT);
  ?
 
 This might work better:
 
 ?php
   error_reporting(E_ALL | E_STRICT);
 ?

E_STRICT is now part of E_ALL

Kevin


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



Re: [PHP] templating engine options

2009-05-23 Thread Kevin Waterson
On Sat, 2009-05-23 at 23:21 +0100, Nathan Rixham wrote:
 Hi All,
 
 Just a quick one, can anybody recommend any decent templating engines 
 other than smarty.
 
 I've got no problem with smarty and it does the job - but if there is 
 something newer and lighter out there that I'm missing then I'd be a 
 fool not to at least consider it!
 
 can't be part of a framework, (or if it is easily extracted with no 
 framework dependencies), and not xslt (love xslt, but not many designers 
 do!).

eZ Components
Use just the template component

http://ezcomponents.org

Kevin
http://phpro.org



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



Re: [PHP] ImageMagick

2009-05-01 Thread Kevin Waterson
This one time, at band camp, Michael A. Peters wrote:
 Here's the scenario -
 
 Website has some demonstrative images.
 
 I create these images with the gimp - starting with a jpeg, adding a few 
 text layers and straight lines.
 
 I then save as xcf in case I ever need to edit.
 
 Then I export to jpeg, resize for thumb and export to jpeg again.


http://phpro.org/tutorials/Imagick.html

Kevin
http://phpro.org



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



[PHP] Eclipse, PDT plugins for hosting, scaling and managing PHP apps.

2009-04-30 Thread Kevin Hakman

re: Eclipse, PDT plugins for hosting, scaling and managing PHP apps.

Aptana has released a new suite of tools for PHP developers that extends the 
popular
Eclipse PDT environment. The plugin for Eclipse, called Aptana Cloud 
Connect, lets
you get all the benefits of scalable, on-demand PHP hosting in the Cloud 
with the ease
of integration right into Eclipse and PDT (You can plug it into Zend Studio 
as well).


A few clicks is all that's needed to get a running PHP, MySQL, Apache 
environment
running in about one minute.  Then the plugin lets you instantly scale your 
web and
database servers in the Cloud up or down anytime.  There's a very useful set 
of visual
database tools for working with your remote database.   For file transfers, 
there's a
Smart Sync utility that help you keep local projects coordinated with the 
remote sites.

You can do single file uploads/download and edits as well.

Try it out by adding Aptana Cloud Connect to your Eclipse 3.4 PDT 
installation.


Download and install instructions: 
http://update.aptana.com/install/cloudconnect/


More info at http://www.aptana.com/cloud 



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



Re: [PHP] Anyone fancy getting paid to improve my PHP in London?

2009-03-14 Thread Kevin Kinsey

Robert Cummings wrote:


You forgot to configure the auto_prepend:

php.ini:

auto_prepend = robs_harem.php


?php

system(/bin/cat robs_harem.php | /usr/bin/mail -s 'looky here' $robs_wife);

if (!defined($robs_wife_is_extremely_rare_woman)) {
  die($rob);
} else {
  $days=rand(7,365);
  $n=1;
  chmod($wife,0600); 
  while ($n$days) {

 fputs($rob,$couch);
 sleep(28800);
  }
}
?

Good luck, buddy ;-)

Kevin Kinsey

PS   why are all the trolls in this thread named some
variant of Kenzie?
--
Iowa State -- the high school after high school!
-- Crow T. Robot

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



Re: [PHP] Anyone fancy getting paid to improve my PHP in London?

2009-03-13 Thread Kevin Kinsey

Robert Cummings wrote:

Send me a blank cheque-- if it clears then I'll get back to you... from
someplace warm... by a beach while drinking martinis... and getting a
massage... from more than one lady...


should we forward this to your wife now, or after the check clears?


She's one of the ladies... she's in on it!!!


Warning:  constant ladies defined incorrectly in 
  1236973618.10169.75.ca...@localhost line 7


/troll
:-D

Kevin Kinsey
--
Even if you do learn to speak correct
English, whom are you going to speak it to?
-- Clarence Darrow

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



Re: [PHP] paging

2009-02-09 Thread Kevin Waterson
On Tue, 2009-02-10 at 03:26 +, Jim Douglas wrote:

http://phpro.org/tutorials/Pagination-with-PHP-and-PDO.html
 
 
 
 
 Does anyone have a link to any examples of paging?


Kevin
http://phpro.org


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



Re: [PHP] Re: frameworks

2009-01-30 Thread Kevin Waterson
On Fri, 2009-01-30 at 18:03 -0600, Shawn McKenzie wrote:
  From what I could tell, this was
 the best RAD, however if you prefer to lay everything out your own way
 and do things your own way then probably CI or Zend.

I use Zend every day in my current employ.
It is like pulling teeth and its feature set is not as rich as
they would have you believe.
Zend DB is pathetic
Zend Form (although not from Zend itself) is abstraction for
abstractions sake and is mind numbingly complex.
The lack of a model loader is laughable.
The list goes but you get the point, this is supposed to be from
the makers of PHP and is supposed to be a mature framework and
ready for enterprise level applications.
What a joke.

but, just my $0.02
Kevin


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



Re: [PHP] New PHP User with a simple question

2009-01-25 Thread Kevin Waterson
 
  Sorry, I am also new to the etiquette of these mail lists.

Hope this will get you started,

http://www.phpro.org/tutorials/Introduction-to-PHP-templating.html

Kevin

http://phpro.org


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



Re: [PHP] What's the best way to rotate, resize, and thumbnail?

2009-01-17 Thread Kevin Waterson
This one time, at band camp, Al n...@ridersite.org wrote:

 Imagick class.  Has more image manipulating functions than you'll ever use. 
 You 
 name, and there's function to do it.

http://www.phpro.org/examples/Create-Thumbnail-With-GD.html
http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html
http://www.phpro.org/examples/Imagick-Thumbnail-From-Center.html

but _do_ checkout imagick it has all the good toys
http://www.phpro.org/tutorials/Imagick.html

Kevin

http://phpro.org

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



Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, mike mike...@gmail.com wrote:

 On Fri, Jan 16, 2009 at 10:58 AM, mike mike...@gmail.com wrote:
 
  only if it's parseable xml :)
 
 
 Or not! Ignore me. Supposedly this can handle HTML too. I'll have to
 try it next time. Normally I wind up having to use tidy to scrub a
 document and try to get it into xhtml and then use simplexml. I wonder
 how well this would work with [crappy] HTML input.

$dom-loadHTML($html)

Kevin

http://phpro.org

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



Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, Eric Butera eric.but...@gmail.com wrote:

 
 You could also use DOM for this.
 
 http://us2.php.net/manual/en/domdocument.getelementsbytagname.php

http://www.phpro.org/examples/Get-Links-With-DOM.html


Kevin

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



Re: [PHP] Zend (or other) Framework...where to start?

2009-01-15 Thread Kevin Waterson
WRT Frameworks..
before I rant, I should declare myself as an ex-consultant to Zend.

I have used most of the more popular frameworks, and in my current employment
am using Zend Framework.

All of the frameworks I have used, have had some good features, and some 
poorly implemented ones. This, I beleive comes from people trying to make
the application all things to all people to fit all applications. This will
never happen, at some time, you need to code for yourself, which is why many
developers develop their own frameworks from the ground up, myself included.

Symphony I did not like at all, but it has a nice modular api, which CodeIgnitor
I spent nearly a year on a project and eventually came to be familiar with its
nuances. The good documentation of CI and examples I found refreshing.

Symphony, Cake, CI etc all have a single commong feature, they are not Zend.
Not that the Zend Framework is a total peice of crap ... mostly, but seems to
be the product of a tortured development process where comprimises have been
made by a committee.

Although not strictly part of the framework, Zend Form would have to be the 
biggest waste of time I have come across. Abstracted to the point of 
un-usability.
Much simpler/easier to write a HTML form.

A framework is not so much a tool to make your development faster, although this
will be the case, it is a tool to make your development constant. This means you
can easily, and rapidly deploy applications as you are familiar with the tool. 
The
speed of development comes as you become more familiar with the environment you 
are
developing in.

Try any of the frameworks, or write you own, just avoid Zend.

Kevin

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



Re: [PHP] print a to z

2009-01-15 Thread Kevin Waterson
This one time, at band camp, Leon du Plessis l...@dsgnit.com wrote:

 I used that notation before, and it did not work 100%. 
 Adapt as follows:
 
 for ($i = 'a'; $i = 'z'; $i++)
 if ($i == aa) break; else echo $i;
 


foreach(range('a', 'z') as $letter ) { echo $letter; }

Kevin


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



RE: [PHP] how does one bind a gui representation and a container object.

2009-01-08 Thread McClusky, Kevin - Sacramento
As an ammendum to the prior response, you may want to look into using
AJAX with a streaming connection to the server.  If you have a small
number of users, this works nicely (I have used it in production systems
before).

http://ajaxpatterns.org/HTTP_Streaming#Solution

If there are a large number of users expected, normal periodic AJAX
requests would be the way to go.


You'll have to use Ajax to make another HTTP request.

HTTP is not really designed for this, and it will make the site quite
sluggish most likely...

You should certainly make it an async call and not slow users down with
this feature.




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



RE: [PHP] how does one bind a gui representation and a container object.

2009-01-08 Thread McClusky, Kevin - Sacramento
Reading your original request a little more carefully, it appears you're
really looking for a way to immediately update the database when someone
changes a value in an HTML form.

Ajax is necessary.

Make an ajax call triggered by a change in the table's data, which sends
the change as GET or POST data.

Write a PHP script to accept the data and update the database.

If you want all users to see the change immediately, you'll also need to
create a mechanism to send any changes back to the users.  My prior
email is relevant for that part.

Good luck.


As an ammendum to the prior response, you may want to look into using
AJAX with a streaming connection to the server.  If you have a small
number of users, this works nicely (I have used it in production
systems before).

http://ajaxpatterns.org/HTTP_Streaming#Solution

If there are a large number of users expected, normal periodic AJAX
requests would be the way to go.


You'll have to use Ajax to make another HTTP request.

HTTP is not really designed for this, and it will make the site quite
sluggish most likely...

You should certainly make it an async call and not slow users down
with this feature.




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



Re: [PHP] RSS Feed on my PHP site

2009-01-06 Thread Kevin Waterson
This one time, at band camp, DanBarker85 danbarke...@hotmail.co.uk wrote:

 
 Hi
 
 i'm new to RSS Feeds, but how would it be possible to have a BBC News Feed
 added to my website?
 
 I've searched for some kind of tutorial but haven't found anything.

http://www.phpro.org/classes/Rss-Class.html

enjoy
Kevin

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



Re: [PHP] Image Resizing

2008-12-21 Thread Kevin Waterson
This one time, at band camp, Stephen Alistoun stephenalist...@gmail.com wrote:

 
 I want all the images to resize to 100px width but the height adjusts
 automatically.


Two ways, GD or Imagick

http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html

http://www.phpro.org/tutorials/Imagick.html#4

Kevin

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



Re: [PHP] First PHP program

2008-12-13 Thread Kevin Waterson
This one time, at band camp, Anwarulhaq anwarulha...@gmail.com wrote:

 I am working on MS.net.But now i days i want to work on PHP. I dont know the
 basis of PHP. Can any one guide me how i have to start with PHP and which
 editor i should use. Also the links of useful sites for help in PHP. I shall
 be thankful.

have a look at phpro.org and for an editor, well vi(m) of course ;)
set yourself a project to make something, start coding, and ask lots
of questions.

Kevin

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



Re: [PHP] Dates and Mysql

2008-12-10 Thread Kevin Waterson
This one time, at band camp, VamVan [EMAIL PROTECTED] wrote:

 I was wondering how is it possible for me to query the table to retrieve all
 the records that are one week less than the time stamp?


SELECT DATE_SUB(date_time_column, INTERVAL 1 WEEK) FROM your_table;
http://www.phpro.org/tutorials/Introduction-to-PHP-and-MySQL.html#45

Kevin

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



Re: [PHP] A MySQL Question

2008-12-07 Thread Kevin Waterson
This one time, at band camp, tedd [EMAIL PROTECTED] wrote:


 In any event, the interviewer asked me how long I've been using MySQL 
 and I replied several years. After which she asked a single question, 
 which was What does EXIST mean?
I only ever use it in rollbacks to check if a table exists. Not sure if
it has another purpose...


 I've read that the common way is to say My Squell, or something 
 like that. But I always sounded out each letter, such as My S-Q-L. 
 The interviewer pronounced it the same as I, but I have heard others 
 say it differently.

Only a barbarian would call it Sequel or anything other than
My S. Q. L MY ESS KEW ELL

Kevin

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



Re: [PHP] Job opportunity in Denver, CO - Jr. PHP developer needed

2008-12-05 Thread Kevin Waterson
This one time, at band camp, Nick Gasparro [EMAIL PROTECTED] wrote:

 The perfect candidate will possess the following skills:
 * Serious OO design background
 * PHP5 (this will be your primary language, though you can learn it on 
 the job )
 * Strong database design skills (MySql experience preferred)
 * Love of open source development and standards-based development
 * Expert understanding of JavaScript, XHTML, and the DOM
 * Strong communication skills and able to multi-task and project manage 
 well --

Hmm, all of this, I thought you wanted a Junior developer...

Kevin

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



Re: [PHP] store class zithin session

2008-11-20 Thread Kevin Waterson
This one time, at band camp, Alain Roger [EMAIL PROTECTED] wrote:

 Hi,
 
 i have a class and i would like to store it zithin session.
 i was thinking to use serialize/unserialize but it does not work.

http://www.phpro.org/tutorials/Introduction-To-PHP-Sessions.html#8

Kevin

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



Re: [PHP] Days until Easter and Christmas

2008-11-18 Thread Kevin Waterson
This one time, at band camp, tedd [EMAIL PROTECTED] wrote:

 Easter lands on different dates depending upon several different 
 factors. For example in Canada it's the day after it is in the USA -- 
 I guess Canadians are slower, eh?  :-)
 
 Also, in some religions the date is the full-moon after the Equinox 
 and not a specific date. Furthermore, the Equinox does not always 
 land on March 21, but sometimes it's March 20 (leap year).

So, the key is to find the date of the Vernal Equinox, which as you say,
does not always land on March 21. However, every 400 years, it does happen
on March 21 7:30am GST. From there, we can derive a base for future dates.
Every 4th year is a leap year, and every 4th century, giving 97 leap days
each 400 years. so (365*400+97)/400 is 365.2425 gives the length of each year.
Then the dates can be calculated as follows:

http://phpro.org/examples/Get-Vernal-Equinox.html

Any improvements welcomed

Kind regards
Kevin

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



Re: [PHP] question about google maps

2008-11-09 Thread Kevin Waterson

This one time, at band camp, Sudhakar [EMAIL PROTECTED] wrote:

 hi
 
 how do i go about displaying an address which appears on google maps for a
 business on a web page.
 
 what are the steps.
 
 if some one knows about this please let me know.

http://www.phpro.org/classes/Phproogle.html

and some docs at

http://www.phpro.org/classes/Phproogle-Docs.html

example code can be found at
http://www.phpro.org/examples/Google-Maps-With-PHP-And-Phproogle.html


Kevin


-- 
This email message (and any accompanying file attachments) may contain 
confidential or privileged information and is intended for the sole use of the 
addressee(s) named above. If you are not the intended recipient, or the person 
responsible for delivering this message to the intended recipient, please 
notify [EMAIL PROTECTED] immediately and destroy any copies of the original 
message.


Any unauthorised review, use, alteration, disclosure or distribution of this 
email (including any attachments) is prohibited.

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



[PHP] ANN: BrowserHawk for PHP

2008-09-22 Thread Kevin E
Hi all,

I wanted to share with you that we have (finally!) a version of BrowserHawk
that works great with PHP.  There is nothing to install to use it either.
Its called BrowserHawk To-Go (BHTG) an integrates instantly with any PHP
page(s) just by including a single line of code in the page.  See
www.cyscape.com/products/bhtg .

For a while now many PHP developers have been asking us to add PHP support
to BrowserHawk.  We initially tried to provide this by leveraging our
existing Java code base and making an interface to it through a PHP to Java
bridge.  However this was too complicated for many to get working and
performance was far from ideal.

BHTG, on the other hand, provides an instant drop in solution for PHP
developers that works extremely fast and is seamless.  Here is a summary of
what BrowserHawk does for unfamiliar with it:

  - detects 100+ browser/system properties including connection speed and
latency, installed plug-ins, browser type/version/platform, mobile devices,
Java settings, blocked popups and more. Essentially a robust and
comprehensive browser sniffer with big advantages over user agent sniffing
and how grown sniffers.

  - adds an instant browser troubleshooting page to any site, without any
programming required. You specify what your rules are (such as what
browsers and settings are required) and it presents the user with a
checklist and shows them where they are good and what needs to be fixed - an
provides self-help for the user to correct their incompatible settings or
missing plug-ins. It will also email you a report that contains the results
of their browser test and a description of the issue so you can troubleshoot
easily. Give it a try on this page:
www.cyscape.com/products/bhtg/bhtg_ret.aspx .

  - monitors the actual page load times as experienced by each user on the
site. This is not a ping test or synthetic monitoring, but rather the
*actual* load times, including latency, that each user experienced on each
page on your site.

  - tracks and reports back to you on any JavaScript errors users encounter
while on your site.  There are errors which occur in the wild which
developers often do not know about because with their test cases the errors
do not occur.

Also new is the pricing model.  With BHTG there are no upfront licensing
fees.  Instead you pay a small monthly fee (staring at $0.35 - $3.50) based
on your usage.  You pay for only what you use, and there are no minimums.

There is also a free version of BHTG you can use from development and
testing boxes. To try out the free account go to
www.cyscape.com/products/bhtg/signup.aspx.

For more information see www.cyscape.com/products/bhtg .

We're very much looking forward to the feedback from the PHP community on
how you like BHTG so please give it a try and let us know!

Thanks,

Kevin
Product Engineer
cyScape, Inc,
www.cyscape.com
Makers of BrowserHawk


Re: [PHP] ASCII Captcha

2008-09-14 Thread Kevin Waterson
This one time, at band camp, tedd [EMAIL PROTECTED] wrote:

 I fixed the errors you spoke about except I could never get the 
 Graphic CAPTCHA to fail.
 
 Also, you're supposed to click the accessibility icon to get the 
 page to speak the number.

What if the user is deaf and blind? they are denied access?

Kevin

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



Re: [PHP] Recursive Iteration over a collection of objects

2008-09-08 Thread Kevin Waterson
This one time, at band camp, David Lidstone [EMAIL PROTECTED] wrote:


 which with hindsight is completely illogical! I also wasn't aware of the 
 constants. Is there a simple tutorial / docs you know of for SPL? 

http://www.phpro.org/tutorials/Introduction-to-SPL.html

Kevin

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



Re: [PHP] Regex for email validation

2008-08-27 Thread Kevin Waterson
This one time, at band camp, Yeti [EMAIL PROTECTED] wrote:

 ?php
 # this one worked fine for me, but it does not cover the full RFC
 like: name [EMAIL PROTECTED] OR name [EMAIL PROTECTED]
 $regex = 
 ^[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+)[EMAIL
  PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$;
 if (eregi($regex, $email)) {
  // do something
 }
 # Beware that the filter functions only work under PHP5+. If your PHP
 supports them they should be the preferred choice
 ?

There is no silver bullet regex to validate all RFC compliant email address.
Many have tried, but they all fail at some point. The best you can do is
cater to most _sane_ addresses.

And when the domain name space is opened up, well, you will back to strpos() 
and @

Kevin

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-21 Thread Kevin Waterson
This one time, at band camp, Robert Cummings [EMAIL PROTECTED] wrote:

 Your assumption that this will occur is clearly based on false
 presumptions. For instance you assume that what has happened before will
 happen again. Secondly, your assertion that there are pedants waiting to
 pick apart poorly thought out arguments is baseless. Lastly, you forgot
 to send in your dues to the list to ensure unmolested posting of
 ridiculous statements.
 
 Please return to your rock and draw up another strategy to offend the
 list.

See what I mean?

Kevin

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-20 Thread Kevin Waterson
This one time, at band camp, V S Rawat [EMAIL PROTECTED] wrote:

 Sorry for bothering the rest of you. I hope you wouldn't really mind if
 some of our colleagues who are doing such a lovely volunteer work here
 get to earn some money for a bottle of beer and more. Rest assured that
 it is no fraud/ scam/ cheating. I am very much here to take the brickbats.

Oh my.. You will upset the list gods and guru's.
There will follow from this at least 50 mails saying how bad you are, followed
by a bunch of pedants that will pick holes in their arguments.

If you need some help, just drop me a mail

Kind regards
Kevin

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



Re: [PHP] Using Ajax to populate a drop-down list

2008-08-08 Thread Kevin Waterson
This one time, at band camp, Don [EMAIL PROTECTED] wrote:

 Does anyone have an example of how to do this?


http://phpro.org/tutorials/Creating-Dropdowns-with-PHP-and-Xajax.html

enjoy,

Kevin

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Kevin Waterson
This one time, at band camp, Richard Heyes [EMAIL PROTECTED] wrote:

 I'm interested - why are people still using PHP4? It's been over 4
 years (I think) - plenty of time to upgrade to five.

I asked that question and was called a troll...

Kevin

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



Re: [PHP] Web2.0 style tags - where to start?

2008-07-30 Thread Kevin Waterson
This one time, at band camp, Paul Jinks [EMAIL PROTECTED] wrote:

 Does anyone know of any good resources on building a tagging system? The
 video for now will be held on a normal LAMP machine as will everything
 else.

Tagging...
http://phpro.org/tutorials/Tagging-With-PHP-And-MySQL.html

Kevin

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



Re: [PHP] OpenID

2008-07-18 Thread Kevin Waterson
This one time, at band camp, Per Jessen [EMAIL PROTECTED] wrote:


 I'm curious, how does a domain get stolen ? 
This is a process I am now looking in to. The domain was registered
via a reseller who I also had an email address with. The reseller had access to
to both my domain registration details, and my email address. With both of these
they were able to simply enact a transfer and intercept the mail agreeing to the
deal.

I now have documentary proof of this from the gandi and have contacted the 
Australian
Police regarding the matter. I am also trying to get the domain back via icann 
and
mediation, which has so far cost me over $1k.

Kevin

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



Re: [PHP] OpenID

2008-07-17 Thread Kevin Waterson
This one time, at band camp, Alex Chamberlain [EMAIL PROTECTED] wrote:


 Has anybody had any success implementing an OpenID server in PHP??

Sure, I had mine all set up on oceania.net and then the domain got
stolen. So, all my OpenID info went with it.. not as good an idea as
it first seems.


Kevin

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



Re: [PHP] IPv6 validation

2008-07-13 Thread Kevin Waterson
This one time, at band camp, Per Jessen [EMAIL PROTECTED] wrote:

 No, it's a simple matter of need.  People also run apache 1.x, mysql 3.x
 etc.  There are still Linux 2.2 and 2.4 systems out there too.

4 years its been, thats incompetence.

Kevin

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



Re: [PHP] IPv6 validation

2008-07-12 Thread Kevin Waterson
This one time, at band camp, Yeti [EMAIL PROTECTED] wrote:

 Now i was wondering of what there might be the best way to validate an IPv6
 address.

from this url..
http://phpro.org/tutorials/Filtering-Data-with-PHP.html#9

?php

/*** an IP address ***/
$ip = 2001:0db8:85a3:08d3:1319:8a2e:0370:7334;

/*** try to validate as IPV6 address ***/
if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE)
{
echo $ip is not a valid IP;
}
else
{
echo $ip is valid;
}
?

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



Re: [PHP] IPv6 validation

2008-07-12 Thread Kevin Waterson
This one time, at band camp, Yeti [EMAIL PROTECTED] wrote:

 It will still take some time until every provider has PHP5 running, at least
 where I am from. I have many customers who want me to get their sites
 running on some cheap webspace they got along with their internet
 connection. Then you have to tell them it won't work because of some problem
 with the versions. I would love to write code for PHP5+ only.This is a 
 terrible excuse for using 

PHP 4. Today, July 13, marks 4 years since
the release of PHP 5.0. _4 YEARS_ to move applications and code to PHP5.

Its either apathy or incometence.
Kevin

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



Re: [PHP] PDO Question. Number of rows returned

2008-07-12 Thread Kevin Waterson
This one time, at band camp, Stephen [EMAIL PROTECTED] wrote:

 I am switching to PDO and can't find an equivalent to mysql_num_rows.
 
 Am I missing something silly?
 
 Or is there a change of thinking needed for PDO?
 
 How should I determine how many rows a query returned?

PDO returns an array, sizeof/count will get you home

Kevin
http://phpro.org

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



Re: [PHP] Dynamic dropdown lists (select)

2008-04-06 Thread Kevin Waterson
On Fri, 2008-04-04 at 12:51 +0200, Angelo Zanetti wrote:

 So there will be 2 dropdown lists. First one say gets (for example) a list
 of cars, 
 
 Then once the car is choosen the second list is populated with the list of
 models for the car choosen.


Try something like this-
http://phpro.org/tutorials/Creating-Dropdowns-with-PHP-and-Xajax.html

It gives you goodness you desire

Kevin


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



Re: [PHP] objects stored in sessions

2008-04-06 Thread Kevin Waterson
On Sun, 2008-04-06 at 11:02 -0400, Mark Weaver wrote:

 So, if I create a user object, set the properties of said user object 
 and store that object in the user session will that object be available 
 throughout the application from the session?


http://phpro.org/tutorials/Introduction-To-PHP-Sessions.html#8


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



[PHP] MS purchase Yahoo

2008-03-31 Thread Kevin Waterson
Did they finally do it or is April fools com early?

http://digg.com/business_finance/Microsoft_Purchase_Yahoo_For_62_Billion

K


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



Re: [PHP] MS purchase Yahoo

2008-03-31 Thread Kevin Waterson
On Mon, 2008-03-31 at 17:05 -0700, mike wrote:
 You are pathetic. Spamming your own fake digg article to your own fake
 news story and didn't even take the effort to host it on another
 domain?

BWHAHAHAHHAA

Thanks, nice reaction, made my day,
do you have more?

Kev




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



[PHP] Using CURLOPT_TIMEOUT_MS correctly?

2008-01-28 Thread Kevin Eppinger
T'he behavior I'm experiencing from
using this option (CURLOPT_CONNECTTIMEOUT_MS, also) is strange.  Here is a code 
snippet:
--
$c = curl_init(www.google.com);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($c, CURLOPT_TIMEOUT_MS, 500);
$resp = curl_exec($c);

--

This ALWAYS returns an errno 28 (Timeout was reached) for ANY URL that I try.  
The only way I can get it to work is if I set the MS timeout value = 1000.  I 
can set it to 999 and it immediately fails, but bump it up to 1000 and 
everything is fine.  Is anyone else seeing this behavior?
--

My PHP-
PHP 5.2.5 (cli) (built: Jan 24 2008 17:17:05)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

My cURL-
curl 7.17.1 (i686-pc-linux-gnu) libcurl/7.17.1 OpenSSL/0.9.7e zlib/1.2.2
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IPv6 Largefile NTLM SSL libz
--
Thanks for any help you can provide.

-Kevin

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



[PHP] // ?

2007-12-04 Thread Kevin Schmeichel
Here's some unexpected behavior:

?php
// ? what?
?

This will output what? - I expected no output, as is the case if the
inline comment was a /* */ comment.  Is this a bug?

Kevin

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



[PHP] Regex for Advanced search feature

2007-10-19 Thread Kevin Murphy
I'm trying to create an advanced search feature for my site, and I  
have it mostly working the way I want. I take whatever search term  
($searchkey) that the user submits, explodes if off any spaces  
between words, and then use that to search for each word separately.


$keys = explode( ,$searchkey);

So the search phrase of:

Dog Cat Horse

would output :

Array
(
[0] = Dog
[1] = Cat
[2] = Horse
)

However, I would like to add the ability to have phrases in there  
indicated by  marks. So, if the search phrase was this:


Dog Cat Horse

It would output:

Array
(
[0] = Dog Cat
[1] = Horse
)

My concept to solve this is right before I explode the keys as above,  
to replace any spaces within  marks with a garbage string of  
characters (say XX) using a regular expression, and then  
later replace it back with a space. However, I suck at regular  
expressions and can't figure it out.


Anyone have a way for me to accomplish this with a regular expression  
or with another method?


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.





[PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy
I've got a little function that just checks to see if something is in  
a mysql db. There are several ways to do this and was curious as to  
the best way. The following are 2 (simplified) versions that work  
just fine. If these are the best ways, which of the following is  
better from a performance standpoint. And if there is a way that is  
better than one of these, I'd love to know what that is.


$query = SELECT count(id) as count FROM wncci_intranet.iAdmin_users  
WHERE name = '$name' LIMIT 1;

$results = mysql_query($query);
$row = mysql_fetch_array($results);
$count = $row[count];
return $count;

OR

$query = SELECT id FROM wncci_intranet.iAdmin_users WHERE name =  
'$name' LIMIT 1;

$results = mysql_query($query);
$count = mysql_num_rows($results);
return $count;


Thanks.

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.





Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy


Is this a joke?  You are using a LIMIT 1, so your count is always  
going to be 1.


No, its not a joke. The answer is not going to always 1, its going to  
be 1 (the value exists in the DB at least once) or 0 (the value  
doesn't exist in the DB), that's what I am trying to test for. I  
don't need to know how many times something exists, just if it does.


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

Re: [PHP] Re: strpos error (I'm missing something obvious)

2007-10-02 Thread Kevin Murphy
Thanks for the info. I've modified the script to reflect that. I  
actually ended up reversing it, and so I used !== 0 which should work  
just the same.


All this is a minor portion of a much larger security scheme for an  
intranet site (which is protected by an LDAP server), where I am just  
trying to keep images outside the web directory, and want to prevent  
people from linking directly to an image... the only way an image  
displays is if they view the page, and not link directly to the  
image. Not foolproof, I know, but I'm not dealing with the general  
population here, just internal employees some of whom are more  
computer savvy than others.


Thanks all for your help. It seems to be working now.

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.



On Oct 2, 2007, at 8:32 AM, Andrew Ballard wrote:


I'd suggest the following *slight* enhancement to make sure that the
HTTP_REFERER actually *begins* with the site name, not simply contains
it.

// prevents visits from pages like
http://badsite.com/form.htm?http://www.wnc.edu
if (strpos($referer, $site) === 0)
{
echo 'yes';
}

(or, if you like the preg solution)
if (preg_match(%^$site%, $referer))
{
//
}

However, I'd argue that the effectiveness of checking the referrer
itself could be considered negligible, and hardly foolproof. The
header is easily spoofed in scripts, and may not even be sent at all
by legitimate clients because of various browser and/or personal
firewall options.

Andrew

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





[PHP] Secure Image Storage

2007-10-01 Thread Kevin Murphy

Hello all,

Following up with my success last week with putting downloadable  
files in a directory above the web root and then using a combination  
of fopen and stuff to download the file, I am now trying to do  
something similar with images.


However, what I am trying to do is to put an image file above the web  
root, then use PHP to display that image in the web page, and not  
download it. I have the feeling that this isn't possible (all  
solutions I've seen involve using header() function, which won't work  
since this is midway down the page), but I wanted to make sure. This  
will return the binary source of the file:


print file_get_contents($file_path);

but doesn't display the image. Is there any way to have this (or  
something else) generate the image?

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.




[PHP] strpos error (I'm missing something obvious)

2007-10-01 Thread Kevin Murphy

Overly simplified version of my code.

$site = http://www.wnc.edu;;
$referer = $_SERVER[HTTP_REFERER];

echo $referer;  // the output is correct at: http://www.wnc.edu/test/

if (strpos($referer,$site) === TRUE)
{
echo yes;
}

Why doesn't it echo out yes? I know I am doing something stupid  
here, but it doesn't seem to work  :-)



--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.





Re: [PHP] strpos error (I'm missing something obvious)

2007-10-01 Thread Kevin Murphy
I fixed this by changing === TRUE to !== FALSE, so I think I am good  
to go now. But would still like to know why TRUE doesn't work. Thanks.


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from  
wncc.edu to wnc.edu.



On Oct 1, 2007, at 2:23 PM, Kevin Murphy wrote:


Overly simplified version of my code.

$site = http://www.wnc.edu;;
$referer = $_SERVER[HTTP_REFERER];

echo $referer;  // the output is correct at: http://www.wnc.edu/test/

if (strpos($referer,$site) === TRUE)
{
echo yes;
}

Why doesn't it echo out yes? I know I am doing something stupid  
here, but it doesn't seem to work  :-)



--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed  
from wncc.edu to wnc.edu.







  1   2   3   4   5   6   7   8   9   10   >