Re: [PHP] Question about the mail() php function

2004-04-24 Thread Andy B
hi...

the reason that mail() wont work on windows without an smtp server (outgoing
mail server) is because normally windows doesnt have a mail server
installed. the default smtp settings in php.ini usually is for *nix systems
(that is if it is even set).

it is very easy to fix:
go into c:\windows\php.ini or wherever you had put it at and search for the
section [mail function]. in that section there will be a line that looks
like this:

smtp=
all you need to do is add your outgoing mail server to that line (you can
use the one that outlook express uses if you want) or call your ISP and ask
them what smtp server to use.

- Original Message - 
From: Shawn Inder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 24, 2004 1:02 AM
Subject: [PHP] Question about the mail() php function


 Hello,
 I was browsing your site and came across the mail() PHP function. I tryed
it
 out:

 ?php
 mail([EMAIL PROTECTED], My Subject, Line 1\nLine 2\nLine 3);
 ?

 [EMAIL PROTECTED] is my e-mail adress, obviously enough..
 The problem is, the e-mail doesn't get sent.
 A warning appears on the page:

 Warning: mail(): Failed to connect to mailserver at localhost port 25,
 verify your SMTP and smtp_port setting in php.ini or use ini_set() in
 C:\Program Files\Abyss Web Server\htdocs\page.php on line 24

 What is this all about?  Why wont it work?
 Thanks you very much

 If this is not the right place to send a question, please tell me where
that
 right place would be :)

 shlagish (or Shawn, you choose)

 _
 STOP MORE SPAM with the MSN Premium and get 2 months FREE*

http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines

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



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



[PHP] Re: [PHP-DB] Inserting date into a table

2004-04-24 Thread francesco
Hi Pambos,
you can use the function date in this manner:

date(YmdGis);

because the type TIMESTAMP has the following format:

MMDDHHMMSS, where:
=year like 2004
MM=month like 04
DD=day like 24
HH=hour like 10
MM=minutes like 24
SS=seconds like 33

in this case date(YmdGis); has the output 20040424102433 that is the right
format for TIMESTAMP.



- Original Message -
From: Pambos Nicolaou [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 24, 2004 6:35 AM
Subject: [PHP-DB] Inserting date into a table


 I have created the table below:

 CREATE TABLE questions (ID INT NOT NULL AUTO_INCREMENT,name
VARCHAR(30),day
 TIMESTAMP, question TEXT, email VARCHAR(30),answer TEXT, PRIMARY KEY(ID));

 I want to insert into the TIMESTAMP field the date automatically. How can
I
 do it using the  insert command

 INSERT INTO $table
 VALUES('','$name','TIMESTAMP','$question','$email','NULL');

 Thanks in advance

 Pambos Nicolaou

 _
 Protect your PC - get McAfee.com VirusScan Online
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

 --
 PHP Database 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] Question about the mail() php function

2004-04-24 Thread Julien Wadin
you've to go in the php.ini and give a smtp server

-Message d'origine-
De : Shawn Inder [mailto:[EMAIL PROTECTED]
Envoyé : samedi 24 avril 2004 6:03
À : [EMAIL PROTECTED]
Objet : [PHP] Question about the mail() php function


Hello,
I was browsing your site and came across the mail() PHP function. I tryed it
out:

?php
mail([EMAIL PROTECTED], My Subject, Line 1\nLine 2\nLine 3);
?

[EMAIL PROTECTED] is my e-mail adress, obviously enough..
The problem is, the e-mail doesn't get sent.
A warning appears on the page:

Warning: mail(): Failed to connect to mailserver at localhost port 25,
verify your SMTP and smtp_port setting in php.ini or use ini_set() in
C:\Program Files\Abyss Web Server\htdocs\page.php on line 24

What is this all about?  Why wont it work?
Thanks you very much

If this is not the right place to send a question, please tell me where that
right place would be :)

shlagish (or Shawn, you choose)

_
STOP MORE SPAM with the MSN Premium and get 2 months FREE*
http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=htt
p://hotmail.com/encaHL=Market_MSNIS_Taglines

--
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] static __get function

2004-04-24 Thread Marek Kilimajer
I'm not sure if it will help but do't define the magic functions as 
public static, use just:

function __get(...)

The function is not public anyway, as it should no be called directly.

And to my knowledge self:: references a class, not an object. You should 
use $this- instead.

David Goodlad static objectwrote:
Hi all...

I'm trying to build a simple configureation class (using the singleton 
pattern).  Using PHP5, I want to use the __get and __set methods to 
access configuration settings for my site.  However, they don't work :P 
 Here's my class definition:

class Configuration {
static private $ConfigSettings;
private function __construct() {
   
}

public static function __get($Setting) {
if (!is_array(self::$ConfigSettings)) {
require_once(dirname(__FILE__) . 
'/../../configs/Framework.conf.php');
}

if (isset(self::$ConfigSettings[$Setting])) {
return self::$ConfigSettings[$Setting];
}
return NULL;
}
public static function __set($Setting, $Value) {
self::$ConfigSettings[$Setting] = $Value;
}
}
However, instead of doing something like:

Configuration::DbType = 'mysql';

I have to use:

Configuration::__set('DbType', 'mysql');

It works, yes, but not quite like I want it to - it just seems 'ugly' to 
me.

This is using PHP5 RC1 on Apache 2.0.49 (linux).

Any suggestions?

Dave

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


[PHP] PHP5 bloats the code

2004-04-24 Thread Johannes Reichardt
Hi there,

i don´t know if this is the right place to ask but since there are a lot 
of cracks around i thought i throw this in here. actually i am using 
typo3 (www.typo3.org) a full-blown, extendable cm-framework that is 
based on php. so here is the problem:

typo3 very often uses a syntax like this:

is_array($TCA['pages']['columns']['title'])

but this will spawn an error in PHP5 that says, $TCA['pages'] is not an array.

The solution would be
if (
is_array($TCA['pages']) 
is_array($TCA['pages']['columns']) 
is_array($TCA['pages']['columns']['title']) )
actually that is really ugly code and would be hardly acceptable.

i dunno who to ask, but if that is a verified issue and this behaviour 
goes in the final php5 we had a lot of trouble  - so who can i ask to 
make it work the old fashioned way as well?

- Johannes

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


Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Marek Kilimajer
Hmm, this will certainly slow down PHP5 acceptance. I cannot imagine a 
hosting company that will upgrade to PHP5 and break so many client's 
applications.

Johannes Reichardt wrote:
Hi there,

i don´t know if this is the right place to ask but since there are a lot 
of cracks around i thought i throw this in here. actually i am using 
typo3 (www.typo3.org) a full-blown, extendable cm-framework that is 
based on php. so here is the problem:

typo3 very often uses a syntax like this:

is_array($TCA['pages']['columns']['title'])

