[PHP] Get the row number in php-script?

2001-09-16 Thread Håkan Askengren

Hi
Does anybody know how to get hold of the rownumber of the current row in a
php-script?
(Rownumber in the actual file.)

Thanks
/Håkan



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




Re: [PHP] Get the row number in php-script?

2001-09-16 Thread speedboy

 Does anybody know how to get hold of the rownumber of the current row in a
 php-script?
 (Rownumber in the actual file.)

echo __LINE__;


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




[PHP] meta redirect explanation

2001-09-16 Thread Nikola Veber

Hi !

Thanks for the quick answer. It works, but I was curious what does the number 
before the adress mean. META http-equiv=refresh 
content=??0??;url=file.php

Thanks

Nikola

9/16/01 4:08:08 AM, Gavin [EMAIL PROTECTED] wrote:

Yes, this HTML line will redirect the browser to the php page..

META http-equiv=refresh content=0;url=file.php

Gavin

Nikola Veber [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



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




php-general Digest 16 Sep 2001 11:04:42 -0000 Issue 879

2001-09-16 Thread php-general-digest-help


php-general Digest 16 Sep 2001 11:04:42 - Issue 879

Topics (messages 67471 through 67490):

PHP Auth problem
67471 by: Alex Sofronie

Please please please help!
67472 by: Kyle Smith

help with some nasty recursive algorithm
67473 by: Christian Dechery

Re: redirect to php problem
67474 by: David Otton
67478 by: Gavin

500 Internal Server Error
67475 by: Deryck Henson

How do I use a .tar file?
67476 by: Deryck Henson
67479 by: Jack Dempsey
67481 by: Deryck Henson
67483 by: Deryck Henson

International Jazz Competition held on the Internet
67477 by: Jazz Events

PHP versus ZOPE
67480 by: Carlos Fernando Scheidecker Antunes
67485 by: John Lim

sorting multi-dimensional arrays
67482 by: Christian Dechery

code optimization
67484 by: Christian Dechery

Re: Monitoring traffic
67486 by: John Lim

naming convention in php?
67487 by: saif

Get the row number in php-script?
67488 by: Håkan Askengren
67489 by: speedboy

meta redirect explanation
67490 by: Nikola Veber

Administrivia:

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

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

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


--



Hi all

I have a rather strange problem with php auth:

i want to authenticate a user through php and validate it through
imap_open function (to access his email).
I send WWW-Authenticate header like this:

header(WWW-Authenticate: Basic Realm=\Private\);


After, i check for isset($PHP_AUTH_USER) and validate it through PHP.

Can anyone tell me why, for a real user (it really exists), the
authentication simply fails and asks me again for a username and password,
without even leaving the authenticate intrinsic routine (the script just
keeps telling me that the auth is failed, but WITHOUT running imap_open or
any other part of the script).

Why is that?

If anyone has the time and the understanding, i can post the code
fragment.
Thanks

-
   Alexandru SOFRONIE
 [EMAIL PROTECTED]
-
IT Software Dept.
  Omega-Tehnoton GROUP
 +40-93-670773
-






In php is there any way to write to the end of a line in a text document so i can set 
out email addresses as a list on 1 line and the ; can be on the second... is this 
possible or has anyone a better way of doing this? any and all help would be 
appreciated (please send or cc messages to my address because im now going to watch a 
film... forgot what its called something about taking peoples brains out durning the 
night and replacing them with others!)

Thank you!


-lk6-
http://www.StupeedStudios.f2s.com
Home of the burning lego man!

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666






I need some help with an algorithm that I'm writing to build a categories 
array, based on the mysql table.

the table goes by:
id_category, name_category, parent_category

and with a simple query, with a group by and after doing a little for(;;) 
processing, I get the following array..

categ   | parent| num_childs
null   1   1
null   4   0
1  5   2
5  6   0
5  7   0

well... I have a function called CatName($id) that returns me the name of 
that giving its ID... so, I want from that array build a new array like this:

[0][id] = 1
[0][name] = Electronics
[1][id] = 5
[1][name] = Electronics/Palm
[2][id] = 6
[2][name] = Electronis/Palm/WindowsCE
[3][id] = 7
[3][name] = Electronis/Palm/PalmOS
[3][id] = 4
[3][name] = Food

preety nasty hun? I know its something recursive... but I can't figure out 
how to walk trough the array to get this kind of output...

any help will be welcome..

thanks...





On Sun, 16 Sep 2001 09:57:14 +0200, you wrote:

I'm having a problem with following : I'd like to activate a php file as a home page, 
but without pointing directly to it(http://www.smth.com/file.php). I'd like to know 
if it is 
possible to call it from a html file(index.htm for exp. )

index.php could include('file.php');

or you could redirect with header('Location...'); or a meta refresh
tag.

djo





Yes, this HTML line will redirect the browser to the php page..

META http-equiv=refresh content=0;url=file.php

Gavin

Nikola Veber [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi !

 I'm having a problem with following : I'd like to activate a php file as a
home page,
 but without pointing directly to it(http://www.smth.com/file.php). I'd
like to know if it is
 possible to call it from a html file(index.htm for exp. )

 Thanks
 Nikola








I am trying to run PHP 4 on Windows with PWS.  Nothing is working!  I did
exactly like the manual said and even tried another 

RE: [PHP] meta redirect explanation

2001-09-16 Thread Richard Heyes

 Thanks for the quick answer. It works, but I was curious what
 does the number
 before the adress mean. META http-equiv=refresh
 content=??0??;url=file.php

Delay in seconds before redirection occurs.
--
Richard Heyes
I know not with what weapons World War III will be fought, but World War IV
will be fought with sticks and stones. - Albert Einstein



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




[PHP] problem with getting data from NNTP server

2001-09-16 Thread Luboslav Gabal ml.

I have script for getting header of article from NNTP server using sockets:

?
$conn = fsockopen("csnews.vslib.cz", 119);
fputs($conn, "GROUP cz.comp.lang.php\r\n");
fputs($conn, "HEAD 3600\r\n");
while ($result = fgets($conn, 2048)) {
 if (substr($result, 0, 1) == ".") break;
 echo $result."br";
}
?

output have look so:

...
Path: csnews.vslib.cz!not-for-mail
From: "Antonin Mohaupt" [EMAIL PROTECTED]
Newsgroups: cz.comp.lang.php
...

but it is only

...
Path: csnews.vslib.cz!not-for-mail
From: "Antonin Mohaupt"
Newsgroups: cz.comp.lang.php
...

What's the problem ? I tried higher raise length of data (second argument of
fgets()), but with no result.
When I am doing it by telnet, all is ok. What to do ?

Luboslav Gabal


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




Re: [PHP] sorting multi-dimensional arrays

2001-09-16 Thread Christian Dechery

it was just a typo... I meant:

$categories[0][id]=2;
$categories[0][name]=lele;
$categories[1][id]=6;
$categories[1][name]=lala;
.. ...

and so on...


At 00:52 16/9/2001 -0400, you wrote:
The below code would result in an array of:

$categories[0][id]=2;
$categories[0][name]=Lele;

Please tell us the actual code you're using, or print_r($arrayname);

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 09, 2001 11:51 PM
Subject: [PHP] sorting multi-dimensional arrays


| I'm having a little trouble sorting mult-dimensional arrays by key...
|
| I looked-up the manual and found out that array_multisort() thing... but I
| don't think it does what I want... or I don't understand it...
|
| I have an array like this...
|
| $categories=array();
| $categories[0][id]=1;
| $categories[0][name]=Xyz;
| $categories[0][id]=7;
| $categories[0][name]=Lala;
| $categories[0][id]=2;
| $categories[0][name]=Lele;
|
| I want it sorted by name... the way I'm doing it  right now is by using
| an auxiliar array that gets all the names, sorts them, and then build a
new
| array based on that...
|
| is a better way?
|
| p.s: meu novo email é [EMAIL PROTECTED]
| 
| . Christian Dechery (lemming)
| . http://www.tanamesa.com.br
| . Gaita-L Owner / Web Developer
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


p.s: meu novo email é [EMAIL PROTECTED]

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




[PHP] dynamic menu possible?

2001-09-16 Thread LRW

Hi all.
I was wondering if a situation I'll describe below is possible. If it is,
I'm hoping someone could point me to the topics I would need to study to
learn how to do it. I hate to say that right now I don't have the time to
read the Manual or any books cover-to-cover to figure it out...but I do want
to learn how to do things on my own. So if someone could just tell me what
the items I'd need to study are called, I'd really appreciate it.

What I want to do is have a drop-down menu where the options are files
located in a folder on the server that changes as items are added to or
removed. Then the user can select an item from the menu, submit, and that
page will load.
Did that make sense?
So I have 1.htm and 2.htm and 3.htm in a folder. A selectable menu reads the
folder and lists those three files as options. The user can click on it and
submit and that page will load. And if I add 4.htm, the menu will add that
to the drop down on its own.

That that's not possible, how close can I get to something like that?
An example of something close to that I found on www.megatokyo.com . They
have a dropdown menu where a user selects an item and gets sent to that
page. A URL from one attempts shows as
http://www.megatokyo.com/index.php?date=2001-09-04 . How is that done?

Again, if I could just be pointed to the related PHP concepts I'll take it
from there.
Thanks!
Liam
www.celticbear.com



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




[PHP] Parsing html table into MySQL

2001-09-16 Thread i_union



I  need to get from another page table and put it into MySQL table
dynamically



for example http://66.96.230.191/table.html  so I need to parse this table
in database.



If you have any code how to implement such operation by using php MySQL
please help me;



thanks in advance



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


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




[PHP] PHP as offline tool?

2001-09-16 Thread Tomas Valusek

Hello,

I'd like to create a series of web pages and burn them to CD. To achieve a
unified layout of these pages, I'd like to use PHP to generate them. I'm
working on Win98 with no web server installed and a dial-up connection to
net. What's the php.exe's command line syntax? I can't find it in the
manual.

Thanks for any help.

Tomas Valusek



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




Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread Christian Dechery

wait a minute... do you want to parse the HTML to get the values to 
populate a mysql table, or do you have this table in another DB and just 
want it copied to your mysql one??

If it is the former, you'll some very hardcore regex work to be done... I 
once did this... it is very stressing work...
- you need to analyse the HTML document and find patterns that indicate 
'begin of row' 'begin and end of column' and 'end of row', 'end of table' - 
these patterns must be unique or you'll find yourself looking for it 
indefinetly and going into an endless loop - do a giant loop that only ends 
on 'end of table' and grab the values within this patterns... the code to 
get this done is huge (not complex), and (I expect) will be only used once, 
right?

At 19:25 16/9/2001 +0500, i_union wrote:


I  need to get from another page table and put it into MySQL table
dynamically



for example http://66.96.230.191/table.html  so I need to parse this table
in database.



If you have any code how to implement such operation by using php MySQL
please help me;



thanks in advance



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


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


p.s: meu novo email é [EMAIL PROTECTED]

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




[PHP] Re: Sorting an array

2001-09-16 Thread ~~~i LeoNid ~~

On Thu, 13 Sep 2001 11:10:03 +0200 impersonator of
[EMAIL PROTECTED] (_lallous) planted I saw in php.general:

here's your script,

..
Kill 'em All
The Wall;

$mem = split(\n, $mem);

Explode() is less expensive then split(), as long as you don't use regexp,
which is the case here, and (from the first glance without improvement
attempts:) you missed reset() of array before the while(list() each())
structure.
..
var_dump($arr2);

This ^one^ is a good choice:)
..
i leonid http://nux.home.dk3.com

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




Re: [PHP] PHP as offline tool?

2001-09-16 Thread Michael van Bracht


- Original Message -
From: Tomas Valusek [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 16, 2001 4:32 PM
Subject: [PHP] PHP as offline tool?


 Hello,

 I'd like to create a series of web pages and burn them to CD. To achieve a
 unified layout of these pages, I'd like to use PHP to generate them. I'm
 working on Win98 with no web server installed and a dial-up connection to
 net. What's the php.exe's command line syntax? I can't find it in the
 manual.

i never used php on windows, but under linux you can use -q to suppress http
header output
and then the .php file you want to be processed


 Thanks for any help.

 Tomas Valusek



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



regards

Michael van Bracht


--
intraDAT AGhttp://www.intradat.com
Wilhelm-Leuschner-Strasse 7   Tel: +49 69-25629-0
D - 60329 Frankfurt am Main Fax: +49 69-25629-256



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




Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread i_union

No I need to copy the rows values from HTML table you can see it in exlamle
http://66.96.230.191/table.html  This is a live score system which updates
every  2 min, So I need to get these values and parse it in MySQL after that
I neeed to get some element from my database and show in my page..

I have problems in regex I dont know good coding and need only smmall
support Please help me :)



- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: i_union [EMAIL PROTECTED]; Chris Lambert [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 7:57 PM
Subject: Re: [PHP] Parsing html table into MySQL


 wait a minute... do you want to parse the HTML to get the values to
 populate a mysql table, or do you have this table in another DB and just
 want it copied to your mysql one??

 If it is the former, you'll some very hardcore regex work to be done... I
 once did this... it is very stressing work...
 - you need to analyse the HTML document and find patterns that indicate
 'begin of row' 'begin and end of column' and 'end of row', 'end of
table' -
 these patterns must be unique or you'll find yourself looking for it
 indefinetly and going into an endless loop - do a giant loop that only
ends
 on 'end of table' and grab the values within this patterns... the code to
 get this done is huge (not complex), and (I expect) will be only used
once,
 right?

 At 19:25 16/9/2001 +0500, i_union wrote:


 I  need to get from another page table and put it into MySQL table
 dynamically
 
 
 
 for example http://66.96.230.191/table.html  so I need to parse this
table
 in database.
 
 
 
 If you have any code how to implement such operation by using php MySQL
 please help me;
 
 
 
 thanks in advance
 
 
 
 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


 p.s: meu novo email é [EMAIL PROTECTED]
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


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


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


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




Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Mark) wrote:

 if(isset($) and !empty($a) and !$a)
 
 this is the same as if(!empty($a))
 
 or
 
 if(isset($) and $a===FALSE)
 
 this is the same as if(empty($a))

(Aside from accidentally omitted the a in the var name...oops...) 

No, they're not the same thing if you have error reporting set to E_ALL.  
If $a is not set, calling empty($a) or !$a produces a warning.

-- 
CC

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




Re: [PHP] PHP as offline tool?

2001-09-16 Thread Tomas Valusek

Hello,

thank you for your help - I could get all the switches of PHP executable by
using a -? switch. It's just pity they aren't documented in manual ...

Tomas Valusek



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




[PHP] General info about sessions?

2001-09-16 Thread Tomas Valusek

Hello,

where can I find an introduction to sessions in PHP? They are mentioned in
manual for example in a Serializing objects - objects in sessions section,
but there toesn't seem to be any section covering sessions in general. How
they work? Where to use this feature?

Tomas Valusek



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




[PHP] sending a 404 error

2001-09-16 Thread Michael A. Peters

Is it possible to invoke the server 404 error error from php?

Where I would like to do such a thing is

http://24.5.29.77:10080/encryption/index.phps

I would like to replace the line
die (The file you wish to download does not exist);

with instead an invocation of the http 404 error.

Theoretically a 404 error should never happen if I properly did my stuff, but it would 
be nice for me to be able to detect such problems just from the http error logs...

If there's not a way to directly do it, I'll need to redirect to a 404 error page 
(well, include my custom error page) and have the script make an entry into the 
http_error log- but a nice one liner invocation of Apache's built in 404 error 
function would be nice...

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/

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




Re: [PHP] problem with getting data from NNTP server

2001-09-16 Thread Christopher William Wesley

On Sun, 16 Sep 2001, Luboslav Gabal ml. wrote:

 I have script for getting header of article from NNTP server using sockets:
 output have look so:
   From: Antonin Mohaupt [EMAIL PROTECTED]
 but it is only
   From: Antonin Mohaupt
 What's the problem ? I tried higher raise length of data (second argument of

Anything between  and  will look like an HTML tag to your browser.  If
you view the source of the HTML in your browser, I'm sure you'll see
[EMAIL PROTECTED]  :)  You browser just doesn't know how to display that
tag (because it's not one).  Change your echo line from
  echo $result.br;
to
  echo htmlspecialchars($result).br;
This will convert  to lt; and  to gt; so it will be displayed
in your browser correctly.

For more info: http://php.net/htmlspecialchars

~Chris   /\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden




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




Re: [PHP] General info about sessions?

2001-09-16 Thread Julie Meloni

Sunday, September 16, 2001, 9:59:36 AM, you wrote:

TV where can I find an introduction to sessions in PHP? They are mentioned in
TV manual for example in a Serializing objects - objects in sessions section,
TV but there toesn't seem to be any section covering sessions in general.

http://www.php.net/manual/en/ref.session.php

LXXVIII. Session handling functions


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com


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




[PHP] Problem installing PHP on RH7.1

2001-09-16 Thread Tad

I am setting up a box to run Apache + mod_ssl + MySQL + PHP.
Apache is configured with DSO support and everything goes fine until I do
make inststall in the php source dir

Making install in .
make[1]: Entering directory `/root/programs/web/php-4.0.6'
/root/programs/web/php-4.0.6/build/shtool mkdir -p
/usr/local/apache/libexec  /usr/local/apache/bin/apxs -S
LIBEXECDIR=/usr/local/apache/libexec -i -a -n php4 libs/libphp4.so
[activating module `php4' in /usr/local/apache/conf/httpd.conf]
cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so
cp: cannot stat `libs/libphp4.so': No such file or directory
apxs:Break: Command failed with rc=1
make[1]: *** [install-sapi] Error 1
make[1]: Leaving directory `/root/programs/web/php-4.0.6'
make: *** [install-recursive] Error 1


Anyone have any ideas? I have done this process many times before and have
never seen this error before. I am also using all of the latest updates from
the RH site.

-Tad




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




[PHP] Debug problem

2001-09-16 Thread php

Hello,

This issue has got me beaten. Have been trying for days to make some
progress identifying a problem either with my php installation, or a class I
am attempting to make use of:

The error I receive is :

Unknown list entry type in request shutdown (0) in Unknown on line 0

How can I find the offending code?

To make matters worse, if apache segfaults, there is no core dump. No idea
why, ulimit allows core files on the machine.


I believe the problem is within either mcrypt and/or xml functions, but I
cannot pinpoint the problem.


Thank you for any advice,


Sean


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




Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread Mark

On Sun, 16 Sep 2001 09:18:23 -0700, CC Zona wrote:
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Mark) wrote:

 if(isset($) and !empty($a) and !$a)

 this is the same as if(!empty($a))

 or
 
 if(isset($) and $a===FALSE)

 this is the same as if(empty($a))

Aside from accidentally omitted the a in the var name...oops...)

