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



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



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] 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] 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] strange php url (CORRECTION)

2006-04-28 Thread Kevin Kinsey

Kevin Kinsey wrote:



Pretty good thoughts, there.  Some years ago, Tim Perdue
(of PHPBuilder and SourceForge fame) had a popular
article on Search Engine Friendly URL's (or some such),
in which he described use of the Apache ForceLocal
directive to make a site just One Big Script, parsing
the slashed portions of the query string as variables
(instead of GET, a la ?section=manterm=foo) so that
the browser appears to be accessing documents in subfolders,
but it's really just telling the server to grab a page with certain
values defined in the URI.

It sure looks like a possibility of this or similar magic in
this case.  Of course, I could be way off my tree...


And it appears I was at least *slightly* off my tree.  In looking for 
more info on this, my post (archived in 2 places), was the only 
reference to a ForceLocal directive in Apache that Google could find ;-)


I meant ForceType, and here's how it works in httpd.conf:

VirtualHost *
  ServerName test.foo.com
  DocumentRoot /var/www/data/footest
  ServerAdmin [EMAIL PROTECTED]
  Location /manual
ForceType application/x-httpd-php
  /Location
/VirtualHost

Now, you write manual in PHP, (no file extension), and anything 
directed to manual is parsed by said script.


Since I used the wrong terminology, I may have distracted any *real* 
gurus from recognizing what I was talking about.  Sorry for any confusion.


Kevin Kinsey
--
It's hard to think of you as the end
result of millions of years of evolution.

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



Re: [PHP] strange php url

2006-04-21 Thread Kevin Kinsey

Hi,

could anyone tell me why the following url doesn't 
generate a page not found ?


http://www.php.net/manual/en/function.checkdnsrr.php/manual/


you can try with a longer url after the last .php.

I tried with ../manual instead of manual and this produces a 404.

I checked with www.php.net because my own site does the same and I 
wanted to be sure it didn't come from my config.


thanks

Nicolas Figaro


[EMAIL PROTECTED] wrote:

The other thing that could happen is they could be 
using something like the Apache mod_rewrite (some 
info at http://www.modrewrite.com/ among others) which 
can dynamically change the requested URL to a more 
standard URL before sending back to the user.


Something like this:
http://www.testserver.com/tgryffyn/homepage/middlesection

Could be turned into something like:
http://www.testserver.com/userpage.php?user=tgryffynpage=home#middleanchor

But to the user requesting the page, it'll always look like the first URL.

Forgive me if I got any syntax or capability of mod_rewrite wrong, 
never used it myself just know that's the general sort of thing that it does.
 



Pretty good thoughts, there.  Some years ago, Tim Perdue
(of PHPBuilder and SourceForge fame) had a popular
article on Search Engine Friendly URL's (or some such),
in which he described use of the Apache ForceLocal
directive to make a site just One Big Script, parsing
the slashed portions of the query string as variables
(instead of GET, a la ?section=manterm=foo) so that
the browser appears to be accessing documents in subfolders,
but it's really just telling the server to grab a page with certain
values defined in the URI.

It sure looks like a possibility of this or similar magic in
this case.  Of course, I could be way off my tree...

Kevin Kinsey

--
Byte your tongue.

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



Re: [PHP] any better way...

2006-04-20 Thread Kevin Kinsey

benifactor wrote:


I am trying to come up with the best way to check for errors on a form.  I have 
done this before by checking each $_POST variable seperatly but needed a better 
way that would display more then one error.  The following is what i came up 
with...

if (!$condition1 || !$condition2 || $condition1 != $condition2) {
   if (!$condition1) {
$regError[0] = condition 1  not met.;
$regErrorc[0] = font color=red;
$regErrore[0] = /font;
$regErrord[0] = font color=red***/font;
   }
   else {
   if (!$condition2) {
$regError[1] = condtion 2 not met.;
$regErrorc[1] = font color=red;
$regErrore[1] = /font;
$regErrord[1] = font color=red***/font;
   }
   else {
   if ($condition1 != $condition2) {
$regError[0] = condition 1 is not equal to condition 2;
$regErrorc[0] = font color=red;
$regErrore[0] = /font;
$regErrord[0] = font color=red***/font;
$regErrorc[1] = font color=red;
$regErrore[1] = /font;
$regErrord[1] = font color=red***/font;
   }
   }
   }
}

which works fine but gets rather lengthy...   i was just wondering if there is 
any better logic to go about this with and if there is could you please 
enlighten me?
 



Well, the only real *variable* datum there is which condition
was broken.  So, how about leaving out the HTML construction
until after the determination has been made?

HTH,

KDK

--
QOTD:
Money isn't everything, but at least it keeps the kids in touch.

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



Re: [PHP] phpMyAdmin--resetting auto increments to 0

2006-04-16 Thread Kevin Kinsey

alex wrote:


hi everyone

i have delete a few entries in my database as they were entered for testing 
purposes and are no longer need (actually 102 entries)... and even thought 
that db is empty i noticed that when the next entry went in the id number 
went to 103
not 0 so i was wondering is it possible to somehow reset the value to 
zero...


it is of int type and auto_increment

i have a few db's which id like to reset to zero i have tried placing a zero 
enrty after deleting the lot but it only jumps to  its next increment.

does anyone know what i mean...?
any help will be grateful
regards alex 
 



Select the desired database on the left.  The browser
will reload and show the STRUCTURE page.

Click on the SQL tab; the browser should now load a
page with a textarea that says Run SQL query/queries
on database FOOBAR.

Enter the following in the textarea:

   ALTER TABLE footable auto_increment=0;

and then press the GO button.

You can set the auto_increment number to any positive
integer, AFAIK, though there might be a limit.

:-)