but this will spawn an error in PHP5 that says, $TCA['pages'] is not 
an array.

The solution would be
if (
is_array($TCA['pages']) 
is_array($TCA['pages']['columns']) 
is_array($TCA['pages']['columns']['title']) )
actually that is really ugly code and would be hardly acceptable.

i dunno who to ask, but if that is a verified issue and this behaviour 
goes in the final php5 we had a lot of trouble  - so who can i ask to 
make it work the old fashioned way as well?

- Johannes

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


[PHP] Re: PHP5 bloats the code

2004-04-24 Thread Torsten Roehr
Johannes Reichardt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi there,

 i don´t know if this is the right place to ask but since there are a lot
 of cracks around i thought i throw this in here. actually i am using
 typo3 (www.typo3.org) a full-blown, extendable cm-framework that is
 based on php. so here is the problem:

 typo3 very often uses a syntax like this:

 is_array($TCA['pages']['columns']['title'])

 but this will spawn an error in PHP5 that says, $TCA['pages'] is not an
array.

 The solution would be
 if (
 is_array($TCA['pages']) 
 is_array($TCA['pages']['columns']) 
 is_array($TCA['pages']['columns']['title']) )


 actually that is really ugly code and would be hardly acceptable.

 i dunno who to ask, but if that is a verified issue and this behaviour
 goes in the final php5 we had a lot of trouble  - so who can i ask to
 make it work the old fashioned way as well?

 - Johannes

Hi Johannes,

look into the mailing list archive (or newsgroup) at this thread from
yesterday, 11:55, started by Christian Jul Jensen:
How to do type/existence checking in PHP5.

It's about exactly the problem you have. There are several answers. Take a
look.

Regards, Torsten

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



[PHP] php/apache/mysql on ntfs

2004-04-24 Thread Andy B
hi...
we are upgrading test servers to xp home and want to know if its possible to
run php/apache/mysql and all that sort of stuff on ntfs or does the servers
have to run fat32??

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



Fw: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread Andy B
does anybody have any idea why this message keeps coming up every time i
send a msg to the list?? im sort of confused now

- Original Message - 
From: [EMAIL PROTECTED]
To: Andy B [EMAIL PROTECTED]
Sent: Saturday, April 24, 2004 7:17 AM
Subject: NDN: [PHP] php/apache/mysql on ntfs


 Sorry. Your message could not be delivered to:

 PHP Net List [Conference] (Mailbox or Conference is full.)



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



[PHP] A security thing or just sessions working?

2004-04-24 Thread john
Hi

I had a problem with what my host called a spate of insecure PHP
applications being used to upload proxying applications which I think has
been solved, however I've just spotted this when trying to validate my
HTML:

form action=abc.php4 method=postinput type=hidden
name=PHPSESSID value=aada9a6f795cb72df1ef8b8f61d2715c /div
class=secondColThirdinput type=submit value=register/div/form

The HTML validator wants the input type to be within the div. Problem
is, I didn't put the input type=hidden name=PHPSESSID
value=aada9a6f795cb72df1ef8b8f61d2715c / in there, it's just appeared.

So. Should it be there? Is this just sessions working like they should?
I've never seen it before.

Or have I got Russian Big Boobs all over again :-)

J

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



[PHP] A security thing or just sessions working?

2004-04-24 Thread john
Hi

I had a problem with what my host called a spate of insecure PHP
applications being used to upload proxying applications which I think has
been solved, however I've just spotted this when trying to validate my
HTML:

form action=abc.php4 method=postinput type=hidden
name=PHPSESSID value=aada9a6f795cb72df1ef8b8f61d2715c /div
class=secondColThirdinput type=submit value=register/div/form

The HTML validator wants the input type to be within the div. Problem
is, I didn't put the input type=hidden name=PHPSESSID
value=aada9a6f795cb72df1ef8b8f61d2715c / in there, it's just appeared.

So. Should it be there? Is this just sessions working like they should?
I've never seen it before.

Or have I got Russian Big Boobs all over again :-)

Oh, I just put the site onto a different server on a different host and
didn't get the PHPSESSID thing inserted.

J

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



[PHP] A security thing or just sessions working?

2004-04-24 Thread john
Hi

I had a problem with what my host called a spate of insecure PHP
applications being used to upload proxying applications which I think has
been solved, however I've just spotted this when trying to validate my
HTML:

form action=abc.php4 method=postinput type=hidden
name=PHPSESSID value=aada9a6f795cb72df1ef8b8f61d2715c /div
class=secondColThirdinput type=submit value=register/div/form

The HTML validator wants the input type to be within the div. Problem
is, I didn't put the input type=hidden name=PHPSESSID
value=aada9a6f795cb72df1ef8b8f61d2715c / in there, it's just appeared.

So. Should it be there? Is this just sessions working like they should?
I've never seen it before.

Or have I got Russian Big Boobs all over again :-)

Oh, I just put the site onto a different server on a different host and ..
I've taken another look, I did get the PHPSESSID thing inserted, so I
guess it's standard stuff.

J

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



[PHP] Re: $PATH_INFO not working

2004-04-24 Thread Anguz
Noel Da Costa wrote:
Hi,

Anyone know what might stop the $PATH_INFO variable from working?  I
developed a nav system using this which works on the test server, but not on
the live server. I'm guessing this is something to do with the way PHP
(4.2.2)  and Apache (2.0) were compiled on the live server (I've posted that
question on php.install), but what I'm wondering is...
Is there perhaps a code fix/work-around I could apply in my scripts to
replace the $PATH_INFO with something that achieves the same effect, without
having to redisign my entire nav system.
Thanks,
Noel
I think you have to enable accept path info in Apache 2, it's on in 1 by 
default. I'm not sure exactly what the command is, but you can search 
based on that. It's probably AcceptPathInfo ON.

Anguz

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


[PHP] mouse over problem on php

2004-04-24 Thread gowthaman ramasamy
hi list ,
In the web page, i display different bars (actually tables with single
column, with cellpadding=1 and color=xxx) based on the information
parsed from MySQL database. I, now want to display more information by
mouse over when ever user moves the cursor over the bar(actually single
cell table).
I use a hreff=xx.xx.com title=$display ./a. and  have two
problems in this ...
1) i need to have some txt/figure to be linked. But i dont want to keep
any thing in the table (single cell). Can i display some text when mouse
is moved over table(cell).

2)even if i hyperlink  the text with title attribute... only the text
before the first space (the very first word) is displayed. Not the
entire sentence.

Many thanks in advance ..
gowtham
-- 
Ra. Gowthaman,
Graduate Student,
Bioinformatics Lab,
Malaria Research Group,
ICGEB , New Delhi.
INDIA

Phone: 91-9811261804
   91-11-26173184; 91-11-26189360 #extn 314

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



[PHP] Re: mouse over problem on php