No, they're not the same thing if you have error reporting set to
E_ALL.
If $a is not set, calling empty($a) or !$a produces a warning.

calling empty($a) does not give a warning.

--
Mark, [EMAIL PROTECTED] on 09/16/2001



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




[PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Bora Paksoy

Hi;

I am planning to implement a new site which will be
using mysql db heavily, and I am in the middle of (and
stuck:) deciding what I should use for implementation.
I would definitely prefer Java Servlets, but it is
very expensive to host servlets, so I am only
comparing PHP vs. Perl. 

I have been hearing very good things about PHP for a
long time, and I started reading the manual/tutorial
posted on php.net. To be honest, I didn't see much
difference from perl. It is almost identical (I have
to admit, there are some practical advantages, but not
a huge difference), even the syntax is almost same to
perl.

Comparing basic functional stuff:

1.Speed: If you use mod_perl or fastcgi kind of deals
(which are based on threadding instead of forking), I
don't think PHP is considerably faster than perl? Is
that the case?

2.Database Connection: What is the BIG advantage of
PHP here? Using DBI packages for perl, and fastcgi for
db connection pooling, you can achieve the same thing,
I guess. It just looks like PHP has some of these
libraries embedded in the core language, but the idea
is same--implementing the native db protocol over
sockets?

3.Shared Memory, global variables, etc: I was
expecting a better interface for this in PHP, and I
was really disappointed to see that developers have to
use O/S level shared memory. First of all, this is not
available on Windows And, it is kind of messy and
hard to use, especially when you compare this to
Java's static variables.

4.Session Management: If you use files to manage
sessions, same thing can be achieved in perl.
Regarding in memory session management, as far as I
know, FastCGI can share variables among sessions, so
it shouldn't be hard to write a session manager in
perl as well.

5.Architecture: I couldn't find any doc about how PHP
works. And any answer to important questions, like 
-How does compilation process work? Does the PHP
engine compile htmls first time a request is made to
that html and use that compiled code later on(just
like JSPs), or does it compile everytime? Is PHP
engine an interpreter, jvm-like byte-code
generator/executer or a compiler? 
-How does threadding work? How can you cache stuff,
etc.?
-What is the generic lifecycle of a request/response?

6. Embedding scripts in HTML: Well, I mean, this is
similar to JSP, but what the hell, you can use AA
. AA; syntax and embed any string you want at any
point by mixing and matching HTML and perl code. I
mean, yeah PHP is easier, but it is not considerably
easier, I believe.


I have been searching the internet to find some
serious comparisons, but all I found was a stupid page
which compares the syntax rather than functionality. 

As I said, I really need to start developing soon, and
I would appreciate comments regarding this issue.

Thanks in advance,
Baho.


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

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




Re: [PHP] sending a 404 error

2001-09-16 Thread GATop

Hello Michael,

Sunday, September 16, 2001, 9:05:35 AM, you wrote:

MAP Is it possible to invoke the server 404 error error from php?

MAP Where I would like to do such a thing is

MAP http://24.5.29.77:10080/encryption/index.phps

MAP I would like to replace the line
MAP die (The file you wish to download does not exist);

MAP with instead an invocation of the http 404 error.

MAP Theoretically a 404 error should never happen if I properly did my stuff, but it 
would be nice for me to be able to detect such problems just from the http error 
logs...

MAP If there's not a way to directly do it, I'll need to redirect to a 404 error page 
(well, include my custom error page) and have the script make an entry into the 
http_error log- but a nice one
MAP liner invocation of Apache's built in 404 error function would be nice...


Yes You can

header (404 Not Found);

should work

-- 
Best regards,
 GATopmailto:[EMAIL PROTECTED]


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




[PHP] radio button help

2001-09-16 Thread Nikola Veber

Hi !
I know that this may be not the right place for this question,  bu anyway:
The radiobutton tag looks like this:

input type=radio name=radiobutton value=radiobutton

How am I suposed to handle multiple buttons(what should I change, name or the 
value?)
 My point here is: Does the buttons with the same name return defined values for 
one variable(the $name of selected button = its value), or buttons with different 
names should have a boolean value , 0 or 1, depends on weather they have been 
selected or not($name1 = 0, $name2 = 0, $name3 = 1, vhere name3 is selected) ?

Thanks
Nikola



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




[PHP] Comining variables into a single string

2001-09-16 Thread Salty Marine


Greetings to All:

I'm inexperienced, although enthusiastic about using PHP.  I want to write
data more effectively to a file.

This doesn't work:  fputs($frank, Testing  $whatever  more testing
\n\n\n);
Right now, all I know is using three separate fputs statements.  I'd like to
use just one.

