Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-17 Thread Jason Wong

On Thursday 18 July 2002 13:14, vins wrote:
> How do i debug.
> Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that they 
contain what you expect them to contain.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:  Heard about the  who couldn't spell?
A:  He spent the night in a warehouse.
*/


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




[PHP] Re: Sessions / logins / cookies / security

2002-07-17 Thread Peter James

There's a good article on authentication at phpbuilder.com

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

that may provide an idea or two.

- Original Message -
From: "Chad Day" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 10:30 AM
Subject: Sessions / logins / cookies / security


> I asked something similar a little while ago, but didn't do a good job
> clarifying.
>
> What I'm looking to do is when a user logs in, I start up the session.. I
> then have the registered session var to verify they are authenticated as
> they move throughout the site.
>
> Now, when they close the browser and come back, I want them to still be
> authenticated.  Obviously, I have to set a cookie.  But what do I set?  Do
I
> set just their user ID?  The MD5 of their password?  What's the most
secure
> way, that's not easily spoofed?  I don't know that much about cookies, but
> if I just use a user ID, couldn't someone just change that ID value and
> 'become' another user?
>
> Thanks for any advice,
> Chad
>



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




RE: [PHP] why my php can not get values from Form?

2002-07-17 Thread Balaji Ankem

Enable Rigister_globals to On in php.ini file and then try.

Best Regards
Balaji

-Original Message-
From: ram friend [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 18, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] why my php can not get values from Form?


hello,
I have just installed apache+php4, but my php can not get values from
form? what's wrong? following is the code in php named file
"welcome.php" 

I called it with http://localhost/welcome?username=&passwd=bbb
i get nothing, what's wrong?





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



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


Re: [PHP] why my php can not get values from Form?

2002-07-17 Thread Jadiel Flores

Probably you don't have the Register Global turned on in your php.ini, try 
using $_GET['usernm'] and $_GET['passwd'] or change your php.ini

At 01:41 p.m. 07/18/2002 +0800, you wrote:
>hello,
>I have just installed apache+php4, but my php can not get values from form?
>what's wrong?
>following is the code in php named file "welcome.php"
>echo( "Welcome to our Web site, $usernm $passwd!" );
>?>
>
>I called it with
>http://localhost/welcome?username=&passwd=bbb
>i get nothing, what's wrong?
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] why my php can not get values from Form?

2002-07-17 Thread ram friend

hello,
I have just installed apache+php4, but my php can not get values from form?
what's wrong?
following is the code in php named file "welcome.php"


I called it with
http://localhost/welcome?username=&passwd=bbb
i get nothing, what's wrong?





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




Re: [PHP] Importing CSV File : 100000 Rows!

2002-07-17 Thread Analysis & Solutions

On Wed, Jul 17, 2002 at 10:33:50PM -0700, Thomas Edison Jr. wrote:
> 
> Basically the problem is that i have to connect from
> my localhost to my MySQL database on the
> server/internet. I don't have command prompt access to
> the internet database...

But, if you have the mysql terminal software installed on your localhost,
and your host/user combo is permitted to log in to the database, you can
log in to the database from your machine.  Something like:

mysqlimport -h remote.host.com -u username -p databasename file.txt

http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#mysqlimport

Otherwise, break up the file into smaller pieces and see how that works.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] querying for one specific row number

2002-07-17 Thread Justin French

For starters, this is a PHP list, not MySQL.

Check out the LIMIT statement in the MySQL manual.

Or, if you have a primary key field like id and you KNOW that id#2 will be
there, then it's a simple

SELECT * FROM mytable WHERE id='2'


But in the case where id#2 has been deleted, you really want to pull out
id#3, the new second rown in the table... in which case you'd use limit

make sense?


Justin French


on 18/07/02 12:21 AM, Phil Schwarzmann ([EMAIL PROTECTED]) wrote:

> I want query my mysql table and get one particular row.
> 
> So let's say my table had 5 rows (entries) in it, and I want to pull
> just row #2, how would I do this??
> 
> THANKS!!
> 


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




Re: [PHP] Importing CSV File : 100000 Rows!

2002-07-17 Thread Thomas Edison Jr.

Hi,

Basically the problem is that i have to connect from
my localhost to my MySQL database on the
server/internet. I don't have command prompt access to
the internet database...


--- Pradeep Dsouza <[EMAIL PROTECTED]> wrote:
> 
> there is a way to do it from the prompt 
> 
> I use Windows but the command on Linux is close 
> 
> if the file is called mydata.sql
> 
> mysql > \. C:\mydata.sql
> 
> 
> Hope this works 
> 
> Pradeep 
> 
> 
> - Original Message - 
> From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 18, 2002 10:50 AM
> Subject: [PHP] Importing CSV File : 10 Rows!
> 
> 
> > Hi,
> > 
> > I have generated a .csv file from a .dat file
> using a
> > VB program. Now this .csv file needs to be
> imported
> > into my mySQL Database Table on the internet,
> using
> > phpMyAdmin.
> > 
> > The problem i'm facing is that the file, while
> > uploading, stops somewhere in the middle. The
> upload
> > just gets stuck. 
> > 
> > Possible reasons :
> > 
> > 1. Number of rows is too large. About 10. Does
> > mySQL Support these many rows? Is yes, is it
> possible
> > to upload these many rows from a client to a table
> on
> > the internet using phpMyadmin?
> > 
> > 2. Internet connection. Due to the mere size of
> the
> > file in terms of no. or rows, maybe my internet is
> not
> > able to send all the data. I dont' know.
> > 
> > Now can anyone suggest a possibly solution? Can i
> > break up the file automatically and send or
> something?
> > 
> > Please help..
> > 
> > T. Edison Jr.
> > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Yahoo! Autos - Get free new car price quotes
> > http://autos.yahoo.com
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > 
> 


=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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




Re: [PHP] Importing CSV File : 100000 Rows!

2002-07-17 Thread Jason Reid

First off, does your mysql DB allow you to connect remotly (not including
phpmyadmin). If so, I'd suggest www.anse.de/mysqlfront, and use that to
connect to the database, and import the .csv through that. I can see the
file maybe not fully uploading, due to possibly the max file size in php, as
100,000 rows of data must be approaching at least 1mb (might be wrong there
too, depends on the data).

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 11:20 PM
Subject: [PHP] Importing CSV File : 10 Rows!


> Hi,
>
> I have generated a .csv file from a .dat file using a
> VB program. Now this .csv file needs to be imported
> into my mySQL Database Table on the internet, using
> phpMyAdmin.
>
> The problem i'm facing is that the file, while
> uploading, stops somewhere in the middle. The upload
> just gets stuck.
>
> Possible reasons :
>
> 1. Number of rows is too large. About 10. Does
> mySQL Support these many rows? Is yes, is it possible
> to upload these many rows from a client to a table on
> the internet using phpMyadmin?
>
> 2. Internet connection. Due to the mere size of the
> file in terms of no. or rows, maybe my internet is not
> able to send all the data. I dont' know.
>
> Now can anyone suggest a possibly solution? Can i
> break up the file automatically and send or something?
>
> Please help..
>
> T. Edison Jr.
>
>
>
> __
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes
> http://autos.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




[PHP] Importing CSV File : 100000 Rows!

2002-07-17 Thread Thomas Edison Jr.

Hi,

I have generated a .csv file from a .dat file using a
VB program. Now this .csv file needs to be imported
into my mySQL Database Table on the internet, using
phpMyAdmin.

The problem i'm facing is that the file, while
uploading, stops somewhere in the middle. The upload
just gets stuck. 

Possible reasons :

1. Number of rows is too large. About 10. Does
mySQL Support these many rows? Is yes, is it possible
to upload these many rows from a client to a table on
the internet using phpMyadmin?

2. Internet connection. Due to the mere size of the
file in terms of no. or rows, maybe my internet is not
able to send all the data. I dont' know.

Now can anyone suggest a possibly solution? Can i
break up the file automatically and send or something?

Please help..

T. Edison Jr.



__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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




RE: [PHP] Require some help about the date comparison

2002-07-17 Thread Manisha

Thanks to all who responded me. Actually I got confused after seeing so 
many commands but finally got it correct from u guys.

Thanks once again.

Manisha


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




[PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-17 Thread vins

How do i debug.
Thats why i asked

"Vins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
> I've just made this script to update a binary file for my BIND 9 DNS
server.
>
> ===
>  $WorkFile = "domains/db.nom.za";
>  $buffer   = file($WorkFile);
>
>  $DBfile = implode($buffer, "");
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
> "$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
> "$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
>  $DBfile = trim($DBfile)."\n";
>
>  $fp = fopen($WorkFile, 'w');
>  fwrite($fp, $DBfile);
>  fclose($fp);
>
> ===
>
> Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
> it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
> maintain the format of the file...
>
> My script keeps adding and extra line to every line even when I told it to
> trim.
>
> Any  please help
>
> Kindest Regards
> Vins
> :D
>
>



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




[PHP] Re: preg_replace_callback

2002-07-17 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Rafael Fernandes) wrote:

> First, sorry for my elementary english...
> I need a function made for PHP3 that works like preg_replace_callback...

Before preg_replace_callback() was introduced, preg_replace() used to have 
another an "f" modifier which had similar functionality.  I'm not sure 
whether that modifier was available back in PHP3, but here's the relevant 
quote about "f" from an old set of PCRE Syntax docs:

> F
> If this modifier is set, preg_replace() treats the replacement parameter as a 
> function name that should be called to provide the replacement string. The 
> function is passed an array of matched elements in the subject string. NOTE: 
> this modifier cannot be used along with /e modifier; and only preg_replace() 
> recognizes this modifier.

If I recall correctly (which I may not), an example would look something 
like this:

$output=preg_replace("/(\w+)/f","'***' . strtolower($1) . '***'",$input);

-- 
CC

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




[PHP] Re: Regular expression for correcting proper nouns

2002-07-17 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Henry) wrote:

> I'm looking for a simple was to correct a list of proper nouns given all in
> lower case!
> 
> For example
> 
> given $string="london paris rome";
> 
> I would like "London Paris Rome".
> 
> However there is one cavet; if the word already has a captital anywhere in
> it, it should be left alone!!!
> 
> Is there a soultion using regular expressions?

Yes.  The topics you'll want to look at (in the PCRE chapter of the manual) 
are: case-sensitivity, character classes, capturing subpatterns, and the 
documentation for preg_replace_callback().  One of the things you'll need 
to do is define for yourself what constitutes a "word" for your purposes.  
Does a single letter word get counted as a "word" (i.e. "i")?  Is there any 
non-alphabet character that can validly appear within the thing you call a 
word (i.e. "hi-fi", "mst3k")?  This is why there's no single ready-made 
solution.

> Also is there one for removing multiple spaces?
> 
> i..e given "A   B C D E" it would give "A B C D E".

Yes.  Again, character classes will be your friend, as will preg_replace().  
Just decide which of the whitespace characters you mean to include in that 
definition of "multiple spaces"...

-- 
CC

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




Re: [PHP] Creating Dynamic Variables

2002-07-17 Thread Michael Sims

On Wed, 17 Jul 2002 22:39:10 -0400, you wrote:

>Hello, I have captured variables from any HTML that is POSTed to me from a
>'foreach' clause. Now, possibly in this foreach clause I want to register
>these name/value pairs into a session var. I have tried :
>session_start();
>foreach ($HTTP_POST_VARS as $name=>$value) {
>$name=$value;
>session_register(name); //without the $
>}
>and get nothing.

Assuming register_globals is off:

session_start();
foreach ($HTTP_POST_VARS as $name => $value) {
  $$name = $value;
  session_register($name);
}

Remember, $name only contains the name of the variable, not a
reference to the variable itself.  To create a new global variable
with the name "$name", you have to use a variable variable, hence
$$name.

Session_register, however, only requires a string which contains the
name of the variable you want to register.  $name will provide that by
itself.  In your example, by leaving off the dollar sign, you are
referencing an undefined constant called "name"...

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




