[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Hannes Magnusson
On Thu, Jul 19, 2012 at 8:36 PM, Ferenc Kovacs tyr...@gmail.com wrote:
 2012.07.19. 20:21, Daniel Brown danbr...@php.net ezt írta:

 Forwarding to php-webmas...@lists.php.net, as it's not a general
 user issue where it pertains to php.net.

 On Thu, Jul 19, 2012 at 2:02 PM, Kris Craig kris.cr...@gmail.com wrote:
  Hey guys,
 
  I just became aware of this:
 
  http://internetdefenseleague.org/
 
 
  It's a site setup by Mozilla, Reddit, and others to defend internet
 freedom
  in the wake of recent legislative events in the U.S. and elsewhere (full
  members list here:  http://www.internetdefenseleague.org/members).
 
  They've setup what they're calling the cat signal, an invisible bit of
  embeddable code you can put in your website that will activate (and
 display
  the afore-mentioned signal/link/etc) if/when the next SOPA/PIPA/etc
 comes
  along that threatens the open internet.
 
  I'd like to propose that we integrate this into the PHP website.  This
  issue directly affects our community and we already staked a claim in
 this
  fight when we participated in the last great blackout.
 
  In addition, I'd also l ike to propose that we officially join this
 group
  as a member.  I'm not sure if we'd do this by vote or something similar
 to
  the RFC process  etc, but if you'll grant me permission, I'd be happy
 to
  do the legwork on this myself (make the HTML edits, contact the
  organization on PHP's behalf, etc).
 
 
  Thoughts?
 
  --Kris



 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/

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


 Btw. we were asked by the to join the league as we were a big traffic
 source on the black out day.
 I don't know if Rasmus is on the webmaster list or not, but we should cc
 him, as he was the driving force behind us joining the anti SOPA movement.

He is everywhere.

But I thought we were already 'members'?
See also http://php.markmail.org/message/7e4uqo73fmtlgjeo

-Hannes

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



[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Hannes Magnusson
On Thu, Jul 19, 2012 at 10:01 PM, Kris Craig kris.cr...@gmail.com wrote:


 On Thu, Jul 19, 2012 at 1:52 PM, Ferenc Kovacs tyr...@gmail.com wrote:


  Btw. we were asked by the to join the league as we were a big traffic
  source on the black out day.
  I don't know if Rasmus is on the webmaster list or not, but we should
  cc
  him, as he was the driving force behind us joining the anti SOPA
  movement.

 He is everywhere.

 But I thought we were already 'members'?
 See also http://php.markmail.org/message/7e4uqo73fmtlgjeo

 -Hannes


 Thanks, that was the mail that I was referring to.
 I didn't see anybody reply on that thread, so except we replied in private
 (why would we do that?) I guess we never officially accepted that
 invitation.

 --
 Ferenc Kovács
 @Tyr43l - http://tyrael.hu


 Can we officially accept it now?  It sounds like everyone is all for this.
 We're already technically a member anyway with the cat signal code
 implemented, plus I've already reached out to them based on this thread and
 the response I got from our webmaster.  Do we have any procedure or secret
 handshake or whatever for this, or can we just say, Yep we're down with
 this and be done with it?  =)

You need to write an RFC, run one round around a church, submit a call
for open discussion for the request for comment, run backwards around
a church, spit on the grave of your first born, then vote.

Or in other words; What exactly are you looking to do here?
If we are already pencilled down as members, great!
Is there anything else left then?

-Hannes

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



[PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Hannes Magnusson
On Thu, Jul 19, 2012 at 10:16 PM, Kris Craig kris.cr...@gmail.com wrote:


 On Thu, Jul 19, 2012 at 2:11 PM, Hannes Magnusson
 hannes.magnus...@gmail.com wrote:

 On Thu, Jul 19, 2012 at 10:01 PM, Kris Craig kris.cr...@gmail.com wrote:
 
 
  On Thu, Jul 19, 2012 at 1:52 PM, Ferenc Kovacs tyr...@gmail.com wrote:
 
 
   Btw. we were asked by the to join the league as we were a big
   traffic
   source on the black out day.
   I don't know if Rasmus is on the webmaster list or not, but we
   should
   cc
   him, as he was the driving force behind us joining the anti SOPA
   movement.
 
  He is everywhere.
 
  But I thought we were already 'members'?
  See also http://php.markmail.org/message/7e4uqo73fmtlgjeo
 
  -Hannes
 
 
  Thanks, that was the mail that I was referring to.
  I didn't see anybody reply on that thread, so except we replied in
  private
  (why would we do that?) I guess we never officially accepted that
  invitation.
 
  --
  Ferenc Kovács
  @Tyr43l - http://tyrael.hu
 
 
  Can we officially accept it now?  It sounds like everyone is all for
  this.
  We're already technically a member anyway with the cat signal code
  implemented, plus I've already reached out to them based on this thread
  and
  the response I got from our webmaster.  Do we have any procedure or
  secret
  handshake or whatever for this, or can we just say, Yep we're down with
  this and be done with it?  =)

 You need to write an RFC, run one round around a church, submit a call
 for open discussion for the request for comment, run backwards around
 a church, spit on the grave of your first born, then vote.

 Or in other words; What exactly are you looking to do here?
 If we are already pencilled down as members, great!
 Is there anything else left then?

 -Hannes


 I don't think so, no.  I just wanted to double-check and make sure I'm being
 kosher in asking them to list us and our logo on their top members page.  =)

Great. let us know how it goes.

-Hannes

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



[PHP] Re: [PHP-WEBMASTER] Class COM not found

2009-12-17 Thread Hannes Magnusson
(moving to php-general@lists.php.net, please reply-to-all if you have
more questions)

DBus would be the only extension that comes close to what the COM
extension does on windows.
See http://pecl.php.net/package/DBus

There are currently no documentations (and apparently no releases?)
but you can check it out from SVN and compile it yourself.
There are lot of examples in the examples directory, and there have
been several presentations about the subject which you can search for.

-Hannes

On Thu, Dec 17, 2009 at 10:00, Dinesh dineshsd...@hotmail.com wrote:
 Ok. I got it that COM will work only in windows environment. What function
 needs to be called to access linux components?

 Regards
 Dinesh

 --
 From: Hannes Magnusson hannes.magnus...@gmail.com
 Sent: Thursday, December 17, 2009 2:08 PM
 To: Dinesh dineshsd...@hotmail.com
 Cc: php-webmaster php-webmas...@lists.php.net
 Subject: Re: [PHP-WEBMASTER] Class COM not found

 On Thu, Dec 17, 2009 at 08:31, Dinesh dineshsd...@hotmail.com wrote:

 Hi,

 I am getting the following error when I tried to run this code in PHP
 $Obj = new COM(PDFTextStamp.PDFTextStampCom); using CLI method

 PHP Fatal error: Class 'COM' not found in /root/TAP3/taptest.php on line
 2

 Can you please help me in fixing this issue?

 http://no2.php.net/manual/en/com.requirements.php

 -Hannes



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



[PHP] ErrorException and set_exception_handler()

2009-12-11 Thread Hannes Magnusson
Hello randallgirard

Since the bug tracker isn't really a discussion forum, lets move it to
the General PHP User List (which is a discussion forum).

Regarding bug#50446[1] you filed, either I am misunderstanding what
you are hoping to achieve or you are misunderstanding the expected
behavior/documentations.

As far as I can tell; you are expecting the ErrorException class to
be some sort of magical exception which turns normal E_USER_* errors
into exceptions, without actually behaving like exceptions (i.e.
stopping program execution if not caught).

If you have a exception handler registered (via
set_exception_handler()) and there is no try/catch block around the
code that triggered the exception (doesn't matter where the exception
is thrown, from set_error_handler() or regular code), then the
exception handler will kick in.
After the exception handler has done its job PHP will stop the
execution of the script. No matter what.

There are no exceptions to that. On uncaught  exceptions (i.e. not
caught via catch() blocks) PHP *will* stop execution of the script.

There are multiple reasons for that, including:
 * How should PHP know where to return to?
If an exception was thrown inside an method, which was called in a
function from global scope; Where do you expect PHP to continue from?
Global scope?
From the function that called the method?
From the method that threw the exception?

 * Exceptions are thrown when there is something very very wrong.
If the application doesn't know how to handle that particular type of
exception (via a catch() block) then the application has no fallback
procedure in place. PHP has no other resort then to stop the execution
of the script.

 * The ErrorException isn't treated specially from PHP point of view.
Its just another exception type, like InvalidArgumentException,
ErrorExeption, BadMethodCallException, LogicException,
RuntimeException, UnexpectedValueException.
There is no technical difference between the exceptions or any other
built-in exception classes.
The built-in exceptions (SPL has a good chunk) simply suggest a
standard naming convention for exceptions to use (to simplify the
catch() clauses in applications for example).
Those exceptions will be treated just as any other exceptions, so you
must catch them if you want to deal with them and continue the script
execution.


If you want to turn all your E_USER_* errors into exceptions then you
absolutely can.
If you prefer to throw an exception when something internally emits
E_* errors (for example, invalid parameters to functions) you can.
But you still have to catch() those exceptions.


The only reason why the ErrorException exists is because many people
in the past complained over the fact PHP didn't stop execution when
internal function emitted E_* errors (such as sending array to a
function that expects an string).
Now you can throw exceptions on such errors.
Simply create an error handler and make it throw Exception
(ErrorException maps nicely to the information contained in normal E_*
errors, as it contains the error message, the errors code(E_*),
severity (fatal error/recoverable error/warning/notice/), the
filename it occurred, and line number.
Note: You still need to catch the exception if you want to continue
the program flow.




I don't quite understand your comment about E_USER_* errors being
useless. I use those error levels extensively when I can't to inform
the caller that something happened, but I could still do the job the
caller expected.

I personally do not use exceptions for my application flow (*I*
consider it extremely bad practice). If I want to inform the
caller/developer that something I had to guess what he wanted, or if
something skeptical/wrong happend, I throw E_USER_* errors.

My main error handler is actually the set_error_handler(). My
default exception handler calls back to my error handler, as my
error handler allready deals with sever error conditions.



Hope it this post shed some light on ErrorException and set_exception_handler().
If not, please reply-to-all with your questions (I CCed
php-general@lists.php.net on this post, which is a discussion list).

-Hannes

[1] http://bugs.php.net/50446

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



[PHP] Re: ErrorException and set_exception_handler()

2009-12-11 Thread Hannes Magnusson
On Fri, Dec 11, 2009 at 23:39, Randall Girard randallgir...@hotmail.com wrote:
 Okay, my mistake.


 E_USER_WARNING and E_USER_NOTICE are supposed to continue execution,
 correct?

Correct.


 Then  I will restate what I previously said. throwing ErrorException from an

No no. Stop there. Exceptions are *totally* different from E_*.


 ERROR_HANDLER(...) is useless iwht E_USER_WARNING and E_USER_NOTICE. Why?
 Because when you throw the exception from the ERROR_HANDLER, presumably it
 may NOT get caught in a try/catch block. Therefor the execution cannot
 continue.

Exactly. And that is the point.
Why would you be turning E_USER_* into exceptions if you don't want to
bail out of the current scope?

If you throw an exception from the error handler, what exactly do you
expect to happen?
I gave several reasons for why that simply is impossible, but I am
curious: what exactly are you expecting?



 Therefor, I think that either a check to see if the TRY/CATCH has been
 initiated further up the call stack, or a function to call from within the
 EXCEPTION_HANDLER that will return execution to the previous scope.


 I don't see how this is difficult to understand.

So you expect a scripting language to scroll up the entire execution
chain to see if there is a catch() block at all, and if there is no
catch() block, the simply ignore the exception and continue?
If thats your expectations then you are severely misunderstanding the
concept of exceptions.


Please do reply-all. And please do not top-post.


-Hannes

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



[PHP] [HEADSUP] New Google Summer of Code Mailinglist

2009-01-25 Thread Hannes Magnusson
Hello all, and sorry for the massive cross-posting :)

As of now we have a list dedicated to Google Summer Of Code[1] discussions.
It is our hope that everyone who are interested in PHP and GSOC
subscribe[2] to the list and participate in the discussions, or just
lurk and follow the fun.

Among other things, the goal for the list is to have a one-entry-point
for anyone wanting follow the work of the (to-be) GSOC students
working for php.net.
Students will be required to CC this list their (weekly? bi-weekly?)
status reports.
If you are a student and looking for a interesting project to work on,
feel free to subscribe and introduce yourself.

Have an idea for a GSOC project? Want to share your GSOC story? Think
you have what it takes to be a mentor? Want to comment on how PHP+GSOC
has been handled the past years? Improvement suggestions?
Sign up and let us know!

-Hannes

[1] g...@lists.php.net  http://news.php.net/php.gsoc
[2] By sending an email to gsoc-subscr...@lists.php.net

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



[PHP] Re: [PHP-DEV] PHP 5.3.0alpha3

2008-12-04 Thread Hannes Magnusson
On Thu, Dec 4, 2008 at 22:17, Lukas Kahwe Smith [EMAIL PROTECTED] wrote:
 in the namespace changes. Please also note that the documentation for
 namespaces has been updated already:
 http://php.net/namespace

Not 100% true. The example are missing the separator due to wrong
syntax highlighting.
This has been fixed in CVS and will be updated tomorrow.

Until then, please use the special docs mirror: http://docs.php.net/namespaces

-Hannes

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



[PHP] Re: [PHP-DEV] PHP 5.3.0alpha1

2008-08-05 Thread Hannes Magnusson
On Fri, Aug 1, 2008 at 09:31, Lukas Kahwe Smith [EMAIL PROTECTED] wrote:
 Hello!

 Johannes has packed PHP 5.3.0alpha1 yesterday evening, which you can find
 here:
 http://downloads.php.net/johannes/

So.. Apparently we will not get Windows builds of alpha1 as some of
the new extensions didn't build on Windows.. Is someone working on
fixing that problem for alpha2?

-Hannes

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



Re: [PHP] Get reference count on a variable.

2004-08-21 Thread Hannes Magnusson
On Sat, 21 Aug 2004 04:10:53 +
[EMAIL PROTECTED] (Curt Zirzow) wrote:

 * Thus wrote Robert Cummings:
  Hi All,
  
  I think I'm looking for something that doesn't exist, but just in
  case thought I'd check the list. Does anyone know if a PHP function
  exists to get the number of references on a given variable's data? I was
  hoping to create a way for a factory to automatically recycle resources
  without the need for the developer to call some kind of free() method.
  If I could get the internal reference count then I'd be able to
  determine if it is free by virtue of only 1 reference (the factory).
  This is for PHP4 btw, the solution is trivial in PHP5 using destructors.
 
 unfortantly there isn't a method to determain this.
 
 Be careful with PHP5, i'm not sure if its applicable in your
 situation, but there does seem to be rumor that php5 objects are
 assigned by reference, which isn't true:
http://zend.com/expert_qa/qas.php?id=41single=1
please read :)

 - Hannes

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



[PHP] Re: Modifying this PHP-based sourceforge.net web proxy

2004-08-18 Thread Hannes Magnusson
On Wed, 18 Aug 2004 14:59:20 -0700
[EMAIL PROTECTED] (News.Php.Net) wrote:

 Attached is an awesome web proxy, which totally meets my needs, but I need
 it to be transparent.  I need anyone accessing the computer that this is on
 to be automatically proxy-ed to a URL, but then let them navigate through
 the links just fine.  I also do not want them to see the banner that's
 displayed by default.
 
 This script was designed for people to be able to bypass blocked websites
 from work, by going through this proxy, but I need it because one DMZ on our
 firewall cannot access the other DMZ where the web server is, and they need
 to be able to.
 
 This script works fine in my testing, but I do not know enough about PHP yet
 to be able to modify it on my own.
 
 I tried changing the $this-url on line 202, which set the script up to
 browse that URL fine, but none of the links.  It always displayed only the
 home page.  I need an initial URL, but then allow it to be changed when
 people click on a link.
 
 Can anyone help?  Thanks a million!
 
   - Adam
[snip some crap attachment]
Sure, the author of this unit can help you, doubt anyone here can/want to/will.
Doesnt it seem logical to you mailing the author instead of this mail list?
-Hannes

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



[PHP] Re: mysql_fetch_array()

2004-08-17 Thread Hannes Magnusson
On Tue, 17 Aug 2004 18:18:24 -0400
[EMAIL PROTECTED] (Anthony Ritter) wrote:

 When using mysql_fetch_array() is it necsessary to specify the second
 argument - meaning the constant of MYSQL_NUM or MYSQL_ASSOC?
php.net/mysql_fetch_array
array mysql_fetch_array ( resource result [, int result_type])
meaning; no. You don't need to specify the second argumen.

 
 I have seen many examples where it is left out and it is coded:
 
 $row = mysql_fetch_array($sql);
 
 as opposed to
 
 $row = mysql_fetch_array($sql, MYSQL_BOTH);
 
 Thank you.
 TR

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



[PHP] Re: writing source code to file

2004-08-17 Thread Hannes Magnusson
On Wed, 18 Aug 2004 00:50:45 -0700
[EMAIL PROTECTED] (Josh Acecool M) wrote:

 file_get_contents(http://www.yoursite.com/script.php;);
I belive that this method will hang for ever since the script doesnt exit until 
file_get_contents() has got the complete results.. ...and the complete results wont be 
ready until file_get_contents() returns.
Rather use Output Controle via PHP ( php.net/outcontrol )
 - Hannes
 
 using http:// causes it to get the html source.
 Hannes Magnusson [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  http://www.php.net/manual/en/ref.outcontrol.php
 
  On Mon, 16 Aug 2004 10:35:42 -0400
  [EMAIL PROTECTED] (Doug Parker) wrote:
 
   I was wondering if there was a block of code I could place at the bottom
 of
   the file that would write the page's source code to an html file.  I
 need
   this because I'm posting pages to a server sans a PHP compiler.
 Basically,
   I'd like for every time I run a page its source code to be saved in the
   filename of my choice, instead of me having to run the page, copy the
   source, and paste it into the file of my choice. I know how to use
 fopen,
   but I'm not sure what to tell it to write to file, since the source I
 want
   to write is being generated simultaneously.
  
   Any help would be greatly appreciated...

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



Re: [PHP] Re: writing source code to file

2004-08-17 Thread Hannes Magnusson
On Tue, 17 Aug 2004 19:34:18 -0700
[EMAIL PROTECTED] (John Holmes) wrote:

 Hannes Magnusson wrote:
 
 file_get_contents(http://www.yoursite.com/script.php;);
  
  I belive that this method will hang for ever since the script 
  doesnt exit until file_get_contents() has got the complete results.. 
  ...and the complete results wont be ready until file_get_contents() 
  returns. 
 
 There are no problems with using a method like this.
You really think that this works? getting contents from the file currently running?
I not only doubt it, I *know* it wont work.
Try this out:
?php
$url = http://; .$_SERVER[ HTTP_HOST ].$_SERVER[ REQUEST_URI ];
$string = file_get_contents ( $url );
?
This really what you are proposing?
Works fine as long as you run file_get_contents() on diffrent file.

 - Hannes
 
 -- 
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals ___ www.phparch.com

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



[PHP] Re: How to understand this Warning?

2004-08-17 Thread Hannes Magnusson
On Wed, 18 Aug 2004 02:54:35 +0300
[EMAIL PROTECTED] (Labunski) wrote:

 Hello,
 How to understand this warning?
 I thought maybe the directory name is incorrect, but it's fine.
 The Browser said..
 Warning: readdir(): 2 is not a valid Directory resource in
note the 2 in that message. You are prob. resetting the readdir() parameter in the 
script somewhere

 C:\xxx\x\news.php no line 78.
 
 
 ?php
  if ($handle = opendir('news')) {
 $sortArray=array();
 while (false !== ($topic = readdir($handle))) {  // this is line 78
 if ($topic != .  $topic != ..) {
 while (false !== ($topic = readdir($handle)))
 {
if($topic != .  $topic != ..)
{
 
You loop twice throu the same dir?

 - Hannes
 ..etc. etc.
 I posted just a first part (beginning) of the code, so that it were easier
 to understand.
 
 Sorry for my bad English,
 Thank you very much,
 Lab.

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



[PHP] Re: writing source code to file

2004-08-16 Thread Hannes Magnusson
http://www.php.net/manual/en/ref.outcontrol.php

On Mon, 16 Aug 2004 10:35:42 -0400
[EMAIL PROTECTED] (Doug Parker) wrote:

 I was wondering if there was a block of code I could place at the bottom of
 the file that would write the page's source code to an html file.  I need
 this because I'm posting pages to a server sans a PHP compiler.  Basically,
 I'd like for every time I run a page its source code to be saved in the
 filename of my choice, instead of me having to run the page, copy the
 source, and paste it into the file of my choice. I know how to use fopen,
 but I'm not sure what to tell it to write to file, since the source I want
 to write is being generated simultaneously.
 
 Any help would be greatly appreciated...

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-15 Thread Hannes Magnusson
On Sun, 15 Aug 2004 16:36:42 -0300
[EMAIL PROTECTED] (Juan Nin) wrote:

 Hannes Magnusson wrote:
 
  Are we just suppost to know Matt Wright's FormMail.pl ? 
 
 Matt Wright's FormMail.pl script is a very well known script, that's 
 been used by thousands of people for several years. So it was very 
 likely that many of the people who read the e-mail knew what I was 
 talking about...
 
 This list consists not only of PHP programmers, but there are also 
 people who know many other languages like Perl, or work administrating 
 servers, etc, so many can know what this script is...
 
 Moreover, the name FormMail is quite descriptive, and there are other 
 FormMail scripts written in several languages that acomplish the same 
 task, so not knowing Matt's script does not mean that you don't know 
 what a FormMail script is.. (obviously not everyone knows what a 
 FormMail script does, but obviously not everyone in the list should know 
 about certain topics)
 
 Or are we suppost to google to check that out so we can answear your question?
 
 I don't expect that...
 
 I have many times googled about things that someone asked on a list and 
 I didn't know what it was.. just for me to know what it as, or to see if 
 I could help this person... I don't expect others to do it, but it 
 doesn't mean that someone can't do it either..
 
 but I also expect a more polite reply than you have obviously not read 
 the PHP manual or RTFM, since it was definitely and obviously not the 
 case...
I was not trying to be rude, just never heard of this FormMail by Matt Wright and have 
*no* idea how it works so I posted link to pear - in case you were new to PHP. 
Your post just sounded like you were hardcore perl writer trying out PHP.

 - After having googled FormMail Matt Wright and checked it out.. ..don't know of 
any compatible PHP scripts, sorry.

 - Hannes
 
 I know this list is a bit differente from others, there are many newbies
 who use to ask how do I do this without RTFM or STFW, and there is a 
 mix of *NIX, Windows and others users, and sometimes that sort of things
 , which are always the same, fed up people, but I was not asking some 
 stupid question because of not RTFM...
 
  Anyway, 
  http://pear.php.net/package-search.php?pkg_name=mailbool=ANDsubmit=Search any 
  help?
 
 nope, thos are packages for mime decoding (which I have used in other 
 projects), access for pop or imap, or the most simple Mail package which 
 serves for e-mail sending, just like phpMailer would do, or even the 
 mail() function for more simple tasks... but that's not what I want...
 
 I know how to send e-mail, with mail(), with phpMailer or with 
 PEAR::Mail, I want a good and tested FormMail script.. if I don't find 
 one, I'll use my own written, but I don't want to reinvent the wheel..
 
 anyway, I think I'll look in other places... thanks anyway
 
 Juan

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



[PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
http://www.zend.com/store/products/zend-encoder.php

On Mon, 16 Aug 2004 01:12:14 +0100
[EMAIL PROTECTED] (Watty) wrote:

 Is it possible to compile a PHP script? And if so, how?
  
 Watty
 

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



[PHP] Re: How to get mime type from file name

2004-08-15 Thread Hannes Magnusson
What happend to RTFM ? Is that not cool anymore?
http://www.php.net/manual/en/ref.mime-magic.php now, R-T-F-M !

- Hannes

On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

 Hello,
 
 Is there any function where I can pass a file name like file.png and 
 get return the string of its type 'image/png' ?
 
 Basically it is a funcion that takes a file name and returns a string of 
 its mime type.
 
 I have used mime_mail to send attachments but the I need when I am 
 attaching the file to know its mime type, for instance a zip file or a 
 jpg or a txt etc.
 
 Thanks in advance for the help.

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



Re: [PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
On Mon, 16 Aug 2004 09:01:54 +0800
[EMAIL PROTECTED] (Louie Miranda) wrote:

 no free tools?
I belive there are some, don't know there name thou. Ask google, should take more then 
2min to find out there names.

 
 On Mon, 16 Aug 2004 02:37:48 +0200, Hannes Magnusson [EMAIL PROTECTED] wrote:
  http://www.zend.com/store/products/zend-encoder.php
  
  On Mon, 16 Aug 2004 01:12:14 +0100
  [EMAIL PROTECTED] (Watty) wrote:
  
   Is it possible to compile a PHP script? And if so, how?
  
   Watty
  
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 -- 
 Louie Miranda
 http://www.axishift.com

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



[PHP] Re: How to get mime type from file name

2004-08-15 Thread Hannes Magnusson
First of, do not mail me directly, post to the news group!

2nd: http://www.php.net/manual/en/function.mime-content-type.php
[snip]
mime_content_type
(PHP 4 = 4.3.0, PHP 5)
[/snip]
Which mean: You need *at least* PHP4.3.0 for this extension.

3rd:
http://www.php.net/manual/en/ref.mime-magic.php
[snip]
Installation

You must compile PHP with the configure switch --with-mime-magic to get support for 
mime-type functions. The extension needs a copy of the simplified magic file that is 
distributed with the Apache httpd.

Note: The configure option has been changed from --enable-mime-magic to 
--with-mime-magic since PHP 4.3.2 
[/snip]
Which mean: You need to compile PHP with this switch.

4th: http://pecl.php.net/package/fileinfo


From: C.F. Scheidecker Antunes [EMAIL PROTECTED]
To: Hannes Magnusson [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: How to get mime type from file name
Date: Sun, 15 Aug 2004 18:40:10 -0600
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Hannes,

Thanks but I have checked the manual as well, my PHP is version 4.3.6 however the 
function mime_content_type() is not there.
Besides that, systems without php 4.3 or higher do not support it.

Therefore, maybe I should write a function to read it from /etc/mime.types.

Unless there is something easier.

Thanks.

Hannes Magnusson wrote:What happend to RTFM ? Is that not cool anymore?
http://www.php.net/manual/en/ref.mime-magic.php now, R-T-F-M !

- Hannes

On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

  Hello,

Is there any function where I can pass a file name like file.png and 
get return the string of its type 'image/png' ?

Basically it is a funcion that takes a file name and returns a string of 
its mime type.

I have used mime_mail to send attachments but the I need when I am 
attaching the file to know its mime type, for instance a zip file or a 
jpg or a txt etc.

Thanks in advance for the help.

  
On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

 Hello,
 
 Is there any function where I can pass a file name like file.png and 
 get return the string of its type 'image/png' ?
 
 Basically it is a funcion that takes a file name and returns a string of 
 its mime type.
 
 I have used mime_mail to send attachments but the I need when I am 
 attaching the file to know its mime type, for instance a zip file or a 
 jpg or a txt etc.
 
 Thanks in advance for the help.

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



[PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
Why did you reply me directly?
Anyway. I suppose you can find similar programs for free, just google'em

From: Watty [EMAIL PROTECTED]
To: 'Hannes Magnusson' [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Compile
Date: Mon, 16 Aug 2004 01:58:37 +0100
X-Mailer: Microsoft Outlook, Build 10.0.2616

Haha at a mere $960

 -Original Message-
 From: Hannes Magnusson [mailto:[EMAIL PROTECTED]
 Sent: 16 August 2004 01:38
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Compile
 
 http://www.zend.com/store/products/zend-encoder.php
 
 On Mon, 16 Aug 2004 01:12:14 +0100
 [EMAIL PROTECTED] (Watty) wrote:
 
  Is it possible to compile a PHP script? And if so, how?
 
  Watty
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



On Mon, 16 Aug 2004 01:12:14 +0100
[EMAIL PROTECTED] (Watty) wrote:

 Is it possible to compile a PHP script? And if so, how?
  
 Watty
 

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



[PHP] Re: Open all subdirectories in a directory

2004-08-14 Thread Hannes Magnusson

On 14 Aug 2004 12:52:12 -
[EMAIL PROTECTED] (Phpdiscuss - Php Newsgroups And Mailing Lists) wrote:

 Hello Professionals,
 Can anybody help me to open all subdirectories in a directory,
 I used is_dir() to check whether it is a dir, and if yes,
 I recursively called it with the new dir name.
 But  all subdirectories are not open the recursion is not working for more
 than 1 level.
Try to call is_dir() with full/path/to/dir ( realpath() may come in handy ) and/or 
chdir() to the dir.

 I tested it in windows server.
 Expecting your help,
 Jacob.

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



[PHP] Re: str_replace - is it case sensitive

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 14:37:09 +0100
[EMAIL PROTECTED] (Andrew W) wrote:

 Is the str_replace function case sensitive, I cant seem to find any 
 answer on the PHP manual website or in my books.
Yes. For case in-sensitve use str_ireplace
Look at the PHP manual one more time under See also

 
 If it is, is there anyway to make it case insensitive so it can handle 
 mIxEd CaSe woRdS in any combination?
 
 Thanks
 AW

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



Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_unique ( $array ) ) == 1 ) {
 // all fields have the same value
}
we could post solution to this problem for ever...
- Hannes

On Sat, 14 Aug 2004 15:24:03 +0100
[EMAIL PROTECTED] (Mike Ford) wrote:

 -Original Message-
 From: Brent Clements
 To: [EMAIL PROTECTED]
 
 I wanted to see if anyone has an easier way to do this. The end result
 is this: I need to compare 7 different text strings(which are in an
 array). They should all be the same, if they are not the same, a message
 should be outputted saying they weren't.
 
 How would one do this outside of using a huge if/then statement?
 
 ---
 
 Two approaches come to mind off the top of my head:
 
   $values = array_count_values($array);
 
   if (count($values)1):
 // there's more than one unique value in the array
   endif;
 
 or...
 
   $value = $array[0];
   for ($i=1; $i7; ++$i):
 if ($array[$i]!= $value):
   // this value doesn't match
   break;
 endif;
   endfor;
 
 Cheers!
 
 Mike

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



Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_diff ( $array, array ( $array[0] ) )  0 ) { // not same }

On Sun, 15 Aug 2004 00:24:30 +0800
[EMAIL PROTECTED] (Jason Wong) wrote:

 On Saturday 14 August 2004 23:12, Hannes Magnusson wrote:
  if ( count ( array_unique ( $array ) ) == 1 ) {
   // all fields have the same value
  }
  we could post solution to this problem for ever...
 
 Indeed:
 
   if (count(array_flip($doo))  1) { // not same }
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 One difference between a man and a machine is that a machine is quiet
 when well oiled.
 */

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



[PHP] Re: [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread Hannes Magnusson
run cron via httpd user? i.e. 
  fputs STDIN crontab -e blablabla

- Hannes

On Sat, 14 Aug 2004 18:34:10 +0200
[EMAIL PROTECTED] (FrancescoAutomationsoftBiz) wrote:

 Hi all,
 I have a script that generate a benchmark report, in *.csv, every day.
 I want to have the possibility to send me this report every day at the same time, 
 during night, i.e. at the 03.00 am. I know that there is Cron that give me the 
 possibility to do this, but I'm not the server manager and I cannot use Cron. I find 
 a good alternative script, called Pseudo-Cron, but it runs only when the page that 
 contains script is called.
 There is a script that have the same function of Cron but is only php, or there is 
 another way to call Cron or anyother way to use Cron?
 All helps are very appreciated.
 Thank's all.
 Francesco
 [EMAIL PROTECTED]
 

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



[PHP] Re: [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread Hannes Magnusson
Don't mail me directly, no good comes from that.

Anyway, see my answear below.
 -Hannes

From: francesco[AT]automationsoft[DOT]biz [EMAIL PROTECTED]
To: Hannes Magnusson [EMAIL PROTECTED]
Subject: Re: [PHP] Re: [PHP-General List] - Cron or script like Cron -
Date: Sat, 14 Aug 2004 19:03:02 +0200
X-Mailer: Microsoft Outlook Express 6.00.2800.1106

Hi Hannes,
I'm not sure that I understand your solution.
Can explain me well?
Thank's

 run cron via httpd user? i.e.
   fputs STDIN crontab -e blablabla
can't doit via fputs, was just trying to put in your head some ideas how to do this.
can problibly do something like shell_exec ( 'echo YourNewCronjob  
/path/to/nobody/crontab' );

This doesnt have alot todo with php thou.

 - Hannes

 On Sat, 14 Aug 2004 18:34:10 +0200
 [EMAIL PROTECTED] (FrancescoAutomationsoftBiz) wrote:

  Hi all,
  I have a script that generate a benchmark report, in *.csv, every day.
  I want to have the possibility to send me this report every day at the
same time, during night, i.e. at the 03.00 am. I know that there is Cron
that give me the possibility to do this, but I'm not the server manager and
I cannot use Cron. I find a good alternative script, called Pseudo-Cron, but
it runs only when the page that contains script is called.
  There is a script that have the same function of Cron but is only php,
or there is another way to call Cron or anyother way to use Cron?
  All helps are very appreciated.
  Thank's all.
  Francesco
  [EMAIL PROTECTED]
 

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



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



[PHP] Re: What happend to _SERVER?

2004-08-14 Thread Hannes Magnusson
try to alter your ini file;
ini_set ( variables_order, EGPCS );
var_dump ( $_SERVER );
- Hannes

On Sat, 14 Aug 2004 15:26:46 -0700
[EMAIL PROTECTED] (Allen Wayne Best) wrote:

 Hello:
 
 I am having a spot of difficulty with PHP. I cannot get php to return the 
 values of _SERVER. Here is a test php file.
 
 ?php
 $handle = fopen( /tmp/test.txt , w ) ;
 fwrite( $handle, REMOTE_ADDR:  ) ;
 fwrite( $handle, $_SERVER[REMOTE_ADDR] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, HTTP_HOST:  ) ;
 fwrite( $handle, $_SERVER[HTTP_HOST] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, SERVER_NAME:  ) ;
 fwrite( $handle, $_SERVER[SERVER_NAME] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, SERVER_SOFTWARE:  ) ;
 fwrite( $handle, $_SERVER[SERVER_SOFTWARE] ) ;
 fwrite( $handle, \n\n ) ;
 phpinfo() ;
 ?
 
 the output in /tmp/test.txt is:
 REMOTE_ADDR: 
 
 HTTP_HOST: 
 
 SERVER_NAME: 
 
 SERVER_SOFTWARE: 
 
 
 and the browser shows a blank window (mozilla and konqueror!).
 
 Any suggestions are greatly appreciated.
 
 -- 
 regards,
 allen wayne best, esq
 your friendly neighborhood rambler owner
 my rambler will go from 0 to 105
 Current date: 1:21:15::226:2004
 
 I went to a job interview the other day, the guy asked me if I had any
 questions , I said yes, just one, if you're in a car traveling at the
 speed of light and you turn your headlights on, does anything happen?
 
 He said he couldn't answer that, I told him sorry, but I couldn't work
 for him then.
   -- Steven Wright

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 20:13:23 -0300
[EMAIL PROTECTED] (Juan Nin) wrote:

 raditha dissanayake wrote:
  Juan Nin wrote:
  
  Hi
 
  I'm looking for a good FormMail PHP script which beheaves like Matt 
  Wright's FormMail.pl script (but lacks it's exploitable problems :)
 
  I found several on the net, but didn't like them too much...
 
  any recommendations?
  
  
  you have obviously not looked at the PHP manual.
 
 First of all: despite the fact that on the manual there are always 
 comments and code examples, it's not the obvious place where to look for 
 that...
 
 Second, I suppose you are talking about the examples that were posted in 
 the docs about the mail() function... that's not what I want... if I 
 simply wanted to write a script that sends an e-mail from a defined 
 form, I do it in 2 minutes...
 
 what I want is a generic script that can be used with ANY form, just 
 like Matt Wright's FormMail.pl does, and that is well written, and 
Are we just suppost to know Matt Wright's FormMail.pl ? Or are we suppost to google 
to check that out so we can answear your question?

Anyway, http://pear.php.net/package-search.php?pkg_name=mailbool=ANDsubmit=Search 
any help?


 secure, that has no spam exploitable bugs, etc, like Matt's has..
 
 I could write it myself too, I can do it, in no more than ten minutes, 
 but I don't want to reinvent the wheel, and maybe if I write it, despite 
 the fact that I administer mail servers, web servers and many others, 
 maybe I fall under some exploitable bug too... so maybe there's an 
 existing good script already written, that many people uses, and that is 
 known to be good? do I explain myself?
 
 I googled and found several, but looking at them, I didn't like them, 
 because they were more like simple scripts like the ones posted in the 
 docs of the mail() function, or the ones which were generic, for any 
 form, weren't good, and didn't have any type of checks, and were 
 obviously and easily exploitable..
 
 so looking at the PHP manual is not the answer for me in this case, I 
 don't want a 2 line script, I want something good and serious...
 
 If anyone knows of a good script of this kind, I will appreciate  :)
 
 thanks again,
 
 Juan

- Hannes

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 18:14:48 -0700
[EMAIL PROTECTED] (Allen Wayne Best) wrote:

 john:
 
 ooops! yes, i do. fixed. ran thru the web browser (no change!) fyi, the web 
 server is apache 2.0.40-21.11 on a rh9 box.
 
 i uninstalled all php rpms, and reinstalled. no change.
 php-4.2.2-17.2.i386.rpm
 php-devel-4.2.2-17.2.i386.rpm
 php-imap-4.2.2-17.2.i386.rpm
 php-ldap-4.2.2-17.2.i386.rpm
 php-manual-4.2.2-17.2.i386.rpm
 php-mysql-4.2.2-17.2.i386.rpm
 php-pgsql-4.2.2-17.2.i386.rpm
 php-snmp-4.2.2-17.2.i386.rpm
 
 bye the way, when i view page source in mozilla, I find:
 htmlhead/headbody/body/html
That is impossible. var_dump() *ALWAYS* prints results.
Insert this code into a file testing.php
?php
var_dump( $_SERVER );
phpinfo ( INFO_VARIABLES );
show_source( __FILE__ );
?
- Hannes

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



Re: [PHP] access a file

2004-08-13 Thread Hannes Magnusson
Web server user  group, not the file.

what user own the file abc.pl ? is it the same user as is running httpd ?

- Hannes

On Fri, 13 Aug 2004 16:14:55 +0600
[EMAIL PROTECTED] (Curlys) wrote:

 -rwxr-xr-x1 root root  133 Aug 13 15:48 zeed.php
 
 group and owner like this ,
 how does it workable plz help
 
 thanx
 curlys
 
 
 - Original Message - 
 From: John Holmes [EMAIL PROTECTED]
 To: Curlys [EMAIL PROTECTED]
 Cc: PHP [EMAIL PROTECTED]
 Sent: Friday, August 13, 2004 7:13 PM
 Subject: Re: [PHP] access a file
 
 
 Curlys wrote:
 
  when run this script from the command prompt, it is working.
 
  ?php
 
  shell_exec ('killall -HUP abc.pl');
 
  ?
  html
  body Terminated the application ... /body
  /html
 
  but , when it is put this file in a apache web server run via web browser
  ( accessing a URL with a Link ) it doesn't work . what should i have to do
 ?
 
 The PHP script runs as the Apache user, which is generally 'nobody', so
 it probably doesn't have permission to execute the requested command.
 
 -- 
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals ___ www.phparch.com

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



Re: [PHP] Thumbnail Problem

2004-08-13 Thread Hannes Magnusson
On Fri, 13 Aug 2004 15:18:20 +0800
[EMAIL PROTECTED] (Jason Wong) wrote:

 On Thursday 12 August 2004 21:05, Me2resh wrote:
  i have a class that generates thumbnails without making actual file on the
  server
  it works good on my local server
  but on my web hosting it gives me  
  Fatal error: Call to undefined function: exif_imagetype() in
Need to compile PHP with --enable-exif, althou getimagesize() maight be better 
alternetive

  /home/me2resh/public_html/furniture/class_THUMB.php on line 58
  
  how can i pass this step and make the script works without using this
  undefines function
 
 Don't use that function? If you want the script to work more or less the same 
 then replace that function with getimagesize().
 
  here is the class :
 
 [load of rubbish snipped]
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #4
 A:Go west, young man, go west!
 Q:What do wabbits do when they get tiwed of wunning awound?
 */

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



Re: [PHP] Newb PHP Question

2004-08-13 Thread Hannes Magnusson
Are you trying to include or fopen file? httpd have access to that file?
- Hannes

On Fri, 13 Aug 2004 11:37:08 -0700
[EMAIL PROTECTED] (Andy Moore) wrote:

  Andy do a small page with only this in it and see if it will load.
  
  ?php
  
  phpinfo();
  
  ?
 
 That churned out a rather long page with all sorts of information... so 
 now I'm assuming that PHP is parsing correctly, but I have some sort of 
 configuration error? What that would be, I'm unsure...
 
 -Andy

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



Re: [PHP] Newb PHP Question

2004-08-13 Thread Hannes Magnusson
httpd got access to all the files?
If the include path is wrong include() will rase error, I'm guessing httpd don't got 
permission to read one ( or more ) of the files.


On Fri, 13 Aug 2004 11:53:46 -0700
[EMAIL PROTECTED] (Andy Moore) wrote:

  Can we see some of the code throwing the error? PHP is working correctly
  if you got the page above (a handy thing to keep around BTW).
 
 I assumed it was a configuration error because the error occured on line 
 0. But in any case, here's some lowdown.
 
 main.php - the file everyone will be seeing, and the file that gets the 
 error I originally posted...
 
 ---
 ?
   require(include/db.php);
   require(include/template.php);
 ..snip..
 ---
 
 and from db.php, which may contribute to the problems...
 
 ---
 ?
   if(!connect()){
echo error('Connection failed!');
   }
   session_start();
 
   function connect() {
$params = array(
 'host' = localhost,
 'dbname' = nmonkey,
 'user' = [ed],
 'password' = [ed]
);
while(list($name,$val) = each($params)){ $constr[] = $name=$val; }
return pg_connect(implode(' ',$constr));
   }
 
 ...snip...
 ---
 
 Is maybe my include directory in php.ini set incorrectly? It's 
 currently set to .:/var/www, which is where main.php resides (and 
 db.php is in /var/www/include)...

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



[PHP] Re: Yet another Newb Question - error

2004-08-13 Thread Hannes Magnusson
No, PostgreSQL is not build in by default. see 
http://www.php.net/manual/en/ref.pgsql.php

On Fri, 13 Aug 2004 12:36:26 -0700
[EMAIL PROTECTED] (Andy Moore) wrote:

 Thanks to this newsgroup I finally overcame one of my biggest errors in 
 PHP. But it still doesn't work completely. :)
 
 ---
 Fatal error: Call to undefined function: pg_connect() in 
 /var/www/include/db.php on line 30
 ---
 
 Undefined function? Isn't it a standard command?
 
 - Andy Moore

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



Re: [PHP] Yet another Newb Question - error

2004-08-13 Thread Hannes Magnusson

On Fri, 13 Aug 2004 13:06:58 -0700
[EMAIL PROTECTED] (Andy Moore) wrote:

  Does PostGres show up in the test page we did earler? If not PHP needs
  to be compiled as stated above
 
 No, PG doesn't show up... What do you mean, compiled? Do you mean 
 installed? I used
http://www.php.net/manual/en/ref.pgsql.php
In order to enable PostgreSQL support, --with-pgsql[=DIR] is required when you 
compile PHP
PHP needs to be compiled with PostgreSQL support
 
 # apt-get install postrgesql
 
 Are you saying I should say
 
 # apt-get install postgresql --with-pgsql
 
 ? Or,
 
 [snip]
 If shared object module is available,
 PostgreSQL module may be loaded using extension directive in php.ini or
 dl() function.
 [/snip]
 
 How can I tell if a shared module available? That sounds like an easier 
 path maybe. :) I know PostgresQL is installed, maybe I can just 
 point it to a directory or something? I don't know where library files 
 are stored...
 
 - Andy Moore

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



[PHP] Re: Combined Production + Development Hosting

2004-08-13 Thread Hannes Magnusson
On Sat, 14 Aug 2004 00:43:26 +0100
[EMAIL PROTECTED] (Watty) wrote:

 I am beginning to host my own website, but I also develop other
 websites. I have no budget for new equipment so I need to do both
 production and development hosting on one system. I run Linux with
 apache, php + mysql. I need a way to essentially hosting two versions of
 PHP, 4 + 5, reading two different php.ini files. I was thinking of
 running two apache daemons reading two different configuration files
 using different PHP modules, which are reading different php.ini files,
 and listening on different ports. Does anyone have a better method for
 doing this?
 
 Thanks in advance,
  
 Watty
 
Might want to check this link out 
http://www.schlitt.info/applications/blog/archives/83_How_to_run_PHP4_and_PHP_5_prallel.html
Doubt you find any better solution to this problem.

 - Hannes

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



Re: [PHP] String compare of 7 text strings

2004-08-13 Thread Hannes Magnusson
sort ( $array );
if ( $array[ 0 ] !== $array[ count ( $array )-1 ] ) {
  // Not all fields in the array are the same...
}

On Fri, 13 Aug 2004 21:10:50 -0500
[EMAIL PROTECTED] (Brent Clements) wrote:

 Let me rephase my question in my previous email:
 
 I'd like to compare 7 strings(which are in an array). Each string should be
 the same, if they are not, a message should be outputted. How would one do
 this outside of using a huge if/then statement?
 
 Thanks,
 Brent
 - Original Message - 
 From: Brent Clements [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, August 13, 2004 9:07 PM
 Subject: [PHP] String compare of 7 text strings
 
 
 I wanted to see if anyone has an easier way to do this. The end result is
 this: I need to compare 7 different text strings(which are in an array).
 They should all be the same, if they are not the same, a message should be
 outputted saying they weren't.
 
 How would one do this outside of using a huge if/then statement?
 
 Thanks,
 Brent

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



Re: [PHP] problem with mysql_fetch_array

2004-08-12 Thread Hannes Magnusson
On Thu, 12 Aug 2004 10:04:00 -0700
[EMAIL PROTECTED] (Justin Patrin) wrote:

 On Thu, 12 Aug 2004 09:20:44 -0400, Deepak Dhake
 [EMAIL PROTECTED] wrote:
  $query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2;
  while($row2 = mysql_fetch_array($query4)) {
//print array
  }
  
  this will print whole array. i just want to print a row at a time and it should be 
  in the loop because i am printing other things as well. can you tell me how to 
  print a row at a time. actually as i explained earlier, i am able to print a row 
  at a time but when it becomes i=1 and starts outer loop for the second time it 
  just printing the same values. any suggestion?
  
 
 I think you're getting your terminology mixed up. $row2 is an array
 which corresponds to a row in the database. Yes, this will print all
 of the returned records, but I can think off very fe wtimes where you
 don't want to do that.
 
 This loop *is* what you want. Tell us what you're trying to do and
 we'll try to help.
 
$query4 = mysql_query(SELECT result FROM TBL_result WHERE survey_no=2;
$row2 = mysql_result ( $query4, 0 );
or
$i = 0;
while ( $row2 = mysql_result ( $query4, $i++ ) ) {
  echo $row2;
}

Looking for this?

 - Hannes

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