This works:
$frank = fopen(VisitorInfo.txt,r+);

fputs($frank, date(h:i A));

fputs($frank, \n);

fputs($frank, date(F d, Y));

fputs($frank, \nIP Address: );

fputs($frank, $ipaddr);

fputs($frank, \nHost: );

fputs($frank, $what);

fputs($frank, \n\n\n);

fclose ($frank);


Regards,
Salty



Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Sterling Hughes

On Sun, 16 Sep 2001, Bora Paksoy wrote:

 Hi;

 I am planning to implement a new site which will be
 using mysql db heavily, and I am in the middle of (and
 stuck:) deciding what I should use for implementation.
 I would definitely prefer Java Servlets, but it is
 very expensive to host servlets, so I am only
 comparing PHP vs. Perl.


Why on earth would you prefer java servlets?

 I have been hearing very good things about PHP for a
 long time, and I started reading the manual/tutorial
 posted on php.net. To be honest, I didn't see much
 difference from perl. It is almost identical (I have
 to admit, there are some practical advantages, but not
 a huge difference), even the syntax is almost same to
 perl.


PHP is a much cleaner language than Perl, ie, it doesn't have the
same abiguities that plague Perl (print reverse split
/\s+/, H P A J;) and is much more akin to C in many ways.  Also,
PHP was written and intended for the web (it can be used in other
veins as well), therefore its imho much easier to do web programming
with php.

 Comparing basic functional stuff:

 1.Speed: If you use mod_perl or fastcgi kind of deals
 (which are based on threadding instead of forking), I
 don't think PHP is considerably faster than perl? Is
 that the case?

The speed is comparable between the two languages, but then again if
you count all the extra Perl libraries you have to call in to
achieve the same results, php starts to win.

FYI, JSP is the slowest to my knowledge.

 2.Database Connection: What is the BIG advantage of
 PHP here? Using DBI packages for perl, and fastcgi for
 db connection pooling, you can achieve the same thing,
 I guess. It just looks like PHP has some of these
 libraries embedded in the core language, but the idea
 is same--implementing the native db protocol over
 sockets?


The PHP way is slightly faster, that's it though (yeah, yeah, I know
database independence, but if you want your code to run with any
speed you'll tune your sql for the individual database anyway,
loosing the necessary portability).

 3.Shared Memory, global variables, etc: I was
 expecting a better interface for this in PHP, and I
 was really disappointed to see that developers have to
 use O/S level shared memory. First of all, this is not
 available on Windows And, it is kind of messy and
 hard to use, especially when you compare this to
 Java's static variables.


No, its not available on Windows, but then again, why on earth would
you want to use Windows? ;) If you really need shm on windows,
submit a patch, hint, its just a mmap() :)

The same applies for perl btw...  I have a feeling your not talking
about Shared memory by the way, but rather sessions, which you can
do via the built-in PHP sessioning support, see below.  Shared
memory is usually only a good idea (outside of the session scope)
when you want to communicate with other programs/processes.  Using
it on high traffic sites is also not a good idea.

 4.Session Management: If you use files to manage
 sessions, same thing can be achieved in perl.
 Regarding in memory session management, as far as I
 know, FastCGI can share variables among sessions, so
 it shouldn't be hard to write a session manager in
 perl as well.


You can use Files or SHM management, or write your own custom
session backend using for example MySQL.

 5.Architecture: I couldn't find any doc about how PHP
 works. And any answer to important questions, like
   -How does compilation process work? Does the PHP
 engine compile htmls first time a request is made to
 that html and use that compiled code later on(just
 like JSPs), or does it compile everytime? Is PHP
 engine an interpreter, jvm-like byte-code
 generator/executer or a compiler?

No.  Its compile and execute everytime, however if you use one of
the Cache's mentioned below its simply an execute each time.  JSP
btw is slower despite the fact that it compiles the stuff ahead of
time.

   -How does threadding work? How can you cache stuff,
 etc.?

you can cache your scripts using the commercial (but higher quality) Zend Cache
(www.zend.com) or the (free) APC Cache (apc.communityconnect.com).

   -What is the generic lifecycle of a request/response?


zend.com should have some information on this.

 6. Embedding scripts in HTML: Well, I mean, this is
 similar to JSP, but what the hell, you can use AA
 . AA; syntax and embed any string you want at any
 point by mixing and matching HTML and perl code. I
 mean, yeah PHP is easier, but it is not considerably
 easier, I believe.


Yes, but do you want your web designer going through your perl code
and messing with that section alone?  Its much easier to maintain
the PHP code in this respect (you could use a templating engine in
Perl of course, but that would slow your code down another notch).
Also, with Perl HERE blocks 

Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Rasmus Lerdorf

 1.Speed: If you use mod_perl or fastcgi kind of deals
 (which are based on threadding instead of forking), I
 don't think PHP is considerably faster than perl? Is
 that the case?

Threading instead of forking?  None of these do either.  Apache is a
pre-forking multi-process server and both PHP and mod_perl are part of
these pre-forked processes.  Neither mod_perl nor PHP do any threading nor
forking.

 2.Database Connection: What is the BIG advantage of
 PHP here? Using DBI packages for perl, and fastcgi for
 db connection pooling, you can achieve the same thing,
 I guess. It just looks like PHP has some of these
 libraries embedded in the core language, but the idea
 is same--implementing the native db protocol over
 sockets?