Re: [PHP] Creating Dynamic Variables

2002-07-17 Thread Pushkar Pradhan

Try putting "" around name in session_register?
> Hello, I have captured variables from any HTML that is POSTed to me from a
> 'foreach' clause. Now, possibly in this foreach clause I want to register
> these name/value pairs into a session var. I have tried :
> session_start();
> foreach ($HTTP_POST_VARS as $name=>$value) {
> $name=$value;
> session_register(name); //without the $
> }
> and get nothing.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


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




RE: [PHP] Creating Dynamic Variables

2002-07-17 Thread Martin Towell

I think you're more after this

session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$$name=$value;
session_register($name); //with the $
}

HTH
Martin

-Original Message-
From: Anup [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 12:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Creating Dynamic Variables


Hello, I have captured variables from any HTML that is POSTed to me from a
'foreach' clause. Now, possibly in this foreach clause I want to register
these name/value pairs into a session var. I have tried :
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$name=$value;
session_register(name); //without the $
}
and get nothing.




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

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




Re: [PHP] Format 24 hr time to 12 hr time

2002-07-17 Thread Jason Wong

On Thursday 18 July 2002 05:31, Ryan wrote:
> How do you format this for example: 13:58:00 into 1:58 PM

Manual > Date and Time functions

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You attempt things that you do not even plan because of your extreme 
stupidity.
*/


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




Re: [PHP] Binary Files :: They Keep Adding Blocks

2002-07-17 Thread Jason Wong

On Thursday 18 July 2002 06:57, vins wrote:
> Hi
> I've just made this script to update a binary file for my BIND 9 DNS
> server.
>
> ===
>  $WorkFile = "domains/db.nom.za";
>  $buffer   = file($WorkFile);
>
>  $DBfile = implode($buffer, "");
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
> "$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
> "$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
>  $DBfile = trim($DBfile)."\n";
>
>  $fp = fopen($WorkFile, 'w');
>  fwrite($fp, $DBfile);
>  fclose($fp);
>
> ===
>
> Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
> it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
> maintain the format of the file...
>
> My script keeps adding and extra line to every line even when I told it to
> trim.

Did you even _try_ to do your own debugging before asking the list? You know 
what the problem is -- extra lines -- so where in your code are you adding 
extra lines (hint "\n").

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"We are on the verge: Today our program proved Fermat's next-to-last theorem."
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982
*/


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




[PHP] Creating Dynamic Variables

2002-07-17 Thread Anup

Hello, I have captured variables from any HTML that is POSTed to me from a
'foreach' clause. Now, possibly in this foreach clause I want to register
these name/value pairs into a session var. I have tried :
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$name=$value;
session_register(name); //without the $
}
and get nothing.




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




RE: [PHP] Re: Includes vs. Functions

2002-07-17 Thread Martin Towell

> >Chris, thanks for describing your method. The reason I really dislike
> >Functions in PHP is because you have to pass every variable needed by a
> >function, even if that variable is global in the main script, which is a
> >pain in the ass when a function needs a long string of variables. It
makes
> >it easier to forget a variable in the list and can make the code look
messy.

[snip]

> The whole idea behind modularization is that you are creating a "black
> box" so to speak, a chunk of code that performs one function, and one
> function only.  It should present a *minimal* interface to the outside
> world.  This means that if I have a black box that say, gives me the
> current local time in a particular timezone, I should be able to feed
> it the name of the timezone, and it should give me back the current
> time.  I should NOT have to know how it works inside, or care.  I feed
> it one value, and it returns another value.

[snip]

To add to this. If you're passing too many values to a function, then maybe
that function isn't broken down enough. I remember hearing/reading that if
you need to pass more than, I think, 5 or 6 values to a function, then
you're passing too many.

Martin

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




Re: [PHP] Running a PHP Script from UNIX Command Line?

2002-07-17 Thread Michael Sims

On Wed, 17 Jul 2002 16:25:10 -0600, you wrote:

>Check the archives on this...
>
>But you need the executable php

Also in the archives are discussions on how to do this using lynx,
which does not require an executable PHP, but does require that the
script reside somewhere in the document root of your web server...

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




Re: [PHP] Re: Includes vs. Functions

2002-07-17 Thread Michael Sims

On Wed, 17 Jul 2002 17:46:25 -0400, you wrote:

>Chris, thanks for describing your method. The reason I really dislike
>Functions in PHP is because you have to pass every variable needed by a
>function, even if that variable is global in the main script, which is a
>pain in the ass when a function needs a long string of variables. It makes
>it easier to forget a variable in the list and can make the code look messy.
>
>So, that's why I prefer includes, because the code is operating on the same
>level as the main script and can easily use variables set locally without
>making them global.
>
>I'll use a function if it only needs one or two variables passed to it, but,
>I find myself using more Includes than Functions because of the variable
>passing necessary. 

Maybe I'm misunderstanding what you guys are talking about here, but
it seems to me that you believe that including a block of code and
calling it as a function are just two different approaches to the same
thing, and nothing more.  It's true that they can be very similar, but
I think you are overlooking one of the major benefits of functions.

You speak of passing variables and making them global as if it were
simply a necessary evil.  Have you stopped to consider that there are
times that variable scope works in your favor?  There are times when
you do NOT want variable $a inside a function to be the same as
variable $a outside of it.

Functions (and classes) are all about code modularization.  Let us say
that you have a particular set of code that you know you are going to
need to execute several times.  So you decide to put it in an external
file and include() that code whenever you need it.  In this case, all
of the variables you use inside that code are global.  But, this is
not a problem because you are aware of which variables are in use, so
there are no conflicts.

But let us say that later on you, or some other programmer entirely,
want to use your code again in a completely different program.  Now,
because all of your variables are global, you (or they) have to stop
and think"now lets see, this code references $var_a and
$var_b...am I using those variables already for other purposes?"  If
the new program is already using those variables, for some other
purpose altogether, then suddenly your included code has clobbered
those variables, and now you have bugs.  You have introduced a
namespace conflict, and this is an example of poorly seperated
functionality.

The whole idea behind modularization is that you are creating a "black
box" so to speak, a chunk of code that performs one function, and one
function only.  It should present a *minimal* interface to the outside
world.  This means that if I have a black box that say, gives me the
current local time in a particular timezone, I should be able to feed
it the name of the timezone, and it should give me back the current
time.  I should NOT have to know how it works inside, or care.  I feed
it one value, and it returns another value.  Now, if I have
implemented this code as a simple block that is include()'ed, now I
suddenly have to concern myself with how it works...i.e. I have to
know, if nothing else, what variable names it is expecting, and I have
to make sure that I am not clobbering any of those variables inside my
main script.

As far as I know, every non-trivial programming language (or scripting
language) has the concept of variable scope.  It behaves differently,
but the concept is still there.  For example, in Perl, a variable that
is referenced in a function (or subroutine) is global by default,
unless you use the "my" keyword, which makes it only visible inside
the subroutine.  PHP is backwards from this...it defaults to assuming
you want a local copy of the variable, and only makes it global if you
tell it to.  But imagine if there was no such concept as variable
scope, and all variables were global.  We'd end up with variables
names like $a3t463tew34 just to make sure we're not conflicting with
another named variable...

If you're saying that you have a group of variables, let us say 10 or
15 or so, that you want to be global EVERYWHERE, then there are easy
ways to accomplish that, and still retain the clean seperation of
functionality that a function or a class would give you.  I would put
the names of the variables inside an array and then globalize them by
iterating through the array.  Example:

$superglobals = array("var1", "var2", "var3", "var4", "var5", "...");

Now inside the function you can do this:

function somefunction ($somevar) {

  global $superglobals;
  foreach($superglobals as $varname) {
global $$varname; //resolves to $var1, $var2, $var3, etc.
  }

  //Other stuff here

}

If I have completely misunderstood the thread here, please forgive my
rambling post. :-)

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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread Michael Sims

On Thu, 18 Jul 2002 03:21:48 +0200, you wrote:

> > Then again, I might not be remembering correctly, so ...
>
>Well it could have been it, but it doesn't work neither trying to set
>the ErrorDocument into a .htaccess file.
>
>The problem is I am not even sure where is the trouble, and if it should
>work or not (I guess it should), so I don't know exactly where to ask,
>the dev list maybe ?

I seem to remember from when I was toying around with this that
$_SERVER["REQUEST_URI"] was still available.  Even if $_GET isn't
populated you could manually parse the REQUEST_URI.  Of course I may
be misremembering...  If it's not available on your install let me
know and I'll setup a test case on my server...

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




[PHP] Format 24 hr time to 12 hr time

2002-07-17 Thread Ryan

How do you format this for example: 13:58:00 into 1:58 PM

Thanks



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




[PHP] Unexpected module init/shutdown behaviour

2002-07-17 Thread Jong-won Choi

Hello,

I'm trying to understand module init/shutdown of PHP and Apache httpd
configuration.

Server version: Apache/1.3.20 (Unix)  (Red-Hat/Linux)
  httpd.conf: StartServers 8
PHP 4.2.1

I just added log messages to init/shutdown function of XML module:

PHP_MINIT_FUNCTION(xml)
{

char msg[1024];
sprintf(msg,"%d - XML: MINIT CALLED!", getpid());
zend_error(E_WARNING, msg);
...
}


PHP_MSHUTDOWN_FUNCTION(xml)
{
char msg[1024];
sprintf(msg,"%d - XML: MSHUTDOWN CALLED!", getpid());
zend_error(E_WARNING, msg);
...
}

Then when httpd is started, following messages appears:

[18-Jul-2002 10:12:03] PHP Warning:  5607 - XML: MINIT CALLED!
in
Unknown on line 0
[18-Jul-2002 10:12:03] PHP Warning:  5610 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:12:09] PHP Warning:  5610 - XML: MINIT CALLED!
in
Unknown on line 0
...

Now, shutdown httpd (there are 9 calls):

...
[18-Jul-2002 10:13:54] PHP Warning:  5619 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:54] PHP Warning:  5618 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:54] PHP Warning:  5617 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:54] PHP Warning:  5616 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:54] PHP Warning:  5615 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:54] PHP Warning:  5614 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:55] PHP Warning:  5613 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:55] PHP Warning:  5612 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
[18-Jul-2002 10:13:55] PHP Warning:  5610 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0


Is above right behaviour? I think that should be something like:

MINIT is called once with process id P1, for example when httpd is
started.
MSHUTDOWN is called once with same pid P1, when httpd is shutdown.
I also checked global init/shutdown functions but it seems like not used
at the moment.

How can I make Apache and PHP work just like I want?

Cheers,

- Jong-won Choi


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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread Fabien Penso


David a écrit : 

 > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...

[...]

 >> but $plop won't be set, and there is no way to get the variables
 >> back. In POST method I won't even see the REDIRECT_QUERY_STRING at
 >> all. So should this work, if not why, and is there a way to fix it ?

 > I seem to remember some discussion about this ages ago - there was some 
 > difference between how ErrorDocument works in httpd.conf and .htaccess - 
 > you might try the latter and see if there is a different result.

 > Then again, I might not be remembering correctly, so ...

Well it could have been it, but it doesn't work neither trying to set
the ErrorDocument into a .htaccess file.

The problem is I am not even sure where is the trouble, and if it should
work or not (I guess it should), so I don't know exactly where to ask,
the dev list maybe ?

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/

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




Re: [PHP] how to access javascipt variables in PHP

2002-07-17 Thread Chris Garaffa

I can't think of a way to do it in the page itself... Unfortunately (there
could be a way, I just can't think of it - frazzled after a day of work),
but if you're using forms on your page, then set the values of some hidden
form elements to the JS variables you want to use, and pass them along. You
could have the page refresh itself to give you the variables, too.
I'm sure there's a better way, though.
Good luck,
-- 
Chris Garaffa
#!/usr/local/lib/php
$contact_info["Name"]   = "Chris Garaffa";
$contact_info["Email"]  = "[EMAIL PROTECTED]";
$contact_info["Work"]   = "[EMAIL PROTECTED]";
$contact_info["cell"]   = "203.803.9066";