2004-04-24 Thread Torsten Roehr
This is more of a Javascript/Style Sheets question than anything else. Try
your luck on a JS/CSS mailing list.

Regards, Torsten

Gowthaman Ramasamy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi list ,
 In the web page, i display different bars (actually tables with single
 column, with cellpadding=1 and color=xxx) based on the information
 parsed from MySQL database. I, now want to display more information by
 mouse over when ever user moves the cursor over the bar(actually single
 cell table).
 I use a hreff=xx.xx.com title=$display ./a. and  have two
 problems in this ...
 1) i need to have some txt/figure to be linked. But i dont want to keep
 any thing in the table (single cell). Can i display some text when mouse
 is moved over table(cell).

 2)even if i hyperlink  the text with title attribute... only the text
 before the first space (the very first word) is displayed. Not the
 entire sentence.

 Many thanks in advance ..
 gowtham
 --
 Ra. Gowthaman,
 Graduate Student,
 Bioinformatics Lab,
 Malaria Research Group,
 ICGEB , New Delhi.
 INDIA

 Phone: 91-9811261804
91-11-26173184; 91-11-26189360 #extn 314

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



Re: [PHP] mouse over problem on php

2004-04-24 Thread Andy B
try javascript

- Original Message - 
From: gowthaman ramasamy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 24, 2004 8:11 AM
Subject: [PHP] mouse over problem on php


 hi list ,
 In the web page, i display different bars (actually tables with single
 column, with cellpadding=1 and color=xxx) based on the information
 parsed from MySQL database. I, now want to display more information by
 mouse over when ever user moves the cursor over the bar(actually single
 cell table).
 I use a hreff=xx.xx.com title=$display ./a. and  have two
 problems in this ...
 1) i need to have some txt/figure to be linked. But i dont want to keep
 any thing in the table (single cell). Can i display some text when mouse
 is moved over table(cell).
 
 2)even if i hyperlink  the text with title attribute... only the text
 before the first space (the very first word) is displayed. Not the
 entire sentence.
 
 Many thanks in advance ..
 gowtham
 -- 
 Ra. Gowthaman,
 Graduate Student,
 Bioinformatics Lab,
 Malaria Research Group,
 ICGEB , New Delhi.
 INDIA
 
 Phone: 91-9811261804
91-11-26173184; 91-11-26189360 #extn 314
 
 -- 
 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] static __get function

2004-04-24 Thread David Goodlad
Hi Marek

Thanks for the response

Two things you should notice is my declaration of the constructor as 
private and the $ConfigSettings variable as static. This class is 
designed in such a way that it can never be instantiated, preventing 
loading the configuration file twice and possibly having inconsistent 
copies of the config file in memory.

I've tried the __get and __set functions as just regular non-static 
ones, but same problem.

I am using self:: instead of $this- because of the reasons mentioned 
above about not wanting to instantiate the object, only have its static 
members loaded. In this way I refer to the class, not a specific 
instance of the class; a real instance should never really exist.

Dave

Marek Kilimajer wrote:

I'm not sure if it will help but do't define the magic functions as 
public static, use just:

function __get(...)

The function is not public anyway, as it should no be called directly.

And to my knowledge self:: references a class, not an object. You 
should use $this- instead.

David Goodlad static objectwrote:

Hi all...

I'm trying to build a simple configureation class (using the 
singleton pattern). Using PHP5, I want to use the __get and __set 
methods to access configuration settings for my site. However, they 
don't work :P Here's my class definition:

class Configuration {
static private $ConfigSettings;
private function __construct() {
}
public static function __get($Setting) {
if (!is_array(self::$ConfigSettings)) {
require_once(dirname(__FILE__) . '/../../configs/Framework.conf.php');
}
if (isset(self::$ConfigSettings[$Setting])) {
return self::$ConfigSettings[$Setting];
}
return NULL;
}
public static function __set($Setting, $Value) {
self::$ConfigSettings[$Setting] = $Value;
}
}
However, instead of doing something like:

Configuration::DbType = 'mysql';

I have to use:

Configuration::__set('DbType', 'mysql');

It works, yes, but not quite like I want it to - it just seems 'ugly' 
to me.

This is using PHP5 RC1 on Apache 2.0.49 (linux).

Any suggestions?

Dave


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


Re: [PHP] mouse over problem on php

2004-04-24 Thread John W. Holmes
gowthaman ramasamy wrote:
hi list ,
Hi. This has nothing to do with PHP.

In the web page, i display different bars (actually tables with single
column, with cellpadding=1 and color=xxx) based on the information
parsed from MySQL database. I, now want to display more information by
mouse over when ever user moves the cursor over the bar(actually single
cell table).
I use a hreff=xx.xx.com title=$display ./a. and  have two
problems in this ...
1) i need to have some txt/figure to be linked. But i dont want to keep
any thing in the table (single cell). Can i display some text when mouse
is moved over table(cell).
If you want hyperlinks and other features in the mouse over area, then 
you'll need to make it a layer that's hidden or not based upon where the 
mouse is. You're talking DHTML/JavaScript here, not PHP.

2)even if i hyperlink  the text with title attribute... only the text
before the first space (the very first word) is displayed. Not the
entire sentence.
Put double quotes around your attributes. title=$display. Again, not a 
PHP issue.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP] A security thing or just sessions working?

2004-04-24 Thread John W. Holmes
[EMAIL PROTECTED] wrote:

Hi

I had a problem with what my host called a spate of insecure PHP
applications being used to upload proxying applications which I think has
been solved, however I've just spotted this when trying to validate my
HTML:
form action=abc.php4 method=postinput type=hidden
name=PHPSESSID value=aada9a6f795cb72df1ef8b8f61d2715c /div
class=secondColThirdinput type=submit value=register/div/form
The HTML validator wants the input type to be within the div. Problem
is, I didn't put the input type=hidden name=PHPSESSID
value=aada9a6f795cb72df1ef8b8f61d2715c / in there, it's just appeared.
So. Should it be there? Is this just sessions working like they should?
I've never seen it before.
Or have I got Russian Big Boobs all over again :-)

Oh, I just put the site onto a different server on a different host and ..
I've taken another look, I did get the PHPSESSID thing inserted, so I
guess it's standard stuff.
Looks like someone may have manipulated your pages to make them 
vulnerable to session fixation attacks. This is where they'll define a 
preset PHPSESSID that'll be used when you start your session on the next 
page. The PHPSESSID is supposed to be unique and hard to guess, but 
using this method, now they'll know what the ID is and it'll be easy for 
them to craft a session cookie with the same value and take over your 
session.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP] mouse over problem on php.. sorry Ignore this

2004-04-24 Thread gowthaman ramasamy
I am very sorry for that.  I am very sorry i bugged  you all. anyway
thanks for the hints ...

thanks a lot
 