No difference.

 3.Shared Memory, global variables, etc: I was
 expecting a better interface for this in PHP, and I
 was really disappointed to see that developers have to
 use O/S level shared memory. First of all, this is not
 available on Windows And, it is kind of messy and
 hard to use, especially when you compare this to
 Java's static variables.

Again, the architectural difference makes this a lot easier to do in a
single-process JVM scenario.  Note that such a single-process JVM
architecture which maintains static objects is very hard to scale cleanly.

 4.Session Management: If you use files to manage
 sessions, same thing can be achieved in perl.
 Regarding in memory session management, as far as I
 know, FastCGI can share variables among sessions, so
 it shouldn't be hard to write a session manager in
 perl as well.

Probably true.

 5.Architecture: I couldn't find any doc about how PHP
 works. And any answer to important questions, like
   -How does compilation process work? Does the PHP
 engine compile htmls first time a request is made to
 that html and use that compiled code later on(just
 like JSPs), or does it compile everytime? Is PHP
 engine an interpreter, jvm-like byte-code
 generator/executer or a compiler?
   -How does threadding work? How can you cache stuff,
 etc.?
   -What is the generic lifecycle of a request/response?

PHP is a 2-stage interpreted language.  First pass generates opcodes,
second pass executes the opcodes.  Various add-on caches and optimizers
can cache the opcodes and thus skip the interpreter step.  Doesn't usually
win you a whole lot unless you have quite complex logic in your pages
though.  The interpreter is pretty fast.

There is no threading in PHP.  The web server provides the base
thread/process architecture.

The lifecycle of a request/response matches the lifecycle of an HTTP
request/response.

 6. Embedding scripts in HTML: Well, I mean, this is
 similar to JSP, but what the hell, you can use AA
 . AA; syntax and embed any string you want at any
 point by mixing and matching HTML and perl code. I
 mean, yeah PHP is easier, but it is not considerably
 easier, I believe.

Probably not.

 I have been searching the internet to find some
 serious comparisons, but all I found was a stupid page
 which compares the syntax rather than functionality.

 As I said, I really need to start developing soon, and
 I would appreciate comments regarding this issue.

Basically any language can be used to write web apps.  There is nothing in
PHP you can't do in Perl, ASP, Cold Fusion, Python or JSP.  PHP just
happens to package things together in a easy to comprehend way and
everything you read about PHP is geared towards the Web problem whereas in
the case of more general-purpose scripting languages it can be confusing
trying to figure out how to approach the web problem.

-Rasmus


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




RE: [PHP] radio button help

2001-09-16 Thread biscut

you would simply have the following:

input type=radio name=radiobutton value=radiobutton1blah1br
input type=radio name=radiobutton value=radiobutton2blah2br
input type=radio name=radiobutton value=radiobutton3blah3br

Any problems let me know...
Regards
Davidt

-Original Message-
From: Nikola Veber [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2001 07:48
To: php forum
Subject: [PHP] radio button help


Hi !
I know that this may be not the right place for this question,  bu anyway:
The radiobutton tag looks like this:

input type=radio name=radiobutton value=radiobutton

How am I suposed to handle multiple buttons(what should I change, name or
the
value?)
 My point here is: Does the buttons with the same name return defined values
for
one variable(the $name of selected button = its value), or buttons with
different
names should have a boolean value , 0 or 1, depends on weather they have
been
selected or not($name1 = 0, $name2 = 0, $name3 = 1, vhere name3 is selected)
?

Thanks
Nikola



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


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




RE: [PHP] Comining variables into a single string

2001-09-16 Thread Luboslav Gabal ml.


 Greetings to All:

 I'm inexperienced, although enthusiastic about using PHP.  I want to write
 data more effectively to a file.

 This doesn't work:  fputs($frank, Testing  $whatever  more testing
 \n\n\n);
 Right now, all I know is using three separate fputs statements.  I'd like
to
 use just one.

fputs($frank, Testing .$whatever. more testing\n\n\n);

see http://www.php.net/manual/en/language.operators.string.php

Luboslav Gabal


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




[PHP] Probem with Rename() and linux

2001-09-16 Thread Gaylen Fraley

I am attempting to use the rename() function and am receiving the following
error:

Warning: Rename failed (Permission denied) in
/usr/local/apache/htdocs/mydir/myfile.php on line 7

The files all have a mod of 777 .  My application can update the same file
w/o any problem, it's only when attempting to use rename.  Is there
something else I need to do?  It's as if delete is not allowed by httpd,
although as root I can.  This does work in windows, so I know the syntax is
correct.

Thanks.

--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts




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




[PHP] Getting screen resolution and color depth

2001-09-16 Thread Salty Marine


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how it is
done in Javascript.  I want to do it and put the results into a PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty



RE: [PHP] Getting screen resolution and color depth

2001-09-16 Thread Matthew Loff


Can't be done...

1) Browser sends request
2) PHP page is compiled and executed
3) PHP output is sent to browser
4) Browser displays page/executes javascript/etc.


-Original Message-
From: Salty Marine [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting screen resolution and color depth


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how
it is done in Javascript.  I want to do it and put the results into a
PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty


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




RE: [PHP] Getting screen resolution and color depth

2001-09-16 Thread Seb Frost

But you could then re-submit the page with this data somehow, couldn't you?

- seb

-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]]
Sent: 16 September 2001 21:04
To: 'Salty Marine'; [EMAIL PROTECTED]
Subject: RE: [PHP] Getting screen resolution and color depth



Can't be done...

1) Browser sends request
2) PHP page is compiled and executed
3) PHP output is sent to browser
4) Browser displays page/executes javascript/etc.


-Original Message-
From: Salty Marine [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting screen resolution and color depth


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how
it is done in Javascript.  I want to do it and put the results into a
PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


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




[PHP] Quick mail function help.... please!!!

2001-09-16 Thread Kyle Smith

Can someone please show me how to change the reply address in the mail function (and 
the from address) cause i have a script im making for a mailing list and the script in 
the manual doesnt work cause it has loads of different code aswell :(


-lk6-
http://www.StupeedStudios.f2s.com
Home of the burning lego man!

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666





RE: [PHP] Getting screen resolution and color depth

2001-09-16 Thread Matthew Loff


As long as it doesn't interfere with any GET or POST data, you could
redirect the browser...

I haven't tried this, so I don't know if my syntax is perfectly correct,
but here's a suggestion...

BODY onLoad=document.location = 'somefile.php?screen_res=' +
screen.width + x + screen.height + 'color_depth=' +
screen.colorDepth


-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 4:13 PM
To: Matthew Loff; 'Salty Marine'; [EMAIL PROTECTED]
Subject: RE: [PHP] Getting screen resolution and color depth


But you could then re-submit the page with this data somehow, couldn't
you?

- seb

-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]]
Sent: 16 September 2001 21:04
To: 'Salty Marine'; [EMAIL PROTECTED]
Subject: RE: [PHP] Getting screen resolution and color depth



Can't be done...

1) Browser sends request
2) PHP page is compiled and executed
3) PHP output is sent to browser
4) Browser displays page/executes javascript/etc.


