Re: [PHP] php5 --enable-soap compile error

2005-01-25 Thread Marten Lehmann
Hello,
Try posting the error messages  and your exact configure line to
php-install for the maximum odds of a useful response.
the configure line is as follows:
CFLAGS=-I/usr/kerberos/include ./configure \
--prefix=/webserver/php-5.0.3 \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-mbstring \
--enable-soap \
--enable-sockets \
--enable-trans-id \
--enable-wddx \
--with-bz2 \
--with-curl \
--with-db4 \
--with-dom \
--with-gdbm \
--with-gettext \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-ldap \
--with-mhash=/webserver/mhash \
--with-mysql=/usr \
--with-openssl \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr/include \
--with-freetype-dir=/usr/include \
--with-zlib
All errors I got have been mailed before.
Regards
Marten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP editor suggestion?

2005-01-25 Thread Merlin
Robert Cummings schrieb:
On Mon, 2005-01-24 at 12:26, Merlin wrote:
Hi there,
I am now using Homesite 4.5.x  since a few years since I found it the 
most relieble editor arround.

Now I would like to have a look around to see if there are better 
solutions nowadays.

I am looking for a relieable, stable and quick PHP/HTML editor.
Can anybody suggest a good one? I tried phpdesigner, but it seems to 
have lots of bugs and is quite slow.

Thank you for any suggestions,
Merlin

Let me recommend something far better: A SEARCH ENGINE
If that should fail: A BRAIN
At the very least: RTFA
This topic spams the list every week or two. It was just on last week.
At least have a little self respect and try to find an answer for
yourself before posting the same old off topic crap.
Cheers,
Rob. 
It seems like you did have a very bad day. Maybe you should consider not 
to spoil the good spirit that this nice php list offers. There are lots 
of great people on here. To bad that such answers also find its way to 
the board.

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


Re: [PHP] Allowing Users to Edit HTML

2005-01-25 Thread trlists
On 24 Jan 2005 Richard Lynch wrote:

 Assuming you are authenticating them correctly so that a Bad Guy can't
 change the HTML out from under them, it seems reasonable to me -- Not much
 point to cross-site vandalism on one's own site, eh?

Exactly, that was my thought as well ...

--
Tom

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



RE: Re: [PHP] String to Date and Date to String Functions?

2005-01-25 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 January 2005 00:25, Ben Edwards wrote:

 On Mon, 24 Jan 2005 20:15:15 -, Ford, Mike
 [EMAIL PROTECTED] wrote:
  To view the terms under which this email is distributed,
 please go to http://disclaimer.leedsmet.ac.uk/email.htm
  
  On 24 January 2005 19:01, Ben Edwards wrote:
  
   On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED]
   [EMAIL PROTECTED] wrote:
How about the strtotime() function?
http://us4.php.net/manual/en/function.strtotime.php
   
   No good, it douse not take a format string.  What if I wanted to
   convert the timestamp to 'DD-MM-YYY', display it on a form,
   validate it, and then convert it back to a timestamp.
  
  Well, if you're going to validate it, you'll have to figure out
  which bits are the day, month and year -- having done that, you'll
  have them as three separate bits of information, so you can use
  mktime() on them, or glue them back together to feed to strtotime()
  in one of the various formats it recognizes.  Seems to me a format
  string is pretty irrelevant in all of this.
 
 Different users have can have the date displayed in there local form.

Which means you've got to know what format any submitted date should be in,
which means you've got to know which bits are day, month and year.

 And no, I dont have to split the date up, the date() function should
 be able to be used to validate the date.  I asume it returns null, or
 something sensable, if the date is invalid.

date() won't do this, it's the function used to display a given timestamp in
a human-readable format.  Functions like mktime() accept apparently invalid
values so as to allow for easy date arithmetic (date('d-M-Y', mktime(0, 0,
0, 1, 32, 2005)) will give you '01-Feb-2005', for example; strtotime() does
something similar).  The only built-in function that does the checking you
are after is checkdate(), and that also wants day, month and year as three
integers.

So yes, you do have to split the input date up.

   Anyway as the date format
 is user defined I need both functions.

No, you don't *need* them.  You may prefer to have the function to decode
according to a format string, but you don't need it -- it's pretty trivial
to do the task without it.

($aDate = explode('-', $inDate);// or preg_split(#[/.-]#, $inDate)
 if (checkdate($aDate[1], $aDate[0], $aDate[2])):
 $timestamp = mkdate(12, 0, 0, $aDate[1], $aDate[0], $aDate[2]);
 else:
 $timestamp = NULL;
 endif;
)

 In this case it is a back end administration form as the (power) user
 does not want to have to fiddle about with drop downs.  In fact they
 can use / or - or . as a seperater.  The split function can handle
 that. 

Well, but then you're splitting the date up into its constituent components
anyway -- so what's all the fuss about???

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
=
Please feel free to add more points and send to the list. 
=

1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can download a copy and use it
offline also. 

Please also try http://www.php.net/manual/faq.php for answers to
frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for php YOUR QUERY may
fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the mailing list discussion at
http://phparch.com/mailinglists. Many of the common topics are discussed
repeatedly, and you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed question in the list is
Best PHP editor. Everyone has his/her favourite editor. You can get
all the opinions by going through the list archives. If you want a
chosen list try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out what extensions are
available to 
you?

Just put the following code into a file with a .php extension and access
it through your 
webserver:

?php
phpinfo();
? 

If PHP is installed you will see a page with a lot of information on it.
If PHP is not installed (or not working correctly) your browser will try
to download the file.
(contributed by Teren and reworded by Chris W Parker)

5. If you are stuck with a script and do not understand what is wrong,
instead of posting 
the whole script, try doing some research yourself. One useful trick is
to print the variable/sql query using print or echo command and check
whether you get what you expected. 

After diagnosing the problem, send the details of your efforts
(following steps 1, 2  3) and ask for help.

6. PHP is a server side scripting language. Whatever processing PHP does
takes place BEFORE the output reaches the client. Therefore, it is not
possible to access users' computer related information (OS, screen size
etc) using PHP. Nor can you modify any the user side settings. You need 
to go for JavaScript and ask the question in a JavaScript list.

On the other hand, you can access the information that is SENT by the
user's browser when a client requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. 
(contributed by Wouter van Vliet and reworded by Chris W Parker.)

7. Provide a clear descriptive subject line. Avoid general subjects like
Help!!, A Question etc. Especially avoid blank subjects. 

8. When you want to start a new topic, open a new mail composer and
enter the mailing list address php-general@lists.php.net instead of
replying to an existing thread and replacing the subject and body with
your message.

9. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. 
[contribued by Chris W Parker]

10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with attachments. If you don't
have a place to upload your code, try the many pastebin websites (such
as www.pastebin.com). 
(contributed by Burhan Khalid)

Following these guidelines will ensure that you get effective responses
from the list members. Otherwise, your questions might not be answered.

===
Hope you have a good time programming with PHP.
===

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



[PHP] php 5.1.0 release - when?

2005-01-25 Thread Sergio Gorelyshev
Hello all. Is anyone aware of php 5.1.0 release date?
Thanks.
-- 
RE5PECT
Sergio Gorelyshev

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



[PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Great list Jay.  The only other thing that I would add is this:
The people on this list are not your paid support specialists that 
*have* to answer you on your slightest whim.  Most of this netiquette 
is covered by http://www.catb.org/~esr/faqs/smart-questions.html, but 
basically if you make it easy for us to help you then we probably will.

I personally find it *very* irritating when I get emails sent to me 
asking for help.  I am more than happy to answer questions on the list, 
but please respect my privacy and realize that I answer questions in the 
newsgroup when / if I get the time to do so.  There will be times to 
send me private emails which are ok, but generally keep all PHP help 
questions on the list.

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


[PHP] Help with file not writing

2005-01-25 Thread Joey
I'm not too good with classes, in the below class I can get the hit counter
to write to the hit counter file, but I can't get it to write the log file,
I know security is done correctly on the file because it's the same as the
counter log file, but I can't figure out why the other file isn't being
written to.
Also while the IP address works within the code prior to calling the class
 
Thanks!
 
%
class counter {
 var $log_file = 'counters/google_log.txt';
 var $file = 'counters/google_counter.txt'; 
 function counter()
 {
  $this-readFile();
  $this-writeFile();
  $this-writeLog();
 }
 
 function readFile()
 {
  $hiti = fopen($this-file, r);
  while(!feof($hiti)){
   $this-$hits .= fgets($hiti,128);
  }
  $this-$hits=1+$this-$hits;
  echo $this-$hits;
  fclose($hiti);
 }
 
 function writeFile()
 {
  $hito = fopen($this-file,w+);
  fputs($hito,$this-$hits);
  fclose($hito);
 }
 
 function writeLog()
 {
  $ip_address=$REMOTE_ADDR;
  $date_stamp=date(F j, Y, g:i a);
   $log_entry=$date_stamp .   :   . $ip_address . \n ;
   echo TEST-  . $log_entry ;
  $log = fopen($this-log_file,w+);
  fputs($log,$this-$log_entry );
  fclose($log);
 }
 
}
%

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



[PHP] PHP Cache

2005-01-25 Thread Merlin
Hi there,
I am trying to find a open source PHP Cache extension. After trying out ionCube 
PHP Accelerator (http://www.php-accelerator.co.uk) I had to remove it from the 
system since it brought down the server every few weeks due to some memory leak. 
There is also APC, but the latest build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth for me to 
spend that much money for a lizence.

Thank you for any suggestion.
Regards,
merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Chris Ramsay
I too agree - the list raises some really important points...
Just a thought, but would it be worth someone posting the list once a week
to catch new users as they sign up?

Might be worth it in the interest of keeping the list tidy?

Chris Ramsay
-
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +44 (0) 1522 884488
e: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
w: http://www.danwood.co.uk
-

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



[PHP] ldap functionality

2005-01-25 Thread Bruce Douglas
hi...

i'm in need of an app that has/should have directory/user/member functionality. 
i want to setup a process to allow an adim to create different fields and 
categories for a user to enter. think of a company employee database, where you 
have the employe name, and then the various groups/projects the employee might 
belong to...

i'm trying to figure out if there's already an app that you may have run across 
that kind of does this, and if you haven't, what might be the best soln/easiest 
soln to implement.. i've started to research ldap, but i'm not sure that this 
is the best approach (given that i have no experience with ldap!)

i'm open to a php/perl/linux/mysql/apache solution.

searching through php/google hasn't turned up anything as of yet...

if you have any thoughts let me know...


thanks

bruce
[EMAIL PROTECTED]

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



Re: [PHP] PHP Cache

2005-01-25 Thread Tom
Squid any good to you? You can configure it to cache based on page name, 
GET and POST params (personally don't like to use POST params for static 
or semi static content, but that's a personal preference, not a hard and 
fast rule), farside domains
You set it up above your php servers so it doesn't care what language 
you are using to provide the content.

Tom
Merlin wrote:
Hi there,
I am trying to find a open source PHP Cache extension. After trying 
out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had 
to remove it from the system since it brought down the server every 
few weeks due to some memory leak. There is also APC, but the latest 
build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth 
for me to spend that much money for a lizence.

Thank you for any suggestion.
Regards,
merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Davey
Hello Chris,

Tuesday, January 25, 2005, 2:03:09 PM, you wrote:

CR Just a thought, but would it be worth someone posting the list
CR once a week to catch new users as they sign up?

Isn't it posted once a month as it is?

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
CR Just a thought, but would it be worth someone posting the list
CR once a week to catch new users as they sign up?

Isn't it posted once a month as it is?
[/snip]

It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Chris Ramsay
Richard  TheList...

Isn't it posted once a month as it is?

Hot damn! That'll be why I have never seen it then! :/

Apologies to all!!!

Chris Ramsay
-
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +44 (0) 1522 884488
e: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
w: http://www.danwood.co.uk
-

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



Re[2]: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Davey
Hello Jay,

Tuesday, January 25, 2005, 2:33:32 PM, you wrote:

JB It used to be, but it seems that it hasn't been posted in a while. So I
JB retrieved it and posted it. I was thinking about setting up a cron to
JB post it every other day or so.

I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
newbies :)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

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



RE: Re[2]: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
JB It used to be, but it seems that it hasn't been posted in a while.
So I
JB retrieved it and posted it. I was thinking about setting up a cron
to
JB post it every other day or so.

I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
newbies :)
[/snip]