"Seppo Laukkanen" (from <[EMAIL PROTECTED]>) wrote on 7/17/02 3:06
PM:

> Can anybody help?
> 
> I have javascript code to find out browsers width and height, but they
> are stored in javascript variables. How can I access them from PHP? Or
> is there a method to do same in PHP straightly?
> 
> Thanks,
> Seppo
> 
> 


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




RE: [PHP] missing function? array_change_key_case()

2002-07-17 Thread Jimmy Brake

yep thats it ... 

On Wed, 2002-07-17 at 18:02, John Holmes wrote:
> Works fine for me on 4.2.1
> 
> You have to have at least 4.2.0, do you?
> 
> ---John Holmes...
> 
> > -Original Message-
> > From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 8:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] missing function? array_change_key_case()
> > 
> > Hi!
> > 
> > When I run this command ...
> > 
> > $foo = array_change_key_case($foo, CASE_UPPER);
> > 
> > I get this error ..
> > 
> > Call to undefined function:  array_change_key_case() in /index.php on
> > line 181
> > 
> > Yet the function (should) exist:
> > 
> > http://www.php.net/manual/en/function.array-change-key-case.php
> > 
> > I am running 4.x any ideas?
> > 
> > Jimmy
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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




RE: [PHP] missing function? array_change_key_case()

2002-07-17 Thread John Holmes

Works fine for me on 4.2.1

You have to have at least 4.2.0, do you?

---John Holmes...

> -Original Message-
> From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 8:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] missing function? array_change_key_case()
> 
> Hi!
> 
> When I run this command ...
> 
> $foo = array_change_key_case($foo, CASE_UPPER);
> 
> I get this error ..
> 
> Call to undefined function:  array_change_key_case() in /index.php on
> line 181
> 
> Yet the function (should) exist:
> 
> http://www.php.net/manual/en/function.array-change-key-case.php
> 
> I am running 4.x any ideas?
> 
> Jimmy
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] missing function? array_change_key_case()

2002-07-17 Thread Jimmy Brake

Hi!

When I run this command ...

$foo = array_change_key_case($foo, CASE_UPPER);

I get this error ..

Call to undefined function:  array_change_key_case() in /index.php on
line 181

Yet the function (should) exist:

http://www.php.net/manual/en/function.array-change-key-case.php

I am running 4.x any ideas?

Jimmy


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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> Tom a écrit : 
> 
>  > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
>  > httpd.conf or an .htaccess file) follows absolute paths, so you are calling
>  > your engine.php out of the root directory of the machine. So the question
>  > is, do you have engine.php in the / folder? If not you can put it there or
>  > just adjust your ErrorDocument command to point to the path of the file.
> 
> No, you didn't understand. I'll make a simpler example. Let's say I did
> use :
> 
> ErrorDocument 404 /phpinfo.php
> 
> /phpinfo.php exists, it just does phpinfo();
> 
> If I call http://localhost/dontexist?plop=foobar I will see the phpinfo,
> and I will see variables like :
> 
> REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist 
> REDIRECT_QUERY_STRING: plop=foobar 
> REDIRECT_REQUEST_METHOD: GET 
> REDIRECT_STATUS: 404 
> etc
> 
> but $plop won't be set, and there is no way to get the variables
> back. In POST method I won't even see the REDIRECT_QUERY_STRING at
> all. So should this work, if not why, and is there a way to fix it ?

I seem to remember some discussion about this ages ago - there was some 
difference between how ErrorDocument works in httpd.conf and .htaccess - 
you might try the latter and see if there is a different result.

Then again, I might not be remembering correctly, so ...

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Someone Help please

2002-07-17 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Chris:
> 
> Geez, this is your third thread on this today...  Lame.
> 
> --Dan
> 
> 

There is none deafer than (s)he who won't listen :-)

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Of Jobs and Certs

2002-07-17 Thread Michael Hall


In my opinion, certification doesn't count for much. The Microsoft certs
are proof enough of this, but even many of the Linux certs are pretty
shallow when you look at what they cover and how they're tested.
Most employers know that you can either do it or you can't.

Anecdote: I once asked a networking/hardware professional whether a RedHat
certificate would make me more employable in his eyes. No way was his
answer, he was more interested in what I could demonstrably do (and had
already done) than in the paper.

I don't have any advice about how to get into the industry. I have only
just joined it after working 10 years as a teacher. I started building
sites for community groups, built web apps for schools, got a few paid
commercial jobs, built up a portfolio, and finally got a fulltime web
development job at a tertiary institution.

The ease/difficulty of getting into the industry probably depends greatly
on economic circumstances. But I know that in my case, knowing Linux,
Apache and PHP/MySQL (plus demonstrable experience, not necessarily
commercial) was what clinched it for me. Where I live (NT, Australia),
Linux really is making inroads into the mainstream.

One thing that might look good on a CV is involvement in an open source
project, at whatever level.

Michael 


On Wed, 17 Jul 2002, Martin Clifford wrote:

> Howdy everyone,
> 
> I'd like to get everyone's input on Jobs and Certs.  I know there are a couple 
>Certifications for web developers out there, such as the CIW and CWP certifications.
> 
> Here are my questions:
> 
> 1.  What is the best method to go about becoming certified?
> 2.  What is the best way to go about getting into the web development industry?
> 3.  If you have ever taken online courses relating to web development, what is your 
>opinion on them?  Good, bad, ugly?
> 4.  Which certification is most beneficial?  I know that CWP requires work 
>experience before becoming certified past certain points, and CIW does not require 
>this.
> 5.  Why can't I remember what question five was? Doh.
> 
> At any rate, I'm current a data entry clerk, but have quite a bit of web experience 
>(none at a job, though), and I know that I have TONS more to learn, but I am very 
>passionate about it and want to be able to do it as a career.  I just don't know 
>where the hell to start, and I know that some of you might be able to offer some 
>advice in this area.
> 
> Thanks in advance!  This is very important to me, so I thought I'd ask the people 
>that would know best :o)
> 
> Martin Clifford
> Homepage: http://www.completesource.net
> Developer's Forums: http://www.completesource.net/forums/
> 
> 
> 
> 

-- 

n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql

Michael Hall [EMAIL PROTECTED]



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




Re: [PHP] Installing 4.0.6 to 4.1.1 patch

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, John Wulff wrote:
> I've downloaded the 4.0.6 to 4.1.1 patch but how do i install it?

Wouldn't you want to use a current version instead?

miguel


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




[PHP] Installing 4.0.6 to 4.1.1 patch

2002-07-17 Thread John Wulff

I've downloaded the 4.0.6 to 4.1.1 patch but how do i install it?



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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread Fabien Penso


Tom a écrit : 

 > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
 > httpd.conf or an .htaccess file) follows absolute paths, so you are calling
 > your engine.php out of the root directory of the machine. So the question
 > is, do you have engine.php in the / folder? If not you can put it there or
 > just adjust your ErrorDocument command to point to the path of the file.

No, you didn't understand. I'll make a simpler example. Let's say I did
use :

ErrorDocument 404 /phpinfo.php

/phpinfo.php exists, it just does phpinfo();

If I call http://localhost/dontexist?plop=foobar I will see the phpinfo,
and I will see variables like :

REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist 
REDIRECT_QUERY_STRING: plop=foobar 
REDIRECT_REQUEST_METHOD: GET 
REDIRECT_STATUS: 404 
etc

but $plop won't be set, and there is no way to get the variables
back. In POST method I won't even see the REDIRECT_QUERY_STRING at
all. So should this work, if not why, and is there a way to fix it ?

Thanks :)

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/

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




[PHP] ldap_add() - null values in fields produce an "value #0 invalid per syntax" error on ldap server

2002-07-17 Thread Ian_Ball

Hi,

New to the list and hoping someone might be able to help me.

I have been using PHP scripts that are to maintain a company address book
with a lot of data about contacts, both inside and outside the company.  The
scripts, which are generating html pages and reading input values back in,
have been working fine with PHP 4.2.1 as a library module for apache 1.3.26
and openldap 1.2.13.  However, openldap 2.0.23 and 25 have been generating
errors with these same PHP scripts, specifically in the ldap_add() and 
ldap_modify() functions.