-Original Message-
From: Salty Marine [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting screen resolution and color depth


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how
it is done in Javascript.  I want to do it and put the results into a
PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


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


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




Re: Fwd: Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread Christian Dechery

ok... so the hard way.

I'm no regex wizard myself... as a matter of fact I suck at it.
I do it the hard (old C like) way.

You have to find some chunks of HTML that determine and end of the data in 
the table and use them to walk trough the doc fetching what you want... let 
me give an example...

html
table
trtdfont face=arialTitle/font/tdtdfont 
face=arialPrice/font/td/tr
trtdfont face=arialXXX/font/tdtdfont 
face=arial10.00/font/td/tr
trtdfont face=arialYYY/font/tdtdfont 
face=arial25.2/font/td/tr
/table
/html

I know that with regex this would be a lot easir but you can do this:

$fp=fopen(htmldoc,r);
while(!feof($fp))
{
 // lets find the first row of DATA (the first were only titles)
 while(!strstr(fgets($fp,256),/tr);

 //now we are the first line
 while(!strstr(fgets($fp,256),/table)
 {
 // see where I'm getting at?
 }
}

No I need to copy the rows values from HTML table you can see it in exlamle
http://66.96.230.191/table.html This is a live score system which updates
every  2 min, So I need to get these values and parse it in MySQL after that
I neeed to get some element from my database and show in my page..

I have problems in regex I dont know good coding and need only smmall
support Please help me :)



- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: i_union [EMAIL PROTECTED]; Chris Lambert [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 7:57 PM
Subject: Re: [PHP] Parsing html table into MySQL


  wait a minute... do you want to parse the HTML to get the values to
  populate a mysql table, or do you have this table in another DB and just
  want it copied to your mysql one??
 
  If it is the former, you'll some very hardcore regex work to be done... I
  once did this... it is very stressing work...
  - you need to analyse the HTML document and find patterns that indicate
  'begin of row' 'begin and end of column' and 'end of row', 'end of
table' -
  these patterns must be unique or you'll find yourself looking for it
  indefinetly and going into an endless loop - do a giant loop that only
ends
  on 'end of table' and grab the values within this patterns... the code to
  get this done is huge (not complex), and (I expect) will be only used
once,
  right?
 
  At 19:25 16/9/2001 +0500, i_union wrote:
 
 
  I  need to get from another page table and put it into MySQL table
  dynamically
  
  
  
  for example http://66.96.230.191/table.html so I need to parse this
table
  in database.
  
  
  
  If you have any code how to implement such operation by using php MySQL
  please help me;
  
  
  
  thanks in advance
  
  
  
  _
  Do You Yahoo!?
  Get your free @yahoo.com address at http://mail.yahoo.com
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] \n not working

2001-09-16 Thread alpherjo

I am just learning PHP. I have it installed on my Win 2000 IIS to practice,
and after I save PHP files in my wwwroot folder, I go ahead and access my
practice pages through IE via my full (universal) server address. However,
the \n code (to start a new line) never works. Any ideas?
Thanks!



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




[PHP] Re: \n not working

2001-09-16 Thread Gaylen Fraley

If you are trying to use \n for a new line in HTML code, it will not work.
In other words
echo htmlh1Hello\nWorld/h1/html; will not work.  You must use br
instead.  Also, be sure that you are using double quotes instead of single
quotes.  Single quoted text is literally interpreted.


--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts

Alpherjo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am just learning PHP. I have it installed on my Win 2000 IIS to
practice,
 and after I save PHP files in my wwwroot folder, I go ahead and access my
 practice pages through IE via my full (universal) server address. However,
 the \n code (to start a new line) never works. Any ideas?
 Thanks!





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




Re: [PHP] \n not working

2001-09-16 Thread Andrew Brampton

Browsers don't parse \n as a new line, try using br which will make a new
line

Andrew
- Original Message -
From: alpherjo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 16, 2001 9:51 PM
Subject: [PHP] \n not working


 I am just learning PHP. I have it installed on my Win 2000 IIS to
practice,
 and after I save PHP files in my wwwroot folder, I go ahead and access my
 practice pages through IE via my full (universal) server address. However,
 the \n code (to start a new line) never works. Any ideas?
 Thanks!



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




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




[PHP] Re: PHP windows version DLLs ...

2001-09-16 Thread nico_oreka

No, my problem is that I haven't got this DLL ...
I only have an older php3_gd.dll who make PHP hang when loaded, so i'm lookin for a 
php4_gd.dll with gif, png, jpeg, etc  support !!!

-- 


(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr


Gaylen Fraley [EMAIL PROTECTED] a écrit dans le message : 
[EMAIL PROTECTED]
 Look in your php\extensions directory.  There should be a php_gd.dll .
 
 --
 Gaylen
 [EMAIL PROTECTED]
 http://www.gaylenandmargie.com
 PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts
 
 Nico_oreka [EMAIL PROTECTED] wrote in message
 00f401c13ef3$80ed60a0$0100a8c0@p2333">news:00f401c13ef3$80ed60a0$0100a8c0@p2333...
 Does someone know where i can get various extension DLLs for 'Zend' PHP 4
 for windows ?
 I can't find any on the net !!!
 I'm specialy lookin for the 'GD' dll extension 
 
 thanx.
 
 
 (°-Nayco,
 //\[EMAIL PROTECTED]
 v_/_ http://nayco.free.fr
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 

(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr

 



[PHP] APC - is it working?

2001-09-16 Thread David Yee

I just installed APC (Alternative PHP Cache).  How do I know it's
loaded/running/working?  Thanks.

David


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




[PHP] Permutation in PHP

2001-09-16 Thread Robert Mena

Hi I am looking for an algorithm to generate the
permutation of the elements of a vector, say a,b,c. 
Does anybody know / have implemented such (in PHP or
different languages).

Best regards.

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

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




RE: [PHP] counting number of lines in file() that match a regexp

2001-09-16 Thread Don Read


On 16-Sep-2001 Kurt Lieber wrote:
 I'm trying to take a text file and count the number of lines that match
 a regexp.  I've got it working using the following code:
 
 $data = file(myfile.txt);
 $total = 0;
 foreach($data as $i) {
   if (ereg(^1,,$i)) {
   $total = $total + 1;
   }
 }
 
 but I'm still learning PHP and am wondering if there's an easier/better
 way to do this?
 

untested:

$data = file(myfile.txt);
chop($data);
$cnt=substr_count(join('~', $data), '~1,'); // change tilde to un-common char
echo $cnt, 'br';

or burn a few pids:

$cnt=`grep ^1, myfile.txt | wc -l`;
echo $cnt, 'br';


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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




Re: [PHP] Re: Problem with Rename() and linux - update

2001-09-16 Thread Gaylen Fraley

That's what I suspected and yes, that does work.  However, it causes
problems with session handling variables since 'www' doesn't own the 'tmp'
file, etc.  Thanks though for confirming what I suspected.

Any other thoughts from anyone?

--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts

Chris Schneck [EMAIL PROTECTED] wrote in message
003d01c13ef8$84435020$[EMAIL PROTECTED]">news:003d01c13ef8$84435020$[EMAIL PROTECTED]...
 Although this is a little OT, I dont remember any online tutorials that
 helped me and this is a fairly lengthy explanation. In your httpd.conf
(this
 is how i did it you can find your own way im sure) set the apache user to
be
 www and the group to www. Apache now knows to run as that user, but your
 linux box doesnt know that user which seems to be the root of your
problem.
 Now you have to edit the file '/etc/passwd' and add a line like
 'www:x:105:105:www::' then edit your '/etc/group' file and a dd a line
like
 'www::105:'.
 Restart your Apache server.
 Now your Apache server is ready to run as user www group www. Any
Directory
 of Files that Apache is going to be working with should be chown'ed to
 www.www

 Remember not to 'adduser' to accomplish this, you dont want anyone
actually
 logging in as www :) Hope this helped a little.


 From: Gaylen Fraley [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 16, 2001 2:07 PM
 Subject: [PHP] Re: Problem with Rename() and linux - update


  It is the delete (unlink) portion that the page cannot execute.  So, I
  assume this is a setting in my server conf?  Apache is running as
nobody,
  but nobody is not a valid user on my linux server.  Is that the problem?
 If
  so, is the normal prcatice to have a user like 'web' and give all rights
 to
  that user?  Alternatively I could do a copy and truncate to accomplish
the
  same task, but this seems too laborious.  Thoughts?
 
  --
  Gaylen
  [EMAIL PROTECTED]
  http://www.gaylenandmargie.com
  PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts
 
  Gaylen Fraley [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I am attempting to use the rename() function and am receiving the
  following
   error:
  
   Warning: Rename failed (Permission denied) in
   /usr/local/apache/htdocs/mydir/myfile.php on line 7
  
   The files all have a mod of 777 .  My application can update the same
 file
   w/o any problem, it's only when attempting to use rename.  Is there
   something else I need to do?  It's as if delete is not allowed by
httpd,
   although as root I can.  This does work in windows, so I know the
syntax
  is
   correct.
  
   Thanks.
  
   --
   Gaylen
   [EMAIL PROTECTED]
   http://www.gaylenandmargie.com
   PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts
  
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 




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




[PHP] Re: Problem installing PHP on RH7.1

2001-09-16 Thread Tad

Nevermind, I made a stupid mistake.

Tad [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am setting up a box to run Apache + mod_ssl + MySQL + PHP.
 Apache is configured with DSO support and everything goes fine until I do
 make inststall in the php source dir

 Making install in .
 make[1]: Entering directory `/root/programs/web/php-4.0.6'
 /root/programs/web/php-4.0.6/build/shtool mkdir -p
 /usr/local/apache/libexec  /usr/local/apache/bin/apxs -S
 LIBEXECDIR=/usr/local/apache/libexec -i -a -n php4 libs/libphp4.so
 [activating module `php4' in /usr/local/apache/conf/httpd.conf]
 cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so
 cp: cannot stat `libs/libphp4.so': No such file or directory
 apxs:Break: Command failed with rc=1
 make[1]: *** [install-sapi] Error 1
 make[1]: Leaving directory `/root/programs/web/php-4.0.6'
 make: *** [install-recursive] Error 1


 Anyone have any ideas? I have done this process many times before and have
 never seen this error before. I am also using all of the latest updates
from
 the RH site.

 -Tad






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




Re: [PHP] sending a 404 error

2001-09-16 Thread Michael A. Peters

Close- this is what actually worked-

header (HTTP/1.1 404 Not Found);

But thanks- it got me on the right track, anyway (i wasn't aware server responses were 
sent from the header)

It doesn't log it in the error_log or send the 404 error page, but i have a custom 
error page- so i just include() it... works beautifully, and agents like wget 
understand there's nothing to grab.

On Sun, 16 Sep 2001 20:44:02 -0800
GATop [EMAIL PROTECTED] wrote:

*snip*
 
 MAP I would like to replace the line
 MAP die (The file you wish to download does not exist);
 
 MAP with instead an invocation of the http 404 error.
 
*snip
 
 Yes You can
 
 header (404 Not Found);
 
 should work
 
 -- 
 Best regards,
  GATopmailto:[EMAIL PROTECTED]
 
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/

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




RE: [PHP] limiting rows and pages like google

2001-09-16 Thread Lawrence . Sheed

How about limiting results?

eg
limit the return page value after a certain number (say 10) to every 5
pages, then 50 pages a la google.



Page
1 2 3 4 5 6 7 8 9 10 ..15  ..20 ..50 ..100

This can be done relatively easily 

eg (untested)


for ($count=1;$count=$pages;$count++) {  // loop thru 
 //set modifier for page display
 if ($count  10)$iMod = 1;
elseif ($count 50)  $iMod = 5;
else $iMod=50;

 if ($count % $iMod==0) //Are we on an exact iMod boundary?
 print  a href=\$PHP_SELF?offset=$count\$i/a nbsp; \n;
 }


-Original Message-
From: Adrian D'Costa [mailto:[EMAIL PROTECTED]]
Sent: September 14, 2001 5:57 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; php general list
Subject: RE: [PHP] limiting rows and pages like google


Hi,

Thanks.  Instead of using next and previous I am giving the page number at
the bottom of the page (see lastminute.vvmm.net/nextweek.php).  The
problem is that if there are, say 35 pages, the page numbers go off the
screen.  This is the snippet:

  if ($nopage=$limit)
{

echo (centertable border=\0\ width=\100%\
tr
tdfont face=\Arial\ size=\1\Pagina/td);
for($j=1; $j=($nopage); $j++)
{
//$next = $limit*($j-1);
$xi = ($j-1);
echo(tdfont
face=\Arial\ size=\1\a
href=\$PHP_SELF?npage=$xi\[$page[$j]]/a/font
/td);

}
echo(  /tr
  /table/center);
}

Adrian

On Thu, 13 Sep 2001 [EMAIL PROTECTED] wrote:

 2 queries is ok imho, but let the database do all the work ;)
 
 The first query should be a select count (*) QUERY for a count.
 The second query should be the actual QUERY.
 
 Eg something cut 'n' pasted from some code of mine (not nice, but hey ;) )
 
 --
 
 $db = mysql_connect($db_domain, $db_user,$db_password);
 mysql_select_db($db_databasename,$db);
 
 $sqlwhere =  where CuisineID = $CuisineID ;
 
 $numresults=mysql_query( select count(*) from restaurants . $sqlwhere);
 $numrows=mysql_num_rows($numresults);
 
 // get results 
 $sqlstring= select ID, Name,LanguageID from restaurants . $sqlwhere .
 limit $offset,$limit;
 $result=@mysql_query($sqlstring,$db);
 
 //Do stuff with $result...
 
 // calculate number of pages needing links 
 $pages=intval($numrows/$limit);
 
 // $pages now contains int of pages needed unless there is a remainder
from
 division 
 if ($numrows%$limit) {
  // has remainder so add one page 
 $pages++;
 }
 
 for ($i=1;$i=$pages;$i++) {  // loop thru 
 $newoffset=$limit*($i-1);
 print  a href=\$PHP_SELF?offset=$newoffset\$i/a nbsp; \n;
 }
 
 // check to see if last page 
 if (!(($offset/$limit)==$pages)  $pages!=1) {
  // not last page so give NEXT link 
 $newoffset=$offset+$limit;
 print  a href=\$PHP_SELF?offset=$newoffset\NEXT/ap\n;
 }
 
 -Original Message-
 From: Julian Wood [mailto:[EMAIL PROTECTED]]
 Sent: September 14, 2001 1:34 AM
 To: php general list
 Subject: Re: [PHP] limiting rows and pages like google
 
 
 
 It's not too hard to do the next/previous through all your results, as 
 has been shown by several people. What is a little trickier, at least 
 when using mysql and trying to take advantage of the limit clause, is 
 how to display how many results you have (ie 1 to 10 of 107 results). If 
 you use the limit, you can't get the total number of rows, without doing 
 a second search sans limit. It's also harder to do the next link, 
 because you don't necessarily know if there are any more rows (imagine 
 you are displaying 10 rows at a time, you are on page 3 and there are 30 
 total rows). Conversely, if you do a single query without the limit, 
 then you're doing a slower search (limiting a search is way faster), and 
 I'm not sure of the implications of the full result set residing 
 serverside - maybe higher memory requirements. So what do people do to 
 take advantage of limit? Two queries or a single query? Any other 
 solutions? Any more insights on how limit works?
 
 Julian
 
 On Wednesday, September 12, 2001, at 10:16 PM, Adrian D'Costa wrote:
 
 
  Hi,
 
  I am trying to find out the the best way to do the following:
 
  I have a script that select records from a table.  The problem is that I
  need to limit the rows to 20. I know that I can use limit 20.  But 
  what I
  want to do is give the view a link to the next 20 till all the records 
  are
  shown.  What I don't know is how to maintain the search query and I want
  to use the same script.
 
  The logic would be to check if the script is called the first time, then
  the sql statement would be select travel.*, city.city from travel, city
  

[PHP] SMS with php

2001-09-16 Thread Alva Chew

Hi,

Does anyone know how to send a sms message to a handphone using PHP?

Thanks and regards,
Alva Chew



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




Re: [PHP] mysqlimport exec()

2001-09-16 Thread David Robley

On Sat, 15 Sep 2001 13:02, Terry Reynolds wrote:
 Hi
 has anyone in the PHP world ever managed to run mysqlimport via exec?

 I have written a one line script

 mysqlimport -u user -ppassword table file.txt

  chmodded it (+ x), which works from the command line every time.
 I've tried exec(), system() etc within PHP but with no luck.
 I have my own Linux/Apache/Slackware box at an IP and I have tried all
 relevant files  directories (including mysqlimport command) as
 root.root and nobody.nobody. Any ideas would be appreciated.
 TIA
 Terry

Check that it is actually executable by the user that your webserver runs 
as.

Checking the output of exec might give some insight.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Useless Invention: Training wheels for timid sports car drivers.

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




[PHP] Problem with Rename() and linux - SOLVED but....

2001-09-16 Thread Gaylen Fraley

I figured out another way to solve this.  But, I need to know the downside,
if any.

I chmod the directory to 2777 and leave Apache as is.  Obviously this opens
the directory up to danger if someone hacks in.

Comments?

--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts

Chris Schneck [EMAIL PROTECTED] wrote in message
003d01c13ef8$84435020$[EMAIL PROTECTED]">news:003d01c13ef8$84435020$[EMAIL PROTECTED]...
 Although this is a little OT, I dont remember any online tutorials that
 helped me and this is a fairly lengthy explanation. In your httpd.conf
(this
 is how i did it you can find your own way im sure) set the apache user to
be
 www and the group to www. Apache now knows to run as that user, but your
 linux box doesnt know that user which seems to be the root of your
problem.
 Now you have to edit the file '/etc/passwd' and add a line like
 'www:x:105:105:www::' then edit your '/etc/group' file and a dd a line
like
 'www::105:'.
 Restart your Apache server.
 Now your Apache server is ready to run as user www group www. Any
Directory
 of Files that Apache is going to be working with should be chown'ed to
 www.www

 Remember not to 'adduser' to accomplish this, you dont want anyone
actually
 logging in as www :) Hope this helped a little.


 From: Gaylen Fraley [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 16, 2001 2:07 PM
 Subject: [PHP] Re: Problem with Rename() and linux - update


  It is the delete (unlink) portion that the page cannot execute.  So, I
  assume this is a setting in my server conf?  Apache is running as
nobody,
  but nobody is not a valid user on my linux server.  Is that the problem?
 If
  so, is the normal prcatice to have a user like 'web' and give all rights
 to
  that user?  Alternatively I could do a copy and truncate to accomplish
the
  same task, but this seems too laborious.  Thoughts?
 
  --
  Gaylen
  [EMAIL PROTECTED]
  http://www.gaylenandmargie.com
  PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts
 
  Gaylen Fraley [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I am attempting to use the rename() function and am receiving the
  following
   error:
  
   Warning: Rename failed (Permission denied) in
   /usr/local/apache/htdocs/mydir/myfile.php on line 7
  
   The files all have a mod of 777 .  My application can update the same
 file
   w/o any problem, it's only when attempting to use rename.  Is there
   something else I need to do?  It's as if delete is not allowed by
httpd,
   although as root I can.  This does work in windows, so I know the
syntax
  is
   correct.
  
   Thanks.
  
   --
   Gaylen
   [EMAIL PROTECTED]
   http://www.gaylenandmargie.com
   PHP KISGB v1.01 Guestbook http://www.gaylenandmargie.com/publicscripts
  
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 




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




Re: [PHP] SMS with php

2001-09-16 Thread Lewis Bergman

 Hi,
 
 Does anyone know how to send a sms message to a handphone using PHP?
 
 Thanks and regards,
 Alva Chew
I have a class that does it. It is very easy. See the RFC on SNPP and some 
use standard mail servers.


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




Re: [PHP] Assigning output of include() to a variable

2001-09-16 Thread Sid

Hey I did it. A special thanks goes out to Michael Kimsal for giving me the 
idea of output buffering. Here is the code I used. Hope this helps

ob_start(); // Start output bufering
include ($filename); //$filename is the file you want to include
$x = ob_get_contents(); //Set the contents of the output buffer to variable x
ob_end_clean(); //Stop output buffering and flush its contents without 
giving output. If you want it to give out put change this line to 
ob_end_flush();

Once again thanks to everyone who helped
:-)

SID

At 11:09 PM 9/9/01 -0400, you wrote:
file() probably won't do it, unless you call an http:// file request to
your webserver - PHP won't execute other PHP code in another file when
pulled in thru file().

What you are looking for is most likely output buffering.

Read up on ob_start at php.net/ob_start.  Basically turn output buffering
on, include() the file, grab the contents from the output buffer, put them
into $x, and clear the buffer.  There should be an example or 2 at the
website.  zend.com also had an article on output buffering.




Michael Kimsal
http://www.tapinternet.com
734-480-9961


On Mon, 10 Sep 2001, Jason Brooke wrote:

   Hi,
  
   I've been trying to figure this thing out for 3 hours now. Lets say we
  have
   a variable $x. Now I need to assign $x with similar output that comes 
 from
   an include function.
  
   For anyone who did not understand me -- Instead of the stupid include()
   function outputing the file contents to the browser I need it to 
 assign it
   to variable x.
  
   I am pretty sure inlude() cannot do it but is there any other function
   similar to include() that will process the file and then assign the 
 output
   to a variable.
  
   Thanks in advance
  
   SID
 
  there's a stupid function called file() that does that
  it's in the stupid manual - which also explains the behaviour of 
 include for
  you as well
 
  jason
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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


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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Bora Paksoy

 Why on earth would you prefer java servlets?

Hmm... Let's see;Java is a full-fledge, totally OOP
and awesome programming language but not a scripting
language. Speed (will be mentioning this later),
having total control over whatever you want (exception
handling, db pooling, caching, syncrhonization,
threadding, etc. etc.), ease of use, etc. etc. I mean,
come on;)

 veins as well), therefore its imho much easier
 to do web programming with php.

That is what I saw, but as I said, I didn't see a lot
of difference between perl and php, I mean, C++ and
perl are very different, likewise java and perl or
other languages, but PHP has a very similar syntax.

 FYI, JSP is the slowest to my knowledge.

The first request is slow since JSPs are compiled into
servlets (java classes)... But, then it is not bad...
In fact, I saw some comparisons showing that servlets
are kicking ass! But, again, I mean, this all depends
on how you design/configure the system, one simple
example:java used to crap out (before 1.2, don't know
the latest situation, but heard that it is better)
after 40-50 threads per jvm, so if  you have more than
40-50 concurrent requests, starting couple of servlet
engines on different jvms and using apache dispatching
improves the speed a lot! Likewise, tricks like using
caching, staying away from classic traps (i.e. using
StringBuffers instead of Strings when needed),
minimizing garbage collection, etc. etc. Also, with
the introduction of JIT and hotspot capable JREs, java
is doing pretty well these days...You can check
comparisons at rasin servlet engine page.

 No, its not available on Windows, but then
 again, why on earth would you want to use Windows?
;) 

Same here;) I am supposed to implement this sytem on
windows 2000...But I totally agree! I would definitely
prefer linux or other unix systems over windows...