Then we should chnage the header
[NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Jay Blanchard wrote:
[snip]
JB It used to be, but it seems that it hasn't been posted in a while.
So I
JB retrieved it and posted it. I was thinking about setting up a cron
to
JB post it every other day or so.
I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
newbies :)
[/snip]
Then we should chnage the header
[NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND
Hope there are some hot chicks on this island.  Heck I'm a newbie, if 
all the newbies get lei'd once they're accepted on the island ;)

Definitely seems worthy of cron to me.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


Re: [PHP] debugging modules

2005-01-25 Thread Arshavir Grigorian
Rasmus Lerdorf wrote:
Arshavir Grigorian wrote:
Hi,
I am having trouble debugging a PECL module (APC) because while I am 
able to --enable-debug when configuring the PHP course, I cannot do 
the same for APC (no such configure option). Does anyone know how to 
do that?

PHP Warning:  Unknown(): apc: Unable to initialize module\nModule 
compiled with module API=20020429, debug=0, thread-safety=0\nPHP
compiled with module API=20020429, debug=1, thread-safety=0\nThese 
options need to match\n in Unknown on line 0

You need to make install after compiling PHP with --enable-debug to 
get phpize and php-config to inherit the debug flag which will cause 
apc to be built with debug mode when you run phpize in the apc directory.

-R
What I really needed to do was to manually delete bin/php*, lib/php/ and 
include/php/ before attempting a reinstall.

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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Joe Harman
Great List...

although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)

cheers!
Joe


On Tue, 25 Jan 2005 09:48:53 -0500, Jason Barnett
[EMAIL PROTECTED] wrote:
 Jay Blanchard wrote:
  [snip]
  JB It used to be, but it seems that it hasn't been posted in a while.
  So I
  JB retrieved it and posted it. I was thinking about setting up a cron
  to
  JB post it every other day or so.
 
  I think once a week would be more than enough. You have to actually
  hope the newbies even read it, most of them don't even think they are
  newbies :)
  [/snip]
 
  Then we should chnage the header
  [NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND
 
 Hope there are some hot chicks on this island.  Heck I'm a newbie, if
 all the newbies get lei'd once they're accepted on the island ;)
 
 Definitely seems worthy of cron to me.
 
 --
 Teach a man to fish...
 
 NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
 STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
 STFM | http://www.php.net/manual/en/index.php
 STFW | http://www.google.com/search?q=php
 LAZY |
 http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins
 
 -- 
 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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)
[/snip]

Maybe...except for PHP5 :) !

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Jay Blanchard wrote:
[snip]
although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)
[/snip]
Maybe...except for PHP5 :) !
That and XML / SOAP.  I've noticed that while some of those questions go 
answered there are a *lot* of times when they don't.  I guess a lot of 
people on the list don't use it?  That or the answers are sent privately 
/ much later because I seldom see them answered.

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


[PHP] Re: PHP Cache

2005-01-25 Thread Matthew Weier O'Phinney
* Merlin [EMAIL PROTECTED]:
 I am trying to find a open source PHP Cache extension. After trying
 out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had
 to remove it from the system since it brought down the server every
 few weeks due to some memory leak.  There is also APC, but the latest
 build is over 3 years old.

 Is there a working alternative for Zend? I am not sure if it is worth
 for me to spend that much money for a lizence.

I haven't used it yet, but I've heard some good reports about it:

http://eaccelerator.sourceforge.net/Home

It's a fork of Turckk mmcache.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] PHP5: DOM-removeChild Problem

2005-01-25 Thread Christian Stocker
On Fri, 21 Jan 2005 12:02:51 +0100, Mike Blank
[EMAIL PROTECTED] wrote:
 Hi Guys!
 
 I've got a problem with Dom and php 5.0.2. I'm trying to access an xml
 node with $item = $objDom-documentElement-childNodes-item(0);. That
 seems to work, because on the next line I can output the node Value with
 echo $item-nodeValue. But when I use the command
 $objDom-removeChild($item); on the next line, dom throws a
 DOMException:

$objDom has to to be the parent node of $item., not the document itself.

$objDom-documentElement-removeChild($item);
should work in your case. or more general

$item-parentNode-removeChild($item);

chregu

 
 Fatal error: Uncaught exception 'DOMException' with message 'Not Found
 Error' in
 /opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
 a.php:13 Stack trace: #0
 /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(179): require()
 #1 /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154) :
 eval()'d code(1): Admin-editFeature(Object(DOMElement)) #2
 /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154): eval() #3
 /opt/lampp/htdocs/www/snap_chubb/admin/index.php(142):
 Admin-drawContent() #4 {main} thrown in
 /opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
 a.php on line 13
 
 Below you can see my code:
 
 Index.php
 ---
 
 $objDom = new DomDocument(); // neues dom objekt
 $strXML = $this-loadXMLTree($objDATA-fields['pfe_con_id']); //
 funktion, die eine xml datei als string aus der db ausliest if ($strXML
 != false) {
 $objDom-loadXML($strXML); // string wird in das dom objekt
 geladen } $item = $objDom-documentElement-childNodes-item(0); //
 adressierung eines knoten echo $item-nodeValue; // ausgabe funktioniert
 ohne probleme
 $objDom-removeChild($item); // diese zeile spuckt den oben genannten
 Error aus!
 
 Geladener XML string
 ---
 
 ?xml version=1.0?
 root
 mitarbeiter
 image/images/43/team_fabian-bischof_kl.jpg/image
 nameFabian Bischof/name
 detailpage45/detailpage
 /mitarbeiter
 mitarbeiter
 image/images/43/team_sandra-varela_kl.jpg/image
 nameSandra Varela/name
 detailpage0/detailpage
 /mitarbeiter
 mitarbeiter
 image/images/43/team_sandra-varela_kl.jpg/image
 nameSandra Varela/name
 detailpage0/detailpage
 /mitarbeiter
 /root
 ---
 
 I hope somebody can help me somehow! I'm really desperate!
 
 Cheers
 
 mike
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
...stuff...
[/snip]

This is interesting, I set up the mail line for the CRON to read

mail(php-general@lists.php.net, [NEWBIE GUIDE] - For benefit of new
list members, $msg, From: [EMAIL PROTECTED] . Reply-To:
[EMAIL PROTECTED] . X-Mailer: PHP/ . phpversion());

And the test mail did not appear on the list. Would php-general not
recognize itself as a member?

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread John Nichel
Jay Blanchard wrote:
[snip]
CR Just a thought, but would it be worth someone posting the list
CR once a week to catch new users as they sign up?
Isn't it posted once a month as it is?
[/snip]
It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.
Didn't it used to get sent out to people when they subscribed to the 
list too?  Anyone know if that still happens?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Jay Blanchard wrote:
[snip]
stuff...
[/snip]
This is interesting, I set up the mail line for the CRON to read
mail(php-general@lists.php.net, [NEWBIE GUIDE] - For benefit of new
list members, $msg, From: [EMAIL PROTECTED] . Reply-To:
[EMAIL PROTECTED] . X-Mailer: PHP/ . phpversion());
And the test mail did not appear on the list. Would php-general not
recognize itself as a member?
To be honest: I simply don't know.  I'm guessing John Holmes might know 
the answer to this one? ...

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
Jay Blanchard wrote:
[snip]
...stuff...
[/snip]
This is interesting, I set up the mail line for the CRON to read
mail(php-general@lists.php.net, [NEWBIE GUIDE] - For benefit of new
list members, $msg, From: [EMAIL PROTECTED] . Reply-To:
[EMAIL PROTECTED] . X-Mailer: PHP/ . phpversion());
And the test mail did not appear on the list. Would php-general not
recognize itself as a member?
maybe it doesn't work on purpose - possibly to avoid mail loops?
---
Jay, great list BTW - I was thinking maybe we could drop it on a site/wiki
or something which could also contain stuff that comes up again and again,
or stuff that even the 6month y/o newbie finds trivial or just good stuff
thats been condensed from the list (kind of a good practice/cool code
repository). I know there are lots of places out there already but I think
,for instance, the mail archives suck for searching - and often there is
plenty of FUD in among the cherries. someone could then send out a weekly
NEWBIE email that points them to said site - which in turns introduces them
to netiquette, list faqs, etc. having a Wiki type thing would relieve the
list of lots of 'O-T' stuff on 'NEWBIE email enhancements'?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
John Nichel wrote:
Jay Blanchard wrote:
[snip]
CR Just a thought, but would it be worth someone posting the list
CR once a week to catch new users as they sign up?
Isn't it posted once a month as it is?
[/snip]
It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.

Didn't it used to get sent out to people when they subscribed to the 
list too?  Anyone know if that still happens?

yes - the answer is no (if it ever did - I can't recall).
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
 This is interesting, I set up the mail line for the CRON to read
 
 mail(php-general@lists.php.net, [NEWBIE GUIDE] - For benefit of new
 list members, $msg, From: [EMAIL PROTECTED] .
Reply-To:
 [EMAIL PROTECTED] . X-Mailer: PHP/ . phpversion());
 
 And the test mail did not appear on the list. Would php-general not
 recognize itself as a member?

To be honest: I simply don't know.  I'm guessing John Holmes might know 
the answer to this one? ...
[/snip]

I just tried with a different From address...mineand still no
appearance on the list. Interesting to say the least.

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



[PHP] Replace credit card numbers with X ???

2005-01-25 Thread Joe Harman
Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe

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



RE: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jay Blanchard
[snip]
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
[/snip]

ROFLMMFAO! It's all been discussed before Joe! 

http://www.php.net/ereg_replace

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



Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Afan Pasalic
this is my way.
   $cc_stars = '';
   $cc_no_lenght = strlen($cc_number);
   $cc_info_first4 = substr($cc_number, 0, 4);
   $cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
   for($i=0; $i($cc_no_lenght-8); $i++) $cc_stars .= '*';
   $cc_number = $cc_info_first4 .$cc_stars. $cc_info_last4;
-afan
Joe Harman wrote:
Hello,
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
Thanks!
Joe
 

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


[PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Afan Pasalic
Hey!
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
What's going on?
-afan
 Original Message 
Subject: 	DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card 
numbers with X ???)
Date: 	Tue, 25 Jan 2005 19:13:27 +0300
From: 	RIPN NCC [EMAIL PROTECTED]
To: 	php-general@lists.php.net,[EMAIL PROTECTED]


Dear Madam/Sir,
Here are results of  processing your  request:
From:Afan Pasalic [EMAIL PROTECTED]
Subject: Re: [PHP] Replace credit card numbers with X ???
Date:Tue, 25 Jan 2005 10:06:21 -0600
Msg-Id:  [EMAIL PROTECTED]

this is my way.
unrecognized statment - line ignored.
$cc_stars = '';
unrecognized statment - line ignored.
$cc_no_lenght = strlen($cc_number);
unrecognized statment - line ignored.
$cc_info_first4 = substr($cc_number, 0, 4);
unrecognized statment - line ignored.
$cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
unrecognized statment - line ignored.
for($i=0; $i($cc_no_lenght-8); $i++) $cc_stars .= '*';
unrecognized statment - line ignored.
$cc_number = $cc_info_first4 .$cc_stars. $cc_info_last4;
unrecognized statment - line ignored.

-afan
unrecognized statment - line ignored.
Joe Harman wrote:
unrecognized statment - line ignored.
Hello,
unrecognized statment - line ignored.

unrecognized statment - line ignored.
I need to replace all the numbers of a credit card except for the last
unrecognized statment - line ignored.
4 with an 'X' ... can't seem to locate the string function for this...
unrecognized statment - line ignored.
can someone point me in the right direction here to what php item i
unrecognized statment - line ignored.
should be using.
unrecognized statment - line ignored.
Too many warnings (max. 2) - FATAL ERROR!

Thanks!
Joe

  


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

Your current request counter: 1.
You may send us 119 in this hour.
Thank you,
RIPN mail processor.
Tue Jan 25 19:13:27 MSK/MSD 2005
Moscow, Russia.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jochem Maas
Joe Harman wrote:
Hello,
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
that'll be:
string php_replace_all_but_last_four_chars_of_creditcard_number(string input[, 
string pad_string])
actually that func doesn't exist - what you need to do (well its one way to do 
it)
is use a combination of substr() and str_pad() e.g:
echo str_pad(substr($cc, -4), 20, 'X', STR_PAD_LEFT);
where $cc is the previously checked/verified/sanitized creditcard no.
and 20 is the length of a creditcard no. - forgive me if I'm wrong about the CC
number length, I don't have a creditcard.
Thanks!
Joe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread tg-php
In addition to what was mentioned already, using ereg_replace, if you're 
pulling the CC# string out of a database of off of some POST data or something, 
just use a substr() function to pull the last 4 digits and prepend a bunch of 
X's.