The problem comes when fields in the html pages are left empty, which is
normal for this application.  For those familiar with the ldap_add/modify
functions in PHP, the array that is passed in has some values, say for
example title, fax, mobile, ... left empty, and therefore NULL (I have
checked, they really are NULL's stored in the array).  When the values make
it to the ldap server however, they appear to be no longer NULL's, but a
"#0", and through debugging output on the ldap server, I have seen it is
generating an "invalid per syntax" error.

The ldap servers have been complied from source and installed on a SuSE linux
professional 7.3 system.  Hardware resources are no problem (640Mb RAM, 2Gb
swap, 800Mhz processor, 130Gb HDD space with 6Gb free on the working
partition with this stuff)

Does anyone have any suggestions as to how I can address this problem.  It
is important that null values can make it into the ldap server as putting in
other values to try to work around the problem will mess up other
applications that use the ldap server, as will not inserting the fields into
the ldap server.

Ian

The following code segment demonstrates the problem:




Which produces the following segment of debugging output on the ldap server,
started with "slapd -d 255".


dn2entry_r: dn: "CN=SHNETADMIN,O=SHNETDEMO"
=> dn2id( "CN=SHNETADMIN,O=SHNETDEMO" )
> cache_find_entry_dn2id("CN=SHNETADMIN,O=SHNETDEMO"): 3 (1 tries)
<= dn2id 3 (in cache)
=> id2entry_r( 3 )
> cache_find_entry_id( 3 ) "cn=ShnetAdmin,o=shnetdemo" (found) (1 tries)
<= id2entry_r( 3 ) 0x80e72a8 (cache)
> cache_return_entry_r( 3 ): returned (0)
send_ldap_result: conn=12 op=1 p=2
send_ldap_result: 21::mail: value #0 invalid per syntax
send_ldap_response: msgid=2 tag=105 err=21
ber_flush: 47 bytes to sd 9
  :  30 2d 02 01 02 69 28 0a  01 15 04 00 04 21 6d 61   0-...i(..!ma
  0010:  69 6c 3a 20 76 61 6c 75  65 20 23 30 20 69 6e 76   il: value #0 inv
  0020:  61 6c 69 64 20 70 65 72  20 73 79 6e 74 61 78  alid per syntax
ldap_write: want=47, written=47
  :  30 2d 02 01 02 69 28 0a  01 15 04 00 04 21 6d 61   0-...i(..!ma
  0010:  69 6c 3a 20 76 61 6c 75  65 20 23 30 20 69 6e 76   il: value #0 inv
  0020:  61 6c 69 64 20 70 65 72  20 73 79 6e 74 61 78  alid per syntax
daemon: select: listen=6 active_threads=1 tvp=NULL
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=12
connection_read(9): checking for input on id=12
ber_get_next
ldap_read: want=1, got=1
  :  30 0
ldap_read: want=1, got=1
  :  05 .
ldap_read: want=5, got=5
  :  02 01 03 42 00 ...B.
ber_get_next: tag 0x30 len 5 contents:
ber_dump: buf=0x080e5fe0 ptr=0x080e5fe0 end=0x080e5fe5 len=5
  :  02 01 03 42 00 ...B.
ber_get_next
ldap_read: want=1, got=0

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

---

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




[PHP] Binary Files :: They Keep Adding Blocks

2002-07-17 Thread vins

Hi
I've just made this script to update a binary file for my BIND 9 DNS server.

===
 $WorkFile = "domains/db.nom.za";
 $buffer   = file($WorkFile);

 $DBfile = implode($buffer, "");
 $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
"$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
 $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
"$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
 $DBfile = trim($DBfile)."\n";

 $fp = fopen($WorkFile, 'w');
 fwrite($fp, $DBfile);
 fclose($fp);

===

Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
maintain the format of the file...

My script keeps adding and extra line to every line even when I told it to
trim.

Any  please help

Kindest Regards
Vins
:D



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




Re: [PHP] how many requests can php serve?

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Chris Hewitt wrote:
> Apache comes with ab for load testing. Maybe that will provide you with 
> a means of making meaningful comparisons. There will be a "php" aspect 
> to it, php opposed to say 3-tier java, but also things like is php a 
> cgi, apache module or actually compiled into apache.
> 
> When I hear of sites "going down" I perhaps incorrectly start saying 
> there is something wrong. They should get slower but with connection 
> throttling etc they should never actually crash. Or am I in WonderWorld?

Some resources are easily renewable and others aren't. If your log entries
take up all your drive space (and you share a partition with other more
valuable things), or you have a resource leak (memory, database
connections, etc.), you can quickly grind your server to a halt.

miguel


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




Re: [PHP] Classes vs. Functions

2002-07-17 Thread Christopher J. Crane

Thank you for your 2 cents I am just learning and appreciate your comments.
- Original Message -
From: "Michael Hall" <[EMAIL PROTECTED]>
To: "Chris Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 11:13 PM
Subject: Re: [PHP] Classes vs. Functions


>
> There is no simple answer here. I have started using classes where I find
> I am writing a lot of related functions that share similar
> parameters. Database connection and queries are a good
> example. Authentication is another.
>
> I have another class that builds forms, because I just hate the tedium of
> coding HTML forms by hand. It is really just a collection of functions,
> though, and could work fine as such.
>
> I'm still learning/exploring ... I am always guided by the principle that
> whatever makes less work for me (but achieves the same result) is probably
> a good thing.
>
> IMHO classes are best for more universal code that really can be used in
> many different places. My functions tend to be more application specific.
>
> My 2 cents
>
> Michael
>
> On Tue, 16 Jul 2002, Chris Crane wrote:
>
> > Could someone please explain the difference between classes and
functions
> > and how to use a class. I write alot of PHP, but I never understood this
at
> > all. I use an include statement in many of my pages and include a file
with
> > a bunch of functions. For instance, I might have a function called
stock();
> > In the page I am using I include the file that has this function and I
call
> > it like this:
> >
> > stock($Sym);
> >
> > I am wondering if I am doing it the wrong way. So I need to better
> > understand classes. What is one, and why would you use it?
> >
> > Thanks.
> >
> >
> >
> >
>
> --
> 
> n   i   n   t   i  .   c   o   m
> php-python-perl-mysql-postgresql
> 
> Michael Hall [EMAIL PROTECTED]
> 
>
>
>




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




[PHP] Re: win32 mail()

2002-07-17 Thread Manuel Lemos

Hello,

On 07/17/2002 10:18 AM, Val Petruchek wrote:
> i mean mail() on win32 server
> 
> my question is - how to set up SMTP
> authorization in php ini
> (if smtp server requires pop auth)
> 
> is it possible or should i use direct smtp
> connection?

No you need to authenticate via POP3 protocol. You may want to try this 
PHP class for that purpose:

http://www.phpclasses.org/pop3class


-- 

Regards,
Manuel Lemos


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




Re: [PHP] Running a PHP Script from UNIX Command Line?

2002-07-17 Thread B i g D o g

Check the archives on this...

But you need the executable php

And on top of the file:

example.php

#!/usr/bin/php -q



Then chmod the script to be executable and you can run from commandline.
For cron jobs just put it in the cron file and put the path to the file...


.: B i g D o g :.


- Original Message -
From: "Zach Curtis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 4:17 PM
Subject: [PHP] Running a PHP Script from UNIX Command Line?


> UNIX gurus:
>
> How can I get a PHP script to run or execute from a UNIX command line and
> echo the stdout back to the terminal window?
>
> For example,
>
> > execute/run??? file.php
>
> What I really want to do is create a cron job (which I do know how to
> create) for the script. The script doesn't really echo any results back,
but
> logs its results. The script it too time consuming to be run by having
> someone running the script through a web browser and waiting for it to
> complete.
>
> Thank you very much.
>
> _
> Zach Curtis
> Programmer Analyst
> POPULUS
> www.populus.com
> _
>
> Confidentiality Statement:
>
> This e-mail message and any attachment(s) are confidential and may contain
> proprietary information that may not be disclosed without express
> permission.  If you have received this message in error or are not the
> intended recipient, please immediately notify the sender by replying to
this
> message and then please delete this message and any attachment(s).  Any
use,
> dissemination, distribution, or reproduction by unintended recipients is
not
> authorized. Thank you.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Running a PHP Script from UNIX Command Line?

2002-07-17 Thread Zach Curtis

UNIX gurus:

How can I get a PHP script to run or execute from a UNIX command line and
echo the stdout back to the terminal window?

For example,

> execute/run??? file.php

What I really want to do is create a cron job (which I do know how to
create) for the script. The script doesn't really echo any results back, but
logs its results. The script it too time consuming to be run by having
someone running the script through a web browser and waiting for it to
complete.

Thank you very much.

_
Zach Curtis
Programmer Analyst
POPULUS
www.populus.com
_

Confidentiality Statement:

This e-mail message and any attachment(s) are confidential and may contain
proprietary information that may not be disclosed without express
permission.  If you have received this message in error or are not the
intended recipient, please immediately notify the sender by replying to this
message and then please delete this message and any attachment(s).  Any use,
dissemination, distribution, or reproduction by unintended recipients is not
authorized. Thank you.


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




Re: [PHP] Classes Constructor syntax

2002-07-17 Thread Rad0s-ław Gajewski

++>PHP does not support multiple constructors.
but you can easily evade this obstacle:
class A {
function A($parm1,$parm2=false) {
if (!$parm2) {
$this->OneArgConstructor($parm1);
} else {
$this->TwoArgConstructor($parm2);
}
}
function OneArgContructior($parm) {
//...
}
function TwoArgConstructior($parm1,$parm2) {
//...
}
}

Rados
++>
++>Michael
++>
++>On Wed, 17 Jul 2002, David Russell wrote:
++>
++>> Hi all,
++>>
++>> I am finally spending some time converting a million and one functions
++>> into a class - this is for a software issue tracking system.
++>>
++>> I have:
++>>
++>> class issue {
++>>var
++>>var
++>>...
++>>
++>>function issue() { //default constructor
++>>  //initialise all variables to defaults, and start getting the stuff
++>> from forms
++>>}
++>>
++>>function issue($number) { //1 variable constructor
++>>  // Query database and populate variables accordingly
++>>}
++>> }
++>>
++>> My question is: will this work? does PHP OOP support more than one
++>> constructor? If my syntax is wrong, please let me know the correct syntax.
++>>
++>> Thanks
++>>
++>> David R
++>>
++>>
++>>
++>
++>

-- 
--
 pozdr
Rad0s

Radek Gajewski [EMAIL PROTECTED] GG:694459 ICQ:110153822



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




[PHP] Re: Includes vs. Functions

2002-07-17 Thread Monty

Chris, thanks for describing your method. The reason I really dislike
Functions in PHP is because you have to pass every variable needed by a
function, even if that variable is global in the main script, which is a
pain in the ass when a function needs a long string of variables. It makes
it easier to forget a variable in the list and can make the code look messy.

So, that's why I prefer includes, because the code is operating on the same
level as the main script and can easily use variables set locally without
making them global.

I'll use a function if it only needs one or two variables passed to it, but,
I find myself using more Includes than Functions because of the variable
passing necessary. 

Tom



> From: [EMAIL PROTECTED] (Chris Crane)
> Organization: Inxdesign.com
> Reply-To: "Chris Crane" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Date: Wed, 17 Jul 2002 17:05:59 -0400
> To: [EMAIL PROTECTED]
> Subject: Re: Includes vs. Functions
> 
> I am not sure about efficiency, myself and I often ask this without much if
> anything at all for a response. However, I am the opposite of you, in that I
> prefer to create a library file containing all the functions. To make
> developing the page in something like Dreamweaver or Frontpage easier, I
> global all the variables of a given function, like say Function
> StockQuote($sym) { }. They I include the library file in my PHP
> webpage.Something like this...
> 
> 
> 
> ~blah
> 
> 
> 
> 
> various html
> ~blah
> ~blah
> 
> 
> ~blah
> ~blah
> 
> 
> 
> In the library file, I global the variables;
> 
> function StockQuote($sym) {
> 
> global $Stock_LastPrice, $Stock_Position;
> get the data...
> do something with the data...
> $Stock_LastPrice = This minus that blah blah;
> }
> 
> I can use this variable anywhere I would like and it is very WYSIWYG
> friendly.
> 
> I am not sure how efficient it is though as I mentioned above.
> 


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




[PHP] Re: Restart process from code?

2002-07-17 Thread Peter

You need a program to control the ASP process. This is proably some sort of
command line tool and you just put whatever you would type in the
commandline into the exec() function. (in quotes of course!)


"Noah Spitzer-Williams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there a way to restart a process (actually the process to handle ASP
> pages) from code?
>
> - Noah
>
>



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




[PHP] Re: ErrorDocument 404 & Form

2002-07-17 Thread Peter

Can posting to a non existent page give a different error? I know it gives
404 on mine.
Probably not much help but it's a thought!

"Fabien Penso" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi.
>
> I got a trouble I don't know if Apache or PHP is in fault. Let's say I
> got something like :
>
> ErrorDocument 404 /engine.php
>
> If I make a form which use POST and redirect to something which doesn't
> exist, then a phpinfo() in engine.php won't show the variables. Am I
> wrong thinking it should ? Is there a way to make this work ?
>
> Thanks.
>
> --
> Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
> http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/



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




[PHP] Re: Includes vs. Functions

2002-07-17 Thread Chris Crane

I am not sure about efficiency, myself and I often ask this without much if
anything at all for a response. However, I am the opposite of you, in that I
prefer to create a library file containing all the functions. To make
developing the page in something like Dreamweaver or Frontpage easier, I
global all the variables of a given function, like say Function
StockQuote($sym) { }. They I include the library file in my PHP
webpage.Something like this...



~blah




various html
~blah
~blah


~blah
~blah



In the library file, I global the variables;

function StockQuote($sym) {

global $Stock_LastPrice, $Stock_Position;
get the data...
do something with the data...
$Stock_LastPrice = This minus that blah blah;
}

I can use this variable anywhere I would like and it is very WYSIWYG
friendly.

I am not sure how efficient it is though as I mentioned above.



"Monty" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I generally prefer to include various blocks of code in templates using
> include_once() rather than load a functions library and make calls to
those
> functions within the script.
>
> Is there a big difference in efficiency and speed of includes vs. custom
> functions? I like includes because it's easier to drop blocks of code in a
> page design without disrupting the design of the page very much.
>
> Thanks,
>
> Monty
>



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




Re: [PHP] Of Jobs and Certs

2002-07-17 Thread Peter J. Schoenster


On 17 Jul 2002 at 12:55, Miguel Cruz wrote:

> On Wed, 17 Jul 2002, Martin Clifford wrote:
> > I'd like to get everyone's input on Jobs and Certs.  I know there
> > are a couple Certifications for web developers out there, such as
> > the CIW and CWP certifications.
> 
> I don't know if this is what you want to hear, but I can tell you that
> as a rule, I don't hire people who advertise certifications on their
> resume.
> 
> I've found that they correlate pretty strongly with incompetence, to
> the point where nothing saves me more time when filtering through
> resumes than first throwing away the ones covered with acroyms
> starting with C or MC.
> 
> People who have the skills, demonstrate it through their work
> experience, walking through their sample code with me, and their
> ability to explain how they would perform a task. People who trumpet
> certifications overwhelmingly seem to be people who were unable to
> advance their careers based on the strength of their skills, and so
> chose to resort to a paper method instead. I'm not saying anything
> about you here, just suggesting that you consider alternate means of
> impressing employers.

:) ... this is a laugh. 

There must be one Miguel for 10,000 other managers. What Miguel said above is what any 
rational, competent manager would do. I cannot tell you how many times I send my 
resume but I put a link to 
my code (they can download entire apps so they can see not only snippets but how I 
organize or disorganize my code). No one, not one, has ever bothered to look at my 
code and questioned me. I 
interviewed with Jeffrey Friedl of regex fame and even he did not look at my code 
(although when I said I did not know something he laughed and said he did not know 
either, "that's why we have 
reference books").

I think getting the CERTS is not bad. Certainly the smart person will do as Miguel 
suggests, but I think he's in the VAST minority. I know a guy who has a consulting 
firm. It's a M$ shop. They BLAST 
their M$ certs everywhere. The software business is too new imho. Most people who 
should know better will be bamboolzed by CERTS. 

One manager sent out an email to everyone who responded to an ad. He offered general 
suggestions to everyone. I thought that was a dern good thing. He suggested people 
send Brainbench exam 
results. I'm sure certs would have helped as well. Even though this guy was "nice" I 
doubt he could get around code. imho, there are just far, far too few people who can 
judge someone by their code. I 
say get the certs. Personally, I could never work for someone who needed that so I 
don't bother, but if you want a job, I can't see that it hurts AT ALL.

Heck, I'm gonna rant if I keep going ... ever have someone ask you if you know FTP :) 
... like a smart person could not show another smart person about that in 15 minutes. 
It's just amazing  what 
passes for competence in the IT world.  I had a boss who I swear sincerely said he 
could "double click a mouse". The guy was serious. I did not last at that job :)

Peter






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




Re: [PHP] how to access javascipt variables in PHP

2002-07-17 Thread Martin Clifford

You can blend the two... sort of.







I'm not aware of any PHP vars that hold screen information.

HTH

Martin

>>> "Seppo Laukkanen" <[EMAIL PROTECTED]> 07/17/02 03:06PM >>>
Can anybody help?

I have javascript code to find out browsers width and height, but they
are stored in javascript variables. How can I access them from PHP? Or
is there a method to do same in PHP straightly?

Thanks,
Seppo



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



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




Re: [PHP] Includes vs. Functions

2002-07-17 Thread 1LT John W. Holmes

The only difference I can think of is that if you included everything at
once, in function or whatever, then that's only 1 file open and read. if
you're doing a bunch of includes all over the place, then your doing more
file open and reads. Not sure if it really affects your script in the grand
scheme of things. the actually processing of the code should outway most of
it, anyhow...

---John Holmes...

- Original Message -
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 4:32 PM
Subject: [PHP] Includes vs. Functions


> I generally prefer to include various blocks of code in templates using
> include_once() rather than load a functions library and make calls to
those
> functions within the script.
>
> Is there a big difference in efficiency and speed of includes vs. custom
> functions? I like includes because it's easier to drop blocks of code in a
> page design without disrupting the design of the page very much.
>
> Thanks,
>
> Monty
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] how to access javascipt variables in PHP