-- 
Ra. Gowthaman,
Graduate Student,
Bioinformatics Lab,
Malaria Research Group,
ICGEB , New Delhi.
INDIA

Phone: 91-9811261804
   91-11-26173184; 91-11-26189360 #extn 314

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



Re: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread -{ Rene Brehmer }-
Sure you can :) ... I've been doing it for a very long time now ... works
alot better than FAT32 actually ... much faster...

The programs don't care about the file system, that's for the OS to deal
with. Only pure DOS programs have problems with the NTFS ... for all other
programs they can't see what FS it is anyway, since it's not for them to
worry about ... 


Rene

According to historical records, on Sat, 24 Apr 2004 07:18:40 -0400 Andy B
wrote about [PHP] php/apache/mysql on ntfs:

hi...
we are upgrading test servers to xp home and want to know if its possible to
run php/apache/mysql and all that sort of stuff on ntfs or does the servers
have to run fat32??

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] Scripting practices

2004-04-24 Thread -{ Rene Brehmer }-
Same here ... I only initialize variables where's there any point to it ...
like the booleans I use for error checking ... all the others are normally
never initialized


Rene

According to historical records, on Fri, 23 Apr 2004 17:15:58 -0400 Travis
Low wrote about Re: [PHP] Scripting practices:

Also, for the lazy variable typing.  To me, strong typing means pounding the 
keyboard extra hard.

cheers,

Travis

Travis Low wrote:
 It's not necessary.  If you want to go to that much trouble, I would 
 switch to Java for the speed.  I stick with PHP for the shorter 
 development time.
 
 cheers,
 
 Travis
 
 Gabe wrote:
 
 When scripting in a language (such as PHP) that doesn't require you to 
 determine the variable type before you use it, is it still considered 
 good technique to initialize it to the type you're going to use it as? 
 Or is it considered ok to just use it?

 e.g.

 $strText = ;//initialize
 $strText = now i'll give it a useful value;

 Or is it just better to skip the first line?  Just curious, thanks!

 Gabe

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread -{ Rene Brehmer }-
Because someone that's subscribed to the list has a full mailbox ... I get
it too ... all the time ... just like the address harvesters masquerading as
banks ... Advance Credit Suisse Bank [EMAIL PROTECTED] and
Information Desk [EMAIL PROTECTED]


Rene

According to historical records, on Sat, 24 Apr 2004 07:28:07 -0400 Andy B
wrote about Fw: [PHP] php/apache/mysql on ntfs:

does anybody have any idea why this message keeps coming up every time i
send a msg to the list?? im sort of confused now

- Original Message - 
From: [EMAIL PROTECTED]
To: Andy B [EMAIL PROTECTED]
Sent: Saturday, April 24, 2004 7:17 AM
Subject: NDN: [PHP] php/apache/mysql on ntfs


 Sorry. Your message could not be delivered to:

 PHP Net List [Conference] (Mailbox or Conference is full.)



-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] mouse over problem on php

2004-04-24 Thread Jordi Canals
gowthaman ramasamy wrote:
hi list ,
[snip]

I use a hreff=xx.xx.com title=$display ./a. and  have two
[snip]

Try enclosing $display betwen  like:

echo 'a href=xx.xx.com title='. $display ' ... /a';

Regards ...

I do not agree about it's a Javascript issue, the title attribute is an 
standard HTML one. The error possibly was in the PHP code not passing 
the string in the correct form.

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


Re: [PHP] mouse over problem on php

2004-04-24 Thread -{ Rene Brehmer }-
According to historical records, on 24 Apr 2004 17:41:14 +0530 gowthaman
ramasamy wrote about [PHP] mouse over problem on php:

{snip}
2)even if i hyperlink  the text with title attribute... only the text
before the first space (the very first word) is displayed. Not the
entire sentence.

Using proper HTML will solve this ... just use the  around the attributes
like you're supposed to. 

a href=link title=titlelinktext/a

or

td title=titlecell-contents/td

the TITLE attribute will work with any block or inline tag... IF you use
proper HTML to do it


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Marek Kilimajer
I just installed php5 (finaly :-))  and it does not throw any error nor 
warning. I think what you see is Notice, so the behavior did not change.

Johannes Reichardt wrote:
Hi there,

i don´t know if this is the right place to ask but since there are a lot 
of cracks around i thought i throw this in here. actually i am using 
typo3 (www.typo3.org) a full-blown, extendable cm-framework that is 
based on php. so here is the problem:

typo3 very often uses a syntax like this:

is_array($TCA['pages']['columns']['title'])

but this will spawn an error in PHP5 that says, $TCA['pages'] is not 
an array.

The solution would be
if (
is_array($TCA['pages']) 
is_array($TCA['pages']['columns']) 
is_array($TCA['pages']['columns']['title']) )
actually that is really ugly code and would be hardly acceptable.

i dunno who to ask, but if that is a verified issue and this behaviour 
goes in the final php5 we had a lot of trouble  - so who can i ask to 
make it work the old fashioned way as well?

- Johannes

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


Re: [PHP] MySQL Dump

2004-04-24 Thread Jordi Canals
I just tested it and yes, the Michal function runs on Windows and Linux. 
Just must write the path in the proper format for the OS you're using.

Regards,
Jordi.
Matt Palermo wrote:

Will this work on both a Windows and Unix server?

Michal Migurski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is there an easy way to do a mysql dump routine written in php?  I
basically want to write a function to backup a database and have it
create all the neccessary structures and data in the dump.  I know
phpMyAdmin will do this for me, but I want to write a function to do
this incase the server doesn't have phpMyAdmin installed.  Any ideas?
Why not use the existing mysqldump command-line utility?

function mysql_dump($db, $user, $pass)
{
return shell_exec(/path/to/mysqldump
  --user={$user} --password={$pass}
  --complete-insert --add-drop-table
   {$db});
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Curt Zirzow
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
 I just installed php5 (finaly :-))  and it does not throw any error nor 
 warning. I think what you see is Notice, so the behavior did not change.

Here is the offending situation:

?php

/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);

/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);

/* returns false */
$a = array('foo' = 'asdf');
echo is_array($a['foo']['asdf']);

/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);

The last one is the biggie, the solution of course is to have
something like:

