RE: [PHP] Writing to text file from Radio Buttons

2002-01-22 Thread Niklas Lampén

fwrite()?


Niklas

-Original Message-
From: Harphajan Singh [mailto:[EMAIL PROTECTED]] 
Sent: 22. tammikuuta 2002 9:51
To: [EMAIL PROTECTED]
Subject: [PHP] Writing to text file from Radio Buttons


Greeting dudes ! I`m a fresh user of PHP and need some technical
assistance from you folks.

I`m creating a survey form(using radio buttons) and it
looks like this :-

Q1) How do you register for the hostel ?
input type=radio name=reg_method
value=phone By Phone 
INPUT type=radio name=reg_method
value=mail By E-Mail 
INPUT type=radio name=reg_method
value=office checked Walk-In to office

Q2)Do the authorities respond to your complaint
immediately?
INPUT type=radio name=responds value=yes Yes 
INPUT type=radio name=responds value=no
checked No

I would like to store each entry into a text file and
view them later.Hence, I would know the unique 'VALUE'
for a particular 'NAME'(for both the Q`s) So, the
output in my textfile should look something like

 date Value for Q1Value of Q2

I`m trying to open a file and then write to it for
instance :-

$fp = fopen($DOCUMENT_ROOT/.../software/survey.txt,
w);

BUT, I don`t really know how to store the unique
values for those radio buttons into my file.

Please help , dudes !


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Integer in PHP

2002-01-22 Thread Sukumar S.

Hi,

  Use intval(2.05);

  I hope this will do the needful for you.

with regards,
Sukumar .S


On Mon, 21 Jan 2002, Jerry wrote:

 Date: Mon, 21 Jan 2002 13:35:34 -
 From: Jerry [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Integer in PHP
 
 Hi,
 
 I'm new in PHP, coming from JavaScript.
 In JavaScript you had the function parseInt which was really useful.
 For example parseInt(2.05) will return 2...
 
 How can I do that in PHP ?
 
 Thanks.
 
 Jerry
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

--
A real friend is one who walks in when the rest of the world walks out
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: smarter code (mySQL arrays)

2002-01-22 Thread David Robley

[EMAIL PROTECTED] (Justin French) wrote in
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: 

 Hi all,
 
 I've got into the habbit of pulling data out of a table something like
 this: 
 
 
 $sql = SELECT * FROM cd_review WHERE publish='yes' ORDER BY id DESC
 LIMIT 3;
 $sql_result = mysql_query($sql);
 print mysql_error();
 while ($sql_myrow = mysql_fetch_array($sql_result))
   {
   // pull out the data
   $id = $sql_myrow[id];
   $date = $sql_myrow[date];
   $user_id = $sql_myrow[user_id];
   $artist = $sql_myrow[artist];
   $title = $sql_myrow[title];
   // edited out about 10 colums for clarity
   }
 
 Now, I reckon there must be a way of automating the task of making the
 $title var out of $sql_myrow[title] etc etc for starters, which would
 really help on tables with lots of columns.
 
 Then, it'd be great if I could automate this further to automaticaly to
 a stripslashes() on each var, then possibly nl2br() etc.
 
 
 In psuedo-code I guess it looks something like:
 
 while($sql_myrow = mysql_fetch_array($sql_result))
   {
   
   // we have an array of one row
 
   use a foreach loop to stripslashes() on each element of the array
 
   use a foreach loop to nl2br() on each element of the array
 
   use a foreach loop to take each element (eg $sql_myrow[id]) and
 create a var ($id)
 
   }
 
 
 Of course I'm a way newbie on arrays, and I've read the manual, but am
 unclear on the syntax for the above.
 
 
 Ultimately, I'd like to put this all into a function which I call that
 does it all in one hit, but I'll take that in a smaller step :)
 
 
 Justin French

Justin

There is a function extract() which will take an array and return the 
key/value pairs as $key = value

So if you do 
while($sql_myrow = mysql_fetch_array($sql_result))
  extract($sql_myrow);

you can then refer to the field names as the same variable.

I have a vague recollection (its a couple of months since I retired!) that 
you can apply functions like nl2br() to an array and they work on each 
element of the array? Worth a try; it shouldn't take too long to test and 
see if it works.

Cheers
-- 
David Robley
Temporary Kiwi!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing. Which method to use?

2002-01-22 Thread Sukumar S.

Hi,
  I'm using sessions extremely to do that. 

with regards
Sukumar .S
On Tue, 22 Jan 2002, Floyd Baker wrote:

 Date: Tue, 22 Jan 2002 01:17:18 -0500
 From: Floyd Baker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Passing.  Which method to use?  
 
 
 Hi once again.
 
 What's the consensus on the best way to pass arrays from page to page?
 
 By serializing?  But I think it's not recommended?
 
 By writing then reading to a text file?  Maybe?
 
 By inputting to and pulling from db records?  Possibilities?  
 
 Any other?  
 
 Thanks in advance.
 
 Floyd
 
 
 --
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

--
A real friend is one who walks in when the rest of the world walks out
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems from php4.0.6 to 4.1.1 with sessions

2002-01-22 Thread Ben-Nes Michael

Hi All

In all my sessions sites when I had to move from the primary domain using
session to a secondary domain (like from www.domain.com to
secure.domain.com) I added the PHPSESID to the URL and the session in the
new site continued from the previous Domain.

in 4.1.1 when I move from the primary domain to the secondary one I still
can use the session until I click/submit without PHPSESID which then make
PHP loose the old session and start a new one.

Until now I didn't had to submit the PHPSESID every time but only once ( in
the first entrance to the secondary domain )

And Yes
register_globals = On

I dont make thing complex and so I use only:
session_start();
session_register(some_var);

a copy of the php.ini for the 4.1.1 is at:
http://www.canaan.co.il/users/miki/php-ini-4.1.1.txt

Thanks in Advance.

--
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: How should I cache database data for php?

2002-01-22 Thread DL Neil

Garth,

 my two cents...

=thank you for the description - it is worth more than a figurative two cents!

 I used to work at a newspaper we used a very elaborate
 caching system, it used to function at the at the
 page subcomponent level (i.e. header, footer, left nav, articles
 were all stored separately) AND page level.  The page
 subcomponents were cached together as pages.   This was a good
 system because it allowed for the subcomponents to be updated
 without effecting the pages (by deleting the subcomponent cache
 and leaving the page cache), then subcomponents were regenerated
 with new contents, and finally the page caches were deleted
 and the pages were then regenerated from the cached subcomponents
 (which was the same speed as doing SSI's basically).  Anyway,
 a fast system, a bit complex, a bit ridged (if you want
 dynamic stuff in your pages) but solid for a newspaper.

=makes sense as an architecture

=were the page subcomponents formatted as HTML or simple text?

=how was the fact that a particular page used certain subcomponents tracked? (eg to 
know what to update, when)

 Now on to DB caching... ADODB has support for Database caching,
 it basically dumps the database to a file and reloads it
 transparently when you next do the same select on the DB.
 This would work if you coupled it with a publish event... i.e.
 DB changes - have a script SSH to the web servers and delete
 the cache / or pregenerate the cache on the db server and upload
 it to the webserver as a temp file and then do a mv to the real
 cache file... many ways to skin that cat.

=why did/do you think the newspaper made the decision to do the former, than to try 
this ADODB-type solution?

=they both achieve the stated objective (reduce load on the db-server). Is one 
somewhat lesser/better than the
other?

=Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Nobody know nothing about? Php login scripts using PHP4.01, Apache3.01 CGI on W2K

2002-01-22 Thread Tim Ward

Use html form for user input with text field for user name and password
filed for password. Hold password encrypted using MySQL password() function
and check login by SELECT * FROM users WHERE user='$user' AND
pass=PASSWORD($password). If (mysql_num_rows($result)) login = true;

Tim
www.chessish.com http://www.chessish.com 

--
From:  [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:  21 January 2002 19:58
To:  [EMAIL PROTECTED]
Subject:  [PHP] Nobody know nothing about?  Php login scripts
using PHP4.01, Apache3.01 CGI on W2K


Atte. Ignacio Estrada F.
Centro Nacional de Control de Energia
Area de Control Occidental
025+6463, 025+6464, 025+6469



ignacio.estrada@
cfe.gob.mx  Para:
[EMAIL PROTECTED]
cc:
01/21/2002 09:34Asunto:  [PHP] Php
login scripts using PHP4.01, Apache3.01 CGI on W2K





Hi, am looking for good samples scripts for authentication, but I am
using
the CGI version of Apache.   However could be a good way for make
authentication using some file or database as the source for the
login name
and so on.

Please let me know if you know where exists a good samples scripts
for
that.

Greetings!!

Atte. Ignacio Estrada F.
Centro Nacional de Control de Energia
Area de Control Occidental
025+6463, 025+6464, 025+6469


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: file upload with story

2002-01-22 Thread Tim Ward

I found everything I needed to upload images here:
http://www.php.net/manual/en/features.file-upload.php
http://www.php.net/manual/en/features.file-upload.php 

Tim
www.chessish.com http://www.chessish.com 

--
From:  will hives [SMTP:[EMAIL PROTECTED]]
Sent:  21 January 2002 23:01
To:  [EMAIL PROTECTED]
Subject:  file upload with story

Please can someone help, I can't find any answers anywhere

I have this code:

?

$db_name = name;

$table_name = my_contacts;

$connection = @mysql_connect(www.myserver.net, username,
password) or
die (couldn't connect.);

$db = @mysql_select_db($db_name, $connection) or die (couldn't
select
database.);

$sql = INSERT INTO $table_name
(id, fname, lname, address1, address2, address3, postcode, country,
prim_tel, sec_tel, fax, email, birthday)
VALUES
(\\, \$fname\, \$lname\, \$address1\, \$address2\,
\$address3\,
\$postcode\, \$country\, \$prim_tel\, \$sec_tel\, \$fax\,
\$email\, \$birthday\) ;

$result = @mysql_query($sql, $connection) or die (couldn't execute
query);

?

it's really just an online contacts book, what I want to do as have
the
ability to upload an image with the record.

Then when the contact details are viewed it shows the also uploaded
image.

How do I add that code into this...any help would be fantastic.

Cheers
Will


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Split files

2002-01-22 Thread Martin Thoma

Hello! Is there a PHP-function to split binary files into pieces of a
several size and glue them together later?

Martin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Printer funtions

2002-01-22 Thread Tim Ward

Why would you expect these functions to do anything on the client machine?
These are for printers attached to the server.

Tim
www.chessish.com http://www.chessish.com 

--
From:  James Mclean [SMTP:[EMAIL PROTECTED]]
Sent:  21 January 2002 23:48
To:  [EMAIL PROTECTED]
Subject:  Printer funtions


All,

I have been reading through the php.net printer function pages, but
from what I 
can see it does not look like the docs are that good. 

basically, I want to run through to see if any one has any pointers
before 
using the PHP printers funtions. IE does printer_open() open a
connection to 
the default printer specified on the client machine? The docs doent
eben 
specify this...

The site mentions listing the printer in php.ini, but this is not
possible in 
this instance, having to cater for printers that will be unknown to
me.

any pointers helpful! TIA.

Regards,

James Mclean
Adam Internet Web Design Team

Windows didn't get as bad as it is overnight -- it took over ten
years of 
careful development.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to call Calling Non-Existing function

2002-01-22 Thread Tim Ward

This generates a parse error if Draw_Table() doesn't exist rather than
returning false, unless there's something in my set up that's different to
yours.

Tim
www.chessish.com http://www.chessish.com 

--
From:  val petruchek [SMTP:[EMAIL PROTECTED]]
Sent:  21 January 2002 11:22
To:  [EMAIL PROTECTED]
Cc:  PHP
Subject:  Re: [PHP] How to call Calling Non-Existing function

Not sure this is exactly what you need but try this:

@Draw_Table() or default_func();


Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: S. Murali Krishna [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Monday, January 21, 2002 1:17 PM
Subject: [PHP] How to call Calling Non-Existing function



 Hi PHP Experts,

 Is there any way to call a non-existent or undeclared function
 and redirect the call to someother function by knowing its
non-existense.

 Is there any try() and catch() idea or any configurations,
 or may be either error handler like thing.

 for example if I call a function 'Draw_Table()' without declaring
like
 this

 Draw_Table();

 it should know the non-existense of Draw_Table() and redirect to
 'default_func'

 function default_func()
 {
 
 }

 Note:
 
 Perl  programmers please recollect 'AUTOLOAD' Method of a
package.
 C++,Java  programmers please recollect exception handling.


 Thanks in Advance.

 S.Murali Krishna
 [EMAIL PROTECTED]
 =
 We grow slow trying to be great

- E. Stanley Jones
 -


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: PHP vs Java reliability

2002-01-22 Thread Geoff Caplan

Michael

  the Why PHP on zend.com is a great place to go for this sort of
stuff...
 
 Honestly, it doesn't seem all that professional a resource paper...

I would tend to agree - not something you could show to a hard-headed
corporate purchasing committee with any confidence.


 I believe Java *can* be pretty stable and robust, but at a cost which
 far exceeds PHP's.  This is something that seemed to be missing from
 that article - a cost/benefit analysis compared to other platforms .

Yeah, Java/ASP/etc can have enormous benefits over PHP in
 some situations, but the price tag is often beyond what people initially
 imagine.


I suspect that this is the vital point - for the right type of project PHP
will be quicker to develop and cheaper to deploy. I think the Zend case
would be more credible if they defined the niche for PHP more clearly -
which is surely the small to mid-sized project.

My own project is aimed at making fully customised e-commerce affordable for
the smaller organisation, and this seems an ideal field for PHP.

For end-to-end enterprise computing, PHP would need better namespaces, a
proper object model, more rigorous error handling, a thriving market in
high-quality components (and/or a robust interface to Java) and a fully
featured IDE. Zend 2 should lay the foundations for this, but by then Java
will be so far ahead that PHP may never catch up. But does this matter? The
great majority of organisations and projects are small, and for them PHP is
ideal. If I were Zend, I would be focusing on products and pricing that
appeals to this market, but they rather give the impression that they are
aiming for the enterprise...

Geoff Caplan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

Hi there,

First off this may be more of a javascript question than PHP question
but I was wondering if anyone else has attempted something similar (and
it does involve the deletion of PHP sessions).

Here's the scenario: I have a 'stand alone' website on our intranet
which creates a PHP session upon startup. A new browser window is then
opened for the duration of the site - until the user has finished and
wishes to leave the system. This window cannot have a link to a standard
'logout' page, it needs to delete the PHP session when the browser
window is closed (possibly by launching a temporary page which calls the
necessary functions and then automatically closes via javascript).

The problem I have is that this site must work in both IE and Netscape
and this is what is causing me headaches :) Both browsers supposedly
support an 'onunload' event and I have managed to achieve what I want in
IE but Netscape refuses to lauch my 'logging out' page.

Does anyone have any suggestions as to how I could achieve the
following:
a) Browser window closed by user clicking on [X]
b) 'Logging out' page opened (which handles the PHP session deletion).

I hope this is clear enough.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Chat REALTIME

2002-01-22 Thread Nuno Mariz

I need to build a php-chat (online support system), but in realtime.
I've develope a system that refresh in browser client in 5 seconds. But
i need a system that works in realtime, what i meen is when a client or
the server send a message, the browser refresh when a message was sent.
All this without JAVA.

thanx


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How should I cache database data for php?

2002-01-22 Thread B Richards

I've been following this discussion and has anyone tried smarty?  smarty is
a template but also does caching.  haven't tried it but i think you can set
the cache to be like 30 seconds and it will display a cached html page
instead of hitting your database.  i think you can also cach only different
parts of a page too.  someone probably knows more about this then me.


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* On 22-01-02 at 11:30 
* Neil Freeman said

 Does anyone have any suggestions as to how I could achieve the
 following:
 a) Browser window closed by user clicking on [X]

No but I'm sure someone will.

 b) 'Logging out' page opened (which handles the PHP session deletion).

When a user closes the browser (any browser) the session is ended. You
don't need to manually terminate it.

HTH
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TUBSHpvrrTa6L5oRAn45AJ4kltU6UKb+JCSamfgUfQ+e1CPIKACff0Xn
NlVo2ttprA1xjdLz6lB3DWg=
=BOV1
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

OK I agree with you there :) But as I haven't called the session_destroy()
function the session file still resides in the session.save_path directory.
Over time the number of these files will obviously increase so isn't it
better to implement a method which calls the session_destroy() function ???

Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 * On 22-01-02 at 11:30
 * Neil Freeman said

  Does anyone have any suggestions as to how I could achieve the
  following:
  a) Browser window closed by user clicking on [X]

 No but I'm sure someone will.

  b) 'Logging out' page opened (which handles the PHP session deletion).

 When a user closes the browser (any browser) the session is ended. You
 don't need to manually terminate it.

 HTH
 - --

 Nick Wilson

 Tel:+45 3325 0688
 Fax:+45 3325 0677
 Web:www.explodingnet.com

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8TUBSHpvrrTa6L5oRAn45AJ4kltU6UKb+JCSamfgUfQ+e1CPIKACff0Xn
 NlVo2ttprA1xjdLz6lB3DWg=
 =BOV1
 -END PGP SIGNATURE-

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 ***
  This message was virus checked with: SAVI 3.52
  last updated 8th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Ben-Nes Michael

The server can controll the Refresh and the cache expiry through headers
sent when the page is requested by the client.

add this to expire client content every time a request for the same page is
sent.
header(Pragma: no-cache);

add this to refresh client content every 5 sec
meta http-equiv=Refresh
content=5;URL=http://www.doamin.com/page.phtml;.

--
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--

- Original Message -
From: Nuno Mariz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 12:32 PM
Subject: [PHP] PHP Chat REALTIME


 I need to build a php-chat (online support system), but in realtime.
 I've develope a system that refresh in browser client in 5 seconds. But
 i need a system that works in realtime, what i meen is when a client or
 the server send a message, the browser refresh when a message was sent.
 All this without JAVA.

 thanx


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* On 22-01-02 at 11:46 
* Neil Freeman said

 OK I agree with you there :) But as I haven't called the session_destroy()
 function the session file still resides in the session.save_path directory.
 Over time the number of these files will obviously increase so isn't it
 better to implement a method which calls the session_destroy() function ???

I see what you mean but I think you are either a: mistaken or b: under a
misaprehension. The reason I say this is that I can't believe that
*something* be it PHP or the system itself won't take that in to
account. 

Have a look at the manual or whatever and if you find the answer please
let me know as it's a good point. I just think I've seen something about
it somewhere :)

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TUWAHpvrrTa6L5oRAoCKAJ9/YaNP4lYEnRqXc4YABWpj/kS8OwCcCW3g
dx3GdbUs4s75a8PBl4zdC3Q=
=7c8g
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Nuno Mariz

That was not the problem, i need something that keep the conection
between client and server.

On Tue, 2002-01-22 at 10:51, Ben-Nes Michael wrote:
 The server can controll the Refresh and the cache expiry through headers
 sent when the page is requested by the client.
 
 add this to expire client content every time a request for the same page is
 sent.
 header(Pragma: no-cache);
 
 add this to refresh client content every 5 sec
 meta http-equiv=Refresh
 content=5;URL=http://www.doamin.com/page.phtml;.
 
 --
 Canaan Surfing Ltd.
 Internet Service Providers
 Ben-Nes Michael - Manager
 Tel: 972-4-6991122
 http://sites.canaan.co.il
 --
 
 - Original Message -
 From: Nuno Mariz [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 22, 2002 12:32 PM
 Subject: [PHP] PHP Chat REALTIME
 
 
  I need to build a php-chat (online support system), but in realtime.
  I've develope a system that refresh in browser client in 5 seconds. But
  i need a system that works in realtime, what i meen is when a client or
  the server send a message, the browser refresh when a message was sent.
  All this without JAVA.
 
  thanx
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
-- 

  Nuno  Mariz
 Web Developer

WEBSOLUT - Soluções Internet
Email: [EMAIL PROTECTED]
http://websolut.net/people/nunomariz.html

As informações contidas neste email são confidenciais
para todos os efeitos e destinam-se apenas a quem foi enviado:
http://websolut.net/confidencialidade-responsabilidade.html


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Rand function

2002-01-22 Thread Sam

Hi all,

Can anyone tell me why, when I run this

$number = rand (1,12);
The only number that ever appears is 5?
Not really a random number...


Thanks
Sam



Re: [PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

OK I'll have a look around. Thanks for your time Nick.

Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 * On 22-01-02 at 11:46
 * Neil Freeman said

  OK I agree with you there :) But as I haven't called the session_destroy()
  function the session file still resides in the session.save_path directory.
  Over time the number of these files will obviously increase so isn't it
  better to implement a method which calls the session_destroy() function ???

 I see what you mean but I think you are either a: mistaken or b: under a
 misaprehension. The reason I say this is that I can't believe that
 *something* be it PHP or the system itself won't take that in to
 account.

 Have a look at the manual or whatever and if you find the answer please
 let me know as it's a good point. I just think I've seen something about
 it somewhere :)

 - --

 Nick Wilson

 Tel:+45 3325 0688
 Fax:+45 3325 0677
 Web:www.explodingnet.com

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8TUWAHpvrrTa6L5oRAoCKAJ9/YaNP4lYEnRqXc4YABWpj/kS8OwCcCW3g
 dx3GdbUs4s75a8PBl4zdC3Q=
 =7c8g
 -END PGP SIGNATURE-

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 ***
  This message was virus checked with: SAVI 3.52
  last updated 8th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Rand function

2002-01-22 Thread Jason Wong

On Tuesday 22 January 2002 18:52, Sam wrote:
 Hi all,

 Can anyone tell me why, when I run this

 $number = rand (1,12);
 The only number that ever appears is 5?
 Not really a random number...


You need to seed the random number generator using srand(). Best to read the 
online annotated manual as there's some useful info regarding random number 
generation.

Remember you only need to call srand() *ONCE* during the lifetime of your php 
script. Do NOT call srand() each time you want a random number.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Now hatred is by far the longest pleasure;
Men love in haste, but they detest at leisure.
-- George Gordon, Lord Byron, Don Juan
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Rand function

2002-01-22 Thread Jon Haworth

 Can anyone tell me why, when I run this
 $number = rand (1,12);
 The only number that ever appears is 5?
 Not really a random number...

You need to seed the random number generator first.

http://www.php.net/srand

HTH
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foreach array into mail isn´t working

2002-01-22 Thread DL Neil

Josepablo,

 Hey guys guess what.. the problem is fixed the was that at mailaddr.txt sense
 the e-mails are each on one line each line has \n that crashed when asigning it
 at mail() , ill make a note of this on the manul.. I have included below the
 script iam now using.. what do you guys think?

 Josepablo Pérez

 -

 $maildb = file(mailaddr.txt);

 foreach ($maildb as $address)
 {
 $addr_format=explode(\n,$address);
 mail($addr_format[0],$subject, $message\n, From: $from\n);
 }


=Classic!

=So busy looking at the mail() that didn't see what was happening before - and my test 
rig took data from an
array (no terminating newline chars) and worked happily, but completely side-stepped 
the real problem...

=if it works, it's right!

=note for future: don't use files and records, use db fields!

=well done everybody,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Bruno Baketaric

Uhhh? Closing a browser window, does definetly NOT delete the session.
Closing a Browser Window simply does nothing on the Server-Side, so there's
no command to delete a session executed. If someone manages to grab the
sessionid (or the cookie) and opens the Page again, the session is still
active. Neil is completely right, if he tries to generate a new GET-Request
to a special log-out page on the server that uses session_destroy().
Well, I've no experence in using the window.onclose or document.onunload
events with Netscape Javascript, but something like that should be the right
way, if you need to be really save that a session is destroyed.

Bruno

Nick Wilson [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * On 22-01-02 at 11:30
 * Neil Freeman said

  Does anyone have any suggestions as to how I could achieve the
  following:
  a) Browser window closed by user clicking on [X]

 No but I'm sure someone will.

  b) 'Logging out' page opened (which handles the PHP session deletion).

 When a user closes the browser (any browser) the session is ended. You
 don't need to manually terminate it.

 HTH
 - --

 Nick Wilson

 Tel: +45 3325 0688
 Fax: +45 3325 0677
 Web: www.explodingnet.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8TUBSHpvrrTa6L5oRAn45AJ4kltU6UKb+JCSamfgUfQ+e1CPIKACff0Xn
 NlVo2ttprA1xjdLz6lB3DWg=
 =BOV1
 -END PGP SIGNATURE-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Richard Baskett

Actually PHP has a garbage collector that periodically it cleans deletes
all those old session files.  I believe you can set the time it cleans these
files up in the php.ini file.  Now that you know where to look a search
should be able to answer this question more fully than I can and with more
guidelines on how to regulate it.  I hope this helps!

Rick

I remember a man of some standing who once came to see me and told me that a
friend of his who claimed no small spiritual achievements had offended him;
Who should go and make his peace with the other? he asked. I can not
answer your question, I replied, as I cannot possibly set myself as a
judge between you, but one thing is certain to me; the meanest of the two of
you will wait for the other to make the move. The great man said no word,
but went forthwith to make his peace with his friend. - Unknown

 From: Neil Freeman [EMAIL PROTECTED]
 Date: Tue, 22 Jan 2002 11:08:23 +
 To: PHP-General [EMAIL PROTECTED]
 Subject: Re: [PHP] Session deletion on window close?
 
 OK I'll have a look around. Thanks for your time Nick.
 
 Nick Wilson wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 * On 22-01-02 at 11:46
 * Neil Freeman said
 
 OK I agree with you there :) But as I haven't called the session_destroy()
 function the session file still resides in the session.save_path directory.
 Over time the number of these files will obviously increase so isn't it
 better to implement a method which calls the session_destroy() function ???
 
 I see what you mean but I think you are either a: mistaken or b: under a
 misaprehension. The reason I say this is that I can't believe that
 *something* be it PHP or the system itself won't take that in to
 account.
 
 Have a look at the manual or whatever and if you find the answer please
 let me know as it's a good point. I just think I've seen something about
 it somewhere :)
 
 - --
 
 Nick Wilson
 
 Tel:+45 3325 0688
 Fax:+45 3325 0677
 Web:www.explodingnet.com
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE8TUWAHpvrrTa6L5oRAoCKAJ9/YaNP4lYEnRqXc4YABWpj/kS8OwCcCW3g
 dx3GdbUs4s75a8PBl4zdC3Q=
 =7c8g
 -END PGP SIGNATURE-
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 ***
  This message was virus checked with: SAVI 3.52
  last updated 8th January 2002
 ***
 
 --
 
 Email:  [EMAIL PROTECTED]
[EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Chat REALTIME

2002-01-22 Thread David

 hey, i thought about this problem last time, i figured out that there's NO WAY to do 
this in php, (the auto refresh does not count). somebody pls prove me wrong.

intrested to continue this discussion

David
I need to build a php-chat (online support system), but in realtime. 
I've develope a system that refresh in browser client in 5 seconds. But i need a 
system that works in realtime, what i meen is when a client or the server send a 
message, the browser refresh when a message was sent. 
All this without JAVA. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: Re: [PHP] ok, I ask again.. how to encrypt to be able to match

2002-01-22 Thread David

 u used password() to encrypt the value in mysql?

u can get back a encrypted value of a value by doing a select password('secret'); in 
mysql, it will return u the encrypted value, check this value against the encrypted 
password in mysql.

is this what you're asking? :)

I've asked this several times but it doesn't seem like anyone understands my 
problem, the passwords are encrypted in the database, but I don't know how 
to match an unencrypted password from the login form with the database? 
is it possible to encrypt the password I sent from the form in php or does 
that have to be done in mysql? 
in any case, how do I do it? 
If you don't have anything bright to say, don't, in some of the replys I've 
had earlier it sounds like you think I'm an idiot... 
And even if I am, I don't want to be refered as one ;) 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Best way to get the remote IP address?

2002-01-22 Thread gaouzief

here is a piece o fcode that looks up user ip from env vars recursively

?php
if($HTTP_X_FORWARDED_FOR) 
  { 
   $ip = $HTTP_X_FORWARDED_FOR; 
  }
  elseif($HTTP_VIA)  
  { 
   $ip = $HTTP_VIA; 
  }
  elseif($REMOTE_ADDR) 
  { 
   $ip = $REMOTE_ADDR; 
  } 
  else 
  { 
   $ip = unknown;
  }
?

22/01/2002 04:57:50, Jimmy [EMAIL PROTECTED] wrote:

 either $HTTP_SERVER_VARS['REMOTE_ADDR'] or simply $REMOTE_ADDR (if you use
 $REMOTE_ADDR in functions make sure you do a global on it first) - I
 personally use $REMOTE_ADDR, but you should read the docs for details...

using $REMOTE_ADDR directly is fine as long as the
register_global setting is off.

otherwise, it's wiser to use getenv('REMOTE_ADDR') instead of
$REMOTE_ADDR directly.

--
Jimmy

Failure doesn't mean you'll never make it. It just means it may take longer.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Ben-Nes Michael

I dont think its possible without Java programing.

If there is other solutions ill be glad to hear.
--
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--

- Original Message -
From: Nuno Mariz [EMAIL PROTECTED]
To: Ben-Nes Michael [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 1:02 PM
Subject: Re: [PHP] PHP Chat REALTIME


That was not the problem, i need something that keep the conection
between client and server.

On Tue, 2002-01-22 at 10:51, Ben-Nes Michael wrote:
 The server can controll the Refresh and the cache expiry through headers
 sent when the page is requested by the client.

 add this to expire client content every time a request for the same page
is
 sent.
 header(Pragma: no-cache);

 add this to refresh client content every 5 sec
 meta http-equiv=Refresh
 content=5;URL=http://www.doamin.com/page.phtml;.

 --
 Canaan Surfing Ltd.
 Internet Service Providers
 Ben-Nes Michael - Manager
 Tel: 972-4-6991122
 http://sites.canaan.co.il
 --

 - Original Message -
 From: Nuno Mariz [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 22, 2002 12:32 PM
 Subject: [PHP] PHP Chat REALTIME


  I need to build a php-chat (online support system), but in realtime.
  I've develope a system that refresh in browser client in 5 seconds. But
  i need a system that works in realtime, what i meen is when a client or
  the server send a message, the browser refresh when a message was sent.
  All this without JAVA.
 
  thanx
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

--

  Nuno  Mariz
 Web Developer

WEBSOLUT - Soluções Internet
Email: [EMAIL PROTECTED]
http://websolut.net/people/nunomariz.html

As informações contidas neste email são confidenciais
para todos os efeitos e destinam-se apenas a quem foi enviado:
http://websolut.net/confidencialidade-responsabilidade.html


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help for swflib

2002-01-22 Thread Michael Plies

Hy - i hope someone can help me - please

i need an url for downloading the swflib or another swflibarie for use with
php (and some information about it). I dont find it under the url given in
the phpmanual.  Have someone informations or expirience ??

Please Help
Thanks




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] The Euro symbol, default charset and htmlentities()

2002-01-22 Thread Sönke Tesch


Hi everybody!


I'm a bit lost. The original problem was (and still is) to get the Euro
symbol from a iso-8859-15 string into the HTML code output by a PHP-script
(4.0.6 by the way).

At first it worked fine using htmlentities(¤,ENT_QUOTES,iso-8859-15).
However, this is a bit long, I would have plenty of htmlentities() to fix,
and since -15 should be the considered the current standard rather than 
the outdated -1 it replaced, I wanted to figure out how to tell PHP and
its htmlentities() which character set to use as default. 

First question:
Where's the configuration for that? mbstring.* ini php.ini doesn't seem 
to be the right place (and I didn't expect it anyway).


So, after learning that mbstring.* doesn't work I removed these from 
php.ini and now the extended htmlentities() doesn't work anymore. The 
line

  echo htmlentities(¤,ENT_QUOTES,iso-8859-15);

results in a Wrong parameter count for htmlentities()-warning. Oops?

Second question: 
What's wrong now? I'm sure it worked earlier and I can't see that this
line is wrong anyway. htmlentities() expects upto three arguments, there 
are three.


And, not related to a problem, the third question:
Did anybody yet consider setting iso-8859-15 as default charset throughout
PHP instead of iso-8859-1?


Regards,
  soenk.e

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] url for swflib ?

2002-01-22 Thread Michael Plies

Hy - i hope someone can help me - please

i need an url for downloading the swflib or
another swflibarie for use with
php (and some information about it). I dont find
it under the url given in
the phpmanual.  Have someone informations or
expirience ??

Please Help
Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] RE: Printing structure and data of array

2002-01-22 Thread matthias.stache

Use this:


function debugPrint($mVar, $bHtml) {
 if ($bHtml){
  echo pre;
  print_r ($mVar);
  echo /pre;
 } else {
  print_r ($mVar);
 }
}

call it like this:

debugPrint($yourVariable,1);


This will print out any type (object,array,ressource,string...)

- Original Message -
From: Sandeep Murphy [EMAIL PROTECTED]
To: 'Tim Ward' [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 1:00 PM
Subject: RE: [PHP] RE: Printing structure and data of array


 hi,

 how can I display the array exactly as it is the format specified??? like
if
 their exists sub elements of elements, how could I represent them in a
 multidimensional format??

 I went thru most of the array functions but unable to adapt any of them..

 pl help..

 TIA,
 sands

 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: segunda-feira, 21 de Janeiro de 2002 10:24
 To: PHP List; Daniel Alsén
 Subject: [PHP] RE: Printing structure and data of array


 Foreach($array as $key=$value) ech0($key=$valuebr);

 Tim
 www.chessish.com http://www.chessish.com

 --
 From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
 Sent:  20 January 2002 19:33
 To:  PHP List
 Subject:  Printing structure and data of array

 Hi,

 i know i have this answered before. But i can´t find that mail in
 the
 archive.

 How do i print an array to see both the structure and the data
 within?
 (test = value, test2 = value2)...

 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Authentication Pages

2002-01-22 Thread Nicolas Llamosas

Where can I find some information about Authentication Pages, login, pass, 
using php, apache and mysql?

Thanks.

Nicolas Llamosas

_
MSN Photos es la manera más sencilla de compartir, editar e imprimir sus 
fotos favoritas. http://photos.latam.msn.com/Support/WorldWide.aspx


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to get php to accept spaces in a file name?

2002-01-22 Thread Kevin Garrett

Hi guys,

I've an index script which views the contents of a directory on a unix 
server.  This unix server has also got file with windows naming convesion, 
which makes a file with spaces look like this /this\ is\ an\ example/.  
The file name itself appears fine but there is also a link to the file which 
would only see the /this\  part of the file.

My question is, does anybody know how to get php to accept spaces in a file 
name?

Thanks
Kev

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Sandeep Murphy

hi,

Thnx for the info but this is what I am using right now... It prints the
contents of array one below the other... is not showing the format of the
contents as i want...:(

any more suggestions??

thnx,
sands

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 22 de Janeiro de 2002 12:43
To: PHP List
Subject: Re: [PHP] RE: Printing structure and data of array


Use this:


function debugPrint($mVar, $bHtml) {
 if ($bHtml){
  echo pre;
  print_r ($mVar);
  echo /pre;
 } else {
  print_r ($mVar);
 }
}

call it like this:

debugPrint($yourVariable,1);


This will print out any type (object,array,ressource,string...)

- Original Message -
From: Sandeep Murphy [EMAIL PROTECTED]
To: 'Tim Ward' [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 1:00 PM
Subject: RE: [PHP] RE: Printing structure and data of array


 hi,

 how can I display the array exactly as it is the format specified??? like
if
 their exists sub elements of elements, how could I represent them in a
 multidimensional format??

 I went thru most of the array functions but unable to adapt any of them..

 pl help..

 TIA,
 sands

 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: segunda-feira, 21 de Janeiro de 2002 10:24
 To: PHP List; Daniel Alsén
 Subject: [PHP] RE: Printing structure and data of array


 Foreach($array as $key=$value) ech0($key=$valuebr);

 Tim
 www.chessish.com http://www.chessish.com

 --
 From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
 Sent:  20 January 2002 19:33
 To:  PHP List
 Subject:  Printing structure and data of array

 Hi,

 i know i have this answered before. But i can´t find that mail in
 the
 archive.

 How do i print an array to see both the structure and the data
 within?
 (test = value, test2 = value2)...

 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward

how about ...

function ShowArray($array)
{   echo(ul);
foreach ($array as $key=$value)
{   echo(li$key)
if (is_array($value))
{   ShowArray($value);
} else
{   echo(=$value);
}
echo(/li)
}
echo(/ul);
} // end of fn ShowArray


Tim
www.chessish.com

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 12:01
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 hi,
 
 how can I display the array exactly as it is the format specified??? like
 if
 their exists sub elements of elements, how could I represent them in a
 multidimensional format??
 
 I went thru most of the array functions but unable to adapt any of them..
 
 pl help..
 
 TIA,
 sands
 
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: segunda-feira, 21 de Janeiro de 2002 10:24
 To: PHP List; Daniel Alsén
 Subject: [PHP] RE: Printing structure and data of array
 
 
 Foreach($array as $key=$value) ech0($key=$valuebr);
 
 Tim
 www.chessish.com http://www.chessish.com 
 
   --
   From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
   Sent:  20 January 2002 19:33
   To:  PHP List
   Subject:  Printing structure and data of array
 
   Hi,
 
   i know i have this answered before. But i can´t find that mail in
 the
   archive.
 
   How do i print an array to see both the structure and the data
 within?
   (test = value, test2 = value2)...
 
   # Daniel Alsén| www.mindbash.com #
   # [EMAIL PROTECTED]  | +46 704 86 14 92 #
   # ICQ: 63006462   | +46 8 694 82 22  #
   # PGP: http://www.mindbash.com/pgp/  #
   
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Best way to get the remote IP address?

2002-01-22 Thread Antonio S. Martins Jr.

Hi,

  Simply... test for HTTP_X_FORWARDED_FOR if it exists, then your client
are behind a proxy server, the REMOTE_ADDR is the proxy IP, and
HTTP_X_FORWARDED_FOR is the client IP (if not faked by the proxy). 


   hope this helps,

  Antonio.


On Mon, 21 Jan 2002, Bogdan Stancescu wrote:

 I can't seem to find any references to HTTP_X_FORWARDED_FOR in the PDF PHP
 documentation from January 2001, so you should probably best stick with
 either $HTTP_SERVER_VARS['REMOTE_ADDR'] or simply $REMOTE_ADDR (if you use
 $REMOTE_ADDR in functions make sure you do a global on it first) - I
 personally use $REMOTE_ADDR, but you should read the docs for details...
 
 Bogdan
 
 Alan McFarlane wrote:
 
  I'm trying to get the remote IP address of a user in a (PHP) version and
  server-software independant way, but am having a few problems.
 
  Obviously, I've seen $HTTP_SERVER_VARS['REMOTE_ADDR'], but Ive also seen
  references to $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'].
 
  Is there any generic solution to this problem (and if so, what is it?)
 
  Cheers
  --
  Alan McFarlane
  [EMAIL PROTECTED]
  ICQ: 20787656
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Antonio S. Martins Jr. - System Analist |  Only The Shadow Knows   |
| WorldNet Internet Maringa - PR - Brasil |   what evil lurks in the  |
| E-Mail: [EMAIL PROTECTED]  |   Heart of Men!  |
| [EMAIL PROTECTED]   | !!! Linux User: 52392 !!! |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   This e-mail message is 100% Microsoft free!

 /\
 \ /  CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
  X   ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 / \





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Installation: .rpm working with RaQ4 wanted...

2002-01-22 Thread Stefan Rusterholz

Hi

is there a recommendable site where I can find a .rpm (PHP 4.06 or higher) working on 
a Cobalt RaQ4? (I found some for RH6.x  7.x but they didn't work. I got the message 
only packages with major numbers = 3 are supported by this version of RPM)
Any hints are appreciated!

TIA  best regards
Stefan Rusterholz



Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Joffrey van Wageningen

 I dont think its possible without Java programing.

its posible to keep a http connection open and trust on flush() to send some
data to the client, if this data contains javascript you could update a
window or something... if you want to make this safe: make sure you use a
combination of a open http connection with flush() and reload the frame your
flush()'ing time to time (in case of a proxy server)

shoplist for a chat:
* 3 frames: 1 to display incomming data, 1 to have a input field and post to
the server and 1 to receive data from your http stream (could be hidden)

* some javascript to move the data from the http stream window to the
display window

* a db backend and maybe a check (with the post, or the refresh) which lines
have been received by the client

* a cute design :)

with kind regards,
Joffrey van Wageningen
ne2000.nl





Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Bogdan Stancescu

I've been kidding around with a chat experiment of my own a few weeks ago and
stumbled in the same problem with refresh, so I'm quite interested in this
discussion. So, ok, I didn't know about flush() at all, but how do you keep the
http connection open in the first place? Just keep looping in the PHP or is
there a smarter way?

Bogdan

Joffrey van Wageningen wrote:

  I dont think its possible without Java programing.

 its posible to keep a http connection open and trust on flush() to send some
 data to the client, if this data contains javascript you could update a
 window or something... if you want to make this safe: make sure you use a
 combination of a open http connection with flush() and reload the frame your
 flush()'ing time to time (in case of a proxy server)

 shoplist for a chat:
 * 3 frames: 1 to display incomming data, 1 to have a input field and post to
 the server and 1 to receive data from your http stream (could be hidden)

 * some javascript to move the data from the http stream window to the
 display window

 * a db backend and maybe a check (with the post, or the refresh) which lines
 have been received by the client

 * a cute design :)

 with kind regards,
 Joffrey van Wageningen
 ne2000.nl




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to get php to accept spaces in a file name?

2002-01-22 Thread Bogdan Stancescu

rawurlencode() is the answer to your question.

Bogdan

Kevin Garrett wrote:

 Hi guys,

 I've an index script which views the contents of a directory on a unix
 server.  This unix server has also got file with windows naming convesion,
 which makes a file with spaces look like this /this\ is\ an\ example/.
 The file name itself appears fine but there is also a link to the file which
 would only see the /this\  part of the file.

 My question is, does anybody know how to get php to accept spaces in a file
 name?

 Thanks
 Kev

 _
 Join the world’s largest e-mail service with MSN Hotmail.
 http://www.hotmail.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Wolfram Kriesing

if you are using it for debugging try 
   print_r()
OR
   var_dump()


-- 
Wolfram


 function debugPrint($mVar, $bHtml) {
  global $HTTP_REFERER;
  if (is_array($mVar)){
   $sTemp = Array;
  }
  if (is_bool($mVar)){
   $sTemp = Bool;
  }
 [snip]
 ...
  $sFunction = debugPrint$sTemp; //getting the function to
 call to $sFunction($sTemp,$mVar,$bHtml); //calls the fuction
 }


 function debugPrintArray($sTemp,$mVar,$bHtml){
  $sInfo = brtype:  . $sTemp;
  if ($bHtml){
   echo brukey=value/u;
   foreach($mVar as $sKey = $sValue) {
$aFormData[$sKey] = $sValue;
echo bru.$sKey .  = /u;
echo u.$sValue . /u;
debugPrint($sValue,1);
   }
  } else {
  $sInfo = \ntype:  . $sTemp;
   echo key  --  value\n;
   foreach($mVar as $sKey = $sValue) {
$aFormData[$sKey] = $sValue;
echo \n.$sKey .  = ;
echo $sValue;
debugPrint($sValue,1);
   }
  }
 echo $sInfo;
 }

 function debugPrintBool($sTemp,$mVar,$bHtml){
  if ($bHtml){
 [snip]

 I'm not sure, the output 100% right but it should show how to use
 it. I attached the .php file.

 Greets

 - Original Message -
 From: Sandeep Murphy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; PHP List
 [EMAIL PROTECTED] Sent: Tuesday, January 22, 2002 1:51 PM
 Subject: RE: [PHP] RE: Printing structure and data of array

  hi,
 
  Thnx for the info but this is what I am using right now... It
  prints the contents of array one below the other... is not
  showing the format of the contents as i want...:(
 
  any more suggestions??
 
  thnx,
  sands
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: terça-feira, 22 de Janeiro de 2002 12:43
  To: PHP List
  Subject: Re: [PHP] RE: Printing structure and data of array
 
 
  Use this:
 
 
  function debugPrint($mVar, $bHtml) {
   if ($bHtml){
echo pre;
print_r ($mVar);
echo /pre;
   } else {
print_r ($mVar);
   }
  }
 
  call it like this:
 
  debugPrint($yourVariable,1);
 
 
  This will print out any type (object,array,ressource,string...)
 
  - Original Message -
  From: Sandeep Murphy [EMAIL PROTECTED]
  To: 'Tim Ward' [EMAIL PROTECTED]; PHP List
  [EMAIL PROTECTED]
  Sent: Tuesday, January 22, 2002 1:00 PM
  Subject: RE: [PHP] RE: Printing structure and data of array
 
   hi,
  
   how can I display the array exactly as it is the format
   specified???

 like

  if
 
   their exists sub elements of elements, how could I represent
   them in a multidimensional format??
  
   I went thru most of the array functions but unable to adapt any
   of

 them..

   pl help..
  
   TIA,
   sands
  
   -Original Message-
   From: Tim Ward [mailto:[EMAIL PROTECTED]]
   Sent: segunda-feira, 21 de Janeiro de 2002 10:24
   To: PHP List; Daniel Alsén
   Subject: [PHP] RE: Printing structure and data of array
  
  
   Foreach($array as $key=$value) ech0($key=$valuebr);
  
   Tim
   www.chessish.com http://www.chessish.com
  
   --
   From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
   Sent:  20 January 2002 19:33
   To:  PHP List
   Subject:  Printing structure and data of array
  
   Hi,
  
   i know i have this answered before. But i can´t find that mail
   in the
   archive.
  
   How do i print an array to see both the structure and the data
   within?
   (test = value, test2 = value2)...
  
   # Daniel Alsén| www.mindbash.com #
   # [EMAIL PROTECTED]  | +46 704 86 14 92 #
   # ICQ: 63006462   | +46 8 694 82 22  #
   # PGP: http://www.mindbash.com/pgp/  #
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
   [EMAIL PROTECTED]
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
   [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Authentication Pages

2002-01-22 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* On 22-01-02 at 13:49 
* Nicolas Llamosas said

 Where can I find some information about Authentication Pages, login, pass, 
 using php, apache and mysql?

All the usuall places. Have you not seen these sites:
www.phpbuilder.com
www.devshed.com
www.zend.com
They're fundemental to learning PHP (well, almost)
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TW2vHpvrrTa6L5oRAg6iAJ0V/4TK4qt283EajP+uIHYiJOiSJgCdEr4Q
bEyANJX3dqVjNvjQKInUsVk=
=tnfy
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] array_walk inside class method

2002-01-22 Thread S. Murali Krishna


Dear Gyozo

You have sent me the following solution thru php mailing list.
I have also asked you a doubt  about the syntax.

I  want to explain this syntax to my colleagues, could
u
pls point me to any documentation of this syntax or any article.

if possible pls explain yourself if u have time.

It is urgent . pls 


Thanks in Advance

On Mon, 7 Jan 2002, S. Murali Krishna wrote:

 Hi
   Thanks for ur help. 
   Its Working but I couldn't understand the syntax given by u
   can u explain pls.
 
 Thanks again.
 
 
 On Sun, 6 Jan 2002, Gyozo Papp wrote:
 
  it may be better:
  
  array_walk($this-array, array($this, 'func1');
  
  | 
  | 
  |  Hi All,
  |  I want to use array_walk function inside a class method. But the
  |  problem is i want the second argument to array_walk ( function name )
  |  be a another function of the same class. when i gave like that its telling
  | 
  |  Error : function not exist.
  | 
  |  class some()
  |  {
  | 
  |  function func1()
  |  {
  |  }
  |  function func2()
  |  {
  |  array_walk($array,func1);
  |  }
  |  }
  | 
  |  What is the syntax or way to do this.
  | 
  | 
  |  Thanks in Advance.
  | 
  |  S.Murali Krishna
  |  [EMAIL PROTECTED]
  |  =
  |  We grow slow trying to be great
  | 
  | - E. Stanley Jones
  |  -
  | 
  | 
  |  --
  |  PHP General Mailing List (http://www.php.net/)
  |  To unsubscribe, e-mail: [EMAIL PROTECTED]
  |  For additional commands, e-mail: [EMAIL PROTECTED]
  |  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  | 
  | 
  
 
 S.Murali Krishna
 [EMAIL PROTECTED]  
 = 
 We grow slow trying to be great
   
  - E. Stanley Jones
 -
 
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] OOP Problem

2002-01-22 Thread Charles

Hi,

i have create a simple php class to learn how to oop programming, like this:

class mysqldb {
  var $dbconn;

  function OpenCon($DBHOST,$DBUSER,$DBPASS){
$this-dbconn = mysql_connect($DBHOST,$DBUSER,$DBPASS);
  }

}

this is a simple example...

but when i inherit the class, 
php give me a error,
call to undefined function: mysql_connect()

php think that mysql_connect is my private function ?

Charles

Ps. sorry my poor english


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Joffrey van Wageningen

   I dont think its possible without Java programing.

  its posible to keep a http connection open and trust on flush() to send
some
  data to the client, if this data contains javascript you could update a
  window or something... if you want to make this safe: make sure you use
a
  combination of a open http connection with flush() and reload the frame
your
  flush()'ing time to time (in case of a proxy server)

 I've been kidding around with a chat experiment of my own a few weeks ago
and
 stumbled in the same problem with refresh, so I'm quite interested in this
 discussion. So, ok, I didn't know about flush() at all, but how do you
keep the
 http connection open in the first place? Just keep looping in the PHP or
is
 there a smarter way?

the 'smarter' way would be having a client side programming language open a
socket to the server (read: the php script running). the only realy useful
language is javascript becouse flash and java are not portable on some
platforms. the next problem is javascript isnt able (for security reasons)
to open a socket to the outside.

the only way to do (simplex) communication is to leave the http connection
open... by default, the connection is kept open until the php scripts
finishes (or die()'s). by looping php for a sertain amout of time we create
a 'stable' connection to the client.

an example (dont mind my crappy code format/indenting):

html
body
?
// put a new row in /tmp/myfile?
if($new)
  {
  // yup, let us open a file (append modes) and write one line...
  $fp = fopen(/tmp/myfile, a);
  fputs($fp, $new.\n);
  fclose($fp);
  // done, no code left for us, lets die
  }
else
  {
  // no new line, we are in viewing mode
  while(1 == 1)
{
// i feel looped :) open a file, again and again and again :)
$file = file(/tmp/myfile);

// if the file has more lines than the last time we opened it, we should
display some
for($x=$filemax; $x  count($file); $x++)
  echo $file[$x].br;
// here we flush our send queue... the client is getting some data now
flush();

// count the number of lines we have displayed
$filemax = count($file);
// sleep! strange things are appenin' if we dont give a file time to
close when we are appending
sleep(1);
}
  }
?
/body
/html

this example does _not_ handle any file locking and is _verry_ cpu/io
intensive. alot of other solutions could be uses including database query's
or shared memory

the next step is to build a nice interface for this, and maybe send some
'script/script' info instead of plain text

please mind, default php sets a timeout of 30 seconds for completing a php
script. ofcourse we can overrule that:

ini_set(max_execution_time, 3600);

another problem is proxy's and to slow connections, they will reset and your
client wont noice the page is not recieving data anymore... one of my
solutions is to just take resets for granted and build in a reload every 10
seconds with a html meta directive. if we use this we have a problem with
the sequenceing of the data: 'is our last row received'... a javascript
thingy could send a notice to the webserver the client recieved the line...

but thats a choice by the designer of a specific system, every chat has his
own needs of connection integrety.

hope my 5 euro cents help... :)

Joffrey van Wageningen
ne2000.nl


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OOP Problem

2002-01-22 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* On 22-01-02 at 15:08 
* Charles said

 php give me a error,
 call to undefined function: mysql_connect()
 
 php think that mysql_connect is my private function ?
 

obvious question
Have you used mysql functions in that enviornment (without a class)
before?
/obvious question

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TXagHpvrrTa6L5oRAkA3AJ4hf3jkyMdbmURrFF8dIWAhx35yNQCeMWv6
Z0vPc+NdUcJyatDQ0IzZV28=
=TmdC
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Chat REALTIME

2002-01-22 Thread Joffrey van Wageningen

i forgot to mention in my last code sniplet:

just run the script (maybe touch a new file in /tmp and give it readwrite
rights)... you will have a run for 30 seconds (the php timeout)

if you want to add a line edit the file manualy or use the sniplet:

sniplet.php?new=mynewline

:)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Sandeep Murphy


nope...

It continues to print in a single column indexed from 0 to  It does not
print the sub elements as sub elements.

any more ideas???

regards,
sands
-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 22 de Janeiro de 2002 12:56
To: Sandeep Murphy; PHP List
Subject: RE: [PHP] RE: Printing structure and data of array


how about ...

function ShowArray($array)
{   echo(ul);
foreach ($array as $key=$value)
{   echo(li$key)
if (is_array($value))
{   ShowArray($value);
} else
{   echo(=$value);
}
echo(/li)
}
echo(/ul);
} // end of fn ShowArray


Tim
www.chessish.com

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 12:01
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 hi,
 
 how can I display the array exactly as it is the format specified??? like
 if
 their exists sub elements of elements, how could I represent them in a
 multidimensional format??
 
 I went thru most of the array functions but unable to adapt any of them..
 
 pl help..
 
 TIA,
 sands
 
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: segunda-feira, 21 de Janeiro de 2002 10:24
 To: PHP List; Daniel Alsén
 Subject: [PHP] RE: Printing structure and data of array
 
 
 Foreach($array as $key=$value) ech0($key=$valuebr);
 
 Tim
 www.chessish.com http://www.chessish.com 
 
   --
   From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
   Sent:  20 January 2002 19:33
   To:  PHP List
   Subject:  Printing structure and data of array
 
   Hi,
 
   i know i have this answered before. But i can´t find that mail in
 the
   archive.
 
   How do i print an array to see both the structure and the data
 within?
   (test = value, test2 = value2)...
 
   # Daniel Alsén| www.mindbash.com #
   # [EMAIL PROTECTED]  | +46 704 86 14 92 #
   # ICQ: 63006462   | +46 8 694 82 22  #
   # PGP: http://www.mindbash.com/pgp/  #
   
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward

I may have lost the original problem, but I thought you wanted a way of
displaying the structure of an array hierarchy,
e.g.
$fred[0][0] = array(length=10, width=20);
$fred[0][1] = array(length=20, width=30);
$fred[0][2] = array(length=30, width=20);
$fred[0][3] = Hello world;
$fred[1] = another string;

if this isn't what you're trying to do I apologise for misinterpreting the
question

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 14:42
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 
 nope...
 
 It continues to print in a single column indexed from 0 to  It does
 not
 print the sub elements as sub elements.
 
 any more ideas???
 
 regards,
 sands
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: terça-feira, 22 de Janeiro de 2002 12:56
 To: Sandeep Murphy; PHP List
 Subject: RE: [PHP] RE: Printing structure and data of array
 
 
 how about ...
 
 function ShowArray($array)
 { echo(ul);
   foreach ($array as $key=$value)
   {   echo(li$key)
   if (is_array($value))
   {   ShowArray($value);
   } else
   {   echo(=$value);
   }
   echo(/li)
   }
   echo(/ul);
 } // end of fn ShowArray
 
 
   Tim
   www.chessish.com
 
  -Original Message-
  From:   Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
  Sent:   22 January 2002 12:01
  To: 'Tim Ward'; PHP List
  Subject:RE: [PHP] RE: Printing structure and data of array
  
  hi,
  
  how can I display the array exactly as it is the format specified???
 like
  if
  their exists sub elements of elements, how could I represent them in a
  multidimensional format??
  
  I went thru most of the array functions but unable to adapt any of
 them..
  
  pl help..
  
  TIA,
  sands
  
  -Original Message-
  From: Tim Ward [mailto:[EMAIL PROTECTED]]
  Sent: segunda-feira, 21 de Janeiro de 2002 10:24
  To: PHP List; Daniel Alsén
  Subject: [PHP] RE: Printing structure and data of array
  
  
  Foreach($array as $key=$value) ech0($key=$valuebr);
  
  Tim
  www.chessish.com http://www.chessish.com 
  
  --
  From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
  Sent:  20 January 2002 19:33
  To:  PHP List
  Subject:  Printing structure and data of array
  
  Hi,
  
  i know i have this answered before. But i can´t find that mail in
  the
  archive.
  
  How do i print an array to see both the structure and the data
  within?
  (test = value, test2 = value2)...
  
  # Daniel Alsén| www.mindbash.com #
  # [EMAIL PROTECTED]  | +46 704 86 14 92 #
  # ICQ: 63006462   | +46 8 694 82 22  #
  # PGP: http://www.mindbash.com/pgp/  #
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Joffrey van Wageningen

how about:

?
$a = array(dit = array(zus, zo, bla), nog = array(wat, van,
dit = array(is, dat)), bla);

function displayarr($arr)
  {
  $c = ;
  echo array(;
  foreach($arr as $key = $val)
{
if($c)
  echo , ;

if(is_array($key))
  displayarr($key);
else
  echo \.$key.\ = ;

if(is_array($val))
  displayarr($val);
else
  echo \.$val.\;

$c++;
}
  echo );
  }

displayarr($a);

?

it prints the output just like you would enter it in your code...

with kind regards,
Joffrey van Wageningen
ne2000.nl

- Original Message -
From: Sandeep Murphy [EMAIL PROTECTED]
To: 'Tim Ward' [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 3:41 PM
Subject: RE: [PHP] RE: Printing structure and data of array



 nope...

 It continues to print in a single column indexed from 0 to  It does
not
 print the sub elements as sub elements.

 any more ideas???

 regards,
 sands
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: terça-feira, 22 de Janeiro de 2002 12:56
 To: Sandeep Murphy; PHP List
 Subject: RE: [PHP] RE: Printing structure and data of array


 how about ...

 function ShowArray($array)
 { echo(ul);
 foreach ($array as $key=$value)
 { echo(li$key)
 if (is_array($value))
 { ShowArray($value);
 } else
 { echo(=$value);
 }
 echo(/li)
 }
 echo(/ul);
 } // end of fn ShowArray


 Tim
 www.chessish.com

  -Original Message-
  From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
  Sent: 22 January 2002 12:01
  To: 'Tim Ward'; PHP List
  Subject: RE: [PHP] RE: Printing structure and data of array
 
  hi,
 
  how can I display the array exactly as it is the format specified???
like
  if
  their exists sub elements of elements, how could I represent them in a
  multidimensional format??
 
  I went thru most of the array functions but unable to adapt any of
them..
 
  pl help..
 
  TIA,
  sands
 
  -Original Message-
  From: Tim Ward [mailto:[EMAIL PROTECTED]]
  Sent: segunda-feira, 21 de Janeiro de 2002 10:24
  To: PHP List; Daniel Alsén
  Subject: [PHP] RE: Printing structure and data of array
 
 
  Foreach($array as $key=$value) ech0($key=$valuebr);
 
  Tim
  www.chessish.com http://www.chessish.com
 
  --
  From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
  Sent:  20 January 2002 19:33
  To:  PHP List
  Subject:  Printing structure and data of array
 
  Hi,
 
  i know i have this answered before. But i can´t find that mail in
  the
  archive.
 
  How do i print an array to see both the structure and the data
  within?
  (test = value, test2 = value2)...
 
  # Daniel Alsén| www.mindbash.com #
  # [EMAIL PROTECTED]  | +46 704 86 14 92 #
  # ICQ: 63006462   | +46 8 694 82 22  #
  # PGP: http://www.mindbash.com/pgp/  #
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OOP Problem

2002-01-22 Thread Sam Masiello


Hi there!

It sounds like you do not have mysql support compiled into PHP.  You didn't
say if you were using PHP on Windows or Linux so you might want to read the
documentation for the respective version that you have downloaded to find
out how to compile MySQL support into your PHP installation.

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 X289
[EMAIL PROTECTED]

- Original Message -
From: Charles [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 10:25 AM
Subject: [PHP] OOP Problem


 Hi,

 i have create a simple php class to learn how to oop programming, like
this:

 class mysqldb {
   var $dbconn;

   function OpenCon($DBHOST,$DBUSER,$DBPASS){
 $this-dbconn = mysql_connect($DBHOST,$DBUSER,$DBPASS);
   }

 }

 this is a simple example...

 but when i inherit the class,
 php give me a error,
 call to undefined function: mysql_connect()

 php think that mysql_connect is my private function ?

 Charles

 Ps. sorry my poor english


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Bogdan Stancescu

 the 'smarter' way would be having a client side programming language open a
 socket to the server (read: the php script running). the only realy useful
 language is javascript becouse flash and java are not portable on some
 platforms. the next problem is javascript isnt able (for security reasons)
 to open a socket to the outside.

Been there, done that (i.e. already thought about these).

 the only way to do (simplex) communication is to leave the http connection
 open... by default, the connection is kept open until the php scripts
 finishes (or die()'s). by looping php for a sertain amout of time we create
 a 'stable' connection to the client.

Been here too - that's why my original question looks the way it does. So, the
answer is actually No, there's no smarter way than looping in the PHP - am I
correct?

 an example (dont mind my crappy code format/indenting):

 $file = file(/tmp/myfile);
 for($x=$filemax; $x  count($file); $x++)
   echo $file[$x].br;

I especially liked the bit above. Never used file() myself so the code looked
quite awkward at first glance...

 this example does _not_ handle any file locking and is _verry_ cpu/io
 intensive. alot of other solutions could be uses including database query's
 or shared memory

Another feature of PHP I always overlooked! I'm learning of a lot of overlooked
features from your e-mail!

 ini_set(max_execution_time, 3600);

You could also do a set_time_limit(30) INSIDE the loop. This resets the timeout
counter, so it's a better option.

 the sequenceing of the data: 'is our last row received'... a javascript
 thingy could send a notice to the webserver the client recieved the line...

...which further speeds down the overall process, plus induces a lot of delays
which have to be dealt with (quite complicated, I must say). I think simply
reloading from time to time and sending the last 10 lines for example might be a
better solution.

 hope my 5 euro cents help... :)

Yes, they did - you opened my eyes to a couple of useful but neglected features
of PHP.

Thanks for taking the time to answer!

Bogdan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] changing unix password in php?

2002-01-22 Thread Mehmet Kamil ERISEN

I have not done it, but i can be done by using a form and
calling the shell script that does the job.
Of course shell script has to be executable by everybody.
It may be a security concern.
or, you can add the shell script to your cron tab.
and keep the password change requests in a file and change
the passwords every 10 minutes or so. 

--- Charlie Grosvenor [EMAIL PROTECTED]
wrote:
 Hi
 I would like to create a page in php where a user can
 change their unix password, does anybody know how i can
 do this?
 
 Thankyou
 
 Charlie
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OOP Problem

2002-01-22 Thread Anas Mughal

send us the code that inherits your mysqldb class...


--- Charles [EMAIL PROTECTED] wrote:
 Hi,
 
 i have create a simple php class to learn how to oop
 programming, like this:
 
 class mysqldb {
   var $dbconn;
 
   function OpenCon($DBHOST,$DBUSER,$DBPASS){
   $this-dbconn =
 mysql_connect($DBHOST,$DBUSER,$DBPASS);
   }
 
 }
 
 this is a simple example...
 
 but when i inherit the class, 
 php give me a error,
 call to undefined function: mysql_connect()
 
 php think that mysql_connect is my private function
 ?
 
 Charles
 
 Ps. sorry my poor english
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Anas Mughal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel: 973-249-6665

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Sandeep Murphy


Hey!

No need to apologise!!! If it werent for guys like u newbies like us would
hv a head full of grey hair!! honestly, methinks u guys rock!!

well, coming bak to the problem, I guess I have the posted the same problem
a few times in this list and receiving none or different answers

may i am asking a bit too much wud appreciate if anyone has the time to help
me out...:)

for clarity sake, i am going to explain my problem again If anything is
missing, pl lemme know..


I have an XML tree which I am parsing using DOM...

The tree has elements, sub elements and attributes like the following:

app // MAIN APP  (can hv any number of sub applications)
namesan/name
age23/age
   app// THIS IS AN SUB APPLICATION 
 namesan/name
 age23/age
url type=defaultyahoo.com/url
   /app   
/app
app
/app   and so on...

the elements are being stored consecutively in the array and displays them
as such, which is not how I want 

The array shud output such that the main app and sub app are distinguishable
from each other..

Thnx again...

sands
-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 22 de Janeiro de 2002 14:48
To: Sandeep Murphy; PHP List
Subject: RE: [PHP] RE: Printing structure and data of array


I may have lost the original problem, but I thought you wanted a way of
displaying the structure of an array hierarchy,
e.g.
$fred[0][0] = array(length=10, width=20);
$fred[0][1] = array(length=20, width=30);
$fred[0][2] = array(length=30, width=20);
$fred[0][3] = Hello world;
$fred[1] = another string;

if this isn't what you're trying to do I apologise for misinterpreting the
question

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 14:42
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 
 nope...
 
 It continues to print in a single column indexed from 0 to  It does
 not
 print the sub elements as sub elements.
 
 any more ideas???
 
 regards,
 sands
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: terça-feira, 22 de Janeiro de 2002 12:56
 To: Sandeep Murphy; PHP List
 Subject: RE: [PHP] RE: Printing structure and data of array
 
 
 how about ...
 
 function ShowArray($array)
 { echo(ul);
   foreach ($array as $key=$value)
   {   echo(li$key)
   if (is_array($value))
   {   ShowArray($value);
   } else
   {   echo(=$value);
   }
   echo(/li)
   }
   echo(/ul);
 } // end of fn ShowArray
 
 
   Tim
   www.chessish.com
 
  -Original Message-
  From:   Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
  Sent:   22 January 2002 12:01
  To: 'Tim Ward'; PHP List
  Subject:RE: [PHP] RE: Printing structure and data of array
  
  hi,
  
  how can I display the array exactly as it is the format specified???
 like
  if
  their exists sub elements of elements, how could I represent them in a
  multidimensional format??
  
  I went thru most of the array functions but unable to adapt any of
 them..
  
  pl help..
  
  TIA,
  sands
  
  -Original Message-
  From: Tim Ward [mailto:[EMAIL PROTECTED]]
  Sent: segunda-feira, 21 de Janeiro de 2002 10:24
  To: PHP List; Daniel Alsén
  Subject: [PHP] RE: Printing structure and data of array
  
  
  Foreach($array as $key=$value) ech0($key=$valuebr);
  
  Tim
  www.chessish.com http://www.chessish.com 
  
  --
  From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
  Sent:  20 January 2002 19:33
  To:  PHP List
  Subject:  Printing structure and data of array
  
  Hi,
  
  i know i have this answered before. But i can´t find that mail in
  the
  archive.
  
  How do i print an array to see both the structure and the data
  within?
  (test = value, test2 = value2)...
  
  # Daniel Alsén| www.mindbash.com #
  # [EMAIL PROTECTED]  | +46 704 86 14 92 #
  # ICQ: 63006462   | +46 8 694 82 22  #
  # PGP: http://www.mindbash.com/pgp/  #
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Prev Next Buttons

2002-01-22 Thread Alawi


How cam I make Prev Next Buttons with 

ODBC+ACCESS XP by PHP :(




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Joffrey van Wageningen

 i haven't been following this, but have you guys thought of ircg?
 http://php.net/ircg

ircg is a lot of fun and could be used as the server system for message
management, the real problem is how to get the data  to the client without
use of a socket

ircg also needs an ircd which is a little to bloated[1] for a simple
solution for a realtime chat :)

/me is taking a extra jolt on ircg :)

Joffrey van Wageningen
ne2000.nl
--
[1]
bloat·ed (bltd)
adj.
  1.. Much bigger than desired: a bloated bureaucracy; a bloated budget.
  2.. Medicine. Swollen or distended beyond normal size by fluid or gaseous
material.




Re: [PHP] Prev Next Buttons

2002-01-22 Thread Joffrey van Wageningen

phpbuilder has a good article on prevnext buttons, the code is based on
mysql but take a look at the mysql  odbc functions... view, compare and
adjust to your needs:

http://www.phpbuilder.com/columns/rod20001214.php3

with kind regards,
Joffrey van Wageningen
ne2000.nl

- Original Message -
From: Alawi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 4:06 PM
Subject: [PHP] Prev Next Buttons



How cam I make Prev Next Buttons with

ODBC+ACCESS XP by PHP :(




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Chat REALTIME

2002-01-22 Thread Emile Bosch

it's kinda impossible since HTTP is a STATELESS PROTOCOL


Nuno Mariz [EMAIL PROTECTED] wrote in message
1011695546.3467.5.camel@sputnik">news:1011695546.3467.5.camel@sputnik...
 I need to build a php-chat (online support system), but in realtime.
 I've develope a system that refresh in browser client in 5 seconds. But
 i need a system that works in realtime, what i meen is when a client or
 the server send a message, the browser refresh when a message was sent.
 All this without JAVA.

 thanx




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Joel Boonstra

 I need to build a php-chat (online support system), but in realtime.
 I've develope a system that refresh in browser client in 5 seconds. But
 i need a system that works in realtime, what i meen is when a client or
 the server send a message, the browser refresh when a message was sent.
 All this without JAVA.

Have you thought about using a pre-built system:

  http://www.phplivesupport.com/web/phplive_web/

It does cost money (one-time fee, no recurring fee), but I would imagine
that spending time to build one yourself would also cost money (in terms
of time).

I have never used it, but it definitely looks to be worthwhile.

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward

I understand now, your problem is not how display the array but how to get
it in a meaningful structure in the first place
i.e.
$app[0][name] = san;
$app[0][age] = 23;
$app[0][app][name] = san;
$app[0][app][age] = 23;
etc.
is that valid XML? (I'm not that up on XML and can't find anything in the
docs). If so you'll need to do some fancier regular expression stuff than
you already are to separate out the sub-application

Tim
www.chessish.com

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 15:25
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 
 Hey!
 
 No need to apologise!!! If it werent for guys like u newbies like us would
 hv a head full of grey hair!! honestly, methinks u guys rock!!
 
 well, coming bak to the problem, I guess I have the posted the same
 problem
 a few times in this list and receiving none or different answers
 
 may i am asking a bit too much wud appreciate if anyone has the time to
 help
 me out...:)
 
 for clarity sake, i am going to explain my problem again If anything
 is
 missing, pl lemme know..
 
 
 I have an XML tree which I am parsing using DOM...
 
 The tree has elements, sub elements and attributes like the following:
 
 app // MAIN APP  (can hv any number of sub applications)
   namesan/name
   age23/age
  app// THIS IS AN SUB APPLICATION 
namesan/name
age23/age
   url type=defaultyahoo.com/url
  /app   
 /app
 app
 /app   and so on...
 
 the elements are being stored consecutively in the array and displays them
 as such, which is not how I want 
 
 The array shud output such that the main app and sub app are
 distinguishable
 from each other..
 
 Thnx again...
 
 sands
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: terça-feira, 22 de Janeiro de 2002 14:48
 To: Sandeep Murphy; PHP List
 Subject: RE: [PHP] RE: Printing structure and data of array
 
 
 I may have lost the original problem, but I thought you wanted a way of
 displaying the structure of an array hierarchy,
 e.g.
 $fred[0][0] = array(length=10, width=20);
 $fred[0][1] = array(length=20, width=30);
 $fred[0][2] = array(length=30, width=20);
 $fred[0][3] = Hello world;
 $fred[1] = another string;
 
 if this isn't what you're trying to do I apologise for misinterpreting the
 question
 
   Tim Ward
   Senior Systems Engineer
 
 Please refer to the following disclaimer in respect of this message:
 http://www.stivesdirect.com/e-mail-disclaimer.html
 
  -Original Message-
  From:   Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
  Sent:   22 January 2002 14:42
  To: 'Tim Ward'; PHP List
  Subject:RE: [PHP] RE: Printing structure and data of array
  
  
  nope...
  
  It continues to print in a single column indexed from 0 to  It does
  not
  print the sub elements as sub elements.
  
  any more ideas???
  
  regards,
  sands
  -Original Message-
  From: Tim Ward [mailto:[EMAIL PROTECTED]]
  Sent: terça-feira, 22 de Janeiro de 2002 12:56
  To: Sandeep Murphy; PHP List
  Subject: RE: [PHP] RE: Printing structure and data of array
  
  
  how about ...
  
  function ShowArray($array)
  {   echo(ul);
  foreach ($array as $key=$value)
  {   echo(li$key)
  if (is_array($value))
  {   ShowArray($value);
  } else
  {   echo(=$value);
  }
  echo(/li)
  }
  echo(/ul);
  } // end of fn ShowArray
  
  
  Tim
  www.chessish.com
  
   -Original Message-
   From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
   Sent: 22 January 2002 12:01
   To:   'Tim Ward'; PHP List
   Subject:  RE: [PHP] RE: Printing structure and data of array
   
   hi,
   
   how can I display the array exactly as it is the format specified???
  like
   if
   their exists sub elements of elements, how could I represent them in a
   multidimensional format??
   
   I went thru most of the array functions but unable to adapt any of
  them..
   
   pl help..
   
   TIA,
   sands
   
   -Original Message-
   From: Tim Ward [mailto:[EMAIL PROTECTED]]
   Sent: segunda-feira, 21 de Janeiro de 2002 10:24
   To: PHP List; Daniel Alsén
   Subject: [PHP] RE: Printing structure and data of array
   
   
   Foreach($array as $key=$value) ech0($key=$valuebr);
   
   Tim
   www.chessish.com http://www.chessish.com 
   
 --
 From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
 Sent:  20 January 2002 19:33
 To:  PHP List
 Subject:  Printing structure and data of array
   
 Hi,
   
 i know i have this answered before. But i can´t find that mail in
   the
 archive.
   
 How do i print an array to see both the structure and the data
   within?
 (test = value, test2 = value2)...
   
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL 

RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Sandeep Murphy

exactly!
fancier regular expression is what I am looking for here:)

thnx anyway...

if anyone else has any suggestions.. welcome...

regards,

sands


-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 22 de Janeiro de 2002 16:13
To: Sandeep Murphy; Tim Ward; PHP List
Subject: RE: [PHP] RE: Printing structure and data of array


I understand now, your problem is not how display the array but how to get
it in a meaningful structure in the first place
i.e.
$app[0][name] = san;
$app[0][age] = 23;
$app[0][app][name] = san;
$app[0][app][age] = 23;
etc.
is that valid XML? (I'm not that up on XML and can't find anything in the
docs). If so you'll need to do some fancier regular expression stuff than
you already are to separate out the sub-application

Tim
www.chessish.com

 -Original Message-
 From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
 Sent: 22 January 2002 15:25
 To:   'Tim Ward'; PHP List
 Subject:  RE: [PHP] RE: Printing structure and data of array
 
 
 Hey!
 
 No need to apologise!!! If it werent for guys like u newbies like us would
 hv a head full of grey hair!! honestly, methinks u guys rock!!
 
 well, coming bak to the problem, I guess I have the posted the same
 problem
 a few times in this list and receiving none or different answers
 
 may i am asking a bit too much wud appreciate if anyone has the time to
 help
 me out...:)
 
 for clarity sake, i am going to explain my problem again If anything
 is
 missing, pl lemme know..
 
 
 I have an XML tree which I am parsing using DOM...
 
 The tree has elements, sub elements and attributes like the following:
 
 app // MAIN APP  (can hv any number of sub applications)
   namesan/name
   age23/age
  app// THIS IS AN SUB APPLICATION 
namesan/name
age23/age
   url type=defaultyahoo.com/url
  /app   
 /app
 app
 /app   and so on...
 
 the elements are being stored consecutively in the array and displays them
 as such, which is not how I want 
 
 The array shud output such that the main app and sub app are
 distinguishable
 from each other..
 
 Thnx again...
 
 sands
 -Original Message-
 From: Tim Ward [mailto:[EMAIL PROTECTED]]
 Sent: terça-feira, 22 de Janeiro de 2002 14:48
 To: Sandeep Murphy; PHP List
 Subject: RE: [PHP] RE: Printing structure and data of array
 
 
 I may have lost the original problem, but I thought you wanted a way of
 displaying the structure of an array hierarchy,
 e.g.
 $fred[0][0] = array(length=10, width=20);
 $fred[0][1] = array(length=20, width=30);
 $fred[0][2] = array(length=30, width=20);
 $fred[0][3] = Hello world;
 $fred[1] = another string;
 
 if this isn't what you're trying to do I apologise for misinterpreting the
 question
 
   Tim Ward
   Senior Systems Engineer
 
 Please refer to the following disclaimer in respect of this message:
 http://www.stivesdirect.com/e-mail-disclaimer.html
 
  -Original Message-
  From:   Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
  Sent:   22 January 2002 14:42
  To: 'Tim Ward'; PHP List
  Subject:RE: [PHP] RE: Printing structure and data of array
  
  
  nope...
  
  It continues to print in a single column indexed from 0 to  It does
  not
  print the sub elements as sub elements.
  
  any more ideas???
  
  regards,
  sands
  -Original Message-
  From: Tim Ward [mailto:[EMAIL PROTECTED]]
  Sent: terça-feira, 22 de Janeiro de 2002 12:56
  To: Sandeep Murphy; PHP List
  Subject: RE: [PHP] RE: Printing structure and data of array
  
  
  how about ...
  
  function ShowArray($array)
  {   echo(ul);
  foreach ($array as $key=$value)
  {   echo(li$key)
  if (is_array($value))
  {   ShowArray($value);
  } else
  {   echo(=$value);
  }
  echo(/li)
  }
  echo(/ul);
  } // end of fn ShowArray
  
  
  Tim
  www.chessish.com
  
   -Original Message-
   From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]]
   Sent: 22 January 2002 12:01
   To:   'Tim Ward'; PHP List
   Subject:  RE: [PHP] RE: Printing structure and data of array
   
   hi,
   
   how can I display the array exactly as it is the format specified???
  like
   if
   their exists sub elements of elements, how could I represent them in a
   multidimensional format??
   
   I went thru most of the array functions but unable to adapt any of
  them..
   
   pl help..
   
   TIA,
   sands
   
   -Original Message-
   From: Tim Ward [mailto:[EMAIL PROTECTED]]
   Sent: segunda-feira, 21 de Janeiro de 2002 10:24
   To: PHP List; Daniel Alsén
   Subject: [PHP] RE: Printing structure and data of array
   
   
   Foreach($array as $key=$value) ech0($key=$valuebr);
   
   Tim
   www.chessish.com http://www.chessish.com 
   
 --
 From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
 Sent:  20 January 2002 

[PHP] strange behaviour of mysql_pconnect()

2002-01-22 Thread Jimmy

Hi list,

I do a small test on mysql_connect() and mysql_pconnect(),
and discover a strange behaviour.

?
$cid1 = mysql_pconnect($host,$user,$pass) or die(cant connect1);
$cid2 = mysql_pconnect($host,$user,$pass) or die(cant connect2);
echo $cid1, $cid2;
?

the output if using mysql_connect():
Resource id #1
Resource id #1
(both resource id are the same, as expected)

the output if using mysql_pconnect():
Resource id #1
Resource id #2
(both resource id are different)

at first I though pconnect() will create 2 different connection
because the printed resource id is different.

But after doing some test (by looking at the mysql processlist) i can
conclude that those two link_identifier are actually the same
(only one link, but with two different id)

the question is, why pconnect() print different resource id,
whereas connect() print the same one?

--
Jimmy

You can't quicken the growing of a plant by pulling the leaves



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strange behaviour of mysql_pconnect()

2002-01-22 Thread Shane Wright


Actually, I'd be interested to know why the same connection is used for two 
connections to the same database?

I'm guessing people could fall over this trying to do, say, unbuffered 
queries through one to fetch a huge result set, and normal queries through 
another to make changes

Of course thats not really a good thing to do anyways...

--
Shane

On Tuesday 22 Jan 2002 4:27 pm, Jimmy wrote:
 Hi list,

 I do a small test on mysql_connect() and mysql_pconnect(),
 and discover a strange behaviour.

 ?
 $cid1 = mysql_pconnect($host,$user,$pass) or die(cant connect1);
 $cid2 = mysql_pconnect($host,$user,$pass) or die(cant connect2);
 echo $cid1, $cid2;
 ?

 the output if using mysql_connect():
 Resource id #1
 Resource id #1
 (both resource id are the same, as expected)

 the output if using mysql_pconnect():
 Resource id #1
 Resource id #2
 (both resource id are different)

 at first I though pconnect() will create 2 different connection
 because the printed resource id is different.

 But after doing some test (by looking at the mysql processlist) i can
 conclude that those two link_identifier are actually the same
 (only one link, but with two different id)

 the question is, why pconnect() print different resource id,
 whereas connect() print the same one?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to get php to accept spaces in a file name?

2002-01-22 Thread Kevin Garrett


Thanks Bogdan,

From: Bogdan Stancescu [EMAIL PROTECTED]
To: Kevin Garrett [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] How to get php to accept spaces in a file name?
Date: Tue, 22 Jan 2002 15:30:39 +0200

rawurlencode() is the answer to your question.

Bogdan

Kevin Garrett wrote:

  Hi guys,
 
  I've an index script which views the contents of a directory on a unix
  server.  This unix server has also got file with windows naming 
convesion,
  which makes a file with spaces look like this /this\ is\ an\ example/.
  The file name itself appears fine but there is also a link to the file 
which
  would only see the /this\  part of the file.
 
  My question is, does anybody know how to get php to accept spaces in a 
file
  name?
 
  Thanks
  Kev
 
  _
  Join the world’s largest e-mail service with MSN Hotmail.
  http://www.hotmail.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strange behaviour of mysql_pconnect()

2002-01-22 Thread Jimmy

Hi Shane,

 Actually, I'd be interested to know why the same connection is used for two
 connections to the same database?
 I'm guessing people could fall over this trying to do, say, unbuffered
 queries through one to fetch a huge result set, and normal queries through 
 another to make changes

nope...
as i've said before, this is only a testing script, not a real one.

I come across this testing when discussing about how many
same persistent connection can be opened to mysql.
I believe there will always be exactly only one same connection
(same connection = same host and same username), regardless of
using connect() or pconnect().

but then someone make a small testing, by doing 2 same pconnect()
and printing the returned link_identifier, which surprisingly return 2
different id.

--
Jimmy

There is no greater waste as a waste of time



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SimpleTemplate, each template configurable individually

2002-01-22 Thread Wolfram Kriesing

just to announce that SimpleTemplate is also capable now of 
configuring each template individually
you either write a block like this:

SimpleTemplate
options override=yes
delimiter begin=[ end=]/
autoBraces value=true/
locale value=en/
/options
/SimpleTemplate

in your template file or in a seperate config-file, which can be 
laying in the path to this template
this gives designers (template creators) the choice to use settings 
of their preference

this feature is realized using the Tree-class which can handle XML 
structures

have a look at
http://wolfram.kriesing.de/programming

by the way: this template can also translate your templates, without 
using a function call around every string ... have a look
examples are also avaiable at the url given above


-- 
Wolfram

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PEAR-DEV] New Metabase Aniversary release

2002-01-22 Thread Lukas Smith

Hi,

so for all who care:
I will begin pearifying Metabase starting next week.
Obviously this will take a fair amount of time. Also I am fairly busy
with work so any help is greatly appreciated.

This is also my first stab at reworking such a huge amount of code that
was originally written by someone else. I am quite optimistic that it
will work out though (with the megabytes of code my companies framework
fills sometimes that code feels alien too :-)  ) and I am allready quite
aqainted with the Metabase code. I am not very experienced with PEAR DB
code though so it is very important for people to tell me what features
are missing from Metabase that are included in PEAR now. I also would
like to hear where people think the issues will be (and possibly how to
solve them).

Aside from the fact that the Metabase class is not derived from the PEAR
core class there are a couple of things, like being able to retrieve and
associative array from a result set, missing from Metabase.

The goal is to have a DB abstraction layer based on Metabase with a PEAR
DB API. The outcome will be compatible with both Metabase and PEAR DB
where necessary through a wrapper class.

I also would like to hear if anyone uses Metabase with using the API in
metabase_interface.php .. if there are not many people using it then all
then I can safely modify the method names and parameters orders in the
new DB class and make the same changes to metabase_interface.php.

I guess after getting a good idea where the problem zones are and not
what features are missing I will first attempt to get a pearified
version of Metabase along with the MySQL driver working.

I will first focus on the functional aspects, then step by step making
the necessary changes to make that final code compliant to the PEAR
coding standard.

FYI: there has been a lot of discussion about this project in the last
couple months (especially december irrc) on the pear-dev mailinglist. So
some questions might allready be answered there.

Best regards,
Lukas Smith
[EMAIL PROTECTED]
___
 DybNet Internet Solutions GbR
 Alt Moabit 89
 10559 Berlin
 Germany
 Tel. : +49 30 83 22 50 00
 Fax : +49 30 83 22 50 07
 www.dybnet.de [EMAIL PROTECTED]
___


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SQL / PHP Join issue.

2002-01-22 Thread Michael O'Neal

Hi,

I'm having a little trouble with this join statement I'm working on.  What I
*think* is happening is that PHP is getting confused with the ID field
that is the same for the three different tables.  When I go through the
result set, you can see that the field ID gets used a couple of times.  I
have since tried to change the result set to call out the table as well (as
in calendar.ID, but that didn't work.  How can I give each ID field a
unique value to be used in the variables?

Here's my code:

$sql =SELECT calendar.ID,calendar.Calendar_Title,calendar.Add_To_Scroller,
   careers.id,careers.title,careers.Add_To_Scroller,
   
menu_specials.ID,menu_specials.Menu_Description,menu_specials.Add_To_Scrolle
r 
   FROM calendar,careers,menu_specials
   WHERE calendar.Add_To_Scroller = 2
   AND careers.Add_To_Scroller = 2
   AND menu_specials.Add_To_Scroller = 2;

$result = @mysql_query($sql, $connection) or die(Error #. mysql_errno() .
:  . mysql_error());

while ($row = mysql_fetch_array($result)) {
$calendar_ID=$row['ID'];
$calendar_Calendar_Title=$row['Calendar_Title'];
$calendar_Add_To_Scroller=$row['Add_To_Scroller'];
$careers_id=$row['id'];
$careers_title=$row['title'];
$careers_Add_To_Scroller=$row['Add_To_Scroller'];
$menu_specials_ID=$row['ID'];
$menu_specials_Menu_Description=$row['Menu_Description'];
$menu_specials_Add_To_Scroller=$row['Add_To_Scroller'];


$display_block .= Latest News -
$calendar_Calendar_Title|http://skunkworks.thinkmango.com/canyon/calendar/de
tail_action.php?ID=$calendar_ID|_self
Looking for a hot job? -
$careers_title|http://skunkworks.thinkmango.com/scroll/careers/career_detail
.php?id=$careers_id|_self
Great Deals on Great Food! -
$menu_specials_Menu_Description|http://skunkworks.thinkmango.com/scroll/menu
/menu_detail.php?ID=$menu_specials_ID|_self;


}

Thanks in advance!


mto

-- 

Michael O'Neal
Web Producer
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL / PHP Join issue.

2002-01-22 Thread clint

You need to either alias the columns i.e. career.id as careerid or rename your columns 
i.e. change the id to careerid  calendarid. The second option would be best because 
that way your columns are descriptive.

HTH
Clint

-- Original Message --
From: Michael O'Neal [EMAIL PROTECTED]
Date: Tue, 22 Jan 2002 10:23:20 -0700

Hi,

I'm having a little trouble with this join statement I'm working on.  What I
*think* is happening is that PHP is getting confused with the ID field
that is the same for the three different tables.  When I go through the
result set, you can see that the field ID gets used a couple of times.  I
have since tried to change the result set to call out the table as well (as
in calendar.ID, but that didn't work.  How can I give each ID field a
unique value to be used in the variables?

Here's my code:

$sql =SELECT calendar.ID,calendar.Calendar_Title,calendar.Add_To_Scroller,
   careers.id,careers.title,careers.Add_To_Scroller,
   
menu_specials.ID,menu_specials.Menu_Description,menu_specials.Add_To_Scrolle
r 
   FROM calendar,careers,menu_specials
   WHERE calendar.Add_To_Scroller = 2
   AND careers.Add_To_Scroller = 2
   AND menu_specials.Add_To_Scroller = 2;

$result = @mysql_query($sql, $connection) or die(Error #. mysql_errno() .
:  . mysql_error());

while ($row = mysql_fetch_array($result)) {
$calendar_ID=$row['ID'];
$calendar_Calendar_Title=$row['Calendar_Title'];
$calendar_Add_To_Scroller=$row['Add_To_Scroller'];
$careers_id=$row['id'];
$careers_title=$row['title'];
$careers_Add_To_Scroller=$row['Add_To_Scroller'];
$menu_specials_ID=$row['ID'];
$menu_specials_Menu_Description=$row['Menu_Description'];
$menu_specials_Add_To_Scroller=$row['Add_To_Scroller'];


$display_block .= Latest News -
$calendar_Calendar_Title|http://skunkworks.thinkmango.com/canyon/calendar/de
tail_action.php?ID=$calendar_ID|_self
Looking for a hot job? -
$careers_title|http://skunkworks.thinkmango.com/scroll/careers/career_detail
.php?id=$careers_id|_self
Great Deals on Great Food! -
$menu_specials_Menu_Description|http://skunkworks.thinkmango.com/scroll/menu
/menu_detail.php?ID=$menu_specials_ID|_self;


}

Thanks in advance!


mto

-- 

Michael O'Neal
Web Producer
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help is_dir command driving me crazy!

2002-01-22 Thread Dean Dunn

Can anyone tell me why this script doesn't work properly. I've coded it
several others ways including using is_dir pointing to the full path.
Nothing works reliably, it works sometimes/sometimes not.

One interesting thing is that my PHP ecommerce app (osCommrce) is run and
then my script is run it always seems to work. This to me points to some
form of initialisation I'm missing.

Any advice would be gratefully received.

Regards,

Dean (a new PHP user)

Code Follows

?php

$dir_path = \Inetpub\wwwroot\catalog\images;
$dir = abc;
$complete_path = $dir_path\\$dir;
$dir_exists = Directory already exists...can not create againBR;
$dir_not_exist = Directory does not exist...will try and create new
directoryBR;
$dir_create_success = Directory createdBR;
$dir_create_failure = Could not create directoryBR;

print (Checking to see if subdirectory \B$dir_path\\$dir /B\
existsBRBR);

if (is_dir($complete_path) == true)
 {
 print $dir_exists;
 }

else
 {
 print $dir_not_exist;
 chdir ($dir_path);
 if (mkdir (abc,0700) == true) {
 print $dir_create_success; }
  else { print $dir_create_failure; }
  }
?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Rodolfo Gonzalez

On Tue, 22 Jan 2002, Joffrey van Wageningen wrote:
 socket to the server (read: the php script running). the only realy useful
 language is javascript becouse flash and java are not portable on some
 platforms. the next problem is javascript isnt able (for security reasons)
 to open a socket to the outside.

But it would be better to have just a server written in C/C++/whatever and
then a Java applet to connect to the server from the browser, just as
almost every chat around the www do (even an IRC server would do the job
propperly secured). Disadvantages:  the browser must support Java applets
(not a big deal anyway, since with an HTML chat you'll most likely need
frames). I see this solution simpler.

Regards.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] MySQL 4.x's SSL connections from PHP.

2002-01-22 Thread Rodolfo Gonzalez

Hi list,

again with my question, but now a bit different: I guess the current
version of PHP doesn't support the connection to a MySQL server using the
SSL features provided by the 4.x series of MySQL for an encrypted
connection (correct me if I'm wrong, please). Is it planned to include
this support in a near version?.

Thank you.
Rodolfo.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Templates: how to get that HTML outta my templates!

2002-01-22 Thread Mikusch, Rita

Sorry for bringing this topic up yet again, but I'm having a real problem
with the details of implementing a templates system. I'm read all the
tutorials, articles, emails etc, but was hoping others on this list with the
same problems could share how they solved them.

Now I understand the basic logic of a template system: separate the client
side code (html, javascript) from the PHP. That way I can write my PHP
modules then hand them off to the HTML programmers and designers to
implement in their webpages.

Two ways to do this (that I can think of at the moment) would be to use PHP
functions ?php create_main_menu(); ?, or to use include files ?php
include(main_menu.php3); ?.

The problem is that I use PHP throughout my webpages and find it very
difficult to elegantly separate the HTML and PHP code. I use it for main
menus, sub menus, titles, page listings, article listings, next-page links,
random image generation, etc etc. 

As an example lets look at a menu. There are a lot of ways that menu could
be designed. The designer could have a little icon in front of each menu
item, or behind each menu item, or have a special background colour, or
special font colour, etc etc etc. The list is endless. The PHP code is going
to have to loop through that menu array, display each menu item, then add
the appropriate html for that menu item. How the heck do I separate the HTML
and PHP here? One option I thought of was to create a PHP function with the
HTML design components making up the function's arguments. Ie, argument one
would be the name of the mouse-over image in front of each  menu item,
argument two would be it's height, argument three would be it's width. etc
etc ad infinitem. What a mess! You would end up with an insane number of
arguements.

How do users of template systems deal with these problems? 

I work in a very small tech department (there are four of us, and I do all
the PHP coding) and found it was easiest in the long run to just divide up
the webpages into components and turn these components into include files.
For example, the main menu component, sub menu component, page list
component, page contents component, etc etc. Each component is a full
autonomous table that can can easily pop into the basic table structure of a
website. (I've found that dividing up one table into two or more files is
just confusing!) 

Others in the department who are designing a webpage to which I'll be adding
PHP components just use sample data for menus, page content, etc. I take a
look at it then, make sure the design is database-driven content friendly,
then add the php bits. 

When you use template driven websites, do you find there are certain
projects they work better for. Are they more appropriate for larger websites
with larger groups of people working on them?

I'd really be interested in other people's solutions and experiences!

Thanks, Rita.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SQL / PHP Join issue. - SOLVED

2002-01-22 Thread Michael O'Neal

Hi all. Never mind my previous post.  I fixed my SQL statements by using
AS statements.

For example:

SELECT calendar.ID AS calendar_ID,calendar.Calendar_Title AS
Calendar_Title,calendar.Add_To_Scroller AS calendar_Add_To_Scroller...



That worked like I wanted it to.

Thanks!


mto

-- 

Michael O'Neal
Web Producer
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How should I cache database data for php?

2002-01-22 Thread Robert V. Zwink

I use cachedFastTemplate for caching Dynamic content.
http://px.sklar.com/code.html?code_id=312

Used in conjection with FastTemplate class.  Very useful.

Also see:
http://www.php.net/manual/en/function.ob-start.php

Output buffering in php can be used to cache dynamic content.

Robert V. Zwink
http://www.zwink.net/daid.php






-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 22, 2002 7:09 AM
To: Jeff Bearer; [EMAIL PROTECTED]
Subject: Fw: [PHP] How should I cache database data for php?


Jeff,

 =sorry, I wish I could remember where I saw that article.

=Have had another quick look around this morning, but to no avail.

=Best I can offer is the suggestion that you take a look at the various
articles on this subject at PHP Builder
http://www.phpbuilder.com/columns/. Maybe something there will help you.

=Guess Richard is going to talk about the gruyere (bubble) between my ears
now!?

=Regards,
=dn



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sessions -- behind the scenes??

2002-01-22 Thread Mikusch, Rita

This may be a silly question . . . where is the information that sessions
hold actually kept? Are cookies generated? Do sessions just simplify the
process of generating those cookies and keeping track of that information?

I have access to PHP3 as an apache module, and PHP4 as a cgi...I'm wondering
if PHP4's sessions are worth the CGI headache?

Thanks! Rita.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching here)..

2002-01-22 Thread James Hallam

We use iPlanet on Windows for a number of our servers, and have succesfully
installed PHP 4.0.6 on NES 4 on NT, with the NSAPI install.  There was one
step that we had to do, which wasn't in the manual, however - which was
making sure that the domain field in the server's TCP/IP Settings was filled
in.  That field wasn't necessary to make NES 4 run, just PHP.

I'm now trying to put together a demonstration laptop, to take some of our
products on the road, where an internet connection wouldn't be available,
and I've got to do our install on a laptop running XP Home, for the moment.
iPlanet 6 sp1 installed perfectly on XP, and the normal NSAPI configuration
for iPlanet went smoothly, but it won't work.

As before, with NES 4 before we added the domain info to the TCP/IP config,
running a phpinfo() file would crash httpd.exe.  The domain fixed this.

Now, does anyone know why this crash happens, and would anyone have any
suggestions how to stop it from happening on XP Home, which doesn't have the
ability to specify a domain?

James Hallam


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sessions -- behind the scenes??

2002-01-22 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Johnson, Kirk blurted
 
 By default, session data is stored in a file in /tmp, but you can specify
 another place, like a database. PHP generates a session id, which is part of
 the filename of the session file. PHP passes a cookie containing the session
 id to the browser, so that PHP can keep track of which session file belongs
 to which browser request.

and if the browser does not support cookies PHP stores it temporarily on
the server machine (unless your using a db of course) I believe.
I remember there being a solid explanation of this in the Manual and
some good tutorials on phpbuilder.com

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8TcfKHpvrrTa6L5oRAiRgAJ9OLroVigvxwVEBbUee/kSNon1+7gCgss/Q
gfdk3+LdIXayY5Rb4JPc/s4=
=PAlH
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Passing. Which method to use?

2002-01-22 Thread Floyd Baker

On Tue, 22 Jan 2002 14:21:56 +0530 (IST), you wrote:

Hi,
  I'm using sessions extremely to do that. 

with regards
Sukumar .S
On Tue, 22 Jan 2002, Floyd Baker wrote:

 Date: Tue, 22 Jan 2002 01:17:18 -0500
 From: Floyd Baker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Passing.  Which method to use?  
 
 
 Hi once again.
 
 What's the consensus on the best way to pass arrays from page to page?
 
 By serializing?  But I think it's not recommended?
 
 By writing then reading to a text file?  Maybe?
 
 By inputting to and pulling from db records?  Possibilities?  
 
 Any other?  
 
 Thanks in advance.
 
 Floyd




Ok then that makes it unanimous.  I will use sessions...  

Except it isn't working yet.  

I have just put in 4.1.1 and everything seems good with that.  I have
been able to pass vars using $_request() etc...  But here is the
script I just now tested and it stays at the count of '1'.  Other
sessions test scripts do not work either.   I was not using sessions
before this install of 4.1.1 either.  

Can there be anything, new or old, in 4.1.1 that I need to fix? 
As with register_globals and whatever else that has been changed?  

Here is the script straight off the tutorial:

//? //'s here only.

// initialize a session
session_start();

// register a session variable
session_register('counter');

// increment and display the value of the counter
$counter++ ;
echo(You have visited this page $counter times! Don't you have
anything else to do, you bum?!);

//?


Thanks.

Floyd

--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PEAR-DEV] Re: [metabase-dev] RE: [PEAR-DEV] New Metabase Aniversary release

2002-01-22 Thread Björn Schotte

* Manuel Lemos wrote:
 I think that the greatest point of the merger is to have one and only
 one abstraction layer in PEAR,

I think consensus was that there shouldn't be the one and
only XYZ PEAR class but more than one XYZ PEAR class (like
IT[X] and the PEAR rewrite of PHPLib's Template class).

-- 
PHP-Schulungen in Frankfurt und München!

Mehr Informationen?  mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [binarycloud-dev] Re: [PEAR-DEV] New Metabase Aniversaryrelease

2002-01-22 Thread Alex Black

 I will first focus on the functional aspects, then step by step making
 the necessary changes to make that final code compliant to the PEAR
 coding standard.
 This makes no sense for PEAR.
 
 I propose this way:
 1. pearize Metabase (functionNames, using PEAR_Error)
 2. commit the stuff to PEAR
 3. create a wrapper class matching PEAR::DB

I agree with all but 3. Metabase offers a superset of the functionality
available in pear, so the exiting API must be extended to support metabase's
additional functionality.

otherwise, Lukas, fantastic and I await your work... we will be using your
code in binarycloud as soon as it's ready.

Manuel: will you mintain metabase based on Lukas's work? i.e. is he taking a
branch or are you working together? (I hope it is the latter... as I would
really like to see the metabase code adhere to the pear coding standards).

best,

_alex


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [binarycloud-dev] Re: [PEAR-DEV] Re: [metabase-dev] RE:[PEAR-DEV] New Metabase Aniversary release

2002-01-22 Thread Alex Black

 * Manuel Lemos wrote:
 I think that the greatest point of the merger is to have one and only
 one abstraction layer in PEAR,
 
 I think consensus was that there shouldn't be the one and
 only XYZ PEAR class but more than one XYZ PEAR class (like
 IT[X] and the PEAR rewrite of PHPLib's Template class).

Again, I agree about everything but database abstraction.

It's fine to have applications use 5 different template engines as its only
a matter of taste. binarycloud supports smarty, xslt, and standard php
classes.. I'm sure we'll support more in the future.

The database abstraction layer's behavior and capabilities dictate
application development and we sure as hell don't want 5 abstraction layers
with the same API floating around. IMHO that's actually _worse_ than just
having different abstraction layers compete, because it can confuse new
developers.

We had this discussion a while ago, I was actually under the impression that
everyone agreed that metabase was the most architecturally and functionally
mature package, while PEAR clearly had a cleaner OO api because it wasn't
burdened with PHP3 compatibility.

I would _very_very_very_ much like to see metabase core code replace the
current PEAR::DB codebase, but use the same API as the existing PEAR::DB.
PEAR people and us out there building applications have a lot to gain if
that happens.

_If_ that happens I think we are all better for it: we gain both the good
api and the mature package... and everyone can start using the same
abstraction layer so we can all start sharing applications properly (again
one of the primary ideas behind binarycloud).

If it is indeed the intention of those running pear to (in the long run)
have multiple abstraction layers, I think that is a bad mistake. However,
until whoever decides these things makes themselves clear I don't really
have an opinion :)

_alex


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]