Kevin Kinsey

--
Just because you're paranoid doesn't mean they AREN'T after you.

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



Re: [PHP] SQL result

2006-04-14 Thread Kevin Kinsey

Mohsen Pahlevanzadeh wrote:


Dear all,
I remember that i use a func that it return an array what it consist 
of result of my sql query.

Please name me that.
Yours,Mohsen



Was it mysql_fetch_array()? 


Which SQL was it?

Also, are you aware that even entering an incorrect function name
at php.net will get you some free pointers ?

H.A.N.D.!

Kevin Kinsey

--
There is nothing more exhilarating than to be shot at without result.
-- Churchill

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



Re: [PHP] php security

2006-04-06 Thread Kevin Kinsey

Dallas Cahker wrote:


I was looking to see if there was a quick checklist of settings for php to
be disabled/enabled in the ini file to make the application more secure.
I'm making sure the apps we come out with dont allow sql injections, or form
injections and so forth, I have just seen some posts about magic quotes and
so on and so I was curious.
 




Well, generally php comes with a php.ini-dist and a php.ini-recommended;
for tighter security, use the recommended version.  Examining a diff 
of the

files could help shed some light, as well.

Of course, some of us could be waiting for the day when they ship with a
php.ini-ironclad, php.ini-stealthmode, or 
php.ini-anal-retentive-paranoid,

but I'm not sure those are slated, even for PHP6  ;-)

HTH,

Kevin Kinsey

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



Re: [PHP] parse a Makefile

2006-04-03 Thread Kevin Kinsey

Benjamin D Adams wrote:


I'm trying to parse a Makefile, (FreeBSD Ports)
I plan on dumping the Makefile vars to a MySQL Database.

Would I parse the make file like a ini file?
Or would I have to use something different?

Maybe someone knows a tool that can do this for me?

Thanks
Ben
 



Try file() and ereg() or preg_match.  If the Makefile
has standard format you're looking for

FOOBAR=some string here