if (isset($a['foo']['asdf']) 
is_array($a['foo']['asdf']) {

This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] calling php function

2004-04-24 Thread Daniel Clark
Because the Javascript onclick event runs in the client browser, you could call a php 
file that has and runs a particular php function.  

 Is it possible to call php function in the onclick event ?

REgards,
Uma

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



[PHP] Microsoft Update and how its done question

2004-04-24 Thread Anton Krall
Guys.. Ive been wondering this.. when you visit microsofts update sites, if
you click on look for updates, it loads something into your computer, an vb,
activex or whatever, and looks into your computer for some stuff to update,
then it download and installs it... all showing nice windows, process %,
etc.
 
How can this be done using PHP? 
 
Thx for any comments.
 
Anton Krall

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



[PHP] Re: Microsoft Update and how its done question

2004-04-24 Thread Torsten Roehr
Anton Krall [EMAIL PROTECTED] wrote in message
news:!~!UENERkVCMDkAAQACABgAyt+Udpm8KEiSEdKfabIEWMKA
[EMAIL PROTECTED]
 Guys.. Ive been wondering this.. when you visit microsofts update sites,
if
 you click on look for updates, it loads something into your computer, an
vb,
 activex or whatever, and looks into your computer for some stuff to
update,
 then it download and installs it... all showing nice windows, process %,
 etc.

 How can this be done using PHP?

 Thx for any comments.

 Anton Krall

I don't think this can be done with PHP. You can't access the client's
system. What you're describing is a specific Windows feature that is built
into the operating system.

Regards, Torsten

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



Re: [PHP] overloaded, overworked ereg statement?

2004-04-24 Thread Tim


Travis Low wrote:
Break it up a little.  Try something like this:

$title = preg_replace( /.*title/i, , $file_text );
$title = preg_replace( //title.*/i, , $title );
My title one worked, but I like your idea.  I started to write that you 
were all flip-flopped on your title example, until I realized you were 
using preg_replace instead of preg_match.

quoting Mr. Spock:

An ancestor of mine maintained, that if you eliminate the impossible, 
whatever remains, however improbable, must be the truth.


Ditto for body.

now I have

// strip everything above and including body...
$body = preg_replace(/.*body.*/iU,'',$file_text);
// strip everything after and including /body
$body = preg_replace(/\/body.*/i,'',$body);
Works lik a charm!

Thanks :)

Tim




Since you're looking for certain tags, it stands to reason that you're 
primarily interested in characters after  characters.  So this might 
be faster:

$chunks = split( , $file_text );
for( $i = 0; $i  count( $chunks ); $i++ )
{
if( 0 === strpos( $chunks[$i], title ) )
{
# Title starts after the next , so get it.
# If you're careful, you can modify $i here
# as you gather up the title.
}
if( 0 == strpos( $chunks[$i], body ) )
{
# Body starts after the next 
# Modify $i, but be vewwy caweful.
}
}
The de-commenting is left to the reader.

cheers,

Travis

Tim wrote:

This script worked on one server, but started choking after I moved it 
to a new server.

Summary:  I use the php_auto_prepend script to start output buffering, 
then use the php_auto_append script to extract the content between the 
title tags and between the body tags.  When the size of the content 
between the body tags reaches around 11,500 characters, the ereg 
function stops working correctly.

What governs the number of characters that ereg can process?

I looked at the phpinfo from both servers but didn't find any clues...

Thanks for the help :)

FYI sample code:

prepend--

?php

ob_start();

?

append--

?php

// load document into $file_text

$file_text = ob_get_contents();
ob_end_clean();
// extract title

unset($regs);

// use preg_match because its supposed to be faster...
//eregi(title(.*)/title,$file_text,$regs);
preg_match(|title(.*)/title|i,$file_text,$regs);

$document_title = $regs[1];

// extract body of document (need to add onload statement in body tag)

unset($regs);

// I don't have the foggiest why preg_match doesn't seem to work here...
//preg_match(|\body(.*)/body$|i,$file_text,$regs);
//preg_match(|(.*)|i,$regs[1],$temp);
eregi(body(.*)/body,$file_text,$regs);
ereg((.*),$regs[1],$temp);
$template_body = $temp[1];
// stuff $document_title and $document_body into the official template

/* snip */
?

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


Re: [PHP] Re: Microsoft Update and how its done question

2004-04-24 Thread -{ Rene Brehmer }-
According to historical records, on Sat, 24 Apr 2004 17:49:42 +0200 Torsten
Roehr wrote about [PHP] Re: Microsoft Update and how its done question:

Anton Krall [EMAIL PROTECTED] wrote in message
news:!~!UENERkVCMDkAAQACABgAyt+Udpm8KEiSEdKfabIEWMKA
[EMAIL PROTECTED]
 Guys.. Ive been wondering this.. when you visit microsofts update sites,
if
 you click on look for updates, it loads something into your computer, an
vb,
 activex or whatever, and looks into your computer for some stuff to
update,
 then it download and installs it... all showing nice windows, process %,
 etc.

 How can this be done using PHP?

 Thx for any comments.

 Anton Krall

I don't think this can be done with PHP. You can't access the client's
system. What you're describing is a specific Windows feature that is built
into the operating system.

It's not built in ... the site loads an ActiveX module that talks to an
.exe file that comes with windows. If the .exe is outdated, the ActiveX
module downloads a new one ... 

It's the ActiveX module that generates the progress bar and all that stuff
... but it's the .exe file that does the actual disk investigation


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Johannes Reichardt
Hi Curt,

thank you for pointing this one out. Who are the php internals and how 
could i contact them? This issue was rejected as bug recently.

- Johannes

* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
 

I just installed php5 (finaly :-))  and it does not throw any error nor 
warning. I think what you see is Notice, so the behavior did not change.
   

Here is the offending situation:

?php