2002-07-17 Thread 1LT John W. Holmes

You have to submit the variables back to PHP by refreshing/requesting
another page. Once javascript finds the values..PHP is done executing.

So have the values put into hidden elements of a form that's submitted, or
tacked on to the end of a URL and redirected to another page...

---John Holmes...

- Original Message -
From: "Seppo Laukkanen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 3:06 PM
Subject: [PHP] how to access javascipt variables in PHP


> Can anybody help?
>
> I have javascript code to find out browsers width and height, but they
> are stored in javascript variables. How can I access them from PHP? Or
> is there a method to do same in PHP straightly?
>
> Thanks,
> Seppo
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Restart process from code?

2002-07-17 Thread Analysis & Solutions

On Wed, Jul 17, 2002 at 02:21:27PM -0400, Noah Spitzer-Williams wrote:
> How do I end the process using exec? Is there an equivalent to NET STOP?

Inside the exec(), issue whatever commands you'd type into a command 
line...

exec('NET STOP foo');

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] how to access javascipt variables in PHP

2002-07-17 Thread Seppo Laukkanen

Can anybody help?

I have javascript code to find out browsers width and height, but they
are stored in javascript variables. How can I access them from PHP? Or
is there a method to do same in PHP straightly?

Thanks,
Seppo



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




Re: [PHP] Someone Help please

2002-07-17 Thread Analysis & Solutions

Chris:

Geez, this is your third thread on this today...  Lame.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Confused about the list() function

2002-07-17 Thread Analysis & Solutions

On Wed, Jul 17, 2002 at 12:26:08PM -0400, DonPro wrote:
> 
> $color_list = explode(",", $color);
> 
> Now that I have a string of colors delimited by commas, I would like to 
> parse the string and print out all my colors.

Start with turning on line wrapping in your email client...

Now, your sentence isn't specific enough.  What do you mean by you "want
the print out all my colors?"  Specifically what do you want your output
to look like?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Re: sorting and searching an Array

2002-07-17 Thread Monty

This would be MUCH MUCH easier to do if this data were in a database instead
of a flat file. But, to accomplish this you need to write some code using
the various array functions in PHP, such as asort() and explode(), and
structures such as for() and each() to eliminate the array rows that don't
match your criteria.

"PHP and MySQL Web Development" by Luke Welling and Laura Thomson is a great
book for learning PHP (it's what I used). There's not a whole chapter on
file functions in PHP, but, there is enough info in there to do all the
basic functions you would need to accomplish this task.

Monty


> From: [EMAIL PROTECTED]
> Reply-To: Richard Kurth <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Date: Wed, 17 Jul 2002 12:52:00 -0700
> To: php-general <[EMAIL PROTECTED]>
> Subject: sorting and searching an Array
> 
> After I read this file into an array (small sample of file below) I need to
> sorted it by the name at
> the end of each line and then echo out only the ones that the name
> equals the name in a search variable.
> 
> Also could somebody recommend a PHP book that covers a lot of info on
> working with text files. It seams to be very little info in any of the
> boos I have now. It is sort of skipped over a lot
> 
> [EMAIL PROTECTED]   mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> 


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




Re: [PHP] ARRAY_PUSH()

2002-07-17 Thread Analysis & Solutions

Chris:

Why'd you start a second thread on this?  See my reply in the "File
reading help with Syntax" thread.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Includes vs. Functions

2002-07-17 Thread Monty

I generally prefer to include various blocks of code in templates using
include_once() rather than load a functions library and make calls to those
functions within the script.

Is there a big difference in efficiency and speed of includes vs. custom
functions? I like includes because it's easier to drop blocks of code in a
page design without disrupting the design of the page very much.

Thanks,

Monty


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




Re: [PHP] sorting and searching an Array

2002-07-17 Thread Kevin Stone

Instead of an indexed array build an associative array and sort with one of
the built-in PHP functions..

$myary = array (
'mrgouldian' => '[EMAIL PROTECTED]',
'myname'=> '[EMAIL PROTECTED]');
ksort($myary);

-Kevin

- Original Message -
From: <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:52 PM
Subject: [PHP] sorting and searching an Array


> After I read this file into an array (small sample of file below) I need
to sorted it by the name at
>  the end of each line and then echo out only the ones that the name
>  equals the name in a search variable.
>
>  Also could somebody recommend a PHP book that covers a lot of info on
>  working with text files. It seams to be very little info in any of the
>  boos I have now. It is sort of skipped over a lot
>
> [EMAIL PROTECTED]   mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Re: sorting and searching an Array

2002-07-17 Thread Dan Koken

Unless I'm missing something, why put it in an array. Why not just just 
select the data from the data base that matches your search_name and 
list it. Something like:

SELECT e_mail, name FROM e_mail_file
WHERE name = '$search_name'
ORDER by name

HTH.
Dan.


[EMAIL PROTECTED] wrote:
>  After I read this file into an array (small sample of file below) I need to sorted 
>it by the name at
>  the end of each line and then echo out only the ones that the name
>  equals the name in a search variable.
> 
>  Also could somebody recommend a PHP book that covers a lot of info on
>  working with text files. It seams to be very little info in any of the
>  boos I have now. It is sort of skipped over a lot
> 
> [EMAIL PROTECTED]   mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED]   myname
> [EMAIL PROTECTED] mrgouldian
> [EMAIL PROTECTED]   myname
> 



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




[PHP] Segmentation fault with Sablotron xslt_process()

2002-07-17 Thread William S.

I am getting random Segmentation faults when I use
the following script. This does not happen when I run
scripts that do not include the xslt_process()
So I am assuming it has something to do with Sablotron and xslt.
Below is also the back trace with the problem.
Can anyone suggest a solution or next step?


%s", 
xslt_errno($_parser), xslt_error($_parser) );
}
ob_end_clean();
xslt_free($_parser);
echo $result;
?>

Starting program: /usr/sbin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
__libc_free (mem=0x2) at malloc.c:3135
3135malloc.c: No such file or directory.
in malloc.c
(gdb) bt
#0  __libc_free (mem=0x2) at malloc.c:3135
#1  0x0808a177 in hashTableDestroy ()
#2  0x080890c2 in XML_ErrorString ()
#3  0x080833ea in XML_ParserFree ()
#4  0x4040fd29 in TreeConstructer::parseDataLineUsingExpat (this=0xbfffdcc4, 
S=@0x81202d0,
t=0x8132990, d=0x8131fc0, base_=0x0) at parser.cpp:149
#5  0x40432767 in Tree::parse (this=0x8132990, S=@0x81202d0, d=0x8131fc0) at 
tree.cpp:1373
#6  0x40416328 in Processor::addLineParse (this=0x8120348, S=@0x81202d0, 
newTree=@0x8120348,
absolute=@0xbfffdda0, isXSL=0, ignoreErr=0) at proc.cpp:573
#7  0x404168d2 in Processor::readTreeFromURI (this=0x8120348, S=@0x81202d0, 
newTree=@0x8120348,
location=@0xbfffde40, base=@0xbfffde28, isXSL=0, ignoreErr=0) at proc.cpp:621
#8  0x4041482d in Processor::open (this=0x8120348, S=@0x81202d0,
sheetURI=0x810ba6c "./aaindex.xsl", inputURI=0x810b994 "./aanews.xml") at 
proc.cpp:303
#9  0x4041e5d7 in SablotRunProcessor (processor_=0x8120348, sheetURI=0x810ba6c 
"./aaindex.xsl",
inputURI=0x810b994 "./aanews.xml", resultURI=0x40374da3 "arg:/_result", params=0x0,
arguments=0x0) at sablot.cpp:450
#10 0x4034813b in zif_xslt_process (ht=3, return_value=0x81207ec, this_ptr=0x0,
return_value_used=1) at sablot.c:512
#11 0x4026e047 in execute (op_array=0x81121dc) at ./zend_execute.c:1598
#12 0x4027f994 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
#13 0x40292f35 in php_execute_script (primary_file=0xb4e8) at main.c:1381
#14 0x4028d600 in apache_php_module_main (r=0x8109544, display_source_mode=0) at 
sapi_apache.c:90
#15 0x4028e538 in send_php (r=0x8109544, display_source_mode=0,
filename=0x8109c4c "/var/www/htdocs/index.php") at mod_php4.c:575
#16 0x4028e5bb in send_parsed_php (r=0x8109544) at mod_php4.c:590
#17 0x08055439 in ap_invoke_handler ()
#18 0x0806b0cf in ap_some_auth_required ()
#19 0x0806b536 in ap_internal_redirect ()
#20 0x401d1daa in handle_dir () from /usr/libexec/mod_dir.so
#21 0x08055439 in ap_invoke_handler ()
#22 0x0806b0cf in ap_some_auth_required ()
#23 0x0806b136 in ap_process_request ()
#24 0x08061ae6 in ap_child_terminate ()
#25 0x08061cc5 in ap_child_terminate ()
#26 0x08061e3c in ap_child_terminate ()
#27 0x080624cd in ap_child_terminate ()
#28 0x08062d5c in main ()
#29 0x4009217d in __libc_start_main (main=0x8062998 , argc=2, ubp_av=0xba04,
init=0x804f348 <_init>, fini=0x809adc0 <_fini>, rtld_fini=0x4000a534 <_dl_fini>,
stack_end=0xb9fc) at ../sysdeps/generic/libc-start.c:129
(gdb)