If you really need
 shm on windows, submit a patch, hint, its just a
mmap() :)

Well, what I meant was something like ease of sharing
data in java (using static variables) and dealing with
synchronization is extremely easy in java... Also,
FastCGI is not that hard as far as I could see, but I
am not an expert in that area;)

 You can use Files or SHM management, or write
 your own custom session backend using for example
MySQL.

Using a database in the backhand is what huge sites
are doing, but they have huge boxes to run these
databases and very fast network infrastructure. Do you
think overhead of serializing/de-serializing session
for every request via the database is a lot? Files
again is??? I don't know... As you specified SHM is
not very nice either (dealing with synchronization
might be messy).

 No.  Its compile and execute everytime

??? Don't you think using perl and printing out html
from the code is faster than this? I mean, parsing the
whole html doesn't seem very good???Actually, this is
what I was scared of. I mean, for example say you have
an html that consists of blocks... Making every block
an include is clean, but this time, php engine has to
read all of these includes, and parse the html+php and
compile/run php everytime a request is made??? I am
not sure about this?

 Yes, but do you want your web designer going
 through your perl code

Hmmm, good point, hehehehe...



Thanks a lot for your time and I appreciate your
comments.

Baho...

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Bora Paksoy

 Threading instead of forking?  None of these do
 either.  Apache is a
 pre-forking multi-process server and both PHP and
 mod_perl are part of
 these pre-forked processes.  Neither mod_perl nor
 PHP do any threading nor forking. 