/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);
/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);
/* returns false */
$a = array('foo' = 'asdf');
echo is_array($a['foo']['asdf']);
/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);
The last one is the biggie, the solution of course is to have
something like:
if (isset($a['foo']['asdf']) 
   is_array($a['foo']['asdf']) {
This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.
Curt
 

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


Re: [PHP] Fetching XML for parsing

2004-04-24 Thread Patagonia Hosting Development Group
That may be the exact problem. I was not figuring that one out. Thi is my
fopen and XML parser code:

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
if (!($fp = fopen($uFile,rb))) {
  die (could not open RSS for input);
}
while ($data = fread($fp, 4096)) {
  if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf(XML error: %s at line %d,
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
  }
}

xml_parser_free($xml_parser);

How can I make PHP to first open the dynamically built page and THEN read
it's content?

Thanks a lot,

Cesar Aracena
Patagonia Hosting Development Group

Mike Ryerse [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 How is your fopen code written?
 Could it have something to do with your browser is requesting a
 dynamically built page, and your php script is not?

 --- Patagonia Hosting Development Group
 [EMAIL PROTECTED] wrote:
  Hi all,
 
  I know that fopen and fread should do the trick, but for some
  strange reason
  (maybe piping) I get an error when trying to fetch a XML document
  generated
  from an ASP page. If I open the file in my browser, I click in
  View Source
  Code, copy and paste it in a new notepad document, save it as a
  .xml file
  and then open it, my sript works fine. The problem is when fetching
  the
  live version. It tells me the error is some misspelled tag at
  line 8.
 
  Has anybody seen this before?
 
  Thanks in advanced,
 
  Cesar Aracena
  Patagonia Hosting Development Group
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 





 __
 Do you Yahoo!?
 Yahoo! Photos: High-quality 4x6 digital prints for 25¢
 http://photos.yahoo.com/ph/print_splash

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



Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Marek Kilimajer
Curt Zirzow wrote:
Here is the offending situation:

?php

/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);
/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);
/* returns false */
$a = array('foo' = 'asdf');
echo is_array($a['foo']['asdf']);
/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);
The last one is the biggie, the solution of course is to have
something like:
if (isset($a['foo']['asdf']) 
is_array($a['foo']['asdf']) {
This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.
Curt
Well, what I always know about my variables is if they are arrays or 
scalar ;) And I don't consider warning to be much nicer then error

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


[PHP] From IIS to Apache

2004-04-24 Thread Stephen Craton
I've been running IIS for a while now and I'm really sick of it and all it's
security flaws. I decided today to upgrade to Apache, so I download the msi
from the Apache website. I install it, but once it tries to install it as a
service onto my XP Pro box, it gives me an error telling me that port 80
cannot be used. IIS ran on port 80 and I uninstalled it, rebooted, but I got
the error.

 

I've tried reinstalling Apache, rebooting, and pretty much everything I know
to do. Any help here would be greatly appreciated.

 

Thanks,

Stephen Craton

http://www.melchior.us

 

 

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



RE: [PHP] PHP5 bloats the code

2004-04-24 Thread Mark Charette

 From: Marek Kilimajer [mailto:[EMAIL PROTECTED]

 Well, what I always know about my variables is if they are arrays or
 scalar ;) And I don't consider warning to be much nicer then error

Hmmm ... my current methods and functions in PHP 4.x oftentimes adapt to the
type passed to them since PHP doesn't have method signatures, meaning I
_don't_ know a priori what will be passed to them. Currently type checking
is mandatory if you want to avail yourself of a single method name.

Mark C.

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



Re: [PHP] From IIS to Apache

2004-04-24 Thread Richard Harb
Though this isn't stricly a PHP question - here we go:

It sounds as if IIS didn't really go away...

There's a nice utility out there that lets you know what ports are
active and in use ...
It's called Active Ports (duh!) and is a small download from
http://www.ntutility.com (section /freeware.html). Though it needs
admin rights to run I found this very useful.

Alternatively you could just open a command shell and:

telnet localhost 80

if the connection is opened type GET / to check what might be
answering ... (there's no local echo, so you're typing blind).

If all else fails you can always edit apache's configuration file in
notepad: C:\program files\apache2\apache\conf\httpd.conf (or some
such) and tell it to listen on another port (like the ever popular
8080 for example) .. the config file is very well documented, you
shouldn't have a problem finding your way.

HTH
Richard


Saturday, April 24, 2004, 7:57:53 PM, thus was written:
 I've been running IIS for a while now and I'm really sick of it and all it's
 security flaws. I decided today to upgrade to Apache, so I download the msi
 from the Apache website. I install it, but once it tries to install it as a
 service onto my XP Pro box, it gives me an error telling me that port 80
 cannot be used. IIS ran on port 80 and I uninstalled it, rebooted, but I got
 the error.

  I've tried reinstalling Apache, rebooting, and pretty much everything I know
 to do. Any help here would be greatly appreciated.

 

 Thanks,

 Stephen Craton

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



Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Marek Kilimajer
Mark Charette wrote:
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]


Well, what I always know about my variables is if they are arrays or
scalar ;) And I don't consider warning to be much nicer then error


Hmmm ... my current methods and functions in PHP 4.x oftentimes adapt to the
type passed to them since PHP doesn't have method signatures, meaning I
_don't_ know a priori what will be passed to them. Currently type checking
is mandatory if you want to avail yourself of a single method name.
Mark C.

So you have to check the type of the passed variable anyway, even in 
php4. You won't be affected by the new behavior in php5.

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


Re: Fw: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread Curt Zirzow
* Thus wrote Andy B ([EMAIL PROTECTED]):
 does anybody have any idea why this message keeps coming up every time i
 send a msg to the list?? im sort of confused now

I've gotten so used to them now, that I consider them receipts that
my messages have been posted to everyone :)


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] PHP5 bloats the code

2004-04-24 Thread Johannes Reichardt
Hi Marek,

actually this behaviour is too critical since there are many cases 
where compliant code is not as well as much more simpler code. reminds 
me on the w3c standards that are so high that some things simply dont 
comply if you want them ;)

just a warning would be way better.

- Johannes



So you have to check the type of the passed variable anyway, even in 
php4. You won't be affected by the new behavior in php5.

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


[PHP] PHP Auth

2004-04-24 Thread Anton Krall
Guys.
 
Im doing a small php auth system and I was wondering, how can avoid having
to do a form to pass the user and pw to the php scripts and just use the
popup auth windows on IE and NS? do you remember the names of the vars that
get passed thru that popup or how can I invoke it?
 
Thx!

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



Re: [PHP] MySQL Dump

2004-04-24 Thread Michal Migurski
 I just tested it and yes, the Michal function runs on Windows and Linux.
 Just must write the path in the proper format for the OS you're using.

Holy smokes, that's good news. :)  Spreading dis-information is my price
for not having the first clue about windows.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] Re: PHP Auth

2004-04-24 Thread Rainer Müller
Anton Krall schrieb:
Guys.
 
Im doing a small php auth system and I was wondering, how can avoid having
to do a form to pass the user and pw to the php scripts and just use the
popup auth windows on IE and NS? do you remember the names of the vars that
get passed thru that popup or how can I invoke it?
 
Thx!
This is called Basic Auth and google should give you some infos.

Rainer

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


Re: [PHP] PHP Auth

2004-04-24 Thread Curt Zirzow
* Thus wrote Anton Krall ([EMAIL PROTECTED]):
 Guys.
  
 Im doing a small php auth system and I was wondering, how can avoid having
 to do a form to pass the user and pw to the php scripts and just use the
 popup auth windows on IE and NS? do you remember the names of the vars that
 get passed thru that popup or how can I invoke it?

This page should tell you everything you need to know:
  http://www.php.net/manual/en/features.http-auth.php

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] PHP Auth

2004-04-24 Thread Anton Krall
Thx Curt!


Intruder Consulting
Anton Krall
Director General
[EMAIL PROTECTED]
tel: 5233-9281
mobile: 044-55-1320-8717
IM: [EMAIL PROTECTED]
www.intruder.com.mx

 