-- 
Bill
Amsterdam, NL

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




[PHP] preg_replace_callback

2002-07-17 Thread Rafael Fernandes

First, sorry for my elementary english...
I need a function made for PHP3 that works like preg_replace_callback...
Sugestions???
-- 
Rafael Fernandes
WebDeveloper - Aleph TI Ltda. / Matrix Internet Provider
E-Mail: [EMAIL PROTECTED]
Uin: 5551571

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




Re: [PHP] Printer margins

2002-07-17 Thread Paul Roberts

have a look at the @page spec in the css docs at w3c.org

I use this for A4 paper, you can set the margins as well:

@page{
  size : "21.0cm 29.7cm ";
 }

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Manuel'" <[EMAIL PROTECTED]>; "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:57 AM
Subject: RE: [PHP] Printer margins


You can't change this type of setting on a client's browser
The only way you'd be able to do this is to tell the user that the page
prints best when margins are set to 0.25"

-Original Message-
From: Manuel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 10:52 AM
To: PHP General
Subject: [PHP] Printer margins


I'm creating an HTML file that will be printed by my website users. I've
notices that most browser have the default print margins set to 0.75". Is
there any way to change the print margins to 0.25"?


-
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes

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





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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread Tom Ray

Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
httpd.conf or an .htaccess file) follows absolute paths, so you are calling
your engine.php out of the root directory of the machine. So the question
is, do you have engine.php in the / folder? If not you can put it there or
just adjust your ErrorDocument command to point to the path of the file.

Hope this helps.


- Original Message -
From: "Fabien Penso" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:21 PM
Subject: [PHP] ErrorDocument 404 & Form


> Hi.
>
> I got a trouble I don't know if Apache or PHP is in fault. Let's say I
> got something like :
>
> ErrorDocument 404 /engine.php
>
> If I make a form which use POST and redirect to something which doesn't
> exist, then a phpinfo() in engine.php won't show the variables. Am I
> wrong thinking it should ? Is there a way to make this work ?
>
> Thanks.
>
> --
> Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
> http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] sorting and searching an Array

2002-07-17 Thread rdkurth

 After I read this file into an array (small sample of file below) I need to sorted it 
by the name at
 the end of each line and then echo out only the ones that the name
 equals the name in a search variable.

 Also could somebody recommend a PHP book that covers a lot of info on
 working with text files. It seams to be very little info in any of the
 boos I have now. It is sort of skipped over a lot

[EMAIL PROTECTED]   mrgouldian
[EMAIL PROTECTED]   myname
[EMAIL PROTECTED] mrgouldian
[EMAIL PROTECTED] mrgouldian
[EMAIL PROTECTED]   myname
[EMAIL PROTECTED] mrgouldian
[EMAIL PROTECTED]   myname
[EMAIL PROTECTED]   myname
[EMAIL PROTECTED] mrgouldian
[EMAIL PROTECTED]   myname


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




Re: [PHP] how many requests can php serve?

2002-07-17 Thread Chris Hewitt

Andy wrote:

>ok .. you are right. But how about an average.. between 20 users per minute
>or similar is this a common rate on this data? :
>
>
>Is there something like a benchmark available on such thing?
>
Apache comes with ab for load testing. Maybe that will provide you with 
a means of making meaningful comparisons. There will be a "php" aspect 
to it, php opposed to say 3-tier java, but also things like is php a 
cgi, apache module or actually compiled into apache.

When I hear of sites "going down" I perhaps incorrectly start saying 
there is something wrong. They should get slower but with connection 
throttling etc they should never actually crash. Or am I in WonderWorld?

HTH
Chris


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




Re: [PHP] Of Jobs and Certs [long]

2002-07-17 Thread Chris Hewitt

Jay Blanchard wrote:

>
>+1 Miguel
>
+2 Chris

I found when hiring people in the electronics industry that those who 
were genuinely interested in the subject (as a hobby) and then did a 
course were much better for the company than those that just had lots of 
pieces of paper.


I find that it is the non-technical managers who like the pieces of 
paper, as they are not technical enough to evaluate on anything else.


Chris


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




Re: [PHP] how many requests can php serve?

2002-07-17 Thread Blair Colbey


Ever tried the basic ab (apache benchmark)??  It comes with the unix
distro of it.. not sure about windows..YOu can test say 1000 requests
with as many as you want at the same time..

Works good for load testing a group of servers behind a load balancer..



On Wed, 17 Jul 2002, Andy wrote:

> ok .. you are right. But how about an average.. between 20 users per minute
> or similar is this a common rate on this data? :
> 
> > - Your network connection
> >  100 MBit
> > - Your hard drive
> > pretty fast
> > - Your RAM
> > 256MB
> > - Your CPU
> > Celleron 900
> > - Your database
> > mysql
> > - The design of your site
> > as good as it gets:-)
> > - What the users are doing
> > mainly displaying images 4 - 40 kb
> > - Your caching strategy
> ? No cashing server site.
> 
> Is there something like a benchmark available on such thing?
> 
> Andy
> 
> 
> 
> "Miguel Cruz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Wed, 17 Jul 2002, Andy wrote:
> > > I am wondering how many requests at one time php can serve before the
> site
> > > brakes down. Someone told me that my site has been down yesterday for a
> > > while after I did anounce it through a university email list going to
> 2500
> > > users.
> >
> > It depends on:
> >
> > - Your network connection
> >
> > - Your hard drive
> >
> > - Your RAM
> >
> > - Your CPU
> >
> > - Your database
> >
> > - The design of your site
> >
> > - What the users are doing
> >
> > - Your caching strategy
> >
> > miguel
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] RE: [PHP-WIN] CRON JOB

2002-07-17 Thread Svensson, B.A.T. (HKG)

% man crontab 

-Original Message-
From: MAAS
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2002-07-17 14:51
Subject: [PHP-WIN] CRON JOB


What do I have to do before I can run my file.php as a cron job in
Linux?




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

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




[PHP] imap_mail_move and imap_mail_copy

2002-07-17 Thread Jeff Schwartz

Has anyone had experience with imap_mail_move or imap_mail_copy? 

Can they copy or move a message from one mail server to another or only
into a subfolder on the same server? 

Jeff

__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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




Re: [PHP] how many requests can php serve?

2002-07-17 Thread Andy

ok .. you are right. But how about an average.. between 20 users per minute
or similar is this a common rate on this data? :

> - Your network connection
>  100 MBit
> - Your hard drive
> pretty fast
> - Your RAM
> 256MB
> - Your CPU
> Celleron 900
> - Your database
> mysql
> - The design of your site
> as good as it gets:-)
> - What the users are doing
> mainly displaying images 4 - 40 kb
> - Your caching strategy
? No cashing server site.

Is there something like a benchmark available on such thing?

Andy



"Miguel Cruz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wed, 17 Jul 2002, Andy wrote:
> > I am wondering how many requests at one time php can serve before the
site
> > brakes down. Someone told me that my site has been down yesterday for a
> > while after I did anounce it through a university email list going to
2500
> > users.
>
> It depends on:
>
> - Your network connection
>
> - Your hard drive
>
> - Your RAM
>
> - Your CPU
>
> - Your database
>
> - The design of your site
>
> - What the users are doing
>
> - Your caching strategy
>
> miguel
>



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




RE: [PHP] Of Jobs and Certs [long]

2002-07-17 Thread Jay Blanchard

[snip]
I don't know if this is what you want to hear, but I can tell you that as
a rule, I don't hire people who advertise certifications on their resume.

I've found that they correlate pretty strongly with incompetence, to the
point where nothing saves me more time when filtering through resumes than
first throwing away the ones covered with acroyms starting with C or MC.

People who have the skills, demonstrate it through their work experience,
walking through their sample code with me, and their ability to explain
how they would perform a task. People who trumpet certifications
overwhelmingly seem to be people who were unable to advance their careers
based on the strength of their skills, and so chose to resort to a paper
method instead. I'm not saying anything about you here, just suggesting
that you consider alternate means of impressing employers.
[/snip]

+1 Miguel

I recently had the opportunity to hire someone for a basic web developer
position, so I decided to approach the process differently. I decided that
in all fairness I would give each candidate who applied the chance to prove
themselves. I started with a written test with 20 questions, basic web
development, mostly multiple choice. The highest score was a 68, (out of a
possible 100) posted by a recent (less than 6 months earlier) college
graduate with a degree in Computer Science. Needless to say I was shocked! I
saw all sorts of certs attached to this group.

I brought in the top 5 scorers (they took the original test during the
application process, or were sent the test if they e-mailed their apps with
a requirement to complete and return the test is 24 hours ... and these
e-mail resume senders didn't bother to use the 24 given them TO LOOK UP THE
ANSWERS...DUH!) who actually sent URL's for me to look at (I looked at the
source to see if FrontPage or anything such as that had been used - if so
they were eliminated) for 2 additional tests.

I gave each a 5 question verbal exam which included questions about
standards, documentation, identification of code, basic database knowledge,
etc. Each question was worth 20 points. Hell, I even gave a person 5 points
for honestly answering "I don't know.". High score: 65 points.

The final test. I gave each a basic visual site layout on paper which
included a small table, unordered list, basic headers, basic paragraph,
etc.. (No dynamic elemnets or db connections)  They were seated at a Windows
computer with a copy of notepad and IE. They were given the address of the
graphic to include. All they had to do was type, save, change to browser,
reload, check their progress and move on. Each correct element (tag) was
awarded 5 points for a total of 100 (20 correct elements). I had another 25
bonus points I would give if any used basic CSS. They had 1 hour to hand
code as close as they could get to what had been laid out on paper.

High Score: 60, none used CSS, but I did see lots of font tags!
Total High Score: 178 (The Guy with the BS in CS above) out of a possible
300 ... 59.3 % (Johnny can't read or write code either :^] )

I didn't hire him...I went to have a beer. Myself and a couple of other app
devs were sitting ROFLOAO about the whole thing. I guess the beer increased
our volume level, because a guy came up and said he heard what we were
saying and that he was a web guy looking for a steady gig. I started
interviewing him right there. No certs, no degree. Went to the office,
looked at sites he had a hand in. He described not only basic HTML stuff,
but CSS, ASP, JavaScript, PHP, a smattering of SQL (in which he clames to be
weak), and a couple of other things. He took the 20 question multiple
(remember, we had had a few ;^] ) and he got a 95. Missed the question about
which tag is absolutely required in an HTML page. He hand coded the example
while drinking a Bud Lite, completed it in 15 minutes, missed a couple of
completion tags (like ) and used CSS.

Hired him. Took him back to the bar. Happy ever since.

Moral of story? Learn to write code and listen to loud guys in bars. It may
pay someday.

Jay

"Football incorporates the two worst elements of American society: violence
punctuated by committee meetings." -George Will

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




Re: [PHP] Restart process from code?

2002-07-17 Thread Noah Spitzer-Williams

How do I end the process using exec? Is there an equivalent to NET STOP?

- Noah

- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 2:28 PM
Subject: RE: [PHP] Restart process from code?


> So? Use exec(). Use it twice if you have to. If you can run a command on
> the command line, then you can run it through exec. Only difference is
> if the user PHP is running as can run the command.
>
> ---John Holmes...
>
> > -Original Message-
> > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 2:10 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
> > [EMAIL PROTECTED]
> > Subject: Re: [PHP] Restart process from code?
> >
> > But I would like to restart the process as in it's currently
> running
> > and
> > I want to end it and then start it again...
> >
> >
> >  - Noah
> >
> > - Original Message -
> > From: "John Holmes" <[EMAIL PROTECTED]>
> > To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 17, 2002 2:18 PM
> > Subject: RE: [PHP] Restart process from code?
> >
> >
> > > You can use exec(), as long as the user PHP is running as has
> permission
> > > to execute the program...
> > >
> > > ---John Holmes...
> > >
> > > > -Original Message-
> > > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, July 17, 2002 1:20 PM
> > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > > Subject: [PHP] Restart process from code?
> > > >
> > > > Is there a way to restart a process (actually the process to
> handle
> > > ASP
> > > > pages) from code?
> > > >
> > > > - Noah
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