so reading the file into an array (the file() call) and
using a regular expression conditional (to determine
if you're looking at a variable or something else)
might be quite enough to do the trick.

HTH,

Kevin Kinsey

--
A pedestal is as much a prison as any small, confined space.
-- Gloria Steinem

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



Re: [PHP] microsoft PHP ?

2006-04-01 Thread Kevin Kinsey

Stut wrote:


Joe Wollard wrote:


Leave poor Zouari alone! I for one think that Microsoft
buying Zend would be the best thing to happen to PHP, EVAR!
This Rasmus guy didn't even mean for PHP to be what it is, he
just wanted something simple and now look at it. It's WAY to
complex for an unorganized bunch of hobbyists to maintain. I'm
personally looking forward to the way they'll clean things up.
Who knows, maybe once they've got PHP under control we won't
need these security 'experts' like Chris Shifflett any more because
would be hackers won't be able to see the source code, which of
course means they won't be able to find vulnerabilities. You guys just
need to give up on this open source hippie dream and let Microsoft
change things for the better - who cares if Stephen King thinks
they are working in conjunction with the Crimson King and that
they might build robots that will someday take over the world
and more or less 'suck the s-m-r-t' out of 50% of the worlds
twins? He looks creepy anyway.

 - and a happy April fool's to all ;-)




__
 Troll, I warnest thee, BEGONE!!! 
--
 \/ \  //\
  \|\___/|  /   \//  \\
   /0  0  \__  ///  | \ \   
  / /  \/_///   |  \  \ 
  @_^_@'/   \/_   //|   \   \

  //_^_/ \/_ // |\\
   ( //) |\///  | \ \
 ( / /) _|_ /   )  //   |  \ _\
   ( // /) '/,_ _ _/  ( ; -.|_ _\.-~.-~~~^-.
 (( / / )) ,-{_  `-.|.-~-.   .~ `.
(( // / ))  '/\  / ~-. _ .-~  .-~^-.  \
(( /// ))  `.   {}   /  \  \
 (( / )) .~-.\\-' .~ \  `. \^-.
///...\ _ -~ `.  ^-`  ^-_
  ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
 /.-~
 


:-D


Here's assuming that was a joke so I won't get into the factual
errors. I wonder how Zend and the other core developers will
feel about being referred to as an unorganized bunch of hobbyists.

-Stut



Well, I'm not sure about your LOCALE and cultural referents,
but from where I'm sitting I could freakin' *see* the sarcasm
tags on that one ... or maybe it's just my MUA.  ;-)

As an aside, to prevent further potential misunderstanding,
there's one on my ASCII art as well :-D

KDK

--
Disclose classified information only when a NEED TO KNOW exists.

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



Re: [PHP] IP Address Filtering

2006-03-29 Thread Kevin Kinsey

Joe Harman wrote:


if you really want to mess with them.. only show the user with the
NULL IP address all the spam posts.. .make them think that they've
been successful
 


Freaking hilarious idea!!

Remind me not to let my kids play with yours.  :-D


Of course, there's probably not any Real People(tm)
behind these addys.

Kevin Kinsey

--
Sentient plasmoids are a gas.

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



Re: [PHP] Three quickies anyone?

2006-03-27 Thread Kevin Kinsey

Ryan A wrote:


Hey,
I am new to CLI and using PHP to run shell but need to know it so am getting
my feet wet, hopefully with your help :-)

Now when I said three quickies, I mean three PHP RELATED quickies of
course...if you thought anything otherwise... you have a wicked mind.

Here goes:

1.
I start my CLI scripts with:
#!/usr/local/etc/php

as thats the path on my machine... the problem is some of these scripts will
have to  be installed on clients machines by them... any easy way for them
to find out whats the path PHP is installed on their machine? (this q is
more of a doubt really)

is it the same as $_SERVER[include_path]

 



The canonical way:

#!/usr/bin/env php

This will call the first php executable in $PATH, and is generally
used when portability in scripts is desired.


3.
This should be a rather simple question but I just confused myself after
reading/searching google (i do that to myself sometimes, totally
unintentional really)
Can I run CLI/Shell scripts
eg: scripts that began with the  #!php path
on machines that have PHP loaded as a CGI and as a module or only as a CGI
or only as a module?
 



Well, if you use the canonical way I describe above, one problem
I foresee is that the cgi-bin directory is hardly ever in $PATH. . .

HTH,

Kevin Kinsey

--
How many people work here?
Oh, about half.

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



Re: [PHP] Irritating [EMAIL PROTECTED]

2006-03-27 Thread Kevin Kinsey

Ryan A wrote:


Anybody else getting these annoying auto responses from [EMAIL PROTECTED]
?

If yes, can someone email the list mod to delete his account or something,
or email me back the list mods email and I'll do it myself.

Thanks,
Ryan

 




What, no killfile?

If we bug the mods for every idiot autoresponder out
there, when will they have time to improve PHP?

My $0.02,

KDK

--
An investment in knowledge always pays the best interest.
-- Benjamin Franklin

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



Re: [PHP] where php at?

2006-03-27 Thread Kevin Kinsey

tedd wrote:


Warren Vail said:


Looks like you have a unix machine, if you have a
shell account you may be able to use the command;

which php

to identify it's path.



John Meyer said:


If you're on a linux box, have you tried which php?



Where do I type in which php?

I'm dealing with a host account and I'm
simply trying to find out where php is so
I can set up a cron job.

Thanks.

tedd




If you don't have a shell, you might get away with
a page using system(), backticks, escapeshellcmd(),
and the like (though on a shared host I'd think them
to be wise to disable a shell for www/nobody/apache):

?php

$foo=`which php`;
echo $foo;

?

Now, you may want to use whereis(1) instead, since
which is a shell-built in . . . but it sounds like a catch22:
no shell, no which; no shell, no shell, so whereis(1) can't
work either ... hmm, OTOH, which is only a shell builtin
in some shells, in which case ... ah, nevermind.

If you're guessing?  typical places include : /usr/local/bin/php,
/usr/bin/php, /usr/etc/php . . . .

HTH,

Kevin Kinsey

--
The devil finds work for idle glands.

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



Re: [PHP] where php at?

2006-03-27 Thread Kevin Kinsey

Jay Blanchard wrote:


[snip]
Aarrrg -- no disrespect meant.

I'm totally and absolutely clueless and frustrated. It must be my age 
because I haven't seen a command line since my Apple][ days -- let 
alone one while doing web work.


I'm sitting in front of my computer accessing my remote web site via 
ftp (GoLive) writing code and trying to set up a cron job using 
cpanel to run that code.


Now, I have no idea of where I should type in which php  -- I've 
tried putting it in my cpanel cron jobs command to run box, but 
that doesn't do anything.


Does anyone have any reference material of where a command line of 
the host is?

[/snip]

Dagnabit! Contact your host provider, they will tell you.
 



If they offer a shell account.  I *shudder* to think that as recently
as 1999 I was administering a remote mail/webserver in the Pac
NW from the center of the country via telnet.

Possibly they offer access via ssh (Secure Shell), but a lot of hosts
don't any longer --- many customers wouldn't know what to do with
it anyway (heh, their loss), and some customers who *do* know how
to use it are a tad too curious sometimes, I expect.  I know I've seen
more than one big hosting company act like such things didn't
exist

Kevin Kinsey

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



Re: [PHP] Why Should I Use Zend Optimizer?

2006-03-27 Thread Kevin Kinsey

Richard Davey wrote:


On 27 Mar 2006, at 19:10, [EMAIL PROTECTED] wrote:


In short, Zend Optimise has *nothing* at all to do with 'making dumb
programmers code better' I'm afraid.



I'm not completely sure on this, and if it is true I don't have the
links, but I think it does do one thing to make your code better.
That is to use pre-increments wherever possible, since the
post-increment requires the parser to store the value first then
increment it (or something to that effect).  But even then it's really
only saving you milliseconds of processing time, which would only make
a beneficial improvement on an enterprise system (million-plus hits).



Sorry I should have been more explicit - I meant it won't re-write 
your actual source code for you, which I believe is what the OP 
thought it was supposed to do (if only!)


Cheers,

Rich



Yeah; I'm still petitioning the Team daily via cron for
'make_shopping_cart(str general_business_type);'
in PHP6 

:D

KDK

--
In Boston, it is illegal to hold frog-jumping contests in nightclubs.

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



Re: [PHP] colored text in images

2006-03-24 Thread Kevin Kinsey

Marcus Gnaß wrote:


Hi list!

I like to generate a larger image from different tiles.
Each tile should have a text on it which should be
red for better readability. I figured out how to
compose the larger image but got stuck when
to color the text. I tried the following code:

$img = imagecreate($w * 100, $h * 100);
$tile = imagecreatefromgif($tile_name);






$red = imagecolorallocate($tile, 255, 0, 0);
imagestring($tile, $font, $gebilde_x, $gebilde_y, $gebilde, $rot);




Because PHP doesn't grok that $red==$rot, and I'm not
sure that it is, either?  What happens when you use $red
in the imagestring() call?


imagecopy($map, $tile, $dst_x, $dst_y, 0, 0, imagesx($tile), 
imagesy($tile));

header(Content-Type: image/gif);
imagegif($map);

The text was writte an expected, just it was grey and not
red. What do I have to do to make it read and why was it grey?



Hopefully, you caught that above.  The 6th parameter of
imagestring should be an integer to represent the color.

HTH,

Kevin Kinsey

--
You will hear good news from one you thought unfriendly to you.

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



Re: [PHP] problem

2006-03-22 Thread Kevin Kinsey

Simone O'Brien wrote:


Hi, I have set up a message board and we cannot log out or do anything on the 
page at all. We cannot use it at all.

http://myminiaturegoats.com/forum3/index.php?action=logout;sesc=331181faba9b2783a9506ad21068fb8b



 Database Error 
 Please try again. If you come back to this error screen, report the error to an administrator.  


This is what we get above on the screen.

Can you give me any idea on how we acess it and fix it?
 



Your forum is the Simple Machines Forum

   --- http://www.simplemachines.org/

The copyright indicates that this software is owned
by Lewis Media

   --- http://www.lewismedia.com/

The server that runs the 'myminiaturegoats.com' site
is apparently within a netblock owned by securenet-server.net,
and the technical contact for this domain is listed as:

   Acenet Inc
   Jerald Darow([EMAIL PROTECTED])
   5880 N Canton Center Rd
   Canton
   MI,48187
   US
   Tel. +1.7343546936

Finally, there would be the who in the question who
set up this site for you, or who hosts it, or what company
did you buy the web-space from? (which looks like it should
be related to the above (Acenet), if not exactly them.

Any one of these sources should be a better place
to ask support questions than this mailing list.  This list
is for discussions of PHP programming (m/l), and your issue
is related to the actual use of software that just happens
to be written in PHP.  Not that we're particularly resentful,
but we can't give you much help.  You need to get in touch
with the person who's got access to the server.

The good news, however, is that it should be a relatively
simple issue to fix, provided you get in contact with the
right person; it's just that we ain't him/her.

G'day,

Kevin Kinsey

--
Oatmeal raisin.

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



Re: [PHP] Invoices

2006-03-19 Thread Kevin Kinsey

Leonard Burton wrote:


HI All,

What do you all use for keeping track of invoices?

I looked at a few open source projects (including
http://billing-software.us/) and it seems that there is not really a
good Open Source Project out there for invoices.  Am I wrong?

What would be nice is a project with a good API that would allow other
projects to use its invoice handling capabilities.  It would be nice
if it weren't designed for one specific situation.

Have I missed the boat here?  Is there a nice OS Invoice program that
will do all this?  Has anyone considered starting one?

Thanks,

--
Leonard Burton, N9URK
 



PHP has become a bit of a breeze for me to use, thanks
to its authors (who came up with a nice syntax and great
docs) and its community (who didn't flame me too much
when I was a newbie, less than 5 years ago).

As a result, my business is managed by a home grown
app --- calendar, checkbook management, invoicing,
task list, local messaging, some accounting computations,
mileage computation, expense records, etc.

ATM, I'm adding trouble tickets to the mix, and a few
other ditties.

Now, if there's nothing else out there, I can imagine
it would be nice to release it, but, as I mention, I'm
a relative newbie, and started coding it 4 years ago
and much of it is have never been updated.  Much is from
before I learned that web standards existed (I learned
HTML from reading the source created by MS FrontPage
Express in the late 1990s, [ugh!!!]), and I'm not a geek
by training (so, I've a shelf of books on OOP and still
haven't a great handle on it, but there again comes PHP
to the rescue), so open sourcing it might well take
so much cleaning up that it would kill me.  And if it's
not cleaned up, it'd probably be as traumatic as appearing
on American Idol in a Speedo (at my age, not very pretty
at all; or you can sub in hosting a Tupperware party in the
nude if you wish, but who would?).

Anyway, I guess my point was, rolling your own isn't the
end of the world (unless you want the world to see it).

All that said, have you looked at Hermes, CentraView (not
PHP, IIRC) or NOLA?  ATM, I can't even recall what NOLA
does, but I seem to recall that it was fairly generic (may
have been more of a retail-frontend).

Also, a quick Googling turns up a rather long list at:

 http://cbbrowne.com/info/financefreesoft.html

Good luck, HTH,

Kevin Kinsey

--
Stability itself is nothing else than a more sluggish motion.

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



Re: [PHP] Convert all named entities into numeric character references

2006-03-06 Thread Kevin Kinsey

Jacob Friis Saxberg wrote:


Does anyone know of a Php funtion that can do this:
http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html
 


Hi there!

http://se.php.net/manual/en/function.htmlentities.php

?
   



htmlentities converts to named entitites. I want it to numeric entities.

 



Yes; 'tis true.  However, in looking at the manual page further, I
see at least one user submitted entry that looks like what you
may be desiring, not too far down the page.

HTH,

Kevin Kinsey

--
When the only tool you have is a hammer, every problem starts to look
like a nail.

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



Re: [PHP] CLI utility

2006-03-03 Thread Kevin Kinsey

John Nichel wrote:


Ray Cantwell wrote:


Hello again,
I was wondering if any of you knew of a good command line
utility for php5 on linux? The box i write on has no X-windows.

Ray.



A command line utility to do what?



Indeed.  Context might even indicate he's looking for
something to use to write his PHP scripts on a box
with no GUI.

In which case, the question is better avoided as it's
a terribly effective magnet for holy war.

Furthermore, I didn't choose the .sig below, it's randomly
generated by fortune(6), but it really speaks to me, heh

KDK

PS. ed(1) is the standa  nah. ;-)


--
Uncle Ed's Rule of Thumb:
Never use your thumb for a rule.
You'll either hit it with a hammer or get a splinter in it.

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



Re: [PHP] CLI utility

2006-03-03 Thread Kevin Kinsey

Ray Cantwell wrote:

Indeed i am looking for a tool to write my code with on a box that has 
no gui
environment, However if a Jihad is going to ensue because of it, i 
shall withdraw

my question, head bowed.
RTC



context snipped in froward violation of common sense

Well, kudos to you for discretion, which has been noted
as 'the better part of valor', indeed.

For our mutual edification, here are a few links relevant
to the discussion as it pertains to PHP in particular, from
a favorite forum of mine.

The classic:
  http://www.phpbuilder.com/board/showthread.php?t=10209798

The imitators:
  http://www.phpbuilder.com/board/showthread.php?t=10280025
  http://www.phpbuilder.com/board/showthread.php?t=10274550 (GPL version)
  http://www.phpbuilder.com/board/showthread.php?t=10255309
  http://www.phpbuilder.com/board/showthread.php?t=10253439
  http://www.phpbuilder.com/board/showthread.php?t=10298665
  http://www.phpbuilder.com/board/showthread.php?t=10256359

Regarding WYSIWYG editors:
  http://www.phpbuilder.com/board/showthread.php?t=10264772

For the Mac user:
  http://www.phpbuilder.com/board/showthread.php?t=10297539

I'd also recommend plugging such terms as editor, text editor,
PHP IDE and so on into a good search engine.

Finally, try reading this:  
  http://en.wikipedia.org/wiki/Editor_wars


--- for some background on why this question is so, um, politically
incorrect ? (ahem), and try Googling the phrase vi versus emacs
to see that it's actually true.

Meanwhile, I'm off to unwedge my tongue, which seems to have
lodged itself firmly between my cheek and upper jaw

Use what you want, they'll make more,
  
	Kevin Kinsey


--
A wise man can see more from the bottom
of a well than a fool can from a mountain top.

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



Re: [PHP] Help! Apache 2.2 gives segmentation fault errors with PHP.

2006-02-15 Thread Kevin Kinsey

Olaf Greve wrote:


Hi guys,

I suspect something went wrong in the way I try to use PHP. Basically, 
I first removed
the installed /usr/ports/lang/php4 port, then built and installed the 
/usr/ports/www/mod_php4 port,
and then added various php4-extensions, using the 
/usr/ports/lang/php4-extensions port

(I suspect the extensions to cause the problem).

Does anyone know what could be going on and/or how to properly set up 
PHP 4 under Apache 2.2?


Tnx a lot in advance, and cheers!
Olafo



Check at least these two things:

1.  The extension_dir directive in /usr/local/etc/php.ini should be pointing
to the latest directory of *so files (or, more correctly, to the one that
corresponds to the build you completed in conjuction with apache2 ---
Shared Objects built with wrong dependencies is a classic segfault
waiting to happen scenario in my experience).

2.  For the extension doubling, check the contents of
/usr/local/etc/php/extensions.ini --- almost surely you have
duplicate entries there.

Just as an aside, if you're trying to keep up with PHP development
and the latest Apache, it might be a Good Thing(TM) to update
from FBSD 5.2.1 also.

HTH,

Kevin Kinsey

--
The Creation of the Universe was made possible by a grant from Texas
Instruments.
		-- Credits from the PBS program 
			'The Creation of the Universe'


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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Kevin Kinsey

Jay Blanchard wrote:


In the end it is not worth worrying about. If someone asks you what PHP
stands for tell them it stands for the best darned programming language you
ever saw.
 



Hrm, I thought it was People Hate PERL .

:-D

/me ducks and runs

--
First Corollary of Taber's Second Law:
Machines that piss people off get murdered.
-- Pat Taber

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



Re: [PHP] Ternary operators

2006-02-15 Thread Kevin Kinsey

Carl Furst wrote:


Well, I tried something simple...

$ php -r 'echo hello world\n;'
Error in argument 1, char 2: option not found r
Error in argument 1, char 2: option not found r
Usage: php [-q] [-h] [-s] [-v] [-i] [-f file]
  php file [args...]
 -a   Run interactively
 -C   Do not chdir to the script's directory
 -c path|file Look for php.ini file in this directory
 -n   No php.ini file will be used
 -d foo[=bar] Define INI entry foo with value 'bar'
 -e   Generate extended information for debugger/profiler
 -f fileParse file.  Implies `-q'
 -h   This help
 -i   PHP information
 -l   Syntax check only (lint)
 -m   Show compiled in modules
 -q   Quiet-mode.  Suppress HTTP Header output.
 -s   Display colour syntax highlighted source.
 -v   Version number
 -w   Display source with stripped comments and whitespace.
 -z fileLoad Zend extension file.


This means my install can't run inline stuff like this? Guess it wasn't set
up to do that. So no I won't say that I will use php -r to test anything..
lol :)
 



Actually run php -v and let's see if it's not version 4 ... in
which there is no r option available IIRC 



please say your going start using php -r to test stuff like this. :-)
   



Not unless he upgrades, apparently.

Still, not too hard to open an editor, code a tiny script,
and run it from the CLI in either PHP4 or PHP5.

Let's all learn to test things, eh?

Kevin Kinsey

--
If there is a wrong way to do something, then someone will do it.
-- Edward A. Murphy Jr.

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



Re: [PHP] Blogger post failed?

2006-02-14 Thread Kevin Kinsey

Jay Blanchard wrote:


Is anyone else getting these messages?



Yes.


Very annoying.



Yes.

Barry wrote:

] Sometimes.

] Proably the server is reaching its limits :P


Seems doubtful; if I read the headers correctly,
this list is managed by ezmlm, which means it's
running on a qmail server, and probably on FreeBSD
or Linux.  Not that you couldn't overload such a
machine/operating system, but it's not real likely.

Blogger post failed seems to indicate that someone
is attempting to pipe their subscription to their
blog/website/whatever; when this fails, their MTA
doesn't know who else to notify but the sender,
e.g. php-general@lists.php.net, and we all get
a nice error message to sift.

I suppose it's just like any community; if somebody
farts on the subway, we all get to share the result

#include disclaimer.h

Kevin Kinsey

--
My own business always bores me to death; I prefer other people's.
-- Oscar Wilde

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



Re: [PHP] phpinfo returns a permission error

2006-02-14 Thread Kevin Kinsey

Dave M G wrote:


and this:
$ ls -l /home/dave/web_sites/phpinfo.php



It says:
-rw---  1 dave dave 20 2006-02-13 22:45 
/home/dave/web_sites/phpinfo.php




Well, I'd sure suspect this.  PHP/Apache are probably running as
nobody, daemon, www, or somesuch, and the permissions
on the file above only allow the user dave to read (and write to)
this file.

Try:

   $ chmod 644 /home/dave/web_sites/phpinfo.php

  and see if you can read the file.

In addition, do some checking on your umask, or
try and remember how you created this file.  A umask
of 22 should produce  -rw-r--r--:

[624] Tue 14.Feb.2006 16:15:58
[EMAIL PROTECTED]/daleco/software/Windows]
umask
22

[625] Tue 14.Feb.2006 16:17:00
[EMAIL PROTECTED]/daleco/software/Windows]
touch foobar  ls -l foobar
-rw-r--r--  1 kadmin  wheel  0 Feb 14 16:17 foobar

   but obviously, yours did not.

022 is the default umask for most shells.  Seems likely
that you were running your editor/IDE/whatnot setuid
root, perhaps?


HTH,

Kevin Kinsey

--
Don't hate yourself in the morning -- sleep till noon.

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



Re: [PHP] phpinfo returns a permission error

2006-02-13 Thread Kevin Kinsey

Dave M G wrote:


PHP list,

   I wanted to adjust my register global settings in my
php.ini file. I found instructions on this page:
   http://www.dmcinsights.com/phpmysql/phpini.php

   The first thing it says to do is take a look at the
results of phpinfo(); to see where the php.ini file actually is.

   So I created a phpinfo.php file, put in the following code:
?php
phpinfo();
?
   ... and then accessed it through FireFox at localhost.

   To my surprise, I got the following error message:

Warning: Unknown(/home/dave/web_sites/phpinfo.php):
failed to open stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php'
for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in 
Unknown on line 0


   It looks to be a permissions issue. But who has permission if not me,
and how is permission an issue when I'm just looking at the file 
through a browser?


   By the way, I'm using PHP 4.4.0-3 on Ubuntu 5.10.

   Any advice or help would be much appreciated.

   Thank you.

--
Dave M G



So, what does this say:

$umask

and this:

$ ls -l /home/dave/web_sites/phpinfo.php

and are you using the browser to view the file via
a server (e.g., the browser address bar says http://;),
or via the filesystem (you've opened it from an explorer
type window and the address bar says file:///)

Is PHP running as mod_php in apache, or CGI?

Finally, can you view other files in the same directory
via similar means?

Kevin Kinsey

--
Stult's Report:
Our problems are mostly behind us.
What we have to do now is fight the solutions.

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



Re: [PHP] testing text body emails

2006-02-13 Thread Kevin Kinsey

Mark Steudel wrote:


Im using phpmailer to send emails, with htmlbody and an alternate textbody.
Any suggestions on how to test the text only body?

Thanks, Mark
 



Sure.  Use a text-only MUA?*  /rimshot

But, seriously, most 'Nix gurus have access to text
only mail if they care to.  If you've a friend who's
always preaching about open sores, you might
call him up.

Also, several web-mail solutions are text-only,
or have that option, IIRC.  Although it's been a
while since I used hotmail or excite, etc., you
might take a look.

HTH,

Kevin Kinsey

*I'm not joking too much about the MUA, just
the answer.  I actually like mutt a good deal...

--
The most winning woman I ever knew was hanged for poisoning three little
children for their insurance money.
-- Sherlock Holmes

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



Re: [PHP] Oracle buying out Zend ... how does that affect PHP?

2006-02-11 Thread Kevin Kinsey

Marc G. Fournier wrote:



http://www.businessweek.com/technology/content/feb2006/tc20060209_810527.htm 



Also in Oracle's crosshairs: closely held Zend, based in Cupertino, 
Calif.

Zend's PHP software language is one of the most prevalent on the Web,
present in more than 18 million Web sites. The company, which snared
headlines last year when Netscape co-founder Marc Andreessen joined
its board, has been trying to extend its success with the Web into
business applications. Zend could sell for $200 million, according to one
source.



Marc G. Fournier   Hub.Org Networking Services 
(http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 
7615664




Well, we'd run the risk of losing? a good support company and
optimizer.

But the language above is misleading: PHP isn't owned, per se,
by Zend, although Zend is owned or at least was founded by some
pretty big guns on the PHP Devel Team.  So the effects might not
be much beyond what I mention above.

It's kind of interesting to speculate, though; and it's good news for
the Zend guys --- nice (for them anyway) when you start looking
that juicy to the big players, as a friend of mine says.

Makes you wonder if this really isn't a jab against the other DB
companies/orgs --- I could foresee Zend pushing some PHP/Oracle
interface/optimization products within a year or so if this happens

Kevin Kinsey

--
Reality -- what a concept!
-- Robin Williams

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



Re: [PHP] how to learn php

2006-02-11 Thread Kevin Kinsey

tedd wrote:


hello

i have been trying to learn php.

what is the best approach to learning php for someone who has no 
programming experience?


-snip-

any advice and/or opinions would be greatly appreciated.

thanks.



First, welcome to the language.

Second, I suggest that you find a beginner's book --

snip



1.  If you can do any learning from books (e.g. you were/are
a decent student in whatever educational system you
did/are attend/attending), by all means follow tedd's Second,

Somewhat contrary to the advise get a book with everything
in it, I found Larry Ullman's PHP  The World Wide Web
(PeachPit Press) to be da bomb when I decided to learn PHP.
I'll plug him for readability, his explanations, and he was a
fellow Missourian (think he's in California now).  I get no
money from PeachPit or Larry for that, though ... ;-)

Keep in mind that there is no way that books can keep up
with real-time development on a language like PHP; the need
for the online manual (or the Windows .chm help files) is also
great. 


In particular, I found that Larry's book was mostly
written from a PHP3 POV, but PHP4 was out by the time I
got my hands on it.  There were a few differences; sometimes
he made mention of that.

2.  Write some code:

?php
  echo Hello, world!;
?

3.  Read the source code of scripts you can download for free
at sites like hotscripts.com.  Then, write something better
(be sure to adhere to any licensing restrictions you find)!
Then, you can start reading source code for bigger projects,
and see how the big boys work

4.  Get involved in a PHP developer community (PHPBuilder.com's
forum gets my vote, and, of course, you've joined this mail-list,
I suppose...) and read, read, read, and ask sensible questions.
Read Eric S. Raymond's essay 'How to ask questions the smart
way, if you've not already done so.

So, it's read, code, and read code; then, ask for help nicely
if you need it!

Good luck with PHP,

Kevin Kinsey

--
Chicagoan:  So, wherere you from?
Hoosier:Whats wrong with Indiana?

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



Re: [PHP] php versions between os/platform

2006-02-10 Thread Kevin Kinsey

pedro mpa wrote:


Greetings!

I am building a website using PHP 5.1.2 and MySQL 5.0.18 and I am using
windows xp with IIS.
All the hosting companies I have contacted are using php 4.x.x and mysql
4.x.x or 3.x.x, on linux I suppose.

Are php versions the same for every os/platform?

Thanks in advance.




PHP 5.1.2 is the 'latest and greatest', or pretty close to it.

For various reasons, hosting companies tend to be reluctant
to upgrade such things; the old (USA, anyway) engineer's
adage if it ain't broke, don't fix it comes to mind --- and
these hosting companies figure that it's working and they
don't want to take chances, IMHO.

An even greater reason behind this fact/trend that you notice
is that PHP has become so well-known that websites of all
types are using it, even those whose webmasters don't know
much about how to write in/use the language; therefore they
are using c'n'p ed scripts from the net that may date back
some distance in Net-Time; register_globals must be on,
long global arrays (although they're pretty much backwards-
compatible with PHP 5.X), etc., and deprecated $foo ad nauseum.
The hosting companies don't want their helpdesks flooded with
calls of OMG my site is down!, and Why doesn't my shopping cart |
contact form | uploader | downloader | gallery | ... work???

During my last local update of PHP I finally updated php.ini
as well; took me quite a while to get my business interface
running probably again because I'd written the first scripts
with short tags years ago.  That's the sort of thing they don't
want to have to deal with just yet.  Of course, the day will come
anyway, so they'd better be getting ready

Richard Lynch wrote:

] I'm betting that you can get PHP 5.x out of http://pair.com, since
] they host http://php.net and you gotta figure they're on top of things
] like that, eh?

Pair.com would probably be an excellent choice.  Not only do they
host php.net, but they are very supportive of the Open-Source
movement as a whole, flamebaitand run the best OS on the planet /fb.

] YMMV
] NAIAA
] IANAL

Neither am I.  TIFWIW 

Kevin Kinsey

--
Although the moon is smaller than the earth, it is farther away.

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



Re: [PHP] Weirdness with PHP FreeBSD/OSX/Linux headers already sent

2006-02-10 Thread Kevin Kinsey

Eric Butera wrote:


PHP List,

Perhaps one of you might know the answer to this, because I certainly do
not, nor do any of my coworkers.  The problem is that scripts on our OSX
10.4 (our local development machines) and RedHat/Debian linux servers do not
throw the headers already sent message.  I could have an entire page of
html, php code, whatever I wish and call session_start() at the bottom of
the page and everything would be fine.  No errors on screen, in error_log,
or anywhere else.

I know this is invalid and so do most webservers/environments because
everywhere else I have ever coded I see the headers already sent, output
started at message.  I have used Windows, Linux, and FreeBSD versions of
PHP with Apache 1.3 and 2 and had the error print out as expected.

I want to know if any of you know the reason why this is happening.  I would
prefer the strict error messages to help keep everyones coding in check.
Unfortunately I cannot for the life of me seem to find any configuration
settings which point to this.  Any pointers or help would be greatly
appreciated.

Thank you in advance!
 



Mostly out of curiosity, but also somewhat out of my
troll-like and pedantic nature, what happens if you
start your scripts with:

?php

   error_reporting(E_STRICT);


??

And, the obvious troll question:  you do have session
support compiled?

Kevin Kinsey

--
Anyone who has had a bull by the tail
knows five or six more things than someone who hasn't.
-- Mark Twain

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



Re: [PHP] Newbie Question Can't insert values into MySQL DB via PHP

2006-02-10 Thread Kevin Kinsey

Jochem Maas wrote:


Duggles Temple wrote:



I am having a problem with a shop system. I can't add values into the 
MySQL
DB via a PHP statement. The values are being transferred from one 
page to

another (know that from the echo statement), but the SQL statement isn't
working.

The statement is as follows:

$conn = mysql_connect($DBhost,$DBuser,$DBpass) or die('Unable to 
connect to

database');
$t = $_GET['newdvdtitle'];
$y = $_GET['newdvdyear'];
$c = $_GET['newdvdcost'];
$p = $_GET['newdvdpurchased'];
@mysql_select_db($DBName) or die(Unable to select database $DBName);
$sqladd = INSERT INTO 'dvd' ('id', 'title', 'year','cost','purchased')
VALUES (  NULL , '$t', '$y', '$c' , '$p' );
echo $sqladd;



using echo to find out whats' in your variable is a good start, also
take a look a print_r() and var_dump() - they given more feedback 
regarding

passed in vars.

it would have been useful if you had actually posted the output of the
echo statement.


$result = mysql_query($sqladd);



try adding something like:

if (!$result) {
die(mysql_errno($conn) . :  . mysql_error($conn) . \n)
}



Very good habit to be into.  Also, adding the query will help during
the debugging phase of development.  I generally use something like:

mysql_query($query) or die(Error in query: query was $query and MySql 
sez: .mysql_error());


If, as the continuing thread suggests, the query is actually empty,
the above would make that rather obvious right away.

HTH,

Kevin Kinsey

--
Adler's Distinction:
Language is all that separates us from the lower animals,
and from the bureaucrats.

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



Re: [PHP] pcntl functions and database

2006-01-28 Thread Kevin Kinsey

chris smith wrote:


Hi all,

I'm trying to work out threaded apps and I'm trying to use the pcntl
functions.

I can get it working ok without using a database but when I plug the
database in I get 'lost connection during query' errors.

Does anyone have any suggestions or a working example ?

Thanks!

My code:

 



Your code works for me, *most* of the time - say, 96%++.  I tested
with small values for $childrencount (2 up to 200).  I'd hesitate to
speculate, but it smells like an SQL server performance issue to
my weak nose...(IANAE).

Kevin Kinsey
DaleCo, S.P.

--
Never offend people with style when you can offend them with substance.
-- Sam Brown, The Washington Post, January 26, 1977

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