%-Original Message-
%From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
%Sent: Sábado, 24 de Abril de 2004 02:30 p.m.
%To: [EMAIL PROTECTED]
%Subject: Re: [PHP] PHP Auth
%
%* Thus wrote Anton Krall ([EMAIL PROTECTED]):
% Guys.
%  
% Im doing a small php auth system and I was wondering, how can avoid 
% having to do a form to pass the user and pw to the php scripts and 
% just use the popup auth windows on IE and NS? do you remember the 
% names of the vars that get passed thru that popup or how can 
%I invoke it?
%
%This page should tell you everything you need to know:
%  http://www.php.net/manual/en/features.http-auth.php
%
%Curt
%--
%I used to think I was indecisive, but now I'm not so sure.
%
%--
%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] Problem when compiling php5

2004-04-24 Thread Martin Hjort Eriksen
Hello

I am having a major prolem when compiling PHP5the problem is new, 
and I have never had it before. I have tried compiling on to seperate 
dists og Linux, Debian testing and Slackware 9.0, but the error persistes.

The output I recieve is:

/usr/local/include/unix.h:222: error: parse error before MAILSTREAM
/usr/local/include/unix.h:223: error: parse error before '*' token
/usr/local/include/unix.h:224: error: parse error before '*' token
/usr/local/include/unix.h:225: error: parse error before '*' token
/usr/local/include/unix.h:226: error: parse error before '*' token
/usr/local/include/unix.h:228: error: parse error before '*' token
/usr/local/include/unix.h:229: error: parse error before '*' token
/usr/local/include/unix.h:230: error: parse error before '*' token
/usr/local/include/unix.h:231: error: parse error before '*' token
make: *** [ext/zlib/zlib.lo] Fejl 1
my configure is:

'./configure' '--prefix=/usr' '--disable-static' '--with-apxs2' 
'--enable-discard-path' '--with-config-file-path=/usr/conf' 
'--enable-safe-mode' '--enable-bcmath' '--with-pic' '--enable-calendar' 
'--enable-ctype' '--with-imap=/usr/imap-2002e' '--enable-dbase' 
'--enable-ftp' '--with-gd' '--enable-gd-native-ttf' 
'--with-jpeg-dir=/usr' '--with-png' '--with-mysql=/usr/local/mysql' 
'--with-mm=/usr' '--enable-trans-sid' '--enable-shmop' 
'--enable-sockets' '--with-regex=php' '--enable-sysvsem' 
'--enable-sysvshm' '--enable-yp' '--enable-memory-limit' 
'--with-tsrm-pthreads' '--enable-shared' '--disable-debug' '--with-zlib' 
'--disable-libxml' '--with-pgsql'

What is wrong

\Martin

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


[PHP] formatting a string

2004-04-24 Thread Andy B
hi...

i have a string i want to pull out of a database (mysql). the column name is
Phone1 and it is a 10 digit phone number. the raw string coming out of the
table column would look like this: 1234567890

what i want to do is format the string on display like this: (123)456-7890
but dont quite know how to start with that. what function(s) would i use for
that?

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



Re: [PHP] formatting a string

2004-04-24 Thread Tom Rogers
Hi,

Sunday, April 25, 2004, 11:17:16 AM, you wrote:
AB hi...

AB i have a string i want to pull out of a database (mysql). the column name is
AB Phone1 and it is a 10 digit phone number. the raw string coming out of the
AB table column would look like this: 1234567890

AB what i want to do is format the string on display like this: (123)456-7890
AB but dont quite know how to start with that. what function(s) would i use for
AB that?


Try this:
$phone = '1234567890';
$newphone = preg_replace('/(\d{3})(\d{3})(\d)/','(\1)\2-\3',$phone);
echo $newphone.'br';

-- 
regards,
Tom

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



[PHP] Re: Re: The COM problem when converting from ASP to PHP [works now!!]

2004-04-24 Thread Steven Kidd
Hi,

Thx ur help Richard , but ur method doesn't work.

However, when I switch to the PHP5 RC1, it works!~~
I use the recommonded php.ini setting.
my previous version is 4.3.6.
I really love PHP 5! :)

Strongly suggest anyone who uses COM switch to PHP 5.





Hello Steven,

Saturday, April 24, 2004, 2:08:20 AM, you wrote:

SK Hi,

SK When I converting lines of ASP code:

SK %
SK dim keysobjs
SK dim privkey
SK dim pubkey
SK dim seed
SK Set keysobj= CreateObject(wmrmobjs.WMRMKeys)
SK keysobj.GenerateSigningKeys privkey, pubkey
SK seed = keysobj.GenerateSeed()
SK Response.Write privkey
SK Response.Write br
SK Response.Write pubkey
SK Response.Write br
SK Response.Write seed
%
SK To the PHP one:

SK ?
SK $com = new COM(wmrmobjs.WMRMKeys);
$com-GenerateSigningKeys($privkey,$pubkey);
$seed = $com-GenerateSeed();
SK echo Private key=.$privkey;
SK echo br;
SK echo Public key=.$pubkey;
SK echo br;
SK echo Seed=.$seed;
?
SK In the ASP code everything works pretty well,
SK In the PHP code, although I can obtain the value of $seed,
SK the $privkey and $pubkey are null,
SK kindly check the code for me, thx...
There is nothing wrong with your PHP code, it's just that you never
set the values of $privkey or $pubkey anywhere.
$com-GenerateSigningKeys($privkey,$pubkey);

This is PASSING the values into the GenerateSigningKeys function, it
is not setting them. Are you sure they are not set as the return
values? Like:
$com = new COM(wmrmobjs.WMRMKeys);
$privkey = $com-Privkey;
(etc?)


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


Re: [PHP] formatting a string

2004-04-24 Thread Andy B
[snip]
$phone = '1234567890';
$newphone = preg_replace('/(\d{3})(\d{3})(\d)/','(\1)\2-\3',$phone);
echo $newphone.'br';

--
regards,
Tom
[/snip]
ok sorry but since i never used preg_* before i dont quite get what some of
this stuff means. i looked at the doc page for it but it doesnt make mention
at all of what \d, \w, \s or any of those things mean... i only assume that
\d means digit and \w or \s means blank space??

anyways to go through the whole example above part by part:
$phone = '1234567890';//understand that
$newphone = preg_replace(//ok now what does this stuff
//mean??
'/(\d{3})(\d{3})(\d)/'
im gathering the line above is the search string (what to look for)? if so i
get from it that it is supposed to look for the first block of 3 digits then
the second block of 3 digits and the other 4 numbers by themself in a sense
seperating the string into 3 different parts: 123 456 7890 and then asigning
like id numbers to the blocks
'(\1)\2-\3'
and this one above says put block 1 between (). take block 2 and put a -
after it and leave the other 4 numbers alone to come up with: (123)456-7890
$phone);
the original number to do the replace on of course

let me know if i got that set right

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



php-general Digest 25 Apr 2004 05:14:04 -0000 Issue 2725

2004-04-24 Thread php-general-digest-help

php-general Digest 25 Apr 2004 05:14:04 - Issue 2725

Topics (messages 184527 through 184545):