$ccnum = 342342522342342;  # fake CC #, prob not even correct # of digits :)
$maskedccnum = XXX . substr($ccnum,strlen($ccnum)-5,4);


If you're trying to do it in a form, realtime as the user enters it, you'd have 
to use some funky javascript or do something with a password form type or 
something.  But sounds like you want it like when you display an invoice 
afterwards or display a Would you like to use this CC that's already on file? 
type thing without exposing the whole CC#.

-TG

= = = Original message = = =

Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Maxing out sessions?

2005-01-25 Thread Matt
Ok,
Right now if I look at a session I see the following... this is on a
mail server.. so this is all mail variables and such...  There are
currently 319 session files and 1.5MB... you know I'm also wondering
now if I didn't read things wrong.. .I wonder if it said 2.0MB not
GB yesterday.. that would be a huge difference.


gettext_php_loaded|b:1;gettext_php_domain|s:12:squirrelmail;gettext_php_dir|s:13:../../locale/;gettext_php_translateStrings|a:5:{s:8:New
Mail;s:8:New Mail;s:17:ChiliTech Notice:;s:17:ChiliTech
Notice:;s:18:You Have New Mail!;s:18:You Have New
Mail!;s:13:View New Mail;s:13:View New Mail;s:12:Close
Window;s:12:Close
Window;}gettext_php_loaded_language|s:5:en_US;gettext_php_short_circuit|b:1;sq_base_url|s:31:http://webweather.chilitech.net;base_uri|s:1:/;onetimepad|s:12:GJTEpMkqNw==;sqimap_capabilities|a:1:{s:11:IMAP4rev1
;b:1;}delimiter|s:1:.;username|s:11:pcaddey1376;user_is_logged_in|b:1;just_logged_in|b:1;attachment_common_types|a:7:{s:9:image/gif;b:1;s:15:image/x-xbitmap;b:1;s:10:image/jpeg;b:1;s:11:image/pjpeg;b:1;s:18:application/msword;b:1;s:29:application/x-shockwave-flash;b:1;s:3:*/*;b:1;}attachment_common_types_parsed|a:0:{}theme_css|s:0:;boxesnew|a:4:{i:0;a:7:{s:3:raw;s:43:*
LIST (\Marked \HasChildren) . INBOX
;s:9:formatted;s:5:INBOX;s:14:unformatted-dm;s:5:INBOX;s:11:unformatted;s:5:INBOX;s:16:unformatted-disp;s:5:INBOX;s:2:id;i:0;s:5:flags;a:2:{i:0;s:6:marked;i:1;s:11:haschildren;}}i:1;a:7:{s:3:raw;s:44:*
LIST (\HasNoChildren) . INBOX.Drafts
;s:9:formatted;s:18:nbsp;nbsp;Drafts;s:14:unformatted-dm;s:12:INBOX.Drafts;s:11:unformatted;s:12:INBOX.Drafts;s:16:unformatted-disp;s:12:INBOX.Drafts;s:2:id;i:1;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:2;a:7:{s:3:raw;s:42:*
LIST (\HasNoChildren) . INBOX.Sent
;s:9:formatted;s:16:nbsp;nbsp;Sent;s:14:unformatted-dm;s:10:INBOX.Sent;s:11:unformatted;s:10:INBOX.Sent;s:16:unformatted-disp;s:10:INBOX.Sent;s:2:id;i:2;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:3;a:7:{s:3:raw;s:43:*
LIST (\HasNoChildren) . INBOX.Trash
;s:9:formatted;s:17:nbsp;nbsp;Trash;s:14:unformatted-dm;s:11:INBOX.Trash;s:11:unformatted;s:11:INBOX.Trash;s:16:unformatted-disp;s:11:INBOX.Trash;s:2:id;i:3;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}}auto_create_done|b:1;prefs_cache|a:8:{s:12:chosen_theme;s:27:../themes/default_theme.php;s:17:show_html_default;s:1:0;s:13:javascript_on;s:1:1;s:8:hililist;s:6:a:0:{};s:12:twc_weather0;s:345:17810\17810\after\1\1\0\0\1\0\1\0\1\1105488021\
Allenwood, PA (17810)\33deg;F\24deg;F\Light Rain\0nbsp;Low\East
Northeast at  12nbsp;mph\31deg;F\92%\7.0  miles\30.15  in and
rising\3600\1\275\1\0\1\\IMG
SRC=../plugins/twc_weather/twc_image_handler.php?wicon=http://image.weather.com/web/common/wxicons/52/11.gif
WIDTH=52 
\1\\1\0\0;s:14:newmail_recent;s:2:on;s:13:newmail_popup;s:2:on;s:8:weather0;s:182:17810\Allenwood,
PA\after\1\1\1\0\1\1\1\1\1\1106670053\\28deg;F\18deg;F
(-8deg;C)\Overcast\\W 12 MPH\21deg;F (-6deg;C)\75 %\10.00
mi.\29.90quot; (1013.4
mb)\7200\1\\1\\;}prefs_are_cached|b:1;[

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



Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jochem Maas
Jay Blanchard wrote:
[snip]
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
[/snip]
ROFLMMFAO! It's all been discussed before Joe! 

http://www.php.net/ereg_replace
not-too-serious
wtf :-), I can't find any particular mention of his problem on that page
 (and I know how to use the CTRL+f keycombo in firefox, thanks for asking :-).
regardless of whether ereg_replace() would satisfy his needs pointing him at
that page without explaination is a bit stupid - the guy obviously doesn't
have even half a clue with regards to string manipulation - therefore I think
its safe to assume that regexps are a bit out of his league.
but then again if he is working with (_other_peoples_) creditcard numbers
he should probably:
a, know this shit.
or
b, be capable of finding the answer in the manual.
n'est pas?
anyway I had fun remembering exactly what ROFLMMFAO meant :-), and the tinge
of RTFM at Joe was probably justified - and even if it wasn't I condone it :-)
is it fair game to throw someone an RTFM after you have helped them?
/not-too-serious
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PATH_INFO empty, ORIG_PATH_INFO correct

2005-01-25 Thread Marten Lehmann
Hello,
I'm using PHP as CGI (not through Apache-action, but she-bang line 
containing the path to php). When I'm calling

http://test.com/phpinfo.php/a/variable/url
PATH_INFO should contain /a/variable/url. I checked this with a 
perl-script, which printed out all environment variables and so I know 
that PATH_INFO was set correctly bei Apache.
But PHP seems to perform some unwanted action, so that PATH_INFO shows 
no value and ORIG_PATH_INFO is correct. But this ORIG_PATH_INFO is not 
known by any script.
How can I tell PHP not to touch PATH_INFO but leave it as Apache set it?

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


RE: [PHP] Help with file not writing

2005-01-25 Thread Joey
 
Hi Marek,

I don't see anything in the docs located http://us3.php.net/fopen to help.
I changed it to w only but that made no difference.
Can you please provide a more specific answer.

THanks  

Code looks liks this:

%
class counter {
var $log_file = 'counters/google_log.txt';
var $file = 'counters/google_counter.txt';
function counter()
{
$this-readFile();
$this-writeFile();
$this-writeLog();
}

function readFile()
{
$hiti = fopen($this-file, r);
while(!feof($hiti)){
$this-$hits .= fgets($hiti,128);
}
$this-$hits=1+$this-$hits;
echo $this-$hits;
fclose($hiti);
}

function writeFile()
{
$hito = fopen($this-file,w+);
fputs($hito,$this-$hits);
fclose($hito);
}

function writeLog()
{
$ip_address=$GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']; 
$date_stamp=date(F j, Y, g:i a);
 $log_entry=$date_stamp .   :   . $ip_address . \n ;
 echo TEST-  . $log_entry ;
$log = fopen($this-log_file,a);
fputs($log,$this-$log_entry );
fclose($log);
}

}

%

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



Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Richard Davey
Hello Afan,

Tuesday, January 25, 2005, 4:12:43 PM, you wrote:

AP Hey!
AP I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?

Join the club.. everyone who posts gets one. Annoying, no?

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

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



Re: [PHP] Avoiding NOTICEs with list()

2005-01-25 Thread trlists
On 24 Jan 2005 James Kaufman wrote:

 I just tried it with php 4.3.8 and it did not throw a NOTICE with @list.
 I suppose you could try @explode as well as @list.

Thanks.  I was sure I had tried it with that but I will go back and 
check.

--
Tom

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
I think that Justin Patrin started up a wiki for PHP, but he hasn't been

on the list in a while and I can't remember what the url for his wiki 
was.  But he had a fair amount of useful code in there that would be a 
great start for this project.

AND ...

Yeah the list is pretty high volume... it would be great if we could 
help relieve the stress on the servers a bit.
[/snip]

Perhaps http://www.phpcommunity.org could put some of this stuff up?

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



RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Jay Blanchard
[snip]
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?

What's going on?
[/snip]

I have been getting it with every send too...off to /dev/null

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



RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Mike Johnson
From: Richard Davey [mailto:[EMAIL PROTECTED] 

 Hello Afan,
 
 Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
 
 AP Hey!
 AP I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
 
 Join the club.. everyone who posts gets one. Annoying, no?
 
 Best regards,
 
 Richard Davey

My personal favorite is when someone requests a read receipt on
listmail. I wonder what their inbox looks like when 500 people send one
back all in the space of five minutes.


-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

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



Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Afan Pasalic
Not at all... Actually, I enjoy  :-D
I just wonder what's going on and is it problem on my side or... Now I 
breath easier...

;-)
-afan

Richard Davey wrote:
Hello Afan,
Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
AP Hey!
AP I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
Join the club.. everyone who posts gets one. Annoying, no?
Best regards,
Richard Davey
 

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


[PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Chris Ramsay
snip
Join the club.. everyone who posts gets one. Annoying, no?
/snip

Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found
it useful! ;)

Chris Ramsay
-
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +44 (0) 1522 884488
e: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
w: http://www.danwood.co.uk
-

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Rory Browne
I think sending it to the list every so often, via cron isn't the best
way to handle it. I've read it once, I don't see the point in getting
it again. Perhaps, is the list admins were willing, it could be set up
to be sent to all newbies, as part of the subscription process. To
ensure that it is read by all newbies, they'd have to answer certain
questions in the body of the confirmation email? The problem of
newbies not knowing they are newbies, isn't overcome by cron.

Any thoughts?

P.S. An addition to the above, a reminder that you have to CC to
php-general@lists.php.net, for responses to be sent to the list might
be a good idea. I've lost count of how many times I've forgotten to do
this, including this time(sorry Jay), and ended up sending it only to
the original sender, instead of to the list, resulting in the original
sender recieving the thing twice.

On Tue, 25 Jan 2005 11:22:27 -0500, Jason Barnett
[EMAIL PROTECTED] wrote:
 Jochem Maas wrote:
  Jay Blanchard wrote:
 
 ...
  Jay, great list BTW - I was thinking maybe we could drop it on a site/wiki
  or something which could also contain stuff that comes up again and again,
  or stuff that even the 6month y/o newbie finds trivial or just good stuff
  thats been condensed from the list (kind of a good practice/cool code
  repository). I know there are lots of places out there already but I think
 
 I think that Justin Patrin started up a wiki for PHP, but he hasn't been
 on the list in a while and I can't remember what the url for his wiki
 was.  But he had a fair amount of useful code in there that would be a
 great start for this project.
 
  ,for instance, the mail archives suck for searching - and often there is
  plenty of FUD in among the cherries. someone could then send out a weekly
  NEWBIE email that points them to said site - which in turns introduces them
  to netiquette, list faqs, etc. having a Wiki type thing would relieve the
  list of lots of 'O-T' stuff on 'NEWBIE email enhancements'?
 
 Yeah the list is pretty high volume... it would be great if we could
 help relieve the stress on the servers a bit.
 
 
 --
 Teach a man to fish...
 
 NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
 STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
 STFM | http://www.php.net/manual/en/index.php
 STFW | http://www.google.com/search?q=php
 LAZY |
 http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins
 
 -- 
 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



Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Richard Davey
Hello Chris,

Tuesday, January 25, 2005, 5:07:37 PM, you wrote:

CR Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found
CR it useful! ;)

Ahh... so you're the Russian mail server? :)

I guess we could add don't be a twat with your auto-responders to
the newbie faq, but really no-one ever pays any attention!

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Greg Donald
On Tue, 25 Jan 2005 17:15:37 +, Rory Browne [EMAIL PROTECTED] wrote:
 I think sending it to the list every so often, via cron isn't the best
 way to handle it. I've read it once, I don't see the point in getting
 it again. Perhaps, is the list admins were willing, it could be set up
 to be sent to all newbies, as part of the subscription process. To
 ensure that it is read by all newbies, they'd have to answer certain
 questions in the body of the confirmation email? The problem of
 newbies not knowing they are newbies, isn't overcome by cron.

That doesn't seem like a good idea to me.  I wouldn't want to take a
test just because I need to resubscribe after vacation, or a change of
email address.  Besides that, if the test is unmonitored, well.. 
anyway.

The Perl solution many years ago was to make a newbie list.  My local
Linux user group solution last year was to make a newbie list.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Help with file not writing

2005-01-25 Thread Marek Kilimajer
Joey wrote:
 
Hi Marek,
Me? I did not send you anything :)
Member variables in classes are NOT used this way:
$this-$hits
But this way:
$this-hits

I don't see anything in the docs located http://us3.php.net/fopen to help.
I changed it to w only but that made no difference.
Can you please provide a more specific answer.
THanks  

Code looks liks this:
%
class counter {
var $log_file = 'counters/google_log.txt';
var $file = 'counters/google_counter.txt';
function counter()
{
$this-readFile();
$this-writeFile();
$this-writeLog();
}

function readFile()
{
$hiti = fopen($this-file, r);
while(!feof($hiti)){
$this-$hits .= fgets($hiti,128);
I also think you want just = above (no append)
}
$this-$hits=1+$this-$hits;
echo $this-$hits;
fclose($hiti);
}

function writeFile()
{
$hito = fopen($this-file,w+);
fputs($hito,$this-$hits);
fclose($hito);
}
	function writeLog()
	{
		$ip_address=$GLOBALS['HTTP_SERVER_VARS']['REMOTE_ADDR']; 
		$date_stamp=date(F j, Y, g:i a);
		 $log_entry=$date_stamp .   :   . $ip_address . \n ;
		 echo TEST-  . $log_entry ;
		$log = fopen($this-log_file,a);
		fputs($log,$this-$log_entry );
		fclose($log);
	}
	
}

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


RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Chris Ramsay
snip

Hey!
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?

/snip

I have received this also with both my postings today...and probably will
again...

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



Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread John Nichel
Mike Johnson wrote:
From: Richard Davey [mailto:[EMAIL PROTECTED] 


Hello Afan,
Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
AP Hey!
AP I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
Join the club.. everyone who posts gets one. Annoying, no?
Best regards,
Richard Davey

My personal favorite is when someone requests a read receipt on
listmail. I wonder what their inbox looks like when 500 people send one
back all in the space of five minutes.
I usually just delete those without a second glance, but you may be on 
to something...if we all send the read receipt, then maybe the user will 
get tired of all the receipts and turn it off. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Chris W. Parker
Greg Donald mailto:[EMAIL PROTECTED]
on Tuesday, January 25, 2005 9:36 AM said:

 The Perl solution many years ago was to make a newbie list.  My local
 Linux user group solution last year was to make a newbie list.

This idea has been presented too.

All the smart people will go to the advanced (or normal) list and
leave all the n00bs by themselves to answer questions like, I tried to
download the internets with PHP to my compy 386 but it didn't work. PLZ
HLP! KTHXBYE! with, I don't know. Maybe you should subscribe to the
advanced list and ask there?

After a few hours there will be no more newby list. At least, that's how
the outcome has been imagined in the past.



Chris.

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Rory Browne
On Tue, 25 Jan 2005 11:36:17 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Tue, 25 Jan 2005 17:15:37 +, Rory Browne [EMAIL PROTECTED] wrote:
  I think sending it to the list every so often, via cron isn't the best
  way to handle it. I've read it once, I don't see the point in getting
  it again. Perhaps, is the list admins were willing, it could be set up
  to be sent to all newbies, as part of the subscription process. To
  ensure that it is read by all newbies, they'd have to answer certain
  questions in the body of the confirmation email? The problem of
  newbies not knowing they are newbies, isn't overcome by cron.
 
 That doesn't seem like a good idea to me.  I wouldn't want to take a
 test just because I need to resubscribe after vacation, or a change of
 email address.  Besides that, if the test is unmonitored, well..
 anyway.

Fair enough. Maybe it isn't such a good idea in this instance, but for
the test, I meant something simple, like a what is the missing word
type thing. For example I could ask you what word was missing from the
following sentence You can download a copy and use it ___ also. As you
read through the guide, you'll see that the answer is 'offline'.

I'm not trying to push this through. I just wanted to explain what I
meant by the test and its being unmonitored, and lets face it, its
handier to read the thing, and find out the answers, than it is to
look up some passwordz/crakz/insert_other_l337sp33k_term_here site,
just to subscribe to the PHP mailing list.

Having that said, it was all just a thought.
 



 
 The Perl solution many years ago was to make a newbie list.  My local
 Linux user group solution last year was to make a newbie list.
 
 --
 Greg Donald
 Zend Certified Engineer
 http://destiney.com/
 
 --
 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] PHP refuses to look in the areas I tell it to for its php.ini file, why?

2005-01-25 Thread v0id null
Here is my setup
Windows 2000 with latest service packs

One apache 1.3 install, but two services running off it with two
different configuration files. One file is for PHP4 and one is for
PHP5, and that works like a charm. Oh, both PHP's are running as SAPI
modules for Apache, not as CGI. I'm using both the LoadModule and
AddModule directives.

PHP4 is in c:/php and PHP5 is in c:/php5.

The issue? Neither PHP's seem to be able to find php.ini and for some
really stupid reason, neither of the PHPs seem to really care. I don't
even know how PHP is running without its php.ini file, especially
since its able to load extensions even though, according to phpinfo,
it's trying to find extensions in directories that don't even exist!

I've added both php's directories into my PATH enviroment variable in
windows, I've added SetEnv PHPRC C:/php in httpd.php4.conf (obviously
the apache conf file for php4) and that does nothing for PHP4. I
haven't tried anything for PHP5 because on the immediate side of
things, its not important.

PHP4 is looking for php.ini in c:\WINNT, and its not there. There is
nothing of PHP's files inside any windows directory, no dlls, no ini
files, nothing. Everything is contained in PHP's own directory, which,
so it seems, is reading it partially.

From httpd.php4.conf - here are the config items directly related to
php, in the order in which they apear:

LoadModule php4_module C:/php/php4apache.dll
AddModule mod_php4.c
SetEnv PHPRC C:/php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The Apache PHP4 config works perfectly, php is able to run, but like I
said, phpinfo shows nothing. Now while I can't show the output of
phpinfo directly off the server, http://www.psikon.info./phpinfo.html
is a copy. This is of course the PHP4 apache service outputting this.

Any help anyone could offer would be GREATLY appreciated,
Thanks
-- 
llundi0v

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



[PHP] Magic quotes question

2005-01-25 Thread Ben Edwards
In the php manual it states 

' Keep in mind that the setting  magic_quotes_gpc will not work at runtime.'

What douse this actualy mean?

Ben
-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

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



Re: [PHP] Maxing out sessions?

2005-01-25 Thread Marek Kilimajer
Matt wrote:
Ok,
Right now if I look at a session I see the following... this is on a
mail server.. so this is all mail variables and such...  There are
currently 319 session files and 1.5MB... you know I'm also wondering
now if I didn't read things wrong.. .I wonder if it said 2.0MB not
GB yesterday.. that would be a huge difference.
Most unix filesystem allow you to set certain % of disk space reserved 
for root. If less then this % is available on the partition, only root 
is allowed to take more space.

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


Re: [PHP] Maxing out sessions?

2005-01-25 Thread Richard Lynch
Matt wrote:
 Ok,
 Right now if I look at a session I see the following... this is on a
 mail server.. so this is all mail variables and such...  There are
 currently 319 session files and 1.5MB... you know I'm also wondering
 now if I didn't read things wrong.. .I wonder if it said 2.0MB not
 GB yesterday.. that would be a huge difference.

2M sure sounds a lot more reasonable than 2G...

gettext_php_loaded|b:1;gettext_php_domain|s:12:squirrelmail;gettext_php_dir|s:13:../../locale/;gettext_php_translateStrings|a:5:{s:8:New
 Mail;s:8:New Mail;s:17:ChiliTech Notice:;s:17:ChiliTech
 Notice:;s:18:You Have New Mail!;s:18:You Have New
 Mail!;s:13:View New Mail;s:13:View New Mail;s:12:Close
 Window;s:12:Close
 Window;}gettext_php_loaded_language|s:5:en_US;gettext_php_short_circuit|b:1;sq_base_url|s:31:http://webweather.chilitech.net;base_uri|s:1:/;onetimepad|s:12:GJTEpMkqNw==;sqimap_capabilities|a:1:{s:11:IMAP4rev1
 ;b:1;}delimiter|s:1:.;username|s:11:pcaddey1376;user_is_logged_in|b:1;just_logged_in|b:1;attachment_common_types|a:7:{s:9:image/gif;b:1;s:15:image/x-xbitmap;b:1;s:10:image/jpeg;b:1;s:11:image/pjpeg;b:1;s:18:application/msword;b:1;s:29:application/x-shockwave-flash;b:1;s:3:*/*;b:1;}attachment_common_types_parsed|a:0:{}theme_css|s:0:;boxesnew|a:4:{i:0;a:7:{s:3:raw;s:43:*
 LIST (\Marked \HasChildren) . INBOX
 ;s:9:formatted;s:5:INBOX;s:14:unformatted-dm;s:5:INBOX;s:11:unformatted;s:5:INBOX;s:16:unformatted-disp;s:5:INBOX;s:2:id;i:0;s:5:flags;a:2:{i:0;s:6:marked;i:1;s:11:haschildren;}}i:1;a:7:{s:3:raw;s:44:*
 LIST (\HasNoChildren) . INBOX.Drafts
 ;s:9:formatted;s:18:nbsp;nbsp;Drafts;s:14:unformatted-dm;s:12:INBOX.Drafts;s:11:unformatted;s:12:INBOX.Drafts;s:16:unformatted-disp;s:12:INBOX.Drafts;s:2:id;i:1;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:2;a:7:{s:3:raw;s:42:*
 LIST (\HasNoChildren) . INBOX.Sent
 ;s:9:formatted;s:16:nbsp;nbsp;Sent;s:14:unformatted-dm;s:10:INBOX.Sent;s:11:unformatted;s:10:INBOX.Sent;s:16:unformatted-disp;s:10:INBOX.Sent;s:2:id;i:2;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:3;a:7:{s:3:raw;s:43:*
 LIST (\HasNoChildren) . INBOX.Trash
 ;s:9:formatted;s:17:nbsp;nbsp;Trash;s:14:unformatted-dm;s:11:INBOX.Trash;s:11:unformatted;s:11:INBOX.Trash;s:16:unformatted-disp;s:11:INBOX.Trash;s:2:id;i:3;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}}auto_create_done|b:1;prefs_cache|a:8:{s:12:chosen_theme;s:27:../themes/default_theme.php;s:17:show_html_default;s:1:0;s:13:javascript_on;s:1:1;s:8:hililist;s:6:a:0:{};s:12:twc_weather0;s:345:17810\17810\after\1\1\0\0\1\0\1\0\1\1105488021\
 Allenwood, PA (17810)\33deg;F\24deg;F\Light Rain\0nbsp;Low\East
 Northeast at  12nbsp;mph\31deg;F\92%\7.0  miles\30.15  in and
 rising\3600\1\275\1\0\1\\IMG
 SRC=../plugins/twc_weather/twc_image_handler.php?wicon=http://image.weather.com/web/common/wxicons/52/11.gif
 WIDTH=52
 \1\\1\0\0;s:14:newmail_recent;s:2:on;s:13:newmail_popup;s:2:on;s:8:weather0;s:182:17810\Allenwood,
 PA\after\1\1\1\0\1\1\1\1\1\1106670053\\28deg;F\18deg;F
 (-8deg;C)\Overcast\\W 12 MPH\21deg;F (-6deg;C)\75 %\10.00
 mi.\29.90quot; (1013.4
 mb)\7200\1\\1\\;}prefs_are_cached|b:1;[

How does this compare to a valid login?

Anything, other than the obvious missing PHPSESSID stuff?

Is it possible that the Weather/Mail server is sometimes wiping out your
Cookie?...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Help with file not writing

2005-01-25 Thread Richard Lynch
Joey wrote:
   $this-$hits .= fgets($hiti,128);

Do global search and replace for '-$' and change it to '-'

   $this-$hits=1+$this-$hits;
   echo $this-$hits;
   fputs($hito,$this-$hits);
   fputs($log,$this-$log_entry );

cuz none of those are gonna work.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Magic quotes question

2005-01-25 Thread Chris
It means that you can't set that setting inside a script with ini_set.
Since the earliest opportunity to set it in a script would be after it 
would have already done it's job, it won't work.

You must set it before the script runs.
Chris
Ben Edwards wrote:
In the php manual it states 

' Keep in mind that the setting  magic_quotes_gpc will not work at runtime.'
What douse this actualy mean?
Ben
 

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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Greg Donald
On Tue, 25 Jan 2005 10:19:12 -0800, Chris W. Parker
[EMAIL PROTECTED] wrote:
 All the smart people will go to the advanced (or normal) list and
 leave all the n00bs by themselves to answer questions like, I tried to
 download the internets with PHP to my compy 386 but it didn't work. PLZ
 HLP! KTHXBYE! with, I don't know. Maybe you should subscribe to the
 advanced list and ask there?

When I don't know the answer to a post I don't reply to the post.  I
see no reason to advertise the fact that I don't know, that's a waste
of everyone's time.

If one of us newbies gets no answer after a few days, we would realize
no one knows the answer and would probably repost the question to
another list.

 After a few hours there will be no more newby list. At least, that's how
 the outcome has been imagined in the past.

I for one would subscribe and remain a member of a php-newbie list.
Never too smart to learn something new.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Lynch
Jay Blanchard wrote:
 [snip]
 This is interesting, I set up the mail line for the CRON to read

 mail(php-general@lists.php.net, [NEWBIE GUIDE] - For benefit of new
 list members, $msg, From: [EMAIL PROTECTED] .
 Reply-To:
 [EMAIL PROTECTED] . X-Mailer: PHP/ . phpversion());

 And the test mail did not appear on the list. Would php-general not
 recognize itself as a member?

 To be honest: I simply don't know.  I'm guessing John Holmes might know
 the answer to this one? ...
 [/snip]

 I just tried with a different From address...mineand still no
 appearance on the list. Interesting to say the least.

Many spam filters will utilize various tests to eliminate email that
doesn't look like it came from a real person.

The most common thing you can change is to make the From line include a
name using an email formatted like:
PHP General php-general@lists.php.net

I suspect PHP General also won't take email from itself anyway, so stick
with your own address.

Start comparing the mail headers you are sending with the ones that make
it through to the list.

You'll be able to fool it eventually...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: Re[2]: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Lynch
 I think once a week would be more than enough. You have to actually
 hope the newbies even read it, most of them don't even think they are
 newbies :)

Perhaps the most appropriate subject would be Posting Guide - Read before
sending

Regardless of one's experience, one would expect to read that.

That said:  This *is* PHP General, and there are plenty of people, self
included, who can *read* some chunks of the manual, but...

Reading does not guarantee comprehension, so there will always be posts
about everything.

I tend to just assume that people read and failed to understand, if they
seem to at least have some grasp on what they are typing.

Keeps my blood pressure down :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Maxing out sessions?

2005-01-25 Thread Matt
It's *possible*, however I think slightly unlikely... as when a
problem occurres it occurres across all php applications on the
server.. in that... there is a network status page, a small customer
login area, and a weather section and they all die...

I guess I'm not looking for a magic answer... just someplace to look
for solutions... like things to watch on the server... clearly, it
seems, disk space and not even files per directory are even a
problem... so


On Tue, 25 Jan 2005 10:36:34 -0800 (PST), Richard Lynch [EMAIL PROTECTED] 
wrote:
 Matt wrote:
  Ok,
  Right now if I look at a session I see the following... this is on a
  mail server.. so this is all mail variables and such...  There are
  currently 319 session files and 1.5MB... you know I'm also wondering
  now if I didn't read things wrong.. .I wonder if it said 2.0MB not
  GB yesterday.. that would be a huge difference.
 
 2M sure sounds a lot more reasonable than 2G...
 
 gettext_php_loaded|b:1;gettext_php_domain|s:12:squirrelmail;gettext_php_dir|s:13:../../locale/;gettext_php_translateStrings|a:5:{s:8:New
  Mail;s:8:New Mail;s:17:ChiliTech Notice:;s:17:ChiliTech
  Notice:;s:18:You Have New Mail!;s:18:You Have New
  Mail!;s:13:View New Mail;s:13:View New Mail;s:12:Close
  Window;s:12:Close
  Window;}gettext_php_loaded_language|s:5:en_US;gettext_php_short_circuit|b:1;sq_base_url|s:31:http://webweather.chilitech.net;base_uri|s:1:/;onetimepad|s:12:GJTEpMkqNw==;sqimap_capabilities|a:1:{s:11:IMAP4rev1
  ;b:1;}delimiter|s:1:.;username|s:11:pcaddey1376;user_is_logged_in|b:1;just_logged_in|b:1;attachment_common_types|a:7:{s:9:image/gif;b:1;s:15:image/x-xbitmap;b:1;s:10:image/jpeg;b:1;s:11:image/pjpeg;b:1;s:18:application/msword;b:1;s:29:application/x-shockwave-flash;b:1;s:3:*/*;b:1;}attachment_common_types_parsed|a:0:{}theme_css|s:0:;boxesnew|a:4:{i:0;a:7:{s:3:raw;s:43:*
  LIST (\Marked \HasChildren) . INBOX
  ;s:9:formatted;s:5:INBOX;s:14:unformatted-dm;s:5:INBOX;s:11:unformatted;s:5:INBOX;s:16:unformatted-disp;s:5:INBOX;s:2:id;i:0;s:5:flags;a:2:{i:0;s:6:marked;i:1;s:11:haschildren;}}i:1;a:7:{s:3:raw;s:44:*
  LIST (\HasNoChildren) . INBOX.Drafts
  ;s:9:formatted;s:18:nbsp;nbsp;Drafts;s:14:unformatted-dm;s:12:INBOX.Drafts;s:11:unformatted;s:12:INBOX.Drafts;s:16:unformatted-disp;s:12:INBOX.Drafts;s:2:id;i:1;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:2;a:7:{s:3:raw;s:42:*
  LIST (\HasNoChildren) . INBOX.Sent
  ;s:9:formatted;s:16:nbsp;nbsp;Sent;s:14:unformatted-dm;s:10:INBOX.Sent;s:11:unformatted;s:10:INBOX.Sent;s:16:unformatted-disp;s:10:INBOX.Sent;s:2:id;i:2;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}i:3;a:7:{s:3:raw;s:43:*
  LIST (\HasNoChildren) . INBOX.Trash
  ;s:9:formatted;s:17:nbsp;nbsp;Trash;s:14:unformatted-dm;s:11:INBOX.Trash;s:11:unformatted;s:11:INBOX.Trash;s:16:unformatted-disp;s:11:INBOX.Trash;s:2:id;i:3;s:5:flags;a:1:{i:0;s:13:hasnochildren;}}}auto_create_done|b:1;prefs_cache|a:8:{s:12:chosen_theme;s:27:../themes/default_theme.php;s:17:show_html_default;s:1:0;s:13:javascript_on;s:1:1;s:8:hililist;s:6:a:0:{};s:12:twc_weather0;s:345:17810\17810\after\1\1\0\0\1\0\1\0\1\1105488021\
  Allenwood, PA (17810)\33deg;F\24deg;F\Light Rain\0nbsp;Low\East
  Northeast at  12nbsp;mph\31deg;F\92%\7.0  miles\30.15  in and
  rising\3600\1\275\1\0\1\\IMG
  SRC=../plugins/twc_weather/twc_image_handler.php?wicon=http://image.weather.com/web/common/wxicons/52/11.gif
  WIDTH=52
  \1\\1\0\0;s:14:newmail_recent;s:2:on;s:13:newmail_popup;s:2:on;s:8:weather0;s:182:17810\Allenwood,
  PA\after\1\1\1\0\1\1\1\1\1\1106670053\\28deg;F\18deg;F
  (-8deg;C)\Overcast\\W 12 MPH\21deg;F (-6deg;C)\75 %\10.00
  mi.\29.90quot; (1013.4
  mb)\7200\1\\1\\;}prefs_are_cached|b:1;[
 
 How does this compare to a valid login?
 
 Anything, other than the obvious missing PHPSESSID stuff?
 
 Is it possible that the Weather/Mail server is sometimes wiping out your
 Cookie?...
 
 --
 Like Music?
 http://l-i-e.com/artists.htm
 
 --
 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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
Jay Blanchard wrote:
[snip]
I think that Justin Patrin started up a wiki for PHP, but he hasn't been
on the list in a while and I can't remember what the url for his wiki 
was.  But he had a fair amount of useful code in there that would be a 
great start for this project.

AND ...
Yeah the list is pretty high volume... it would be great if we could 
help relieve the stress on the servers a bit.
[/snip]

Perhaps http://www.phpcommunity.org could put some of this stuff up?
Jay, seeing as your our their steering committee, you tell us :-)
seems like a good place for it tho!
on top of having a place to dump cool stuff, newbie advice etc maybe we should
nominate a person to act as 'Chief Archiver' - responsibilities.
1. sending out a weekly 'refresher' mails (with links to newbie advice etc)
2. managing the content of the refresher (and linked to newbie advice)
3. hassling/encouraging quality posters to summarize cool 
idea/discussions/solutions
into wiki pages (assuming we use a wiki).
4. hassling/encouraging high-volume-posters and/or those people who
show advanced level of knowledge on any given subject to 'take control' of
certain pages/topics in the wiki (again assuming...).
or does the majority prefer anarchy? (heh, its a choice! ;-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Understanding intval() and types conversion

2005-01-25 Thread Jordi Canals
Hi,

I'm trying to understand how the intval() function works, but I'm
unable to understand how exactly it works.

Take a look at this piece of code (Tested on PHP 5.0.3):

?php

$a = (0.1 + 0.7) * 10;
$b = intval($a);

echo 'a - '. $a .' - '. gettype($a);  // Prints: a - 8 - double
echo 'br';
echo 'b - '. $b .' - '. gettype($b);  // Prints: b - 7 - integer

?

I also tested settype() and casting:

settype($a, 'integer'); // New value for $a is 7
$b = (int) $a;   // Value for $b is 7

I cannot understand it. If originally the value for $a is 8 (double),
why when converting to integer I get 7?

Any help or comment which helps me to understand that will be really welcome!
Jordi.

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
Rory Browne wrote:
I think sending it to the list every so often, via cron isn't the best
way to handle it. I've read it once, I don't see the point in getting
indeed not the best way but...
it again. Perhaps, is the list admins were willing, it could be set up
considering the ammount of 'admining' done on this list we could be
waiting along time for anything to change? compounded when you want to
regularly enhance the reminder.
the cron job is pragmatic. as is starting up an unofficial (list-)wiki.
if they flourish then they'll probably be integrated into more official stuff
in php land.
to be sent to all newbies, as part of the subscription process. To
ensure that it is read by all newbies, they'd have to answer certain
questions in the body of the confirmation email? The problem of
newbies not knowing they are newbies, isn't overcome by cron.
lets tell them then ;-)
Any thoughts?
P.S. An addition to the above, a reminder that you have to CC to
php-general@lists.php.net, for responses to be sent to the list might
+1 for that being in the reminder/refresher.
be a good idea. I've lost count of how many times I've forgotten to do
this, including this time(sorry Jay), and ended up sending it only to
the original sender, instead of to the list, resulting in the original
sender recieving the thing twice.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Get full url

2005-01-25 Thread Richard Lynch
Dmitry wrote:
 Dont tell me about simple solutions such as
 $_SERVER[HTTPS] .
 $_SERVER[REMOTE_ADDR] .
 $_SERVER[SERVER_PORT] .
 $_SERVER[PHP_SELF] .
 $_SERVER[QUERY_STRING]

 I want get really good solution.

Bad News: You've rule out the only solution there *IS*

Your best bet is to do this:
?php phpinfo();?

If what you want isn't in there, or you can't figure out how to compose it
from that, then you probably can't get what you want without changing
something in your web-server, rather than in PHP.

PHP pretty much just provides what your web-server provides -- If you
aren't getting what you want, it's not PHP's fault; It's your web-server
that is not providing you the info you need.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
Greg Donald wrote:
On Tue, 25 Jan 2005 10:19:12 -0800, Chris W. Parker
[EMAIL PROTECTED] wrote:
...

I for one would subscribe and remain a member of a php-newbie list.
Never too smart to learn something new.

I think that that comment makes Greg a good candidate for 'Chief Archiver'.
straight up.
(as a bonus any hardwork put into 'archiving' etc pays up in the form of
less illegible junk questions in his inbox via php-newbie ;-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP refuses to look in the areas I tell it to for its php.ini file, why?

2005-01-25 Thread Richard Lynch
v0id null wrote:
 The issue? Neither PHP's seem to be able to find php.ini and for some
 really stupid reason, neither of the PHPs seem to really care. I don't
 even know how PHP is running without its php.ini file, especially

If PHP can't find a php.ini file, it uses the defaults set up when it was
compiled, and the same values as if it had found the default php.ini file
that comes with the distribution.

 since its able to load extensions even though, according to phpinfo,
 it's trying to find extensions in directories that don't even exist!

The extensions it is finding or not finding in the directories that do or
don't exist are pre-set by compiled-in default-values-for-no-php.ini
values.

Windows being windows, DLLs that live next to php.exe (or the php4ts.dll
or whatever the hell it is) may be automagically found by the Windows
OS...  At least, that's how I've understood Windows to work...  Actually,
with the DLL setup, I guess it would find any DLLs sitting in the same
directory as apache.exe...

You could drive yourself crazy trying to figure out which software
(PHP/Apache/OS) is looking for what where.

 I've added both php's directories into my PATH enviroment variable in
 windows, I've added SetEnv PHPRC C:/php in httpd.php4.conf (obviously
 the apache conf file for php4) and that does nothing for PHP4. I
 haven't tried anything for PHP5 because on the immediate side of
 things, its not important.

Don't know nothin' bout no SetEnv PHPRC...  Is that documented in the
manual?...

 PHP4 is looking for php.ini in c:\WINNT, and its not there. There is

So put one there, and life will be good.

The setting for C:\WINNT is compiled into the PHP binary (.exe or .dll)
and that's pretty much where you need to put php.ini if you want it to
work...

Though if you get that SetEnv thing working, and it's a documented
feature, more power to you.

 nothing of PHP's files inside any windows directory, no dlls, no ini
 files, nothing. Everything is contained in PHP's own directory, which,
 so it seems, is reading it partially.

Again, that might be Windoze finding the DLLs more than PHP -- There is
a whole set of rules for Windoze and DLL loading and whatnot that I've
long purged from my brain.  I think it's even documented somewhere on
Microsoft's site...  Good Luck!

 Any help anyone could offer would be GREATLY appreciated,

With any luck at all, your php5 install is looking for php.ini in a
different directory...

Use phpinfo() to determine where it thinks the file should be.

PS:  phpinfo() will output something 'odd' when there is no php.ini file
to be found as opposed to when it found one in the directory where it
looks.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] grabbing the range

2005-01-25 Thread Richard Lynch
blackwater dev wrote:
 Let's say I have 100 rows in the database, I need to loop throw them
 ten at a time and for each set grab the max and min ages...I then need

You really want the min/max of just the 10 on screen?...

Okay. [shrug]

At that point you need to use a sub-query -- which is only supported in
more recent MySQL -- or you can run two queries separately.

Solution 1 (sub-query):
select min(age), max(age) from (select age from customers limit 10, 20)

Solution 2 (two queries):
select ID from customers limit 10, 20
?php
while (list($id) = mysql_fetch_row($customers)){
  $ids[] = $id;
}
$ids_sql = implode(', ', $ids);
$query = select min(age), max(age) from customers where id in ($ids_sql);

 to return a multi-dimensional array of all the ranges...I basically
 want to do this but of course this query won't work:

 ***this is just pseudo code***

 I would run this query for each set and return max and min ages into the
 array.

  select max(age) as max_age, min(age) as min_age
 from customers  limit 10,20;

 How should I do this?  Do I have to run a query like this:
select  age from customers limit 10,20

 and loop through the result set putting all these values into an array
 and then pull the min and max out of the array?

While that would work, it's generally faster to let MySQL do the work of
sorting/searching...

If you're not using the sub-query solution, however, there probably isn't
a whole lot of advantage to running a second query instead of just
tracking min/max as you loop through your results:

$max = 0;
$min = 2; //Older than Methusela
$query = select age from customers limit 10, 20;
$customers = mysql_query($query) or trigger_error(mysql_error() . 
$query, E_USER_ERROR);
while (list($age) = mysql_fetch_row($customers)){
  $min = min($min, $age);
  $max = max($max, $age);
}

Since you're always looping through 10 rows either way, the PHP min/max
will probably be about the same as doing another query.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Magic quotes question

2005-01-25 Thread Richard Lynch
Ben Edwards wrote:
 In the php manual it states

 ' Keep in mind that the setting  magic_quotes_gpc will not work at
 runtime.'

 What douse this actualy mean?

Translation:
If you try to use ini_set to change magic_quotes_gps in your .php script,
here's what happens:

Step 1: Apache/PHP set up $_POST/$_GET/$_COOKIES based on php.ini setting
of magic_quotes_gpc
Step 2: Your script runs
Step 3: Your script calls ini_set('magic_quotes_gpc', ???);

As you can imagine, it really doesn't do much good at that point to change
this setting, since all the work of loading in POST/GET/COOKIES is already
done.

Now, if you worked hard, you could maybe find a way to change the setting,
and then you could re-parse the GET arguments and the POST data (assuming
you configured settings to provide raw POST data) and maybe even (somehow)
manage to re-interpret the cookies...

Or you could just live with the current setting and use stripslashes() or
addslashes() as needed to get the data in the form you want which would be
a zillion times easier.

So while you maybe *CAN* change magic_quotes_gpc at run-time with ini_set,
there ain't a whole lot of point to it, unless you've got a ton of data
you are re-parsing from somewhere else that relies on that setting.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Lynch
 I for one would subscribe and remain a member of a php-newbie list.
 Never too smart to learn something new.

In years past, when this topic has re-re-re-re-re-re-surfaced, the general
consensus always seems to be that most of us would just end up subscribed
to two lists, the newbies would probably post to both too quickly, and the
overall traffic would only increase, not decrease.

Is it only me, or are the number of posts about posts now out-numbering
the number of 'real' posts?... :-^

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Zend Performance Suite 3.6 and PHP5

2005-01-25 Thread Matthew Runo
I'm almost certain that PHP 5 was supported starting with Zend 
Performance Suite 4.0. You can log into your company's Zend account to 
download the software that you have access to.

--Matthew Runo
Founder, Quabbo Internet Services
PHP Hosting Solutions, featuring the Zend Performance Suite
http://www.quabbo.com
On Jan 23, 2005, at 6:23 PM, Lars B. Jensen wrote:
I've taken over the system administration of our servers, and have 
been migrating from PHP4 on Redhat, to PHP5 on a FreeBSD system setup.

Few questions,
Is this version of the ZPS compatible with PHP5, I mean, the software 
was bought back in dec. 2003 and never updated since. (the new Zend 
Platform is outrageously priced, and I'll never get that through on 
the IT budget here)

Does anybody know where to download the source for this, the old (and 
ofcourse not working here anymore) admin didnt keep the source, so all 
I got is the name and serial. (and Zend supporters seem to be on 
vacation)

With the Zend Platform out of the way, should I look more toward eg. 
the APC ?

--
Lars B. Jensen, Internet Architect
CareerCross Japan
Japan's premier online career resource for english speaking 
professionals

http://www.careercross.com
--
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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jochem Maas
Greg Donald wrote:
On Tue, 25 Jan 2005 17:15:37 +, Rory Browne [EMAIL PROTECTED] wrote:
I think sending it to the list every so often, via cron isn't the best
way to handle it. I've read it once, I don't see the point in getting
it again. Perhaps, is the list admins were willing, it could be set up
to be sent to all newbies, as part of the subscription process. To
ensure that it is read by all newbies, they'd have to answer certain
questions in the body of the confirmation email? The problem of
newbies not knowing they are newbies, isn't overcome by cron.

That doesn't seem like a good idea to me.  I wouldn't want to take a
test just because I need to resubscribe after vacation, or a change of
email address.  Besides that, if the test is unmonitored, well.. 
anyway.
agreed - testing is futile, let the test be simply sending an email
thats 'worth' answering (according to the 'guidelines').
The Perl solution many years ago was to make a newbie list.  My local
Linux user group solution last year was to make a newbie list.
i.e. segregate the 'levels' of knowledge. -100.
you'll just end up with the blind leading the blind, leads to more crap PHP
programmers, leads to php's reputation being negatively compounded, leads
to lower (average) paid jobs in phpland. I vote we keep the noobs close :-)
or will all you advanced guys/girls spend countless hours repeatedly
asking people to post code, use print_r()/var_dump() etc... without so much as
halfbaked challenge in sight? me neither ;-)

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


Re: [PHP] Understanding intval() and types conversion

2005-01-25 Thread Richard Lynch
Jordi Canals wrote:
 I'm trying to understand how the intval() function works, but I'm
 unable to understand how exactly it works.

Deep deep inside the guts of the computer, $a is represented as something
not unlike:

80e0

In other words, 8.0 x 10 to the 0th power.

Now, when the computer has to convert that to an integer, the mathematics
involved are, well, pretty complex.

Basically, you're looking at a good solid semester of college-level
courses in computer science to *really* dig into all the guts of binary,
ones-complement, twos-complement, and other internal representations.

Also note that the way things are *really* stored is platform/OS
dependent, so you could get different results from intval() on, say,
Windows and Linux and Mac (and whatever else PHP runs on).

You can be quite sure it will always be 7 or 8 for this example, as the
number internally will be very very very close to 7.99... or
8.000...

But (mostly) computers just don't think of decimal numbers and fractions
the same way you and I do, without some pretty special-purpose coding for
it.

Some real-world suggestions:

Use round(), floor() and ceil() as much as you can to convert if you are
worried about this kind of stuff.

If you *NEED* more precision for scientific purposes, the BC_MATH
extension lets *you* decide how many decimal points to keep around, and
you can get as precise as you want -- Up to the limits of the RAM on your
machine, and at a severe performance penalty compared to the built-in
OS-dependent math.

It should also be noted that there are languages (EG Lisp) which actually
*DO* understand fractions as part of the language specification, and which
just maybe might be more suitable for whatever it is you are doing if
PHP's math is frustrating you.  I suspect somebody somewhere has some
kind of fractional math package you could integate with PHP, though, if
you dig for it.

Keep in mind that it's not even really the way PHP thinks of numbers when
you are trying to figure out what intval() is doing -- It's built into the
hardware and the Operating System, and PHP pretty much just spits out
whatever the OS tells it to for intval().

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jay Blanchard
[snip]
Is it only me, or are the number of posts about posts now out-numbering
the number of 'real' posts?... :-^
[/snip]

I cannot be sure, so we must need a poll. And is a post about posts not
really real or does it have some sort of existential non-sameness?

We could always demand that posts about posts have a PHP TIP or TRICK
attached. I know of another mailing list that does this with regards to
off-topic posts (requires the honor system). Someone even harvests the
tips and re-posts them as a whole on a weekly basis.

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



RE: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Chris W. Parker
Jochem Maas mailto:[EMAIL PROTECTED]
on Tuesday, January 25, 2005 11:23 AM said:

 Greg Donald wrote:
 On Tue, 25 Jan 2005 10:19:12 -0800, Chris W. Parker
 [EMAIL PROTECTED] wrote: 
 
 
 ...

Ok so maybe it wasn't as funny in the email as it was in my head but
gosh where did everyone's sense of humor go?

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



Re: [PHP] Understanding intval() and types conversion

2005-01-25 Thread Jochem Maas
Jordi Canals wrote:
Hi,
I'm trying to understand how the intval() function works, but I'm
you'd think offhand that that would be easy
unable to understand how exactly it works.
hmm. very odd. I took a look at your code and did a few more tests
on PHP 5.0.2 (cli) (built: Oct 21 2004 13:52:27):
OUTPUT
$a = (0.1 + 0.7) * 10;var_dump($a);

float(8)
$b = intval($a);var_dump($b);

int(7)
$c = $a;settype($c, integer);var_dump($c);

int(7)
$d = intval($a);var_dump($d);

int(8)
$e = floatval($a);var_dump($e);

float(8)
$f = floatval($a);var_dump($f);

float(8)
$g = (int) floatval($a);var_dump($g);

int(7)
$h = $a;settype($h, integer);var_dump($h);

int(8)

var_dump($a,$b,$c,$d,$e,$f,$g,$h,$a);

float(8)
int(7)
int(7)
int(8)
float(8)
float(8)
int(7)
int(8)
string(1) 8
/OUTPUT
CMD-LINE-CODE
php -r '
$a = (0.1 + 0.7) * 10;
echo \n\$a = (0.1 + 0.7) * 10;var_dump(\$a);\n\n;
var_dump($a);
$b = intval($a);
echo \n\$b = intval(\$a);var_dump(\$b);\n\n;
var_dump($b);
$c = $a;settype($c, integer);
echo \n\$c = \$a;settype(\$c, \integer\);var_dump(\$c);\n\n;
var_dump($c);
$d = intval($a);
echo \n\$d = intval(\\$a\);var_dump(\$d);\n\n;
var_dump($d);
$e = floatval($a);
echo \n\$e = floatval(\$a);var_dump(\$e);\n\n;
var_dump($e);
$f = floatval($a);
echo \n\$f = floatval(\\$a\);var_dump(\$f);\n\n;
var_dump($f);
$g = (int) floatval($a);
echo \n\$g = (int) floatval(\$a);var_dump(\$g);\n\n;
var_dump($g);
$h = $a;settype($h, integer);
echo \n\$h = \$a;settype(\\$h\, \integer\);var_dump(\$h);\n\n;
var_dump($h);
echo 
\n\nvar_dump(\$a,\$b,\$c,\$d,\$e,\$f,\$g,\$h,\\$a\);\n\n;
var_dump($a,$b,$c,$d,$e,$f,$g,$h,$a);
'
/CMD-LINE-CODE
Take a look at this piece of code (Tested on PHP 5.0.3):
?php
$a = (0.1 + 0.7) * 10;
$b = intval($a);
echo 'a - '. $a .' - '. gettype($a);  // Prints: a - 8 - double
echo 'br';
echo 'b - '. $b .' - '. gettype($b);  // Prints: b - 7 - integer
sidenote: if you use double quotes in your test code you make it a
little easier for people to run the code off the cmdline ('php -r' on *nix).
?
I also tested settype() and casting:
settype($a, 'integer'); // New value for $a is 7
$b = (int) $a;   // Value for $b is 7
I cannot understand it. If originally the value for $a is 8 (double),
why when converting to integer I get 7?
my guess this is a round error issue - never noticed this problem before...
this is a problem right? anybody?
Any help or comment which helps me to understand that will be really 
welcome!
Jordi.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Understanding intval() and types conversion

2005-01-25 Thread Jochem Maas
Richard Lynch wrote:
Jordi Canals wrote:
I'm trying to understand how the intval() function works, but I'm
unable to understand how exactly it works.

Deep deep inside the guts of the computer, $a is represented as something
not unlike:
...
thanks Richard for that explaination! lots of light bulbs just went on.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] replacement

2005-01-25 Thread Jerry Swanson
I'm trying to replace a substr of the string that start from Rated
blahblah; azt the end semicolon.

Example:
safsagfasdfsdfdsfRated by 4 people;fafafaafafaf - return
safsagfasdfsdfdsffafafaafafaf

$replacement =; 
$pattern = /Rated.+;/; 
$found_str = preg_replace($pattern, $replacement, $found_str);

Why this above, doesn't work?

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



Re: [PHP] control REMOTE_ADDR header

2005-01-25 Thread Alawi Albaity
this site is blocked in my country , is it php class ? is there php


On Fri, 21 Jan 2005 22:55:53 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Sat, 22 Jan 2005 06:52:37 +0300, Alawi Albaity [EMAIL PROTECTED] wrote:
  I Want to control some privacy is there class to help me do that ?
 
 http://www.anonymizer.com/
 
 --
 Greg Donald
 Zend Certified Engineer
 http://destiney.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Alawi Albaity
Jeddah - KSA
Mobile : +966506660442

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Bret Hughes
On Tue, 2005-01-25 at 11:15, Rory Browne wrote:

 
 P.S. An addition to the above, a reminder that you have to CC to
 php-general@lists.php.net, for responses to be sent to the list might
 be a good idea. I've lost count of how many times I've forgotten to do
 this, including this time(sorry Jay), and ended up sending it only to
 the original sender, instead of to the list, resulting in the original
 sender recieving the thing twice.
 

I did this a few times when subscribed so I added this to my procmail.rc
( actually to a file lists.rc that I keep all my list processing stuff
in.

:0 fhw
* [EMAIL PROTECTED]
| formail -i Reply-To: php-general@lists.php.net

Now I just hit reply.  and I do not feel stupid two days later when I
wonder why my reply never made it :)

Another favorite if someone gets too obnoxious:

:0
* ^FROM: [EMAIL PROTECTED]
/dev/null


Bret

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



Re: [PHP] Magic quotes question

2005-01-25 Thread Chris
I'm not quite sure I understand you...
The theory behind that function looks sound, but are you meaning to 
return the value or pass it by reference and modify it?

Chris
Ben Edwards wrote:
OK.  This is really confusing me.
I am using the following function to handle this:
function prep( $text ) {  
 echo get_magic_quotes_gpc(). ;
 if (get_magic_quotes_gpc()) {
   echo mq on for $text;
 return $text;		   
 } else {
   echo mq off;
 return addslashes($text);
 }
}

And it is not doing the assslashes but stuff like \'s is still being
added.  wonce savein a few times I get \'.
Ben
 

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


RE: [PHP] replacement

2005-01-25 Thread Jay Blanchard
[snip]
I'm trying to replace a substr of the string that start from Rated
blahblah; azt the end semicolon.

Example:
safsagfasdfsdfdsfRated by 4 people;fafafaafafaf - return
safsagfasdfsdfdsffafafaafafaf

$replacement =; 
$pattern = /Rated.+;/; 
$found_str = preg_replace($pattern, $replacement, $found_str);

Why this above, doesn't work?
[/snip]

What does it return? Try this ...

$string = safsagfasdfsdfdsfRated by 4 people;fafafaafafaf;

$replacement =;
$pattern = /Rated.+;/;
$found_str = preg_replace($pattern, $replacement, $string);

echo $found_str;

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



Re: [PHP] Magic quotes question

2005-01-25 Thread Ben Edwards
OK.  This is really confusing me.

I am using the following function to handle this:

function prep( $text ) {  
  echo get_magic_quotes_gpc(). ;
  if (get_magic_quotes_gpc()) {
echo mq on for $text;
  return $text;
  } else {
echo mq off;
  return addslashes($text);
  }
}

And it is not doing the assslashes but stuff like \'s is still being
added.  wonce savein a few times I get \'.

Ben


On Tue, 25 Jan 2005 10:39:30 -0800, Chris [EMAIL PROTECTED] wrote:
 It means that you can't set that setting inside a script with ini_set.
 
 Since the earliest opportunity to set it in a script would be after it
 would have already done it's job, it won't work.
 
 You must set it before the script runs.
 
 Chris
 
 Ben Edwards wrote:
 
 In the php manual it states
 
 ' Keep in mind that the setting  magic_quotes_gpc will not work at runtime.'
 
 What douse this actualy mean?
 
 Ben
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

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



[PHP] Need help with ldap_search function

2005-01-25 Thread Merritt, David
I'm not familiar with LDAP so the problem may be more LDAP related and
my lack of LDAP knowledge than a PHP problem but I'm not so sure.
Trying to do ldap_search against the LDAP server.  I can get the
information I need against the CN records in the top DC but am unable to
get any record information from a sub DC.  The directory structure is
like so:

|--DC=com
  |--DC=dhwin2knet
|--OU=DHCMC
|  |--OU=Regular Users
||--CN=User 100
||--CN=User 101
||--etc
|
|--DC=dhsp
  |--OU=DHSP
|--CN=User 900
|--CN=User 901
|--etc


Using the following code to search for records:

// ldap auth info
$ldap = my_ldap_server.dhwin2knet.com;
$auth_user = dhwin2knet\\some_userid;
$auth_pass = 'foobar';
$base_dn = dc=dhwin2knet,dc=com;
$filter =
((objectClass=user)(objectCategory=person)(samaccountname=*));

// connect to server and set options
$connect = ldap_connect($ldap);
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);

// bind to server
$bind = ldap_bind($connect, $auth_user, $auth_pass);

// search directory
if (!([EMAIL PROTECTED]($connect, $base_dn, $filter))) {
 die(Unable to search ldap server);
}

// get the number of entries found
$number_returned = ldap_count_entries($connect,$search);
echo The number of entries returned is  . $number_returned;


Using the above code I can return ~500 user records but this is giving
me only the users in the OUs directly below DC=dhwin2knet,DC=com and
none of the ~250 records in the sub-domain, DC=dhsp,DC=dhwin2knet,DC=com
i.e.

Found: CN=User 100,OU=Regular Users,OU=DHCMC,DC=dhwin2knet,DC=com

Not found: CN=User 900,OU=DHSP,DC=dhsp,DC=dhwin2knet,DC=com


I've tried changing the user id that is connecting to the LDAP to be a
user in the dhsp sub-domain, changing the base dn to
dc=dhsp,dc=dhwin2knet,dc=com, using different filters etc but no
matter what I'm trying I am unable to get any records returned from
DC=dhsp,DC=dhwin2knet,DC=com.  I have used the Softerra LDAP Browser to
browse and verify my base dn and filter.  Using the dn and filter from
the code above in LDAP Browser I am getting the ~750 entries that I am
expecting to see.

BTW, using PHP 5.0.3 on Win2000 SP4 against a Windows 2000 Active
Directory server.  The following info on the ldap module is returned by
php_info():

LDAP Supportenabled
RCS Version $Id: ldap.c,v 1.154 2004/06/28 22:31:28 iliaa Exp $
Total Links 0/unlimited
API Version 2004
Vendor Name OpenLDAP
Vendor Version  0


TIA,

Dave Merritt
[EMAIL PROTECTED]

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Jay Blanchard wrote:
[snip]
Is it only me, or are the number of posts about posts now out-numbering
the number of 'real' posts?... :-^
[/snip]
I cannot be sure, so we must need a poll. And is a post about posts not
really real or does it have some sort of existential non-sameness?
We could always demand that posts about posts have a PHP TIP or TRICK
attached. I know of another mailing list that does this with regards to
off-topic posts (requires the honor system). Someone even harvests the
tips and re-posts them as a whole on a weekly basis.
Now Jay that is simply a ridiculous suggestion.  Certainly we do not 
have too many posts about posts.

Oh and by the way, whenever I'm creating the skeleton of a new class I 
will usually insert the following code snippet into the functions to let 
me know I have to come back and actually implement it later.

if ($class = __CLASS__) {
  trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is not finished.', 
E_USER_WARNING);
} else {
  trigger_error(__FUNCTION__ . ' is not finished.', E_USER_WARNING);
}

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Richard Lynch
 Oh and by the way, whenever I'm creating the skeleton of a new class I
 will usually insert the following code snippet into the functions to let
 me know I have to come back and actually implement it later.

 if ($class = __CLASS__) {
trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is not finished.',
 E_USER_WARNING);
 } else {
trigger_error(__FUNCTION__ . ' is not finished.', E_USER_WARNING);
 }

Why the assignment to $class?

Is that supposed to be == or is it just allowing for static class/method
calls with no object instantiated?

And would not 'if (__CLASS__)' serve just as well?

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Log-in script help

2005-01-25 Thread AceZero2790
Hey,
   I need a particular type log in script. I'm not sure how to do it or 
where I could find a tutorial that would help me, so I'll describe what I need 
and then maybe someone could tell me what kind of script I need (sessions or 
whatever) and where I could get the script/learn how to make it.
   I need a pretty basic log in script. Something that people log in to, 
and the page and all linked/related pages cannot be accessed unless the person 
has logged in. 
   So what do I need for this? Cookies, sessions both? And where can I 
learn how?

-Andrew


Re: [PHP] Magic quotes question

2005-01-25 Thread Richard Lynch
Ben Edwards wrote:
 OK.  This is really confusing me.

 I am using the following function to handle this:

 function prep( $text ) {
   echo get_magic_quotes_gpc(). ;
   if (get_magic_quotes_gpc()) {
 echo mq on for $text;
   return $text;
   } else {
 echo mq off;
   return addslashes($text);
   }
 }

 And it is not doing the assslashes but stuff like \'s is still being
 added.  wonce savein a few times I get \'.

Sounds to me like magic_quotes_gpc is ON

That means EVERY value coming in from GET, POST, or COOKIES
automatically has addslashes() called on it.

That presumes that you mostly want to take GET/POST/COOKIE data and shove
it into a database.

For those times when you are *NOT* shoving the data into a database, you
need to use http://php.net/stripslashes to undo the magic quotes'
addslashes.

For example, when re-displaying user input on a FORM after an error, or to
confirm their input, you will need to call http://php.net/stripslashes on
EVERY field you send back to the browser.

On the plus side, you do *NOT* need to call http://php.net/addslashes on
EVERY chunk of data you send to the database, because magic_quotes already
did that for you.

That's kinda the whole purpose of magic_quotes:  Assume that 99% of what
you do is take data in and shove it into your database, so always call
addslashes() on it before you see it, so it's already done by magic

Magic Quotes should be called Auto Addslashes really.

Does that help explain what's going on?

What you might need, then, is a function to send INPUT data to the browser:

function maybe_stripslashes($input){
  if (magic_quotes_gpc()){
$result = stripslashes($input);
  }
  else{
$result = $input;
  }
  return $result;
}

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Log-in script help

2005-01-25 Thread Jay Blanchard
[snip]
  I need a particular type log in script. I'm not sure how to do it
or 
where I could find a tutorial that would help me, so I'll describe what
I need 
and then maybe someone could tell me what kind of script I need
(sessions or 
whatever) and where I could get the script/learn how to make it.
   I need a pretty basic log in script. Something that people log in
to, 
and the page and all linked/related pages cannot be accessed unless the
person 
has logged in. 
   So what do I need for this? Cookies, sessions both? And where can
I 
learn how?
[/snip]

GTFW http://www.google.com/search?hl=enq=basic+PHP+login+script

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



Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Barnett
Richard Lynch wrote:
Oh and by the way, whenever I'm creating the skeleton of a new class I
will usually insert the following code snippet into the functions to let
me know I have to come back and actually implement it later.
if ($class = __CLASS__) {
  trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is not finished.',
E_USER_WARNING);
} else {
  trigger_error(__FUNCTION__ . ' is not finished.', E_USER_WARNING);
}

Why the assignment to $class?
Is that supposed to be == or is it just allowing for static class/method
calls with no object instantiated?
The assignment was intentional... but the reason is that it's my generic 
trigger for any function / method.  So that this can be used inside of 
incomplete functions as well as methods.

?php
class test2 {
  static function test3() {
  if (__CLASS__) {
  trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is not 
finished.', E_USER_WARNING);
} else {
  trigger_error(__FUNCTION__ . ' is not finished.', E_USER_WARNING);
}
  }
}

function test() {
  if (__CLASS__) {
trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is not 
finished.', E_USER_WARNING);
  } else {
trigger_error(__FUNCTION__ . ' is not finished.', E_USER_WARNING);
  }
}

test();
$t2 = new test2();
$t2-test3();
test2::test3();
?
And would not 'if (__CLASS__)' serve just as well?
Good point... no need to assign to the variable; __CLASS__ alone is more 
efficient.

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


Re: [PHP] Re: [NEWBIE GUIDE] For the benefit of new members

2005-01-25 Thread Jason Wong
On Wednesday 26 January 2005 02:41, Greg Donald wrote:

 If one of us newbies gets no answer after a few days, we would realize
 no one knows the answer and would probably repost the question to
 another list.

The clever newbie will cover all bases and cross-post to as many lists as 
possible.

Anyway who decides what is a newbie question? I don't think a newbie would be 
in a position to ascertain whether their question is considered newbie.

-- 
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
--
New Year Resolution: Ignore top posted posts

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



[PHP] Re: Log-in script help

2005-01-25 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
Hey,
   I need a particular type log in script. I'm not sure how to do it or 
where I could find a tutorial that would help me, so I'll describe what I need 
and then maybe someone could tell me what kind of script I need (sessions or 
whatever) and where I could get the script/learn how to make it.
   I need a pretty basic log in script. Something that people log in to, 
and the page and all linked/related pages cannot be accessed unless the person 
has logged in. 
   So what do I need for this? Cookies, sessions both? And where can I 
learn how?

-Andrew
Sessions will certainly be needed; cookies are related to sessions. 
Although technically you don't need cookies to use sessions (and in fact 
some users may not let you use cookies) it is generally a better way to 
handle sessions than using a GET variable.  This user manual page will 
probably help you:
http://www.php.net/manual/en/ref.session.php


--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | 
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins

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


Re: [PHP] Understanding intval() and types conversion

2005-01-25 Thread Richard Lynch
 my guess this is a round error issue - never noticed this problem
 before...
 this is a problem right? anybody?

You can say it is a round error issue.

You can not say it is a problem.

You simply have to be aware that the float number which you think of as
8.... inside of PHP may well be represented as
7.... down in the guts of the machine.

It may help you feel better about this if you recall from grade school
mathematics, that, in point of fact:
7.999... is EXACTLY equal to 8.000...

Those who doubt this fact are requested to remember how to convert
decimals such as:
0.333...
to fractions (1/3), and then apply that exact same method to 7.999...

You will quickly find yourself with a fraction (72/9) which is precisely
equal to 8/1 which is 8.

EVERY floating point number, then, that ends in x000... has a second
representation, exactly equal, which ends in (x-1)999...

Bottom line, however you look at it, is that you can NEVER be 100% certain
that a computer's float number will convert to what you expect in an
integer because their internal representation simply does not allow for
perfection.

This is a feature, not a bug. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Log-in script help

2005-01-25 Thread Chris W. Parker
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
on Tuesday, January 25, 2005 2:46 PM said:

 I need a pretty basic log in script. Something that people log in
 to, and the page and all linked/related pages cannot be accessed
 unless the person has logged in. So what do I need for this?
 Cookies, sessions both? And where can I learn how?

The basic idea for restricting access goes like this:

A value is set in a cookie on the clients machine if the user
successfully authenticates. The website will not allow access to the
page(s) unless this value is found.

Although this sounds pretty simple you have to keep in mind it's not
very secure. Since cookies reside on the clients machine, the client
could manipulate the cookie and pretend to be logged in.

The cookie should also identify the user. Unless of course you have a
single username/password combo for each user that comes to your site. In
which case you will not need to differentiate between one user to the
next.

I am admittedly not an expert when it comes to security so I'll leave
that up to the other people on this list. I wouldn't want to give back
advice. (Hopefully I haven't already!)



HTH,
Chris.

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



Re: [PHP] Log-in script help

2005-01-25 Thread Jason Wong
On Wednesday 26 January 2005 06:58, Chris W. Parker wrote:

 The basic idea for restricting access goes like this:

 A value is set in a cookie on the clients machine if the user
 successfully authenticates. The website will not allow access to the
 page(s) unless this value is found.

No what it really should be doing is setting a cookie, this cookie only 
contains an identifier which (of course) unqiuely identifies the user. When 
the server receives the cookie, it checks whether the identifier is deemed to 
be logged in and act accordingly.

 Although this sounds pretty simple you have to keep in mind it's not
 very secure. Since cookies reside on the clients machine, the client
 could manipulate the cookie and pretend to be logged in.

The above will prevent this. However it does not prevent session hijacking -- 
google for more info.

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] Understanding intval() and types conversion

2005-01-25 Thread Bruce Douglas
so...

you're saying that 7.9 (repeating) is equal to 8.0

i say prove it..  as i recall the numbers might be for all practical purposes 
the same, they are in fact vastly different...

so, prove your assertion...

-bruce


-Original Message-
From: Richard Lynch [EMAIL PROTECTED]
Sent: Jan 25, 2005 2:57 PM
To: Jochem Maas [EMAIL PROTECTED]
Cc: Jordi Canals [EMAIL PROTECTED], PHP List php-general@lists.php.net
Subject: Re: [PHP] Understanding intval() and types conversion

 my guess this is a round error issue - never noticed this problem
 before...
 this is a problem right? anybody?

You can say it is a round error issue.

You can not say it is a problem.

You simply have to be aware that the float number which you think of as
8.... inside of PHP may well be represented as
7.... down in the guts of the machine.

It may help you feel better about this if you recall from grade school
mathematics, that, in point of fact:
7.999... is EXACTLY equal to 8.000...

Those who doubt this fact are requested to remember how to convert
decimals such as:
0.333...
to fractions (1/3), and then apply that exact same method to 7.999...

You will quickly find yourself with a fraction (72/9) which is precisely
equal to 8/1 which is 8.

EVERY floating point number, then, that ends in x000... has a second
representation, exactly equal, which ends in (x-1)999...

Bottom line, however you look at it, is that you can NEVER be 100% certain
that a computer's float number will convert to what you expect in an
integer because their internal representation simply does not allow for
perfection.

This is a feature, not a bug. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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



  1   2   >