??? I didn't get this? Aren't these pre-forked
processes handle requests using threads internally?
Say you configure apache to pre-fork 5 server
processes, what you are saying implies that you can
only handle 5 concurrent requests?? can you please
explain this more?

 Again, the architectural difference makes this a lot
 easier to do in a
 single-process JVM scenario.  Note that such a
 single-process JVM
 architecture which maintains static objects is very
 hard to scale cleanly.

Actually, as far as I know, you can configure tomcat
or other servlet engines to start multiple servlet
engines (JVMs) and the dispatcher code makes sure that
every user goes to the same JVM for subsequent
requests. So, you can scale with this architecture...

 The lifecycle of a request/response matches the
 lifecycle of an HTTP request/response.

Actually, I was asking the low-level information, I
mean something like web server receives the request,
hands this over to mod_php, that requests a thread
from the worker threads, so on so forth...

Anyways, once again, thanks for your time...
Baho.

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

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




[PHP] Performance: PHP vs. Visual Basic

2001-09-16 Thread Masami Kawakami

Maybe this is one of FAQ, Please give me a URL of this kind of comparison
page, or your experience.

A web server program is running in my office. It consists of Visual
Basic, IIS, and MS SQL Server on Windows 2000. although the performance
is confortable for few users, it is terribly slow for 40-50 users. Once
all of them start to use, it takes more than 20 seconds to open a page
in client browser.

To improve the performance, we have an idea to use, instead of Microsoft,
PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be the
improvement?

We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 3rd
for IIS or Apaches. Which has better scalability, VB or PHP?



-- 
Masami Kawakami [EMAIL PROTECTED]


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




Re: [PHP] Performance: PHP vs. Visual Basic

2001-09-16 Thread Michael Kimsal

Much as I don't like to defend MS, I'll take a stab here.

By 40-50 people in an office, I presume you're talking about an intranet
of some type - 40-50 aren't constantly hitting it (meaning 40-50 requests
per second all the time), but 40-50 are using it throughout the day for
various tasks.

You don't give the machine specs, but I'd hazard to say, if it's moderate
equipment, that there's some DB optimization (or VB optimization) that
could be done.  40 people lightly hitting a machine shouldn't cause much
of a problem regardless of language used, unless there's some extremely
bad coding going on.

Are you closing DB connections?
Are you avoiding putting objects in session and/or application scope?
Are the DB queries optimized properly (proper indices on tables, etc)?

Those are just a few things I'd look for.  Yeah it'd be great to have you
switch to PHP, but some optimization issues are universal, and if it's
written poorly in one language, chances are it'll be written poorly in
another.

Regardless of this, we still recommened PHP to most clients because of
the cost issue as well.  However, since you've already paid for this
software you're running (right?) it's probably worth it to take a while to
optimize what you've got first.




Michael Kimsal
http://www.tapinternet.com
734-480-9961


On Sun, 16 Sep 2001, Masami Kawakami wrote:

 Maybe this is one of FAQ, Please give me a URL of this kind of comparison
 page, or your experience.

 A web server program is running in my office. It consists of Visual
 Basic, IIS, and MS SQL Server on Windows 2000. although the performance
 is confortable for few users, it is terribly slow for 40-50 users. Once
 all of them start to use, it takes more than 20 seconds to open a page
 in client browser.

 To improve the performance, we have an idea to use, instead of Microsoft,
 PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be the
 improvement?

 We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 3rd
 for IIS or Apaches. Which has better scalability, VB or PHP?



 --
 Masami Kawakami [EMAIL PROTECTED]


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



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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Rasmus Lerdorf

 ??? I didn't get this? Aren't these pre-forked
 processes handle requests using threads internally?
 Say you configure apache to pre-fork 5 server
 processes, what you are saying implies that you can
 only handle 5 concurrent requests?? can you please
 explain this more?

That's exactly what it means.  Apache on Unix is non-threaded.

 Actually, I was asking the low-level information, I
 mean something like web server receives the request,
 hands this over to mod_php, that requests a thread
 from the worker threads, so on so forth...

Well, since there are no threads involved here there is no pool of worker
threads or anything like that.  You simply have a process that grabs a
requests, branches off to mod_php/mod_perl and sends the result back.

-Rasmus


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




RE: [PHP] Performance: PHP vs. Visual Basic

2001-09-16 Thread Matthew Loff


I would agree that the DB is probably the biggest bottleneck...

Are you connecting to the DB via ODBC?  I'm not an expert at DB stuff
outside of the MySQL realm, but I've heard many say ODBC is horribly
slow.  I don't know ASP that well, but could someone comment on ADODB?
It uses OLEDB, not ODBC, correct?  I've read that OLEDB is much faster.

First and foremost, as Michael said, optimize your SQL...  That's the
first thing I'd do...  Then, check and see how you are connecting to the
DB...

I think I can safely say, that if you switch to PHP/MySQL, that using
MySQL native libs to connect to the database are fastest... But I have
been wrong in the past...



-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 11:54 PM
To: Masami Kawakami
Cc: php forum
Subject: Re: [PHP] Performance: PHP vs. Visual Basic


Much as I don't like to defend MS, I'll take a stab here.

By 40-50 people in an office, I presume you're talking about an intranet
of some type - 40-50 aren't constantly hitting it (meaning 40-50
requests per second all the time), but 40-50 are using it throughout the
day for various tasks.

You don't give the machine specs, but I'd hazard to say, if it's
moderate equipment, that there's some DB optimization (or VB
optimization) that could be done.  40 people lightly hitting a machine
shouldn't cause much of a problem regardless of language used, unless
there's some extremely bad coding going on.

Are you closing DB connections?
Are you avoiding putting objects in session and/or application scope?
Are the DB queries optimized properly (proper indices on tables, etc)?

Those are just a few things I'd look for.  Yeah it'd be great to have
you switch to PHP, but some optimization issues are universal, and if
it's written poorly in one language, chances are it'll be written poorly
in another.

Regardless of this, we still recommened PHP to most clients because of
the cost issue as well.  However, since you've already paid for this
software you're running (right?) it's probably worth it to take a while
to optimize what you've got first.




Michael Kimsal
http://www.tapinternet.com
734-480-9961


On Sun, 16 Sep 2001, Masami Kawakami wrote:

 Maybe this is one of FAQ, Please give me a URL of this kind of 
 comparison page, or your experience.

 A web server program is running in my office. It consists of Visual 
 Basic, IIS, and MS SQL Server on Windows 2000. although the 
 performance is confortable for few users, it is terribly slow for 
 40-50 users. Once all of them start to use, it takes more than 20 
 seconds to open a page in client browser.

 To improve the performance, we have an idea to use, instead of 
 Microsoft, PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be

 the improvement?

 We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 
 3rd for IIS or Apaches. Which has better scalability, VB or PHP?



 --
 Masami Kawakami [EMAIL PROTECTED]


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



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


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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Rasmus Lerdorf

 I mean, for example say you have
 an html that consists of blocks... Making every block
 an include is clean, but this time, php engine has to
 read all of these includes, and parse the html+php and
 compile/run php everytime a request is made??? I am
 not sure about this?