Re: PHP5 bloats the code
184527 by: Johannes Reichardt
184529 by: Marek Kilimajer
184531 by: Mark Charette
184533 by: Marek Kilimajer
184535 by: Johannes Reichardt

Re: Fetching XML for parsing
184528 by: Patagonia Hosting Development Group

From IIS to Apache
184530 by: Stephen Craton
184532 by: Richard Harb

Re: php/apache/mysql on ntfs
184534 by: Curt Zirzow

PHP Auth
184536 by: Anton Krall
184538 by: Rainer Müller
184539 by: Curt Zirzow
184540 by: Anton Krall

Re: MySQL Dump
184537 by: Michal Migurski

Problem when compiling php5
184541 by: Martin Hjort Eriksen

formatting a string
184542 by: Andy B
184543 by: Tom Rogers
184545 by: Andy B

Re: The COM problem when converting from ASP to PHP [works now!!]
184544 by: Steven Kidd

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
Hi Curt,

thank you for pointing this one out. Who are the php internals and how 
could i contact them? This issue was rejected as bug recently.

- Johannes

* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
 

I just installed php5 (finaly :-))  and it does not throw any error nor 
warning. I think what you see is Notice, so the behavior did not change.
   

Here is the offending situation:

?php

/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);
/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);
/* returns false */
$a = array('foo' = 'asdf');
echo is_array($a['foo']['asdf']);
/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);
The last one is the biggie, the solution of course is to have
something like:
if (isset($a['foo']['asdf']) 
   is_array($a['foo']['asdf']) {
This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.
Curt
 

---End Message---
---BeginMessage---
Curt Zirzow wrote:
Here is the offending situation:

?php

/* E_NOTICE: undefined index, returns false */
unset($a);
echo is_array($a['foo']['asdf']);
/* returns false */
$a = 'asdf';
echo isset($a['foo']['asdf']);
/* returns false */
$a = array('foo' = 'asdf');
echo is_array($a['foo']['asdf']);
/* E_ERROR Invalid offset */
$a = 'asdf';
echo is_array($a['foo']['asdf']);
The last one is the biggie, the solution of course is to have
something like:
if (isset($a['foo']['asdf']) 
is_array($a['foo']['asdf']) {
This is a big BC issue, IMO, and might be worth asking internals
why the E_ERROR is given vs. a E_WARNING.
Curt
Well, what I always know about my variables is if they are arrays or 
scalar ;) And I don't consider warning to be much nicer then error

---End Message---
---BeginMessage---

 From: Marek Kilimajer [mailto:[EMAIL PROTECTED]

 Well, what I always know about my variables is if they are arrays or
 scalar ;) And I don't consider warning to be much nicer then error

Hmmm ... my current methods and functions in PHP 4.x oftentimes adapt to the
type passed to them since PHP doesn't have method signatures, meaning I
_don't_ know a priori what will be passed to them. Currently type checking
is mandatory if you want to avail yourself of a single method name.

Mark C.
---End Message---
---BeginMessage---
Mark Charette wrote:
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]


Well, what I always know about my variables is if they are arrays or
scalar ;) And I don't consider warning to be much nicer then error


Hmmm ... my current methods and functions in PHP 4.x oftentimes adapt to the
type passed to them since PHP doesn't have method signatures, meaning I
_don't_ know a priori what will be passed to them. Currently type checking
is mandatory if you want to avail yourself of a single method name.
Mark C.

So you have to check the type of the passed variable anyway, even in 
php4. You won't be affected by the new behavior in php5.
---End Message---
---BeginMessage---
Hi Marek,

actually this behaviour is too critical since there are many cases 
where compliant code is not as well as much more simpler code. reminds 
me on the w3c standards that are so high that some things simply dont 
comply if you want them ;)

just a warning would be way better.

- Johannes



So you have to check the type of the passed variable anyway, even in 
php4. You won't be affected by the new behavior in php5.

---End Message---
---BeginMessage---
That may be the exact problem. I was not figuring that one out. Thi is my
fopen and XML parser code:

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, startElement, endElement);

[PHP] SSI and query string variables to PHP

2004-04-24 Thread Tim Traver
Hi all,

ok, this may be a dumb question, but I have a page that has server side 
includes that include a php script like this :

!--#include virtual=schedule.php --

works fine, except the script doesn't appear to receive any of the query 
string information if that page has a query string on it...

an example would be something like this :

http://www.domain.com/index.shtml?myvariable=1

the php script should get $_REQUEST['myvariable']==1, but instead does not 
get any of the query information.

The $_SERVER global gets the unescaped query string, but has no value for 
just the query string...

any way around this without making the whole page a php script ?

Thanks,

Tim

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


[PHP] SSI and query string variables to PHP

2004-04-24 Thread Tim Traver
Hi all,

ok, this may be a dumb question, but I have a page that has server side 
includes that include a php script like this :

!--#include virtual=schedule.php --

works fine, except the script doesn't appear to receive any of the query 
string information if that page has a query string on it...

an example would be something like this :

http://www.domain.com/index.shtml?myvariable=1

the php script should get $_REQUEST['myvariable']==1, but instead does not 
get any of the query information.

The $_SERVER global gets the unescaped query string, but has no value for 
just the query string...

any way around this without making the whole page a php script ?

Thanks,

Tim 

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


Re[2]: [PHP] formatting a string

2004-04-24 Thread Tom Rogers
Hi,

Sunday, April 25, 2004, 3:15:25 PM, you wrote:

AB ok sorry but since i never used preg_* before i dont quite get what some of
AB this stuff means. i looked at the doc page for it but it doesnt make mention
AB at all of what \d, \w, \s or any of those things mean... i only assume that
AB \d means digit and \w or \s means blank space??

AB anyways to go through the whole example above part by part:
AB $phone = '1234567890';//understand that
AB $newphone = preg_replace(//ok now what does this stuff
AB //mean??
AB '/(\d{3})(\d{3})(\d)/'
AB im gathering the line above is the search string (what to look for)? if so i
AB get from it that it is supposed to look for the first block of 3 digits then
AB the second block of 3 digits and the other 4 numbers by themself in a sense
AB seperating the string into 3 different parts: 123 456 7890 and then asigning
AB like id numbers to the blocks
AB '(\1)\2-\3'
AB and this one above says put block 1 between (). take block 2 and put a -
AB after it and leave the other 4 numbers alone to come up with: (123)456-7890
AB $phone);
AB the original number to do the replace on of course

AB let me know if i got that set right

Yes that is exactly what it does .. sorry probably should have
explained it... but at least you read up the function :-)

the () tells preg to store the contents and they get numbered 1 2 3 ..
the \1 with a number below 10 tells it to use what it captured at that
point.

\D btw captures everything that is not a digit so you can use
that to cleanup the user input with $input = preg_replace('/\D/','',$input);

-- 
regards,
Tom

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