Re: [PHP] how many requests can php serve?

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Andy wrote:
> I am wondering how many requests at one time php can serve before the site
> brakes down. Someone told me that my site has been down yesterday for a
> while after I did anounce it through a university email list going to 2500
> users.

It depends on:

- Your network connection

- Your hard drive

- Your RAM

- Your CPU

- Your database

- The design of your site

- What the users are doing

- Your caching strategy

miguel


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




Re: [PHP] Someone Help please

2002-07-17 Thread Chris Crane

I will try it now...Thank you.
"John Holmes" <[EMAIL PROTECTED]> wrote in message
000301c22dbe$b5caacf0$b402a8c0@mango">news:000301c22dbe$b5caacf0$b402a8c0@mango...
> File() will read the file into an array, each element of the array will
> be a line from the file. Explode() will then split that line by the
> delimiter you choose...
>
> So something like this:
>
> $file = file("filename.txt");
> foreach($file as $line)
> {
>   $part = explode(',',$line);
>   //now you have an array, $part[],
>   //that holds each element of the
>   //current line, do what you will
> }
>
> ---John Holmes...
>
> > -Original Message-
> > From: Chris Crane [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 1:17 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Someone Help please
> >
> > I am getting data froma website for stock information. If I type in
> the
> > brower the URL I get a text file display list this;
> >
> > Date,Open,High,Low,Close,Volume
> > 16-Jul-02,7.92,8.10,7.68,7.82,605500
> > 15-Jul-02,7.98,8.02,7.59,8.02,577200
> > 12-Jul-02,7.80,8.00,7.57,7.95,411100
> > 11-Jul-02,7.82,7.94,7.34,7.80,802400
> >
> > Now I want to break each line and then seperate each line by the
> commas.
> > The
> > amount of linesin the file is never known so I assume I have to use
> > something like a foreach or while statement,but I am not sure the best
> way
> > to do it. This is what I have so far.
> >
> >  $Symbol = "IKN"; $LookupUrl =
> > "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt";;
> $Results =
> > implode('', file("$LookupUrl"));
> >  $Data = array(); split("\n", $Results) = array_push($Data, $line)
> >
> > The end result I am trying to get is each line to be an element in an
> > array.
> > Later I will go back and stepthrough each element of the array and
> then
> > split that by the commas and have it output into an HTML table.At
> least
> > this
> > is the best way I can think to deal with it. I suppose a better way to
> do
> > this would be to make this an associative array and have the data of
> each
> > line be associated with the date then I could producea variable
> something
> > like $StockData[16-Jul-02][value], but I don't know how to do any of
> that.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




RE: [PHP] Restart process from code?

2002-07-17 Thread John Holmes

So? Use exec(). Use it twice if you have to. If you can run a command on
the command line, then you can run it through exec. Only difference is
if the user PHP is running as can run the command. 

---John Holmes...

> -Original Message-
> From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 2:10 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
> [EMAIL PROTECTED]
> Subject: Re: [PHP] Restart process from code?
> 
> But I would like to restart the process as in it's currently
running
> and
> I want to end it and then start it again...
> 
> 
>  - Noah
> 
> - Original Message -
> From: "John Holmes" <[EMAIL PROTECTED]>
> To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, July 17, 2002 2:18 PM
> Subject: RE: [PHP] Restart process from code?
> 
> 
> > You can use exec(), as long as the user PHP is running as has
permission
> > to execute the program...
> >
> > ---John Holmes...
> >
> > > -Original Message-
> > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, July 17, 2002 1:20 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: [PHP] Restart process from code?
> > >
> > > Is there a way to restart a process (actually the process to
handle
> > ASP
> > > pages) from code?
> > >
> > > - Noah
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] File reading help with Syntax

2002-07-17 Thread Analysis & Solutions

On Wed, Jul 17, 2002 at 10:00:29AM -0400, Chris Crane wrote:
> I am getting data froma website for stock information. If I type in the
> brower the URL I get a text file display list this;
> 
> Date,Open,High,Low,Close,Volume
> 16-Jul-02,7.92,8.10,7.68,7.82,605500
> 15-Jul-02,7.98,8.02,7.59,8.02,577200
> 12-Jul-02,7.80,8.00,7.57,7.95,411100
> 11-Jul-02,7.82,7.94,7.34,7.80,802400

So, now you're working an another approach to the stock quote question, 
eh?

Use these functions:
   fopen()
   fgetcsv()

Look at the manual on how to use them.  If, for some reason, that's not 
clear, check out the archives for this list on http://groups.google.com/.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] how many requests can php serve?

2002-07-17 Thread Andy

Hi there,

I am wondering how many requests at one time php can serve before the site
brakes down. Someone told me that my site has been down yesterday for a
while after I did anounce it through a university email list going to 2500
users.

Maybe there is a smart artikle on that.

Thanx for any help,

Andy-






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




Re: [PHP] Opening and Editing Quark Binaries

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Justin French wrote:
> I've attached a file I received with Quark 3.32, which has sample text
> complete with Quark Xpress tags.

XPress Tags is a great format, and easy to work with for auto-generated 
content.

However, all you can do with it is prepare text for a single running 
block - not lay out an entire document (unless you're extremely creative 
with rules and positioning, I guess).

> Just to throw a complete spanner in the works, Adobe InDesign2.0 has a lot
> of XML capabilities, and much more integrated PDF capabilities than Quark...
> perhaps either an XML based solution, or a PDFLib based solution can be
> achieved?
> 
> Considering InDesign is about 1/3rd the price of Quark, *maybe* you might
> want to consider other options aside from Quark.

Good luck convincing seasoned Quark operators to change, though!

miguel


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




Re: [PHP] Restart process from code?

2002-07-17 Thread Noah Spitzer-Williams

But I would like to restart the process as in it's currently running and
I want to end it and then start it again...


 - Noah

- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 2:18 PM
Subject: RE: [PHP] Restart process from code?


> You can use exec(), as long as the user PHP is running as has permission
> to execute the program...
>
> ---John Holmes...
>
> > -Original Message-
> > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 1:20 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: [PHP] Restart process from code?
> >
> > Is there a way to restart a process (actually the process to handle
> ASP
> > pages) from code?
> >
> > - Noah
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




RE: [PHP] Someone Help please

2002-07-17 Thread John Holmes

File() will read the file into an array, each element of the array will
be a line from the file. Explode() will then split that line by the
delimiter you choose...

So something like this:

$file = file("filename.txt");
foreach($file as $line)
{
  $part = explode(',',$line);
  //now you have an array, $part[], 
  //that holds each element of the 
  //current line, do what you will
}

---John Holmes...