I wouldn't say it was clean to split everything out into separate files.
I tend to do something more like:

  ? include 'logic.php' ?
  HTML tags tags tags
? my_func() ?
  More tags
? another_func() ?
  More tags
  ? footer() ?

ie. don't necessarily use 1 file per block, create functions that are
defined in a single file and call those instead of including a new file.
If you really do want to separate it, have a look at a cacheing templating
system like Smarty which lets you keep this per-file separation but it
caches the combined logic.

  http://www.phpinsider.com/php/code/Smarty/

-Rasmus


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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread speedboy

 ie. don't necessarily use 1 file per block, create functions that are
 defined in a single file and call those instead of including a new file.

How do you echo your html, do you put the html in your functions and
escape the double quotes? There is some extra load there echoing all the
html?

Thanks.


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




Re: [PHP] Why doesn't this work?

2001-09-16 Thread Rasmus Lerdorf

 print split(=,$testString)[0];

First, using split() on such a simple delimiter is a waste.  Use
explode().  And yes, PHP does not support automatic dereferencing of
returned arrays like that.

-Rasmus


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




Re: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Rasmus Lerdorf

  ie. don't necessarily use 1 file per block, create functions that are
  defined in a single file and call those instead of including a new file.

 How do you echo your html, do you put the html in your functions and
 escape the double quotes? There is some extra load there echoing all the
 html?

echo HTML?  I do this:

  ? php stuff..?
  HTML stuff
  ? more php stuff ?

I drop out of PHP mode to display raw HTML.  If I have a lot of HTML with
a lot of PHP variables tossed in, I do:

  ?
   $test = 'test';
   $one = 'one';
   echo EOF
   This is a $test.
   And here is another $one.
  EOF;
   ..more php code...
 ?

Or sometimes simply:

  HTML stuff ?=$variable? and some more HTML stuff.

-Rasmus


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




RE: [PHP] Performance: PHP vs. Visual Basic

2001-09-16 Thread Lawrence . Sheed

It may not be a performance thing based on software in use, it could be
coding problems with the current software.

If you are having problems with 40 - 50 users, you may want to look at where
things are locking up.  Table locking because of badly designed update
queries can freeze a good system because of contentions.

How do you handle concurrent locking - what does your code look like for the
initial 20 seconds to load page / slow loading pages?

Run some performance monitoring on sql server, it has good tools for this,
as does win2k.


How much ram do you have?  sql server eats ram.  (buy more, depending on
whether your monitoring tells you its needed - look at paging).  There are
lots of nt tuning faq's out there.  Check what you have before dumping it
for something else.

I learnt from someone once its better to find out and understand the problem
than to avoid it.  It may come back and bite you.

That said, php is more scalable than vb (flamebait), but its equally easy to
write bad code in both.
SQL Server is a bit of a behemoth, but feed it nicely (ram), and it
generally behaves (*unless you are russian nuclear materials database admins
- see slashdot for more.)

Regards,

Lawrence

-Original Message-
From: Masami Kawakami [mailto:[EMAIL PROTECTED]]
Sent: September 17, 2001 11:43 AM
To: php forum
Subject: [PHP] Performance: PHP vs. Visual Basic


Maybe this is one of FAQ, Please give me a URL of this kind of comparison
page, or your experience.

A web server program is running in my office. It consists of Visual
Basic, IIS, and MS SQL Server on Windows 2000. although the performance
is confortable for few users, it is terribly slow for 40-50 users. Once
all of them start to use, it takes more than 20 seconds to open a page
in client browser.

To improve the performance, we have an idea to use, instead of Microsoft,
PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be the
improvement?

We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 3rd
for IIS or Apaches. Which has better scalability, VB or PHP?



-- 
Masami Kawakami [EMAIL PROTECTED]


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

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




Re: [PHP] if(isset($a)) vs if($a)

2001-09-16 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Mark) wrote:

 calling empty($a) does not give a warning.

Sheesh.  It doesn't at that.  WTF?

-- 
CC

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




RE: [PHP] PHP vs. PERL (Functional Comparison)??

2001-09-16 Thread Jack Dempsey

hallelujah...first time i've seen someone else mention here docs, and being
rasmus, not a bad person to make the mention ;-)

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 12:17 AM
To: speedboy
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP vs. PERL (Functional Comparison)??


  ie. don't necessarily use 1 file per block, create functions that are
  defined in a single file and call those instead of including a new file.

 How do you echo your html, do you put the html in your functions and
 escape the double quotes? There is some extra load there echoing all the
 html?

echo HTML?  I do this:

  ? php stuff..?
  HTML stuff
  ? more php stuff ?

I drop out of PHP mode to display raw HTML.  If I have a lot of HTML with
a lot of PHP variables tossed in, I do:

  ?
   $test = 'test';
   $one = 'one';
   echo EOF
   This is a $test.
   And here is another $one.
  EOF;
   ..more php code...
 ?

Or sometimes simply:

  HTML stuff ?=$variable? and some more HTML stuff.

-Rasmus


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



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




[PHP] Re: echo/printing html within a function - best method

2001-09-16 Thread speedboy

  How do you echo your html, do you put the html in your functions and
  escape the double quotes? There is some extra load there echoing all the
  html?
 
 echo HTML?  I do this:
 
   ? php stuff..?
   HTML stuff
   ? more php stuff ?
 
 I drop out of PHP mode to display raw HTML.  If I have a lot of HTML with
 a lot of PHP variables tossed in, I do:
 
   ?
$test = 'test';
$one = 'one';
echo EOF
This is a $test.
And here is another $one.
   EOF;
..more php code...
  ?

I meant to say, in your functions, do you use the same as above echo EOF ...

Thanks.


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




Re: [PHP] Re: echo/printing html within a function - best method

2001-09-16 Thread Rasmus Lerdorf

   How do you echo your html, do you put the html in your functions and
   escape the double quotes? There is some extra load there echoing all the
   html?
 
  echo HTML?  I do this:
 
? php stuff..?
HTML stuff
? more php stuff ?
 
  I drop out of PHP mode to display raw HTML.  If I have a lot of HTML with
  a lot of PHP variables tossed in, I do:
 
?
 $test = 'test';
 $one = 'one';
 echo EOF
 This is a $test.
 And here is another $one.
EOF;
 ..more php code...
   ?

 I meant to say, in your functions, do you use the same as above echo EOF ...

I try to avoid having my functions generate HTML.  But yes, when they do I
use the same approach.  You can have functions that look like this:

   ? function foo() {?
 HTML Stuff
   ? } ?

That is, a function that does nothing but output HTML.

-Rasmus


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




Re: [PHP] Re: echo/printing html within a function - best method

2001-09-16 Thread Jason Bell

Out of curiosity, why do you avoid having functions generate HTML?  Is this
just personal preference, or is there some performance or other reason?

-Jason

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: speedboy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 16, 2001 9:32 PM
Subject: Re: [PHP] Re: echo/printing html within a function - best method


 I try to avoid having my functions generate HTML.  But yes, when they do I
 use the same approach.


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




[PHP] Re: Compiling php like C

2001-09-16 Thread Yasuo Ohgaki

Kunal Jhunjhunwala wrote:
 Hi,
 Has anyone done this to date?? I was thinking of compiling my programs for
 better perfomance, and of course, protect the source code. Anyone have any
 ideas on this issue?
 Regards,
 Kunal Jhunjhunwala
 

There are sevral cache modules. These are cache modules that I know.
  - Alternative PHP Cache (APC): http://apc.communityconnect.com/
  - AfterBuaner Cache (bwcache) : http://bwcache.bware.it/
  - PHP Accelerator : http://www.php-accelerator.co.uk/
  - Zend Cache : http://www.zend.com/zend/products.php#cache

All of them gives 2 - 3 times perfomance improvment in general.

Yasuo Ohgaki


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




[PHP] FOPEN remote problems..

2001-09-16 Thread reberrya

Hey all.  I'm trying to do a fopen for reading on many different sites and
web pages.  However, I have found that many webpages can not be FOPENed at
all.  For instance, one such example would be
http://www.800.com/prod.asp?P=5261

I do not understand as I can read from numerous other sites.  Why can I see
the above site and others in Internet Explorer and Netscape, but PHP is not
able to read from that file?

And yes, I can read from many other ASP, JSP, and PHP pages, so this is not
the problem that I know of.

Any help appreciated.

Andrew



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




Re: [PHP] Re: Compiling php like C

2001-09-16 Thread Andrew Perevodchik

 Has anyone done this to date?? I was thinking
 of compiling my programs for better perfomance,
 and of course, protect the source code. Anyone
 have any ideas on this issue?

Another question: is it possible to compile PHP
script in COM or EXE file?

-- 
Andrew Perevodchik
[EMAIL PROTECTED]


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




Re: [PHP] R: viewer analysis

2001-09-16 Thread Adrian D'Costa

On Fri, 14 Sep 2001, GATop wrote:

 Is there more like that?

Like what :)

Adrian


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




[PHP] Can I use Microsoft Access as a database?

2001-09-16 Thread A. op de Weegh

Hi all,
for testing purposes in a school environment, I would like to use a
Microsoft Access database with PHP. I know how to connect to and use a MySQL
database, but I can't find any functions for accessing Microsoft Access
databases.

Can anyone help me out here?

Thankx,
Alex

--
PS: Replace the underscore (_) in my e-mail address with a minus sign (-).



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