> -Original Message-
> From: Chris Crane [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 1:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Someone Help please
> 
> I am getting data froma website for stock information. If I type in
the
> brower the URL I get a text file display list this;
> 
> Date,Open,High,Low,Close,Volume
> 16-Jul-02,7.92,8.10,7.68,7.82,605500
> 15-Jul-02,7.98,8.02,7.59,8.02,577200
> 12-Jul-02,7.80,8.00,7.57,7.95,411100
> 11-Jul-02,7.82,7.94,7.34,7.80,802400
> 
> Now I want to break each line and then seperate each line by the
commas.
> The
> amount of linesin the file is never known so I assume I have to use
> something like a foreach or while statement,but I am not sure the best
way
> to do it. This is what I have so far.
> 
>  $Symbol = "IKN"; $LookupUrl =
> "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt";;
$Results =
> implode('', file("$LookupUrl"));
>  $Data = array(); split("\n", $Results) = array_push($Data, $line)
> 
> The end result I am trying to get is each line to be an element in an
> array.
> Later I will go back and stepthrough each element of the array and
then
> split that by the commas and have it output into an HTML table.At
least
> this
> is the best way I can think to deal with it. I suppose a better way to
do
> this would be to make this an associative array and have the data of
each
> line be associated with the date then I could producea variable
something
> like $StockData[16-Jul-02][value], but I don't know how to do any of
that.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Restart process from code?

2002-07-17 Thread John Holmes

You can use exec(), as long as the user PHP is running as has permission
to execute the program...

---John Holmes...

> -Original Message-
> From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 1:20 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Restart process from code?
> 
> Is there a way to restart a process (actually the process to handle
ASP
> pages) from code?
> 
> - Noah
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Of Jobs and Certs

2002-07-17 Thread Danny Shepherd

I agree - nothing beats a good portfolio.

Danny.

- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "Martin Clifford" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 6:55 PM
Subject: Re: [PHP] Of Jobs and Certs


> On Wed, 17 Jul 2002, Martin Clifford wrote:
> > I'd like to get everyone's input on Jobs and Certs.  I know there are a
> > couple Certifications for web developers out there, such as the CIW and
> > CWP certifications.
>
> I don't know if this is what you want to hear, but I can tell you that as
> a rule, I don't hire people who advertise certifications on their resume.
>
> I've found that they correlate pretty strongly with incompetence, to the
> point where nothing saves me more time when filtering through resumes than
> first throwing away the ones covered with acroyms starting with C or MC.
>
> People who have the skills, demonstrate it through their work experience,
> walking through their sample code with me, and their ability to explain
> how they would perform a task. People who trumpet certifications
> overwhelmingly seem to be people who were unable to advance their careers
> based on the strength of their skills, and so chose to resort to a paper
> method instead. I'm not saying anything about you here, just suggesting
> that you consider alternate means of impressing employers.



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




Re: [PHP] php Similar to C in Pointer Memory Accessing or not?

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Kondwani Spike Mkandawire wrote:
> Just for interest sake, for those of you who have messed
> with C know about Pointers hence probably know that
> one can access stuff from Memory Locations in very wierd
> ways via pointers and Arrays:
> 
> int * ptr;
> ptr = array[0];
> ptr=ptr-1;
> 
> The last statement does not generate an error but lets you
> access that location...

It may generate an error. Depends on where ptr-1 happens to be. In any
case it's not a bright thing to do as the effects are undefined and
unknowable.

> Firstly I want to know if PHP has pointers (I know it uses
> dereferencing values via &) and if it does use pointers
> does it let you do stuff like this (or does its nature not
> let you interact with the lower level hardware components?

PHP doesn't have pointers as such. It has references but you can't do math 
on them to create other references.

Pointers don't have anything to do with lower level hardware components. 
They're just one way of dealing with memory.

miguel


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




Re: [PHP] Of Jobs and Certs

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Martin Clifford wrote:
> I'd like to get everyone's input on Jobs and Certs.  I know there are a
> couple Certifications for web developers out there, such as the CIW and
> CWP certifications.

I don't know if this is what you want to hear, but I can tell you that as 
a rule, I don't hire people who advertise certifications on their resume.

I've found that they correlate pretty strongly with incompetence, to the
point where nothing saves me more time when filtering through resumes than
first throwing away the ones covered with acroyms starting with C or MC.

People who have the skills, demonstrate it through their work experience,
walking through their sample code with me, and their ability to explain
how they would perform a task. People who trumpet certifications
overwhelmingly seem to be people who were unable to advance their careers
based on the strength of their skills, and so chose to resort to a paper
method instead. I'm not saying anything about you here, just suggesting
that you consider alternate means of impressing employers.

miguel


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




[PHP] ErrorDocument 404 & Form

2002-07-17 Thread Fabien Penso

Hi.

I got a trouble I don't know if Apache or PHP is in fault. Let's say I
got something like :

ErrorDocument 404 /engine.php

If I make a form which use POST and redirect to something which doesn't
exist, then a phpinfo() in engine.php won't show the variables. Am I
wrong thinking it should ? Is there a way to make this work ?

Thanks.

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/

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




Re[2]: [PHP] remove header tags - include file

2002-07-17 Thread Asmodean

JPA>  >Do you mean you want to include the file
JPA> html.html but not the "..." part?
JPA> Yes!!. In other words I just want show the part inside of  tag of the 
JPA> html.html

JPA> I know the answer is in a Regulars expression.. but.. i don't know much 
JPA> about it.


JPA> At 19:08 17-07-2002, you wrote:
>>JPA> Hi guys, me again.
>>JPA> (thanks kevin, but i'm afraid you didn't understand me).
>>
>>JPA> After looking for untiringly in the archives I have I decide to ask 
>>again.
>>
>>JPA> This is my problem:
>>JPA> I want include the file html.html inside of my file index.php, but 
>>before
>>JPA> include it I want to remove .. tags from my html.html file.
>>JPA> My pseudo code would be look like this:
>>
>>JPA>  > index.php
>>
>>JPA> >
>>JPA> include_once("common.php");
>>
>>JPA> header("Welcome to my page");
>>JPA>  include_html_file("html.html");
>>JPA> footer()
>>?>>
>>
>>
>>JPA>  > common.php
>>JPA> function include_html_file($f)
>>JPA>   {
>>JPA>  (your kind contribution:-) )
>>JPA>   }
>>
>>JPA> thanks!!
>>
>>JPA> --jp
>>
>>How do you mean remove? Do you mean you want to include the file
>>html.html but not the "..." part? And why?
>>
>>--
>>Best regards,
>>  Asmodeanmailto:[EMAIL PROTECTED]
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php

JPA> 
JPA> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
JPA> Ingeniero de Sistemas
JPA> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
JPA> Universidad Católica de Temuco.
JPA> Tel:(5645) 205 630 Fax:(5645) 205 628

Seems like a... strange thing to do. Anyway. Since I do not know of
any other way (if there is, anyone, tell), this is what you will have
to do.

1. Open the file with fopen()
2. Perform a regular expression on the content
3. Print the parsed cntents

For example:

$fp = fopen('html.html', 'r');
$content = fread($fp, filesize(html.html));

preg_match("/(.*?)<\/body>/s", $content, $matches);

The parsed contents are now in $matches[1].

I still don't understand why you want to do this, though. Seems like
there must be a better way.

-- 
Best regards,
 Asmodeanmailto:[EMAIL PROTECTED]


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




Fw: [PHP] Someone Help please

2002-07-17 Thread Kevin Stone

Parse all lines of a txt file into an array..
$ary = explode("\n", $results);
-Kevin

- Original Message -
From: "Chris Crane" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 11:16 AM
Subject: [PHP] Someone Help please


> I am getting data froma website for stock information. If I type in the
> brower the URL I get a text file display list this;
>
> Date,Open,High,Low,Close,Volume
> 16-Jul-02,7.92,8.10,7.68,7.82,605500
> 15-Jul-02,7.98,8.02,7.59,8.02,577200
> 12-Jul-02,7.80,8.00,7.57,7.95,411100
> 11-Jul-02,7.82,7.94,7.34,7.80,802400
>
> Now I want to break each line and then seperate each line by the commas.
The
> amount of linesin the file is never known so I assume I have to use
> something like a foreach or while statement,but I am not sure the best way
> to do it. This is what I have so far.
>
>  $Symbol = "IKN"; $LookupUrl =
> "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt";; $Results =
> implode('', file("$LookupUrl"));
>  $Data = array(); split("\n", $Results) = array_push($Data, $line)
>
> The end result I am trying to get is each line to be an element in an
array.
> Later I will go back and stepthrough each element of the array and then
> split that by the commas and have it output into an HTML table.At least
this
> is the best way I can think to deal with it. I suppose a better way to do
> this would be to make this an associative array and have the data of each
> line be associated with the date then I could producea variable something
> like $StockData[16-Jul-02][value], but I don't know how to do any of that.
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Restart process from code?

2002-07-17 Thread Noah Spitzer-Williams

Is there a way to restart a process (actually the process to handle ASP
pages) from code?

- Noah



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




RE: [PHP] CRON JOB

2002-07-17 Thread Miguel Cruz

On Wed, 17 Jul 2002, Jay Blanchard wrote:
> Look at the archives for the past couple of days, it has been covered in
> some detail. Make sure to compile PHP without apsx, and for practical
> purposes move the PHP executable to the /usr/local/bin directory. Then put
> this as the first line of the PHP file you want to run from a CRON;
> 
> #!/usr/local/bin/php
> 
> Then set up your CRON.

Might want to add the -q flag to the php bangpath invocation.

miguel


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




[PHP] Someone Help please

2002-07-17 Thread Chris Crane

I am getting data froma website for stock information. If I type in the
brower the URL I get a text file display list this;

Date,Open,High,Low,Close,Volume
16-Jul-02,7.92,8.10,7.68,7.82,605500
15-Jul-02,7.98,8.02,7.59,8.02,577200
12-Jul-02,7.80,8.00,7.57,7.95,411100
11-Jul-02,7.82,7.94,7.34,7.80,802400

Now I want to break each line and then seperate each line by the commas. The
amount of linesin the file is never known so I assume I have to use
something like a foreach or while statement,but I am not sure the best way
to do it. This is what I have so far.

 $Symbol = "IKN"; $LookupUrl =
"http://demos.inxdesign.com/download?sym=$Symbol&format=.txt";; $Results =
implode('', file("$LookupUrl"));
 $Data = array(); split("\n", $Results) = array_push($Data, $line)

The end result I am trying to get is each line to be an element in an array.
Later I will go back and stepthrough each element of the array and then
split that by the commas and have it output into an HTML table.At least this
is the best way I can think to deal with it. I suppose a better way to do
this would be to make this an associative array and have the data of each
line be associated with the date then I could producea variable something
like $StockData[16-Jul-02][value], but I don't know how to do any of that.










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




Re: [PHP] remove header tags - include file

2002-07-17 Thread Juan Pablo Aqueveque

 >Do you mean you want to include the file
html.html but not the "..." part?
Yes!!. In other words I just want show the part inside of  tag of the 
html.html

I know the answer is in a Regulars expression.. but.. i don't know much 
about it.


At 19:08 17-07-2002, you wrote:
>JPA> Hi guys, me again.
>JPA> (thanks kevin, but i'm afraid you didn't understand me).
>
>JPA> After looking for untiringly in the archives I have I decide to ask 
>again.
>
>JPA> This is my problem:
>JPA> I want include the file html.html inside of my file index.php, but 
>before
>JPA> include it I want to remove .. tags from my html.html file.
>JPA> My pseudo code would be look like this:
>
>JPA>  > index.php
>
>JPA> 
>JPA> include_once("common.php");
>
>JPA> header("Welcome to my page");
>JPA>  include_html_file("html.html");
>JPA> footer()
>?>>
>
>
>JPA>  > common.php
>JPA> function include_html_file($f)
>JPA>   {
>JPA>  (your kind contribution:-) )
>JPA>   }
>
>JPA> thanks!!
>
>JPA> --jp
>
>How do you mean remove? Do you mean you want to include the file
>html.html but not the "..." part? And why?
>
>--
>Best regards,
>  Asmodeanmailto:[EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628


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




Re: [PHP] imap connection problem

2002-07-17 Thread Korbinian Schmid

the important part (without this line the script works):

$mbox = imap_open ("{localhost/imap}INBOX","", "");

it`s the same without "INBOX"
i also tried different downloaded mailbox scripts so i think it's a
php-system problem.

Latex Master <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
> Hello Korbinian,
>   Can you provide the script code?
> Let's see how we can help
>
> Wednesday, July 17, 2002, 4:50:44 PM, you wrote:
>
> KS> when i try to connect to my local imap server by php i get the message
> KS> (standard ie message) that the page can't be shown. with another
server
> KS> (imap.web.de) everything works fine. with outlook i can access my
server
> KS> without any problems and also mtest seems to work without any errors.
what's
> KS> wrong. would be nice if anybody could help me.
>
> KS> CU Korbi
>
>
>
>
>
>
> --
> Best regards,
>  Latexmailto:[EMAIL PROTECTED]
>



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




Re: [PHP] remove header tags - include file

2002-07-17 Thread Asmodean

JPA> Hi guys, me again.
JPA> (thanks kevin, but i'm afraid you didn't understand me).

JPA> After looking for untiringly in the archives I have I decide to ask again.

JPA> This is my problem:
JPA> I want include the file html.html inside of my file index.php, but before 
JPA> include it I want to remove .. tags from my html.html file.
JPA> My pseudo code would be look like this:

JPA>  > index.php

JPA>  include_once("common.php");

JPA> header("Welcome to my page");
JPA>  include_html_file("html.html");
JPA> footer()
?>>


JPA>  > common.php
JPA> function include_html_file($f)
JPA>   {
JPA>  (your kind contribution:-) )
JPA>   }

JPA> thanks!!

JPA> --jp

How do you mean remove? Do you mean you want to include the file
html.html but not the "..." part? And why?

-- 
Best regards,
 Asmodeanmailto:[EMAIL PROTECTED]


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




[PHP] remove header tags - include file

2002-07-17 Thread Juan Pablo Aqueveque

Hi guys, me again.
(thanks kevin, but i'm afraid you didn't understand me).

After looking for untiringly in the archives I have I decide to ask again.

This is my problem:
I want include the file html.html inside of my file index.php, but before 
include it I want to remove .. tags from my html.html file.
My pseudo code would be look like this:

 > index.php




 > common.php
function include_html_file($f)
  {
 (your kind contribution:-) )
  }

thanks!!

--jp



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




Re: [PHP] Confused about the list() function

2002-07-17 Thread Asmodean

D> Hi,

D> I have the following situation.  I have an array of colors that I would like to 
print out.  My first course of action would be to convert the array to a string so 
that I can parse it.  My command
D> would be:

D> $color_list = explode(",", $color);

D> Now that I have a string of colors delimited by commas, I would like to parse the 
string and print out all my colors.  I have read the documentation on using the list() 
function but I find it
D> confusing.  Can someone clear the fog from my mind please?

D> Thanks,
D> Don

Assuming you have an array of colors called $color (and assuming I
haven't misread or misinterpreted any information), you can do the
following to directly print your colors.

// Prints out all colors comma-separated.
print(join(", ", $color));

// Prints out all colors linebreak-separated (HTML-wise).
print(join("", $color));

-- 
Best regards,
 Asmodeanmailto:[EMAIL PROTECTED]


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




RE: [PHP] Tips for better PHP, wish I read yesterday

2002-07-17 Thread Jay Blanchard

[snip]
Awhile back I was asking for just what I'm reading here:

http://www.php9.com/index.php/section/articles/name/PHP%20Guidelines

I have come across some of this in the documentation but not in your face
like it is here (and
should be).

Does anyone have any more links to articles like that?
[/snip]

http://www.zend.com/zend/columns.php
http://www.zend.com/zend/art/mistake.php
http://www.zend.com/zend/art/



Jay

Nobody in football should be called a genius. A genius is a guy like Norman
Einstein. -Joe Theismann

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




Re: [PHP] Confused about the list() function

2002-07-17 Thread 1LT John W. Holmes

How do you want to parse the string? why not just echo $color_list?

---John Holmes...

- Original Message -
From: "DonPro" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 12:26 PM
Subject: [PHP] Confused about the list() function


Hi,

I have the following situation.  I have an array of colors that I would like
to print out.  My first course of action would be to convert the array to a
string so that I can parse it.  My command would be:

$color_list = explode(",", $color);

Now that I have a string of colors delimited by commas, I would like to
parse the string and print out all my colors.  I have read the documentation
on using the list() function but I find it confusing.  Can someone clear the
fog from my mind please?

Thanks,
Don




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




  1   2   >