RE: [PHP] mysql replication + mysql_pconnect

2003-03-02 Thread Dan Rossi
i'll explain

i need a fallbak method where if the master server is down it will goto the
slave i assumed the connection could do this automatically but it doesnt
therefore requires it setup in the php connection  script ,

part of my db class $this-connection = @mysql_pconnect($host,$user,$pass);
say host is localhost:3308 it will still connect to the master on 3306 , or
even localhost:3307 which is the slave it will still get the master server ,
i turn off the master server and i get this localhost:3307Can't connect to
local MySQL server through socket
'/usr/local/etc/mysqlmaster/tmp/mysql.sock' (2) where 3307 is the slave ,
one thing though , i have this in my php configure
'--with-mysql=/usr/local/etc/mysqlmaster' ' is that a problem ?

-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 12:34 PM
To: electroteque; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql replication + mysql_pconnect


 hi there i am setting up a test replication slave server as a mysql db
 master backup if it fails , i would like to know how to
 dynamically connect
 to the slave if the master fails , something really strange i have set the
 host like localhost:3307 for the slave but is still connecting to
 the master
 , and if i shut down the master it wont goto the slave :|



Not sure I understand ... are you saying that
mysql_connect('localhost:3307','user','password') connects to the master
server? Can you describe the problem in more detail?

Rich




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



RE: [PHP] mysql replication + mysql_pconnect

2003-03-02 Thread Dan Rossi
i have worked out the issue , here is my dynamic connection to the slave ,
port does not work i suggest this is a bug ?

localhost:/usr/local/etc/mysqlslave/tmp/mysql.sock this connected to the
slave on 3307 fine

-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 12:34 PM
To: electroteque; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql replication + mysql_pconnect


 hi there i am setting up a test replication slave server as a mysql db
 master backup if it fails , i would like to know how to
 dynamically connect
 to the slave if the master fails , something really strange i have set the
 host like localhost:3307 for the slave but is still connecting to
 the master
 , and if i shut down the master it wont goto the slave :|



Not sure I understand ... are you saying that
mysql_connect('localhost:3307','user','password') connects to the master
server? Can you describe the problem in more detail?

Rich




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



Re: [PHP] PHP SQL Code

2003-03-02 Thread Tim Ward
I'd use ...
WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(sUpdated)  60*60*24*60

but I'm sure someone will come up with something more efficient.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Philip J. Newman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 7:46 AM
Subject: [PHP] PHP SQL Code


 I would like yo show the users in a list that have a date that is more
than
 60 days old.


 $sql = SELECT * FROM stompers WHERE sUpdated 
 from_unixtime(unix_timestamp(now())-(15760*60)) AND sActive = 'Y' ORDER BY
 sUpdated DESC;

 This don't quite work ..

 Any suggestions?


 --
 Philip J. Newman.
 Head Developer
 [EMAIL PROTECTED]

 +64 (9) 576 9491
 +64 021-048-3999

 --
 Friends are like stars
 You can't allways see them,
 but they are always there.

 --
 Websites:

 PhilipNZ.com - Design.
 http://www.philipnz.com/
 [EMAIL PROTECTED]

 Philip's Domain // Internet Project.
 http://www.philipsdomain.com/
 [EMAIL PROTECTED]

 Vital Kiwi / NEWMAN.NET.NZ.
 http://www.newman.net.nz/
 [EMAIL PROTECTED]



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




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



Re: [PHP] authentication question...

2003-03-02 Thread Ernest E Vogelsinger
At 07:02 02.03.2003, Sunfire said:
[snip]
basic question about www-authenticate header...(least i hop its simple)
i have the code:
?php
header(WWW-Authenticate: basic realm='a realm');
header(HTTP/1.0 402 Unauthorized);//dont understand
//what this line does
echo you didnt login yet\n; //understand it but want
//something else like a header sent out...
dont understand what the second line is for and was wondering if that third
line that someone gets when you hit cancel can be turned into another
header? or is there a way to force a header block even if output has already
been put on the screen?
[snip] 

To understand the header lines you need to have some basic knowledge of the
HTTP protocol. Start eating tht HTTP RFC:
http://www.w3.org/Protocols/rfc2616/rfc2616

This will also enlighten yo about the fact that a header cannot be senz
after content has been pushed out.

This said you can use output buffering
(http://www.php.net/manual/en/function.ob-start.php) to avoid output being
sent before the headers:

Example:

ob_start();
echo some stuff;

// we decide to redirect the client
ob_end_clean();  // clear the output buffer
header('Location: http://somewhere.com');

HTH,

-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] browser uploading

2003-03-02 Thread joe
i am operating on safe mode and i need to figure out, how to upload files
with php through your browser. copy() is disabled for sure, im not
absolutsely sure about other functions. i have heard that it is actually
possible but so far i haven't been able to figure out how..
any ideas would be most helpful
thank you



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



Re: [PHP] browser uploading

2003-03-02 Thread Ernest E Vogelsinger
At 12:35 02.03.2003, joe said:
[snip]
i am operating on safe mode and i need to figure out, how to upload files
with php through your browser. copy() is disabled for sure, im not
absolutsely sure about other functions. i have heard that it is actually
possible but so far i haven't been able to figure out how..
[snip] 

check out move_uploaded_file():
http://www.php.net/manual/en/function.move-uploaded-file.php

safe_mode is covered in the docs, too.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] IMAP error while compiling PHP-4.3.0

2003-03-02 Thread Patrick Teague
I saw somewhere that if you don't have the kerberos stuff installed you'll
have problems compiling with imap, so as far as I can figure I have all the
rpms I need installed for imap support -

imap-2001a-9mdk
imap-devel-2001a-9mdk
krb5-devel-1.2.5-1mdk
krb5-libs-1.2.5-1mdk

Patrick

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 1:42 AM
Subject: Re: [PHP] IMAP error while compiling PHP-4.3.0


 On Saturday 01 March 2003 06:30, Patrick Teague wrote:
  I'm trying to compile php on Mandrake 9, but this latest error during
  compile has me stumped as I've installed all the imap-devel type rpms.
 
  .
  checking for IMAP support... yes
  checking for pam_start in -lpam... yes
  checking for crypt in -lcrypt... (cached) yes
  configure: error: Cannot find imap library (libc-client.a). Please check
  your IMAP installation
 
  any ideas?  I checked the php.net faq on building, but I haven't found
any
  info about this.  I've searched the imap rpms I have  even searched the
  whole system, but it couldn't find 'libc-client.a' anywhere.

 Are you using RPMs? On a RH system that file is provided by the IMAP-devel
 package. I suppose it's similar for MDK. In general you need to install
the
 devel packages of any libraries that you wish to use.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Hanson's Treatment of Time:
 There are never enough hours in a day, but always too many days
 before Saturday.
 */


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







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



[PHP] Where to publish extension?

2003-03-02 Thread Niels Andersen
Hello!

I have made a really great (or at least that is what I think) extension,
which I think everybody should use :))

Where should I publish it?
Is there any chance that it will make its way into a future distro?



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



RE: [PHP] Where to publish extension?

2003-03-02 Thread Adrian Portsmouth
Hi There,

Not sure how you define an extension, but you could take a look at my
web site www.phpscriptsearch.com and see if it applies to listing it
there. But like I said, it depends what you mean by extension.

As far as getting it into the next distro, not sure, I have put in a lot
of effort trying to contact various people within the PHP group without
any success at all.

HTH
Adrian
www.phpscriptsearch.com

-Original Message-
From: Niels Andersen [mailto:[EMAIL PROTECTED] 
Sent: 02 March 2003 13:31
To: [EMAIL PROTECTED]
Subject: [PHP] Where to publish extension?


Hello!

I have made a really great (or at least that is what I think) extension,
which I think everybody should use :))

Where should I publish it?
Is there any chance that it will make its way into a future distro?



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


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



[PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
Hi,

I have an array which I am trying to total but having some problems. Any
help is appreciated.

Example:  This is a hockey team and there are 20 players - I am selecting
the goals, assists, and points from each player and then want to have a
grand total of all goals, assists, and points.

$query = select goals, assists, points from roster;

while ($line = mysql_fetch_row($result)) {

$totals[] = $line;

}

I want to total $totals[0][4] through $totals[19][4], $totals[0][5] through
$totals[19][5], etc. for each stat. I thought of putting them in a for loop
and just adding them, but this seemed kind of messy and the long way around

Thanks




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



Re: [PHP] Arrays and MySQL

2003-03-02 Thread Marek Kilimajer
Cannot you just make MaSQL count it?

$query = select sum(goals), sum(assists), sum(points) from roster;



Beauford.2002 wrote:

Hi,

I have an array which I am trying to total but having some problems. Any
help is appreciated.
Example:  This is a hockey team and there are 20 players - I am selecting
the goals, assists, and points from each player and then want to have a
grand total of all goals, assists, and points.
$query = select goals, assists, points from roster;

while ($line = mysql_fetch_row($result)) {

$totals[] = $line;

}

I want to total $totals[0][4] through $totals[19][4], $totals[0][5] through
$totals[19][5], etc. for each stat. I thought of putting them in a for loop
and just adding them, but this seemed kind of messy and the long way around
Thanks



 



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


[PHP] html parsing question

2003-03-02 Thread Jos Elkink
Hello,

I've got a little question. I am writing a page where I would like to
parse my own invented HTML-looking tags (but want to keep the real HTML
tags intact). I use a buffer for the output, and just before the end use
ob_get_contents() to get the whole buffer which I want to check for
those tags.

(Something like:

$tag-content = ob_get_contents();
$output = $tag-interpret();
ob_end_clean();
echo $output;
)

Now my question is, what is the fastest way to search and replace
through this file, whereby the interpretation of the tag can be somewhat
complicated?

I first just had a loop running character by character through this
text, looking for tags, but that is obviously way too slow.

Now I have something like:

preg_replace_callback (/(.+)/, array($this, 'tag_callback'),
$this-content);

But then I don't know how to interpret different tags differently. Any
suggestions?

(A tag looks like: CANTR REPLACE NAME=text where then the whole tag
has to be replaced by something called 'text' that has to be looked up
in a table. So, CANTR REPLACE NAME=text has to be replaced with
something else than CANTR REPLACE NAME=main - well, you get the idea.)

Thanks in advance for any help!

Jos

--
Jos Elkink
Game Administration Council
Cantr II   http://www.cantr.net


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



[PHP] Php and JavaScript

2003-03-02 Thread Valentin
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?

Thanks,



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



[PHP] Re: Php and JavaScript

2003-03-02 Thread Vincent M.
Valentin wrote:
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?
Thanks,


Of course, you can create dynamicaly javascript via php, ie:
  echo 
script language=\JavaScript\
  var yourvar = $onephpvar ;
/script ;
Is that what you were asking for ?

Vincent.

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


RE: [PHP] Just to ask knowledgable ppl

2003-03-02 Thread John W. Holmes
 Not directly PHP related, but I'm building a site in PHP at the
moment, so
 I've been doing a bit of research...
 I've been on the net for years, coding and surfing and coding.  And
not
 always in that order. ;)  But only recently have I heard about web
 beacons,
 or single-pixel gifs.  Seems every site with these beacons mentions
them
 in
 their privacy policy.  Shows you how much I pay to attention to them.
I
 was
 just curious as to how they work.  Is it just a matter of viewing
server
 reports to see how often that image has been accessed?

I'm sure you could do a number of things with them. It could even be a
PHP script that does some logging of it's own with sessions or cookies
or whatever and then outputs the data for a single pixel gif. So you
could have a plain HTML page that'll still access a .php page when it's
loaded to track what users are doing. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] PHP SQL Code

2003-03-02 Thread John W. Holmes
 I would like yo show the users in a list that have a date that is more
 than
 60 days old.

$sql = SELECT * FROM stompers WHERE sUpdated  CUR_DATE() - INTERVAL 60
DAY AND sActive = 'Y' ORDER BY sUpdated DESC;

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Php and JScript

2003-03-02 Thread Valentin
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?

Thanks,




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



Re: [PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
It gets a little more complicated than this. There are several teams (each
with 20 players) and then there is the team owner and then there is the
player position, etc.  So to do this I would have to do some kind of a join
and so on - and to date haven't been able to figure this out with sums. I
would also have to do a second query (I am already doing one to get the
points for each player), so I might as well just use it and through the
results in an array and then total it from there - and thus my question of
how I total the array


- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 11:10 AM
Subject: Re: [PHP] Arrays and MySQL


 Cannot you just make MaSQL count it?

 $query = select sum(goals), sum(assists), sum(points) from roster;




 Beauford.2002 wrote:

 Hi,
 
 I have an array which I am trying to total but having some problems. Any
 help is appreciated.
 
 Example:  This is a hockey team and there are 20 players - I am selecting
 the goals, assists, and points from each player and then want to have a
 grand total of all goals, assists, and points.
 
 $query = select goals, assists, points from roster;
 
 while ($line = mysql_fetch_row($result)) {
 
 $totals[] = $line;
 
 }
 
 I want to total $totals[0][4] through $totals[19][4], $totals[0][5]
through
 $totals[19][5], etc. for each stat. I thought of putting them in a for
loop
 and just adding them, but this seemed kind of messy and the long way
around
 
 Thanks
 
 
 
 
 
 


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





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



php-general Digest 2 Mar 2003 16:43:34 -0000 Issue 1914

2003-03-02 Thread php-general-digest-help

php-general Digest 2 Mar 2003 16:43:34 - Issue 1914

Topics (messages 137753 through 137785):

Re: PHP scripts and the GPL/other licenses
137753 by: Jason Sheets
137754 by: Jeff Lewis
137756 by: Leif K-Brooks

Re: php.ini
137755 by: Anthony Ritter

Date question
137757 by: Sebastian
137759 by: John W. Holmes
137762 by: Sebastian
137764 by: Tom Rogers

Re: 2 questions !
137758 by: Vincent M.

What ?
137760 by: Vincent M.

authentication question...
137761 by: Sunfire
137771 by: Ernest E Vogelsinger

Re: [PHP-I18N] addslashes(): Is it multi-byte safe?
137763 by: Jean-Christian Imbeault

File problem - PHP Quest
137765 by: Monil Chheda

PHP SQL Code
137766 by: Philip J. Newman
137770 by: Tim Ward
137783 by: John W. Holmes

Just to ask knowledgable ppl
137767 by: Jason Paschal
137782 by: John W. Holmes

Re: mysql replication + mysql_pconnect
137768 by: Dan Rossi
137769 by: Dan Rossi

browser uploading
137772 by: joe
137773 by: Ernest E Vogelsinger

Re: IMAP error while compiling PHP-4.3.0
137774 by: Patrick Teague

Where to publish extension?
137775 by: Niels Andersen
137776 by: Adrian Portsmouth

Arrays and MySQL
13 by: Beauford.2002
137778 by: Marek Kilimajer
137785 by: Beauford.2002

html parsing question
137779 by: Jos Elkink

Php and JavaScript
137780 by: Valentin
137781 by: Vincent M.

Php and JScript
137784 by: Valentin

Administrivia:

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

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

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


--
---BeginMessage---
I generally use the BSD license for my code and PHP scripts, in some
cases I have used the GPL but IMHO the GPL is too restricting so I live
what I preach and release my code under the BSD License.

As far as people stealing code and renaming it I've seen several
commercial programs that are simply an open source or free software app
with spyware renamed, not a whole lot you can do without taking legal
action.

Jason
On Sat, 2003-03-01 at 21:26, Jeff Lewis wrote:
 I am wondering if anyone out there has some really good references in
 regards to scripts distributed as open source using the GPL. In the last
 three years that I have worked on open source projects I have seen several
 people steal a program, change the name and then try to distribute it as
 something else.
 
 So I am wondering what people here prefer to use for a license, is there
 anyway to combat these kinds of people, etc.
 
 Why do I ask now? Because it has happened again, only this time, the person
 is actively marketing this new script.
 
 Jeff
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

---End Message---
---BeginMessage---
And they aren't, that is our main issue...

So with the GPL, someone can change say...10 lines and rename the scripts
and distribute it as their own?

Jeff
- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
To: Jeff Lewis [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 11:33 PM
Subject: Re: [PHP] PHP scripts and the GPL/other licenses


 They're doing nothing wrong as long as they distribute the source under
 the GPL.

 Jeff Lewis wrote:

 I am wondering if anyone out there has some really good references in
 regards to scripts distributed as open source using the GPL. In the last
 three years that I have worked on open source projects I have seen
several
 people steal a program, change the name and then try to distribute it
as
 something else.
 
 So I am wondering what people here prefer to use for a license, is there
 anyway to combat these kinds of people, etc.
 
 Why do I ask now? Because it has happened again, only this time, the
person
 is actively marketing this new script.
 
 Jeff
 
 
 
 
 

 --
 The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.




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






---End Message---
---BeginMessage---
Yes.  Just look at Linux, and its many distributions.  Most have changed 
more than 10 lines, but I don't believe the GPL says how much must be 
changed.

Jeff Lewis wrote:

So with the GPL, someone can change say...10 lines and rename the scripts
and distribute it as their own?
--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


---End Message---
---BeginMessage---
Rich,
I've got five screenshots at this URL:


[PHP] Movie ticket reservation system.

2003-03-02 Thread Chuck
Hi. does anyone know of a php//mysql based movie ticket reservation system?

Thanks,
Chuck Barnett

RE: [PHP] html parsing question

2003-03-02 Thread John W. Holmes
 I've got a little question. I am writing a page where I would like to
 parse my own invented HTML-looking tags (but want to keep the real
HTML
 tags intact). I use a buffer for the output, and just before the end
use
 ob_get_contents() to get the whole buffer which I want to check for
 those tags.
 
 (Something like:
 
 $tag-content = ob_get_contents();
 $output = $tag-interpret();
 ob_end_clean();
 echo $output;
 )
 
 Now my question is, what is the fastest way to search and replace
 through this file, whereby the interpretation of the tag can be
somewhat
 complicated?
 
 I first just had a loop running character by character through this
 text, looking for tags, but that is obviously way too slow.
 
 Now I have something like:
 
 preg_replace_callback (/(.+)/, array($this, 'tag_callback'),
 $this-content);
 
 But then I don't know how to interpret different tags differently. Any
 suggestions?
 
 (A tag looks like: CANTR REPLACE NAME=text where then the whole tag
 has to be replaced by something called 'text' that has to be looked up
 in a table. So, CANTR REPLACE NAME=text has to be replaced with
 something else than CANTR REPLACE NAME=main - well, you get the
idea.)

Here's an example of how to use preg_replace_callback. Within the
callback() function, $matches[1] is going to contain whatever value was
in your NAME attribute of your CANTR tag. Act accordingly to it.

?php

$text = 'Hello cantr replace text=name. You are on page cantr
replace text=main right now.';

function callback($matches)
{
switch($matches[1])
{
case 'name':
$retval = 'John';
break;

case 'main':
$retval = 'Index.php';
break;
}

return $retval;
}

$new_text = preg_replace_callback('/cantr replace
text=([^]+)/i','callback',$text);

echo hr;
echo $new_text;
?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] PHP SQL Code

2003-03-02 Thread Philip J. Newman
This one returns a 'Could not get Query' warning ... so thats out.


- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Philip J. Newman' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 5:31 AM
Subject: RE: [PHP] PHP SQL Code


  I would like yo show the users in a list that have a date that is more
  than
  60 days old.

 $sql = SELECT * FROM stompers WHERE sUpdated  CUR_DATE() - INTERVAL 60
 DAY AND sActive = 'Y' ORDER BY sUpdated DESC;

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/




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



[PHP] MySQL

2003-03-02 Thread Dan Sabo
Hi,

This is OT, I'm considering buying the MySQL, Second Edition Paul DuBois
book.  I'm using MySQL 3.23.  Should I be buying the first edition DuBois
book instead or does BuBois cover both 3 and 4 in the second edition?  Is
there a huge difference between 3 and 4?

Thanks.


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



RE: [PHP] PHP SQL Code

2003-03-02 Thread John W. Holmes
   I would like yo show the users in a list that have a date that is
more
   than
   60 days old.
 
  $sql = SELECT * FROM stompers WHERE sUpdated  CUR_DATE() -
INTERVAL 60
  DAY AND sActive = 'Y' ORDER BY sUpdated DESC;

 This one returns a 'Could not get Query' warning ... so thats out.

Sorry, it's CURDATE(), not CUR_DATE(). Maybe you shouldn't be so quick
to rule things out...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Re: Php and JavaScript

2003-03-02 Thread Valentin
Thank you Vincent!




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



[PHP] Free email service Plus get Paid while using it!!!!

2003-03-02 Thread steve adamian
I thought you would enjoy this new web site that I have found and started using 
recently. zWallet.com is a free email service provider that pays its members to email. 
It's really great, we do it anyway, why not get paid for it.

And the best thing of all, zWallet.com not only pays you to email but also pays you 
while your friends or people that you have referred use their service.

Go to http://www.zwallet.com/index.html?user=rudeboy311 to get more info or to join, 
it's fast and free. If you will decide to join please use my User ID rudeboy311, when 
you will be asked the User ID of a person who referred you.

Make sure to tell all your friends about this exiting service because the more 
referrals we will make, the higher our income will be.

__
Get Paid... With Your Free Email at
http://www.zwallet.com/index.html?user=sadamian

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



[PHP] Re: Php and JScript

2003-03-02 Thread Vincent M.
Valentin wrote:
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?
Thanks,



Yes, I think there is a way to do so!
;-)
Vincent.

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


[PHP] php and html differences

2003-03-02 Thread Sunfire
hi..

i guess this is a php related question (well sort of)  the person i work
with decided that he was going to edit a few of my php scripts that make a
web page out of variables and just different conditions that happen in the
script.. he thought that he could use a gui html editor and edit the page..
well it worked and nothing happened bad... he just left any component alone
that had a / in them next to the name of it.. well the other thing that
happened was in another script i have there is 3 or so web pages built into
the script.. based on what happens from the page thet calls that script
either one of those 3 pages could be displayed.. well when i told him that
depending on what happens with the form that calls that page 1 of 3 pages
can come up because certain things are being tested and so on..

he told me a few things that i dont quite understand (or for that matter i
dont belive what he says is really true)..
he said:
1. on the instance about testing certain conditions to determine what page
to show..frames or a frameset can do exactly the same thing...i told him no
it didnt (who is right?)
2. he asked me in the scripts that have 3 or more pages built into them how
was the logo at the top of the page being shown.. i just told him that i
used normal html and put the logo at the top of the pages.. he said frames
wont let you do that (who is right??)

so im confused about that one.. he also said that plain html had an if else
statement in it.. i never heard of such a thing...

can somebody get me unconfused? and is it not really a good idea to have 3
or more pages built inside a php script? should the pages be called from the
script some way else?

tnx




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



[PHP] Still no luck running a PHPCLI script from CRON

2003-03-02 Thread Justin Michael Couto
Does anyone have a PHP CLI script running from cron?

If so I would greatly appreciate any assistance.  Below is everything
from this on going problem.  It seems none has an answer so far.

Please help.
XXX

I tried to run the script directly from cron like:

* * * * * /usr/local/bin/php -q /path/to/cron/script/file_name

I also tried to run cron in the bash environment by writing a bash
script that calls my PHP script.  I set cron you call the bash script
every minute. The bash script contained the following information:

 START SCRIPT
=
#!/usr/local/bin/bash
/path/to/PHP/script/file_name
= END SCRIPT
==

If I run the bash script from the command line it definitely runs my PHP
script. I know this because my PHP script sends me an email. 

Also, if I run my PHP script from the command line it also runs fine and
I receive an email.  However, anytime I try to run PHP script or the
bash script from cron nothing happens.  I get no emails.  I also know
cron is working properly because a regular bash script as I listed in my
earlier posting works fine.

This is using the new CLI that come with PHP 4.3 I have in past versions
of used the CGI from cron with no problems at all.  As a matter of fact
I have another server that does all its maintenance via PHP scripts that
get ran by cron

Here is the PHP CLI cron script I am testing to see if cron will run my
PHP

 START SCRIPT
=
#!/usr/local/bin/php -q
?

mail([EMAIL PROTECTED],Message From cron,date(F j, Y @ h:i a));

?
= END SCRIPT
==
 

Any more suggestions would be greatly appreciated.

Justin

-Original Message-
From: CodersNightMare [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 28, 2003 10:32 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Can't run PHP cli script from Cron


I am sure you have tried this, but,
Do you call the full path to php for cron.

something like:

40 * * * * /usr/local/bin/php -q /home/user/phpcliscript

Hope this helps.


At 10:10 AM 2/28/2003 -0800, you wrote:
The path is

#!/usr/local/bin/php -q

But like I said, that can't be the problem because when I run it from
the command line, it runs fine.  The only problem I am having is that
it
won't run from cron.  That is why I think it is an issue with the cron
environment.  All other types of scripts like bash scripts run fine
from
cron.  I am surprised no one else has come across this problem before.

Please help me!

  Justin Michael Couto[EMAIL PROTECTED]
Director of Operations  805.781.0420
Somnio World Web Solutions  http://www.somnioworld.com


-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 9:44 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Can't run PHP cli script from Cron

Shouldn't it be
#!/usr/local/bin/php

Or was it just a typo here?

- Original Message -
From: Justin Michael Couto [EMAIL PROTECTED]
To: 'Ernest E Vogelsinger' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 12:09 PM
Subject: RE: [PHP] Can't run PHP cli script from Cron


  I can run it from the shell prompt perfectly fine.  I just won't run
  from cron.
 
  I do have the statement:
 
  #!/usr/local/php
 
  In the beginning of my script.  Like I said it works perfect when I
run
  it by hand from the shell prompt.  I think the reason it is not
running
  has to do with the cron environment, but I am not ssure what it is.
 
  Justin Michael Couto[EMAIL PROTECTED]
  Director of Operations  805.781.0420
  Somnio World Web Solutions  http://www.somnioworld.com
 
 
  -Original Message-
  From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
  Sent: Friday, February 28, 2003 12:55 AM
  To: Justin Michael Couto
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Can't run PHP cli script from Cron
 
  At 05:30 28.02.2003, Justin Michael Couto said:
  [snip]
  Here is my crontab entry:
  
  * * * * * /path/to/file/file_name.php
  
  I also have
  
  * * * * * /path/to/file/bash_test_script
  [snip]
 
  Did you try to run the php file interactively, from the shell
prompt?
 
  You need at last this statement on top of your PHP files:
  #!/usr/local/php
 
 
  --
 O Ernest E. Vogelsinger
 (\)ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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


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

Re: [PHP] php and html differences

2003-03-02 Thread Sunfire
well i told him it was probably java or something of the sort cuz he uses
java in his pages sometimes expecially when it comes to buttons or something
of that sort.. he has done about 24 web sites and all but 2 or 3 are framed
based with a minimum of 4 frames in it.. 1 for the logo 1 for a nav bar and
2 for content .. if he doesnt do that then he has a logo fram 2 nav bars and
a main content frame.. after that it can get up to 6 or even some pages i
seen with 8 frames in it... its annoying and i told him that for people that
are visually impared (which he is that himself) or people who use jaws for
windows screen reader on their computer frames arent the best thing in the
world to use.. i told him that frames can be usefull to a point but overall
they suck and moreso its a bad thing to get into for the blind users of his
pages.. he has the problem though of saying it doesnt make a bit of
difference to him if people have frames turned off or cant display frames or
the blind people have a hrd time with it...its their problem and not his.. i
told him toput a noframes section in the pages but he absolutely refuses
and so whatever i make with php/sql  has to fit in a frame 650 pixels wide
and we are running into lots of problems trying to get ie and netscape to
show the same thing in both browsers.. so i told him to drop the frames and
i basically got yelled at for it..

oh well he said that frames are good for the sighted people because it makes
things easier to find and makes the page look better...is this true or are
frames just utterly useless?

if you want a look at some of the stuff we done go to
www.wellstonmichigan.com/members/membersmain.htm and take a look... its a
front end part of a program i made for his web site...

btw i am also totally blind using jaws for windows and even though i have
great concepts of where to put stuff on pages he is telling me its all wrong
visually and it needs to be redone so he told me where to put stuff and i
had to move everything around on it..

if you do take a look at those pages the whole layout was my idea and i
wrote it myself without his changes... let me know if i am doing ok with it
or if he is right in that m atter..


sorry if this starting to fall outside php line but as far as php goes i
think its important things to concider in my php/sql programming life..
i know im not talking direct code but i do need to know if i have layout
problems or if the guy is taking his sight for granted...

tnx

- Original Message -
From: Darren Young [EMAIL PROTECTED]
To: 'Sunfire' [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 3:22 PM
Subject: RE: [PHP] php and html differences


 No, there are no test or conditional functions inside HTML, perhaps
 he's thinking of JavaScript. All HTML does is tells the browser how to
 render the page. It's extremely dumb and is best that way. The only
 thing I can think of at all is SSI or Server Side Includes which _can_
 do some very limited intelligent things. But that tends to be server
 specific and isn't used all that much any more. SSI was handy before
 dynamic languages were around such as PHP.

 Frames are just bad, it's too bad they were ever designed. All they do
 is provide compartments to render text on the browser, again there is
 no intelligence involved. Now, I could be wrong here since I stopped
 using frames many years ago so do some more research. You can always
 check the HTML specs at www.w3c.org or on Netscape's developer site.
 Netscape came up with the whole frame thing anyways.

 Frames won't let you display a logo? Get this guy a book on HTML and a
 clue at Kmart.

 I have MANY PHP pages that build the screen differently depending on the
 way it's called. While it may increase the individual page complexity,
 it does reduce overall site complexity. I prefer fewer pages doing more
 than tons of pages doing little things.

 I'd say overall you're on the right track and should stick to your guns.

 -Original Message-
 From: Sunfire [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 2:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php and html differences


 hi..

 i guess this is a php related question (well sort of)  the person i work
 with decided that he was going to edit a few of my php scripts that make
 a web page out of variables and just different conditions that happen in
 the script.. he thought that he could use a gui html editor and edit the
 page.. well it worked and nothing happened bad... he just left any
 component alone that had a / in them next to the name of it.. well the
 other thing that happened was in another script i have there is 3 or so
 web pages built into the script.. based on what happens from the page
 thet calls that script either one of those 3 pages could be displayed..
 well when i told him that depending on what happens with the form that
 calls that page 1 of 3 pages can come up because certain things are
 being tested and so on..

 he told me a few things that 

Re: [PHP] php and html differences

2003-03-02 Thread Leif K-Brooks
If I was you, I would tell him he's insane.

Sunfire wrote:

hi..

i guess this is a php related question (well sort of)  the person i work
with decided that he was going to edit a few of my php scripts that make a
web page out of variables and just different conditions that happen in the
script.. he thought that he could use a gui html editor and edit the page..
well it worked and nothing happened bad... he just left any component alone
that had a / in them next to the name of it.. well the other thing that
happened was in another script i have there is 3 or so web pages built into
the script.. based on what happens from the page thet calls that script
either one of those 3 pages could be displayed.. well when i told him that
depending on what happens with the form that calls that page 1 of 3 pages
can come up because certain things are being tested and so on..
he told me a few things that i dont quite understand (or for that matter i
dont belive what he says is really true)..
he said:
1. on the instance about testing certain conditions to determine what page
to show..frames or a frameset can do exactly the same thing...i told him no
it didnt (who is right?)
2. he asked me in the scripts that have 3 or more pages built into them how
was the logo at the top of the page being shown.. i just told him that i
used normal html and put the logo at the top of the pages.. he said frames
wont let you do that (who is right??)
so im confused about that one.. he also said that plain html had an if else
statement in it.. i never heard of such a thing...
can somebody get me unconfused? and is it not really a good idea to have 3
or more pages built inside a php script? should the pages be called from the
script some way else?
tnx



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] File problem - PHP Quest

2003-03-02 Thread Marek Kilimajer


Monil Chheda wrote:

Hi,

I have a problem in grabbing data from a file.

I need to fetch data from raw log files and display it
in a proper tabular manner.
The log file contains:

AWSTATS DATA FILE 5.0 (build 1.345)
# If you remove this file, all statistics for date
2002-12 will be lost/reset.
# Position (offset in bytes) in this file of beginning
of each section
# for direct I/O access. If you made changes somewhere
in this file, you
# should also remove completely the MAP section
(AWStats will rewrite it
# at next update).
BEGIN_MAP 23
POS_GENERAL 1602  
POS_PAGEREFS 4060
POS_SEARCHWORDS 5537
POS_KEYWORDS 5769
POS_ERRORS 5916
POS_SIDER_404 6040
POS_EMAILSENDER 
POS_EMAILRECEIVER 
END_MAP

BEGIN_GENERAL 8
LastLine 20030101041055
FirstTime 20021201004812
LastTime 20021231204118
LastUpdate 20030101044540 392 0 391 0 1
TotalVisits 279 
TotalUnique 221 
MonthHostsKnown 0   
MonthHostsUnknown 258 
END_GENERAL

~~

I need the contents between BEGIN_MAP and END_MAP to
be displayed on the browser.
But I need each word seperate in a tabular form. For
Example on the browser it should display:
LOG DETAILS No.Of.Results.
POS_SEARCHWORDS 5537
POS_KEYWORDS5769
--

I am using the following script: But it doesnot work.
Kindly help me.
?php

if(!($myfile = fopen(test.txt,r)))
{
echo File $myfile could not be opened;
exit;
}
else
{
echo $myfile Opened;
exit;
}
while ($line = fgets($myfile))
{
if(eregi(^\s*BEGIN_KEYWORDS, $line)) {
$display=true;
continue;
   }
	

if(eregi(^\s*END_KEYWORDS, $line)) {

$display=false;
continue; // optionaly break
   }
if($display  eregi('^\s*([a-z]+)\s+([0-9]+)',$line,$m)) {
   echo trtd$m[1]/tdtd$m[2]/td/tr\n;
}
}

?

Thank you.

Best Regards,
Monil Chheda

+91-22-5699 1887
+91-22-2820 4125
+09821405705
http://www.eliteral.com
http://order.eliteral.com
http://domains.eliteral.com
http://services.eliteral.com

=
Best Regards,
Monil Chheda(INDIA)
http://domains.eliteral.com
===
===
__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
 



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


Re: [PHP] Arrays and MySQL

2003-03-02 Thread Jason Wong
On Sunday 02 March 2003 23:34, Beauford.2002 wrote:
 Hi,

 I have an array which I am trying to total but having some problems. Any
 help is appreciated.

 Example:  This is a hockey team and there are 20 players - I am selecting
 the goals, assists, and points from each player and then want to have a
 grand total of all goals, assists, and points.

 $query = select goals, assists, points from roster;

 while ($line = mysql_fetch_row($result)) {

 $totals[] = $line;

 }

 I want to total $totals[0][4] through $totals[19][4], $totals[0][5] through
 $totals[19][5], etc. for each stat. I thought of putting them in a for loop
 and just adding them, but this seemed kind of messy and the long way around

You can use array_sum().

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Man's unique agony as a species consists in his perpetual conflict between
the desire to stand out and the need to blend in.
-- Sydney J. Harris
*/


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



Re: [PHP] html parsing question

2003-03-02 Thread Marek Kilimajer
You can output xhtml with your custom tags and use xml parsing functions

Jos Elkink wrote:

Hello,

I've got a little question. I am writing a page where I would like to
parse my own invented HTML-looking tags (but want to keep the real HTML
tags intact). I use a buffer for the output, and just before the end use
ob_get_contents() to get the whole buffer which I want to check for
those tags.
(Something like:

$tag-content = ob_get_contents();
$output = $tag-interpret();
ob_end_clean();
echo $output;
)
Now my question is, what is the fastest way to search and replace
through this file, whereby the interpretation of the tag can be somewhat
complicated?
I first just had a loop running character by character through this
text, looking for tags, but that is obviously way too slow.
Now I have something like:

preg_replace_callback (/(.+)/, array($this, 'tag_callback'),
$this-content);
But then I don't know how to interpret different tags differently. Any
suggestions?
(A tag looks like: CANTR REPLACE NAME=text where then the whole tag
has to be replaced by something called 'text' that has to be looked up
in a table. So, CANTR REPLACE NAME=text has to be replaced with
something else than CANTR REPLACE NAME=main - well, you get the idea.)
Thanks in advance for any help!

Jos

--
Jos Elkink
Game Administration Council
Cantr II   http://www.cantr.net
 



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


[PHP] heredoc problem

2003-03-02 Thread janet
Can someone tell me what is wrong with the following code:

html
headtitleTesting/title/head
body
?php
$str = EOD 
Example of string 
spanning multiple lines 
using heredoc syntax.
EOD;
? 
/body
/html

This is code straight out of the PHP manual. I get the error:
Parse error: parse error, unexpected T_SL in testhere.php on line 5

I looked up T_SL and it is a token representing  so that means it just
doesn't get the . Why not? I've tried all the combinations of spaces and
no space in that line that I can think of.

So, what's wrong. Undoubtedly something obvious to anyone except me.

Janet

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



Re: [PHP] php and html differences

2003-03-02 Thread Sunfire
well i have learned how to actually make better choices with the php and how
to display certain parts of a page rather than redo the whole page... so i
would have a certain web page with a table for example  and the first row
shows a static text from a db.. lets say its a company name  with a phone
number.. i found i can do:
tr
td
?php echo $company; ?
/td
/tr
?php
if(!empty($phone)) {
?
tr
td
?php echo $phone; ?
/td
/tr
?php } else { echo }
//on with the table...

i have found that way works better for me on rewriting tables with the same
page... or is there better way... ?


- Original Message -
From: Larry Brown [EMAIL PROTECTED]
To: Sunfire [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 3:32 PM
Subject: RE: [PHP] php and html differences


 3 or more possible pages from one php page is what php was designed for.
It
 dynamically creates the page depending on what choices the client makes or
 criteria based on what type of browser the user is using or even where the
 client is (subnet).  You may be able to streamline the code though to make
 things easier to follow and shorten the scripts if you only change a
portion
 of the page depending on aforementioned criteria rather then rewriting the
 entire html 3 or more times.  I have never heard of dynamic choices being
 made in frames based on html alone.  A lot of reference books on html tend
 to throw in javascript pieces to help achieve some html authors' desired
 effect.  To my knowledge it isn't part of html though.

 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388

 -Original Message-
 From: Sunfire [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 3:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php and html differences

 hi..

 i guess this is a php related question (well sort of)  the person i work
 with decided that he was going to edit a few of my php scripts that make a
 web page out of variables and just different conditions that happen in the
 script.. he thought that he could use a gui html editor and edit the
page..
 well it worked and nothing happened bad... he just left any component
alone
 that had a / in them next to the name of it.. well the other thing that
 happened was in another script i have there is 3 or so web pages built
into
 the script.. based on what happens from the page thet calls that script
 either one of those 3 pages could be displayed.. well when i told him that
 depending on what happens with the form that calls that page 1 of 3 pages
 can come up because certain things are being tested and so on..

 he told me a few things that i dont quite understand (or for that matter i
 dont belive what he says is really true)..
 he said:
 1. on the instance about testing certain conditions to determine what page
 to show..frames or a frameset can do exactly the same thing...i told him
no
 it didnt (who is right?)
 2. he asked me in the scripts that have 3 or more pages built into them
how
 was the logo at the top of the page being shown.. i just told him that i
 used normal html and put the logo at the top of the pages.. he said frames
 wont let you do that (who is right??)

 so im confused about that one.. he also said that plain html had an if
else
 statement in it.. i never heard of such a thing...

 can somebody get me unconfused? and is it not really a good idea to have 3
 or more pages built inside a php script? should the pages be called from
the
 script some way else?

 tnx




 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



Re: [PHP] php and html differences

2003-03-02 Thread Sunfire
already did that.. he even said whats new... *fear that* if i work for
someone like that?? hrm...


- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
To: Sunfire [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 3:55 PM
Subject: Re: [PHP] php and html differences


 If I was you, I would tell him he's insane.

 Sunfire wrote:

 hi..
 
 i guess this is a php related question (well sort of)  the person i work
 with decided that he was going to edit a few of my php scripts that make
a
 web page out of variables and just different conditions that happen in
the
 script.. he thought that he could use a gui html editor and edit the
page..
 well it worked and nothing happened bad... he just left any component
alone
 that had a / in them next to the name of it.. well the other thing that
 happened was in another script i have there is 3 or so web pages built
into
 the script.. based on what happens from the page thet calls that script
 either one of those 3 pages could be displayed.. well when i told him
that
 depending on what happens with the form that calls that page 1 of 3 pages
 can come up because certain things are being tested and so on..
 
 he told me a few things that i dont quite understand (or for that matter
i
 dont belive what he says is really true)..
 he said:
 1. on the instance about testing certain conditions to determine what
page
 to show..frames or a frameset can do exactly the same thing...i told him
no
 it didnt (who is right?)
 2. he asked me in the scripts that have 3 or more pages built into them
how
 was the logo at the top of the page being shown.. i just told him that i
 used normal html and put the logo at the top of the pages.. he said
frames
 wont let you do that (who is right??)
 
 so im confused about that one.. he also said that plain html had an if
else
 statement in it.. i never heard of such a thing...
 
 can somebody get me unconfused? and is it not really a good idea to have
3
 or more pages built inside a php script? should the pages be called from
the
 script some way else?
 
 tnx
 
 
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
 
 
 
 

 --
 The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



RE: [PHP] Just to ask knowledgable ppl

2003-03-02 Thread John W. Holmes
 How would you get the server to parse PHP if it was just a static HTML
 page?
   If it parses PHP, then why would you need to use a gif at all?  So
many
 sites use them, I just wondered what data they get and how they get
it.

The file that creates your image could be a PHP script:

img src=file.php?id=12

or something similar. That .php page can use sessions, cookies, etc,
just like any other PHP script. I don't think you can determine the page
that the request is coming from, since each request is unique, but you
could pass an ID in the image request that identifies the page. After
the .php page gets/sets whatever data it wants, it then sends the
appropriate image header and the data for a single pixel image. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com

 From: John W. Holmes [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: 'Jason Paschal'
[EMAIL PROTECTED],[EMAIL PROTECTED]
 Subject: RE: [PHP] Just to ask knowledgable ppl
 Date: Sun, 2 Mar 2003 11:29:55 -0500
 
   Not directly PHP related, but I'm building a site in PHP at the
 moment, so
   I've been doing a bit of research...
   I've been on the net for years, coding and surfing and coding.
And
 not
   always in that order. ;)  But only recently have I heard about web
   beacons,
   or single-pixel gifs.  Seems every site with these beacons
mentions
 them
   in
   their privacy policy.  Shows you how much I pay to attention to
them.
 I
   was
   just curious as to how they work.  Is it just a matter of viewing
 server
   reports to see how often that image has been accessed?
 
 I'm sure you could do a number of things with them. It could even be
a
 PHP script that does some logging of it's own with sessions or
cookies
 or whatever and then outputs the data for a single pixel gif. So you
 could have a plain HTML page that'll still access a .php page when
it's
 loaded to track what users are doing.
 
 ---John W. Holmes...
 
 PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
 today. http://www.phparch.com/
 
 
 
 
 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail




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



Re: [PHP] Arrays and MySQL

2003-03-02 Thread Leo Spalteholz
On March 2, 2003 01:53 pm, Jason Wong wrote:
 On Sunday 02 March 2003 23:34, Beauford.2002 wrote:
  Hi,
 
  I have an array which I am trying to total but having some
  problems. Any help is appreciated.
 
  Example:  This is a hockey team and there are 20 players - I am
  selecting the goals, assists, and points from each player and
  then want to have a grand total of all goals, assists, and
  points.
 
  $query = select goals, assists, points from roster;
 
  while ($line = mysql_fetch_row($result)) {
 
  $totals[] = $line;
 
  }
 
  I want to total $totals[0][4] through $totals[19][4],
  $totals[0][5] through $totals[19][5], etc. for each stat. I
  thought of putting them in a for loop and just adding them, but
  this seemed kind of messy and the long way around

 You can use array_sum().

What about SELECT SUM(Goals), SUM(assists)?

Leo

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



Re: [PHP] php and html differences

2003-03-02 Thread Ernest E Vogelsinger
At 21:25 02.03.2003, Sunfire said:
[snip]
i guess this is a php related question (well sort of)  the person i work
with decided that he was going to edit a few of my php scripts that make a

... oh my god.

he told me a few things that i dont quite understand (or for that matter i
dont belive what he says is really true)..
he said:
1. on the instance about testing certain conditions to determine what page
to show..frames or a frameset can do exactly the same thing...i told him no
it didnt (who is right?)

Framesets are HTML constructs to divide a browser window in adjacent areas
to display more than one page at the same time. There's nothing what a
frameset construct can do to implement any logic - the page that's shown in
a frame is available in the src tag.

2. he asked me in the scripts that have 3 or more pages built into them how
was the logo at the top of the page being shown.. i just told him that i
used normal html and put the logo at the top of the pages.. he said frames
wont let you do that (who is right??)

Not within the frameset, of course... if you have a frameset you don't have
a body, that's it.

so im confused about that one.. he also said that plain html had an if else
statement in it.. i never heard of such a thing...

Never heard such bullshit.

can somebody get me unconfused? and is it not really a good idea to have 3
or more pages built inside a php script? should the pages be called from the
script some way else?

Boy - some of my applicatinos server a couple of hundred pages out of a
single script (from the database, that is)...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] php and html differences

2003-03-02 Thread Ernest E Vogelsinger
At 21:54 02.03.2003, Sunfire said:
[snip]
well i told him it was probably java or something of the sort cuz he uses
java in his pages sometimes expecially when it comes to buttons or something

right, you can do some logic with JavaScript (don't confuse that with Java
please!). There's a big BUT there - you can never be sure the client
browser gets it right, be it because JS is switched off, or some malicious
guy tries to trick your application.

oh well he said that frames are good for the sighted people because it makes
things easier to find and makes the page look better...is this true or are
frames just utterly useless?

Layout is a matter of taste, there's no final judgement about this, I
believe. I don't really like your particular layout of the site for two
reasons:
- the graphics render horribly (still alpha, going to be better?)
- the list scrolls endlessly - there must be a better way to display
records found

That doesn't mean that frames are the way to go - usually frames make a
site more complicated from a technical view. With languages like PHP it's
very easy to generate good-looking pages that are easy to navigate - start
your thoughts by trying to separate data and logic from presentation.

btw i am also totally blind using jaws for windows and even though i have
great concepts of where to put stuff on pages he is telling me its all wrong
visually and it needs to be redone so he told me where to put stuff and i
had to move everything around on it..

If he's the boss you should do what he wants; if you believe you have a
better concept try to make an alternative presentation.

sorry if this starting to fall outside php line but as far as php goes i
think its important things to concider in my php/sql programming life..
i know im not talking direct code but i do need to know if i have layout
problems or if the guy is taking his sight for granted...

Presentation doesn't have anything to do with web programming - that's the
HTML stuff. It's just composed by your application. Have a look at some
template engines like Smarty to get an idea.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] heredoc problem

2003-03-02 Thread Ernest E Vogelsinger
At 23:02 02.03.2003, [EMAIL PROTECTED] said:
[snip] 
Can someone tell me what is wrong with the following code:

?php $str =  
This is code straight out of the PHP manual. I get the error:
Parse error: parse error, unexpected T_SL in testhere.php on line 5

I looked up T_SL and it is a token representing  so that means it just
doesn't get the . Why not? I've tried all the combinations of spaces and
no space in that line that I can think of.
[snip] 

The correct heredoc syntax:

$text = EOT
This is
all
a heredoc
text
EOT;

Note: the heredoc delimiter
1) must not be indented
2) must be all lone on a single line (except an optional terminating semicolon)


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread CF High
Hey all.

In Cold Fusion I was able to do the following:

CFSWITCH expression = #action#

CFCASE value = getUpdate,getDelete
Do Stuff
/CFCASE

/CFSWITCH

Note the comma delimited set of values for the case.  Is there a way to do
this in php?( i.e. if any of the comma delimited case values match the
switch expression, proceed with the specified case instructions)

It's kind of cumbersome breaking out 5 cases when in CF I can combine them
into one

Let me know.

--Noah



--




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



Re: [PHP] php and html differences

2003-03-02 Thread Sunfire

- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: Sunfire [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 5:58 PM
Subject: Re: [PHP] php and html differences


 At 21:25 02.03.2003, Sunfire said:
 [snip]
 i guess this is a php related question (well sort of)  the person i work
 with decided that he was going to edit a few of my php scripts that make
a

 ... oh my god.
your telling me...messed up the whole thing and i had to basically rewrite a
700 line script cuz of it too

 he told me a few things that i dont quite understand (or for that matter
i
 dont belive what he says is really true)..
 he said:
 1. on the instance about testing certain conditions to determine what
page
 to show..frames or a frameset can do exactly the same thing...i told him
no
 it didnt (who is right?)

 Framesets are HTML constructs to divide a browser window in adjacent areas
 to display more than one page at the same time. There's nothing what a
 frameset construct can do to implement any logic - the page that's shown
in
 a frame is available in the src tag.
yup i got that but he uses frames way too much and it bothers my
scripts..i.e. cant always get a table to fit in the frame the way he wants
it to..

 2. he asked me in the scripts that have 3 or more pages built into them
how
 was the logo at the top of the page being shown.. i just told him that i
 used normal html and put the logo at the top of the pages.. he said
frames
 wont let you do that (who is right??)

 Not within the frameset, of course... if you have a frameset you don't
have
 a body, that's it.
i mean i hard coded the logo inside of the php script for every page that
was in there.. he said frames cant display a logo

 so im confused about that one.. he also said that plain html had an if
else
 statement in it.. i never heard of such a thing...

 Never heard such bullshit.
me either...

 can somebody get me unconfused? and is it not really a good idea to have
3
 or more pages built inside a php script? should the pages be called from
the
 script some way else?

 Boy - some of my applicatinos server a couple of hundred pages out of a
 single script (from the database, that is)...

wow a very large script then... must be right on what im doing then... so
how do you stop him from editing my scripts with a gui html editor then...ug



 --
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Martin Towell
I've been using this:

if (in_array($value, array(foo, bar, blah)))
{
  // do something
}

but if you want to use a switch/case, I don't know any easier way.

HTH
Martin

 -Original Message-
 From: CF High [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 1:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Switch Statement || Case with multiple values?
 
 
 Hey all.
 
 In Cold Fusion I was able to do the following:
 
 CFSWITCH expression = #action#
 
 CFCASE value = getUpdate,getDelete
 Do Stuff
 /CFCASE
 
 /CFSWITCH
 
 Note the comma delimited set of values for the case.  Is 
 there a way to do
 this in php?( i.e. if any of the comma delimited case values match the
 switch expression, proceed with the specified case instructions)
 
 It's kind of cumbersome breaking out 5 cases when in CF I can 
 combine them
 into one
 
 Let me know.
 
 --Noah
 
 
 
 --
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] 2 questions !

2003-03-02 Thread Justin French
on 02/03/03 7:51 AM, Vincent M. ([EMAIL PROTECTED]) wrote:

 Hello,
 
 I didn't find in the doc how to:
 - Know the full path of the current directory. Like /var/www/to/the/path

http://www.php.net/manual/en/reserved.variables.php#reserved.variables.serve
r


 - Know under which user work apache, to know when I create a file whose
 file it is...

the file is always owned by whatever user apache is... so really you'd have
to try a chown or chmod on the file, to see if you can correct it... really,
you don't need to KNOW who it's owned by, you need to SET IT to your
preference of owner and/or permissions.

I'm sure there's a way to check the owner of a file, but not (from what i
know) a way to check who apache is running as.


Justin


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



RE: [PHP] heredoc problem

2003-03-02 Thread Martin Towell
when I copy/pasted directly from your email and tried to execute it, I can
an error on line 5 too

I noticed that there's a space at the end of line 5, I deleted it and it
worked fine.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 9:02 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] heredoc problem
 
 
 Can someone tell me what is wrong with the following code:
 
 html
 headtitleTesting/title/head
 body
 ?php
 $str = EOD 
 Example of string 
 spanning multiple lines 
 using heredoc syntax.
 EOD;
 ? 
 /body
 /html
 
 This is code straight out of the PHP manual. I get the error:
 Parse error: parse error, unexpected T_SL in testhere.php on line 5
 
 I looked up T_SL and it is a token representing  so that 
 means it just
 doesn't get the . Why not? I've tried all the combinations 
 of spaces and
 no space in that line that I can think of.
 
 So, what's wrong. Undoubtedly something obvious to anyone except me.
 
 Janet
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] php and html differences

2003-03-02 Thread Jason Sheets
On Sun, 2003-03-02 at 16:55, Sunfire wrote:
 - Original Message -
 From: Ernest E Vogelsinger [EMAIL PROTECTED]
 To: Sunfire [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 5:58 PM
 Subject: Re: [PHP] php and html differences
 
 
  At 21:25 02.03.2003, Sunfire said:
  [snip]
 
  Boy - some of my applicatinos server a couple of hundred pages out of a
  single script (from the database, that is)...
 
 wow a very large script then... must be right on what im doing then... so
 how do you stop him from editing my scripts with a gui html editor then...ug
You might consider using a template engine, seperate your HTML from your
PHP logic, that way if he is in charge of the HTML he doesn't touch your
code.  I'd suggest using CVS as well or at least making backups so you
don't have to rewrite stuff when someone messes it up.  Other than that
you could make it a policy where only you change your scripts, they can
submit patches to you and you can apply them but they don't have direct
edit access to your code.

Jason
 
 
 
  --
 O Ernest E. Vogelsinger
 (\)ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
-- 
Jason Sheets [EMAIL PROTECTED]

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



Re: [PHP] php and html differences

2003-03-02 Thread Sunfire
where could i get a templet editor from that is good and fairly easy to use?

- Original Message -
From: Jason Sheets [EMAIL PROTECTED]
To: Sunfire [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 7:07 PM
Subject: Re: [PHP] php and html differences


 On Sun, 2003-03-02 at 16:55, Sunfire wrote:
  - Original Message -
  From: Ernest E Vogelsinger [EMAIL PROTECTED]
  To: Sunfire [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Sunday, March 02, 2003 5:58 PM
  Subject: Re: [PHP] php and html differences
 
 
   At 21:25 02.03.2003, Sunfire said:
   [snip]
  
   Boy - some of my applicatinos server a couple of hundred pages out of
a
   single script (from the database, that is)...
  
  wow a very large script then... must be right on what im doing then...
so
  how do you stop him from editing my scripts with a gui html editor
then...ug
 You might consider using a template engine, seperate your HTML from your
 PHP logic, that way if he is in charge of the HTML he doesn't touch your
 code.  I'd suggest using CVS as well or at least making backups so you
 don't have to rewrite stuff when someone messes it up.  Other than that
 you could make it a policy where only you change your scripts, they can
 submit patches to you and you can apply them but they don't have direct
 edit access to your code.

 Jason
 
 
  
   --
  O Ernest E. Vogelsinger
  (\)ICQ #13394035
   ^ http://www.vogelsinger.at/
  
  
  
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
 --
 Jason Sheets [EMAIL PROTECTED]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



Re: [PHP] Get variable from PHP before submit

2003-03-02 Thread Lars Espelid
I could use anchor's like shown underneath, but then the user will have to
click the link Last position each time a button is submitted. I would like
the page to scroll down automatically. Is that possible, to have the link
executed without clicking help from the user?

body onLoad=mScroll()
?php echo p Ykoordinat:  . $yKoord . p;
echo Teller:  . $teller;
?
a href=#form?php echo $teller; ? target=_self Last position /a
!-- *New line --
?php
for($i=0; $i150; $i++) {
 echo 'br';
}
for($teller=0; $teller2; $teller++) {
?
 a name=form?php echo $teller; ?/a
!-- *New line --
 form action=test3.php name=form?php echo $teller; ? onsubmit=return
hentKoordinat()
  input type=hidden name=teller value=?php echo $teller; ?
  input type=hidden name=yKoord
  input name=button1 type=submit value=Send input
 /form
 ?php $teller++; ?
?php
} //for($teller=0; $i2; $i++) {
?
/body


Rich Gray [EMAIL PROTECTED] skrev i melding
news:[EMAIL PROTECTED]
  I'm trying to implement the following functionality into the file
  test.php:
 
  When I scroll down the page and then hit a button, the page
  should remember
  the scrolled position, refresh the page and then scroll down to the
  remembered position. I've almost managed to make this work, but
  only almost.
 
  The first time I click one of the buttons, the page won't scroll,
  but after
  that it works fine. I think the reason for this is that the function
  hentKoordinat() gets called before $teller is set. hentKoordinat() uses
  $teller.
 
  Anyone know a way to make this work?
 
  Thanks alot!
 
  Lars

 I've probably misunderstood but can you not use an HTML anchor...?
 Rich




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



RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Check the manual:

switch($foo)
{
case fee:
case fie:
...
break;
case fo:
...
case fum:
...
break;
}

fee  fie are tied together, fie will also run the code presented by fum ...

Even more flexible than comma delimited values ...

 -Original Message-
 From: CF High [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 9:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Switch Statement || Case with multiple values?


 Hey all.

 In Cold Fusion I was able to do the following:

 CFSWITCH expression = #action#

 CFCASE value = getUpdate,getDelete
 Do Stuff
 /CFCASE

 /CFSWITCH



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



Re: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Leif K-Brooks
switch($value){
   case 'foo':
   case 'bar':
   //It's either foo or bar
   break;
}
CF High wrote:

Hey all.

In Cold Fusion I was able to do the following:

CFSWITCH expression = #action#

   CFCASE value = getUpdate,getDelete
   Do Stuff
   /CFCASE
/CFSWITCH

Note the comma delimited set of values for the case.  Is there a way to do
this in php?( i.e. if any of the comma delimited case values match the
switch expression, proceed with the specified case instructions)
It's kind of cumbersome breaking out 5 cases when in CF I can combine them
into one
Let me know.

--Noah



--



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] A PHP page counter / statistics app

2003-03-02 Thread Justin French
on 01/03/03 7:27 AM, Michael Zornek ([EMAIL PROTECTED]) wrote:

 I'm ether looking to find or build my own open source php based script, that
 would allow you to include a small code chunk on every page of a site and
 then view statistics from the info, on what pages were viewed, how many
 times, etc...
 
 First, if there are any you know of and want to recommend, please post.

 Secondly, if I do build it myself would it be better to write this log to
 file or mysql db? Right now I only get like 200 page views a day but still
 am concerned about resource use since I'm on a shared server.

It depends how detailed you you want it broken down by:

- page
- page and month
- page and week
- page and day
- page and hour
- page and minute
- page and second

Personally, I have two tables:

counters_page (id, url)
counters_hits (page_id, stamp)

My counters.inc script does the following:

- looks to see if the current URL is already listed in counters_page
- if it is, it grabs the id
- if not, it inserts and creates a new id
- inserts a record into counters_hits with the page_id, and a unix timestamp
of when that page was hit.

This way, I know the exact second that a page was hit... So I can perform
report on that data, selecting how many hits for each page within the last
week, month, year, minute, 30 seconds, etc etc.

This *IS* a little expensive in terms of data storage though.  Each hit to
the site costs around 20 bytes.  A site I recently launched has attracted
37,000+ hits, so we're already looking at 740k of data.  However, this table
layout IS more economic than recording the entire URL of each hit... instead
we only record the id of the URL.


If I were only concerned with days, or months, I'd choose to store less data
(and may still!!)... for example, a current timestamp is 10 chars long,
wheras storing 2003-03 is only 7 chars (but only cares about the month, not
the day, hour, minute, second, etc).


The key issue with the above design is NOT how long it takes to record the
data (I have never noticed any performance hit on my code, even on a very
busy shared server).  It seems to be (although not drastic AT ALL) at the
point where I choose to report.  It's a LOT of information to plow through,
and it will get worse :)

There are plenty of things I can do though... I can archive reports, I can
cache queries, I can perform monthly analysis, etc etc.  To me, the most
important factor is the data, and I know I've got exactly what I want.


You may also wish to know things like what browser they're using, their IP
address, etc etc, which may be a key reason why you should build your own.


I choose to build my own for the following reasons:

1. learn learn learn
2. keep it tightly integrated with my other admin tools
3. get exactly what I want


Also check out:

http://www.phpbuilder.com/columns/index.php3?cat=5subcat=32 (logging
category)


 
 Finally, can you call a php script from an ServerSideInclude page??

not sure, but you should check the archives for server side includes and ssi


Justin


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



Re: [PHP] php and html differences

2003-03-02 Thread Jason Sheets
Smarty is an excellent template engine, it is available at
http://smarty.php.net

Jason
On Sun, 2003-03-02 at 17:13, Sunfire wrote:
 where could i get a templet editor from that is good and fairly easy to use?
 
 - Original Message -
 From: Jason Sheets [EMAIL PROTECTED]
 To: Sunfire [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 7:07 PM
 Subject: Re: [PHP] php and html differences
 
 
  On Sun, 2003-03-02 at 16:55, Sunfire wrote:
   - Original Message -
   From: Ernest E Vogelsinger [EMAIL PROTECTED]
   To: Sunfire [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Sunday, March 02, 2003 5:58 PM
   Subject: Re: [PHP] php and html differences
  
  
At 21:25 02.03.2003, Sunfire said:
[snip]
   
Boy - some of my applicatinos server a couple of hundred pages out of
 a
single script (from the database, that is)...
   
   wow a very large script then... must be right on what im doing then...
 so
   how do you stop him from editing my scripts with a gui html editor
 then...ug
  You might consider using a template engine, seperate your HTML from your
  PHP logic, that way if he is in charge of the HTML he doesn't touch your
  code.  I'd suggest using CVS as well or at least making backups so you
  don't have to rewrite stuff when someone messes it up.  Other than that
  you could make it a policy where only you change your scripts, they can
  submit patches to you and you can apply them but they don't have direct
  edit access to your code.
 
  Jason
  
  
   
--
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/
   
   
   
  
  
   ---
   Outgoing mail is certified Virus Free.
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
  --
  Jason Sheets [EMAIL PROTECTED]
 
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
-- 
Jason Sheets [EMAIL PROTECTED]

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



Re: [PHP] php and html differences

2003-03-02 Thread Paul Nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Use Smarty(http://smarty.php.net/) and Maguma Studio(http://www.maguma.com/).
~Paul

On Sunday 02 March 2003 07:13 pm, Sunfire wrote:
 where could i get a templet editor from that is good and fairly easy to
 use?

[snip]

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
[EMAIL PROTECTED]
www.webpowerdesign.net
The webthe way you want it!


It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+YqJUDyXNIUN3+UQRAlfbAJ9/GVpqmnhQHJOFCZmegOOxh/6JwwCfTJzG
H8abV4rC/ddiNb623gOVTLg=
=U6rL
-END PGP SIGNATURE-

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



Re: [PHP] Get variable from PHP before submit

2003-03-02 Thread Lars Espelid
Hope this will help your gamma-epsilon-psycho telepathy beamer :-)

 When someone hits a button in one of the form-schemas the following
happens:
1) hentKoordinat() is executed. The form-schemas hidden field named yKoord
gets the value: the amunt of pixels scrolled in y-direction.
2)the page is refreshed and $teller is set to a number whisch says which
form is submitted and $yKoord is set to the amunt of pixels scrolled in
y-direction.
3)onload in body calls the function mScroll which scrolls the page to where
it was when someone clicked the button.

Tried to explain the code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
titleUntitled Document/title
script language=JavaScript type=text/javascript
!--

function getPageScroll(){

//this function returns scrollX and scrollY as probertys of
getPageScroll. ScrollX and scrollY
//contains the amount of pixels the page has been scrolled in x and y
direction.

var X, Y;
if(typeof window.pageXOffset == 'number'){
X = window.pageXOffset;
Y = window.pageYOffset;
}else{
if((window.document.compatMode)
  (window.document.compatMode == 'CSS1Compat')){
X = window.document.documentElement.scrollLeft;
Y = window.document.documentElement.scrollTop;
}else{
X = window.document.body.scrollLeft;
Y = window.document.body.scrollTop;
}
}
return {scrollX:X,scrollY:Y};
}
function hentKoordinat() {

// this function uses getPageScroll() to find pixels scrolled in y-direction
and inserts this value into the hidden-form-value named yKoord in the form
schema which holds the button clicked (form?php echo $teller; ?).


 //*Here the problem arises. The first time you click a button, $teller
is not set. This method is executed before the page is refreshed. The value
$teller is set when the page is refreshed.*

document.form?php echo $teller; ?.yKoord.value = getPageScroll().scrollY
}

function mScroll() {

//this function scrolls the page so many pixels that $yKoord holds in the
y-direction.
//to avoid error messages I set $yKoord like 0 if it is empty (scrolls
nothing).

 ?php if(!isset($yKoord)) $yKoord=0; ?
 ?php if($yKoord=='') $yKoord=0; ?
 self.scrollTo(0,?php echo $yKoord; ?)
}

//--
/script
/head

body onLoad=mScroll()
?php echo p Ykoordinat:  . $yKoord . p;
echo Teller:  . $teller;

for($i=0; $i150; $i++) {
//prints 150 line breaks so that the page gets scrollable (the content does
not fit the monitor-area)
 echo 'br';
}
for($teller=0; $teller2; $teller++) {
//prints two form-schemas. Later on I will print a varying amount of
form-schemas (depends on the amunt of
//data in a MySQL-table)
//The form name includes $teller so that each form-schema gets a unike name
and I know which
//$yKoord to update in hentKoordinat(). $teller and $yKoord is passed on as
variables when the page refreshes,
//so that I know which form's button1 is submitted and how many pixels there
are to scroll when onload=mScroll()
// in body is called (uses $yKoord).
?
 form action=test.php name=form?php echo $teller; ? onsubmit=return
hentKoordinat()
  input type=hidden name=teller value=?php echo $teller; ?
  input type=hidden name=yKoord
  input name=button1 type=submit value=Send input
 /form
 ?php $teller++; ?
?php
} //for($teller=0; $i2; $i++) {
?
/body
/html


Chris Hayes [EMAIL PROTECTED] skrev i melding
news:[EMAIL PROTECTED]
 I am putting my gamma-epsilon-psycho telepathy beamer to the maximum but
 there are too many coders inbetween us, i cannot receive you.

 Please give a little hint on what these functions are and what value comes
 from where and goes where.

 At 04:00 1-3-2003, you wrote:
 I'm trying to implement the following functionality into the file
test.php:
 
 When I scroll down the page and then hit a button, the page should
remember
 the scrolled position, refresh the page and then scroll down to the
 remembered position. I've almost managed to make this work, but only
almost.
 
 The first time I click one of the buttons, the page won't scroll, but
after
 that it works fine. I think the reason for this is that the function
 hentKoordinat() gets called before $teller is set. hentKoordinat() uses
 $teller.
 
 Anyone know a way to make this work?
 
 Thanks alot!
 
 Lars
 
 
 File test.php:
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 http://www.w3.org/TR/html4/loose.dtd;
 ?php echo 
 
 Ykoordinat:  . $yKoord . 
 
 ; echo Teller:  . $teller; for($i=0; $i150; $i++) { echo '
 '; } for($teller=0; $teller2; $teller++) { ? ?php $teller++; ?
?php }
 //for($teller=0; $i2; $i++) { ?
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





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



RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Duh. make that
fo will also run the code presented by fum ...

 -Original Message-
 From: Mark Charette [mailto:[EMAIL PROTECTED]
 
 switch($foo)
 {
   case fee:
   case fie:
   ...
   break;
   case fo:
   ...
   case fum:
   ...
   break;
 }
 
 fee  fie are tied together, fie will also run the code presented 
 by fum ...
 
 Even more flexible than comma delimited values ...


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



[PHP] URGENT MYSQL HELP!!

2003-03-02 Thread Stephen Craton
Hello,

I turns out I accidently over wrote my MySQL user table and now everything is out of 
wack. I overwrite it again with a backup install of MySQL and it's 
working...somewhat.. When I try logging in through phpMyAdmin (it's a hosted site with 
ssh access) I get this error:

MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using 
password: NO)

Funn thing is I made the table user have a user with roo, no password, and all that. 
If you can fix this yourself or walk me through it I'd be much obliged!! I need help 
ASAP!! I'll email you the ssh account settings once you reply.

Thanks,
Stephen Craton
http://www.melchior.us



[PHP] mysql query questions

2003-03-02 Thread Sunfire
i have a query:
mysql_query(update members set  where '$edit[company]'='$company)

anyways there are 2 sources using this query.. one that needs the
$edit[company] marker and another one that uses a $company marker.. any way
i can make that 1 query deal with both sources?

and i also having a problem with case sensitive searches and query problems
with it also... just wondering how you tell the variables contents on
comparing in the where clause of the query to be case sensitive...?

'


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



Re: [PHP] heredoc problem

2003-03-02 Thread janet
In a message dated 3/2/2003 3:55:50 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:

when I copy/pasted directly from your email and tried to execute it, I can
an error on line 5 too

I noticed that there's a space at the end of line 5, I deleted it and it
worked fine.


That's it. That is the problem. Good eye.

Thank you,

Janet


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 9:02 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] heredoc problem
 
 
 Can someone tell me what is wrong with the following code:
 
 
 headtitleTesting/title/head
 
 ?php
 $str = EOD 
 Example of string 
 spanning multiple lines 
 using heredoc syntax.
 EOD;
 ? 
 
 
 
 This is code straight out of the PHP manual. I get the error:
 Parse error: parse error, unexpected T_SL in testhere.php on line 5
 
 I looked up T_SL and it is a token representing  so that 
 means it just
 doesn't get the . Why not? I've tried all the combinations 
 of spaces and
 no space in that line that I can think of.
 
 So, what's wrong. Undoubtedly something obvious to anyone except me.
 
 Janet
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Arrays and MySQL

2003-03-02 Thread Beauford.2002
 You can use array_sum().

I have used that in the past, but only on single arrays, I can't figure out
how to do on multi-level arrays, and since I need to have different totals
from different levels of the array, I don't think this will work. If you can
shed some light on this it would be appreciated.

From below - $totals[0][4] through $totals[19][4] , $totals[0][5] through
$totals[19][5], etc.


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 4:53 PM
Subject: Re: [PHP] Arrays and MySQL


 On Sunday 02 March 2003 23:34, Beauford.2002 wrote:
  Hi,
 
  I have an array which I am trying to total but having some problems. Any
  help is appreciated.
 
  Example:  This is a hockey team and there are 20 players - I am
selecting
  the goals, assists, and points from each player and then want to have a
  grand total of all goals, assists, and points.
 
  $query = select goals, assists, points from roster;
 
  while ($line = mysql_fetch_row($result)) {
 
  $totals[] = $line;
 
  }
 
  I want to total $totals[0][4] through $totals[19][4], $totals[0][5]
through
  $totals[19][5], etc. for each stat. I thought of putting them in a for
loop
  and just adding them, but this seemed kind of messy and the long way
around

 You can use array_sum().

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Man's unique agony as a species consists in his perpetual conflict between
 the desire to stand out and the need to blend in.
 -- Sydney J. Harris
 */


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





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



[PHP] Re: Mailling question

2003-03-02 Thread Manuel Lemos
Hello,

On 02/28/2003 11:10 AM, Mathieu Dumoulin wrote:
Allright, we managed to get to send emails thru an SMTP, but now we need to
know which email DID get to the recipient and which didn't. Our smtp class
supports basic error message but as soon as the message is outbound from
this server, which is most oftenly the case, the class always returns
success. Allright we can live with that. But our mass mailing software using
this class needs to keep track of which client of our numerous members gets
the email.
The only solution we though of which is very risky, is to:

Setup a mass mailing account for each client and send emails as if they
where the mass mailer
Then a robot is in charge of scanning the inbox for returned postmaster
messages and parse it to find the error such as unknown user.
I do that, except that I make the message return path be in some domain 
handled by a catch-all POP mailbox. The return path is also set in such 
way that it identifies the exact address of the subscriber that is bouncing.

I don't advise sending via SMTP unless you do not have an alternative 
(when you are using Windows) because it is very slow to queue messages. 
Sending to your local mailer queue (sendmail, qmail, postfix, etc..) can 
be much faster.

Anyway, regardless of the way you send your messages, you may want to 
try this class that knows how to set the return-path address depending 
of the sending methods that you use (mail(), sendmail, SMTP, qmail, etc...).

http://www.phpclasses.org/mimemessage

--

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


[PHP] Re: mail function and Bcc restriction?

2003-03-02 Thread Manuel Lemos
Hello,

On 03/01/2003 08:35 AM, Mirza Muharemagic wrote:
Hi all,

   are there any restrictions for mail function, when I use Bcc? how
   many email adresses can i put in Bcc, are there any PHP
   restriction, or just memory restriction, or something else?
Put them all in a single Bcc: header separating them with commas , .

--

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


Re: [PHP] heredoc problem

2003-03-02 Thread Tom Rogers
Hi,

Monday, March 3, 2003, 8:02:14 AM, you wrote:
jvc Can someone tell me what is wrong with the following code:

jvc html
jvc headtitleTesting/title/head
jvc body
jvc ?php
jvc $str = EOD 
jvc Example of string 
jvc spanning multiple lines 
jvc using heredoc syntax.
jvc EOD;
? 
jvc /body
jvc /html

jvc This is code straight out of the PHP manual. I get the error:
jvc Parse error: parse error, unexpected T_SL in testhere.php on line 5

jvc I looked up T_SL and it is a token representing  so that means it just
jvc doesn't get the . Why not? I've tried all the combinations of spaces and
jvc no space in that line that I can think of.

jvc So, what's wrong. Undoubtedly something obvious to anyone except me.

jvc Janet


You have a space at the end of EOD
Get rid of it and it should work

-- 
regards,
Tom


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



[PHP] Re: Mail() Failing to connect

2003-03-02 Thread Manuel Lemos
Hello,

On 02/28/2003 05:24 PM, Gary wrote:
Does anyone have any idea of why I may be getting this error, when my
scripts ran perfectly fine before (i don't know what). Is there some kind of
setting in my mail program that may have changed? I'm using Outlook with
Exchange Server.
Warning: Failed to Connect in d:\apache\htdocs/emailtest.php on line 43
Either you have not configured the SMTP server right in php.ini or that 
may be a bug in the mail() function.

Either way, you may want to try this class that comes with a sub class 
to send via SMTP. You can enable the debug mode to see the SMTP dialog 
so you can figure what is the problem:

http://www.phpclasses.org/mimemessage

Use it in conjunction with this:

http://www.phpclasses.org/smtpclass

--

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


[PHP] Re: Calendar

2003-03-02 Thread Manuel Lemos
Hello,

On 03/01/2003 07:28 PM, Jason D. Williard wrote:
Is there an easy way to create a calendar in PHP, such as a calendar
function?  All I need is a dynamically created calendar to link to other
pages.
You may want to try this class that you customize in a sub-class to do 
whatever you want as demonstrated in the example:

http://www.phpclasses.org/calendarclass

--

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



Re: [PHP] Still no luck running a PHPCLI script from CRON

2003-03-02 Thread Tom Rogers
Hi,

Monday, March 3, 2003, 6:33:46 AM, you wrote:
JMC Does anyone have a PHP CLI script running from cron?

JMC If so I would greatly appreciate any assistance.  Below is everything
JMC from this on going problem.  It seems none has an answer so far.

JMC Please help.
JMC XXX

JMC I tried to run the script directly from cron like:

JMC * * * * * /usr/local/bin/php -q /path/to/cron/script/file_name

JMC I also tried to run cron in the bash environment by writing a bash
JMC script that calls my PHP script.  I set cron you call the bash script
JMC every minute. The bash script contained the following information:

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/bash
JMC /path/to/PHP/script/file_name
JMC = END SCRIPT
JMC ==

JMC If I run the bash script from the command line it definitely runs my PHP
JMC script. I know this because my PHP script sends me an email. 

JMC Also, if I run my PHP script from the command line it also runs fine and
JMC I receive an email.  However, anytime I try to run PHP script or the
JMC bash script from cron nothing happens.  I get no emails.  I also know
JMC cron is working properly because a regular bash script as I listed in my
JMC earlier posting works fine.

JMC This is using the new CLI that come with PHP 4.3 I have in past versions
JMC of used the CGI from cron with no problems at all.  As a matter of fact
JMC I have another server that does all its maintenance via PHP scripts that
JMC get ran by cron

JMC Here is the PHP CLI cron script I am testing to see if cron will run my
JMC PHP

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/php -q
JMC ?

JMC mail([EMAIL PROTECTED],Message From cron,date(F j, Y @ h:i a));

?
JMC = END SCRIPT
JMC ==
 

JMC Any more suggestions would be greatly appreciated.

JMC Justin

JMC -Original Message-
JMC From: CodersNightMare [mailto:[EMAIL PROTECTED] 
JMC Sent: Friday, February 28, 2003 10:32 AM
JMC To: [EMAIL PROTECTED]
JMC Subject: RE: [PHP] Can't run PHP cli script from Cron


JMC I am sure you have tried this, but,
JMC Do you call the full path to php for cron.

JMC something like:

JMC 40 * * * * /usr/local/bin/php -q /home/user/phpcliscript

JMC Hope this helps.


JMC At 10:10 AM 2/28/2003 -0800, you wrote:
The path is

#!/usr/local/bin/php -q

But like I said, that can't be the problem because when I run it from
the command line, it runs fine.  The only problem I am having is that
JMC it
won't run from cron.  That is why I think it is an issue with the cron
environment.  All other types of scripts like bash scripts run fine
JMC from
cron.  I am surprised no one else has come across this problem before.

Please help me!

  Justin Michael Couto[EMAIL PROTECTED]
Director of Operations  805.781.0420
Somnio World Web Solutions  http://www.somnioworld.com


-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 9:44 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Can't run PHP cli script from Cron

Shouldn't it be
#!/usr/local/bin/php

Or was it just a typo here?

- Original Message -
From: Justin Michael Couto [EMAIL PROTECTED]
To: 'Ernest E Vogelsinger' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 12:09 PM
Subject: RE: [PHP] Can't run PHP cli script from Cron


  I can run it from the shell prompt perfectly fine.  I just won't run
  from cron.
 
  I do have the statement:
 
  #!/usr/local/php
 
  In the beginning of my script.  Like I said it works perfect when I
run
  it by hand from the shell prompt.  I think the reason it is not
running
  has to do with the cron environment, but I am not ssure what it is.
 
  Justin Michael Couto[EMAIL PROTECTED]
  Director of Operations  805.781.0420
  Somnio World Web Solutions  http://www.somnioworld.com
 
 
  -Original Message-
  From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
  Sent: Friday, February 28, 2003 12:55 AM
  To: Justin Michael Couto
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Can't run PHP cli script from Cron
 
  At 05:30 28.02.2003, Justin Michael Couto said:
  [snip]
  Here is my crontab entry:
  
  * * * * * /path/to/file/file_name.php
  
  I also have
  
  * * * * * /path/to/file/bash_test_script
  [snip]
 
  Did you try to run the php file interactively, from the shell
JMC prompt?
 
  You need at last this statement on top of your PHP files:
  #!/usr/local/php
 
 
  --
 O Ernest E. Vogelsinger
 (\)ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
  --
  PHP General Mailing List 

[PHP] File array mailing Loop problem. Help needed urgently

2003-03-02 Thread WebDev
Hello

I  do have the following problem

I read a file  line by line into an array  I use to email address ( a value
of the line) to email each client with custom information from this file
what I  read into the buffer.

The script is working everything is send the way I wish, the only problem is
that the 200 user would see all 199 useres email addresses  before him ..
and so on each member Member 800 sees 799 emails in the email as well 799
times the from address big problem.

I want to send each email in single loop ?  so that each client gets only
one email address to see and my whole doing is not a security risk

Here is my code I use can somebody help me out to show  me a way where I
prevent the above from happening:

$fp = fopen (data/default2.users, r);
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
$City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
$ex4, $ex53, $ex7 ) = split (\|, $buffer);

$myname = browseabit;
$myemail = [EMAIL PROTECTED];
$myreplyemail = [EMAIL PROTECTED];
$contactname = $Realf;
$contactemail = $Email;

$message = Dear $Realf $RealL br   . message text here;

$subject = Subject Text here;

$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: .$myname. .$myemail.\r\n;
$headers .= To: .$contactname. .$contactemail.\r\n;
$headers .= Reply-To: .$myname. $myreplyemail\r\n;
$headers .= X-Priority: 1\r\n;
$headers .= X-MSMail-Priority: High\r\n;
$headers .= X-Mailer: Server Text here;

mail($contactemail, $subject, $message, $headers);

echo font face=\Arial\ size=\1\ color=\#00\ Mail has been send
to $Realf $RealL /fontbr  ;
}
fclose ($fp);





RE: [PHP] File array mailing Loop problem. Help needed urgently

2003-03-02 Thread John W. Holmes
[snip]
 The script is working everything is send the way I wish, the only
problem
 is
 that the 200 user would see all 199 useres email addresses  before him
..
 and so on each member Member 800 sees 799 emails in the email as well
799
 times the from address big problem.
 
 I want to send each email in single loop ?  so that each client gets
only
 one email address to see and my whole doing is not a security risk
[snip]
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: .$myname. .$myemail.\r\n;
 $headers .= To: .$contactname. .$contactemail.\r\n;
 $headers .= Reply-To: .$myname. $myreplyemail\r\n;
 $headers .= X-Priority: 1\r\n;
 $headers .= X-MSMail-Priority: High\r\n;
 $headers .= X-Mailer: Server Text here;
 
 mail($contactemail, $subject, $message, $headers);

You're constantly building up $headers with each loop. You're first line
should be

$headers = MIME-Version: 1.0\r\n;

so that it starts from an empty string and adds the rest. Or, clear
$headers after you call mail(), so the next loop starts with an empty
variable.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] File array mailing What to do

2003-03-02 Thread WebDev
I do not use any loop comand yet
how come I have all email addresses from the data file in the TO: line
but each email is send with unique information to the client,

only TO and From: line is filled with all the values from the data file.
What do I do ?
I hope I explain my self good enough can you help me a bit with the code ?


?php
$fp = fopen (data/default2.users, r);
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
$City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
$ex4, $ex53, $ex7 ) = split (\|, $buffer);

$myname = name text ;
$myemail = [EMAIL PROTECTED];
$myreplyemail = [EMAIL PROTECTED];
$contactname = $Realf $RealL;
$contactemail = $Email;

$message = Dear $Realf $RealL br  message text here ... use of above
arrays . ;

$subject = Subject text here;

$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: .$myname. .$myemail.\r\n;
$headers .= To: .$contactname. .$contactemail.\r\n;
$headers .= Reply-To: .$myname. $myreplyemail\r\n;
$headers .= X-Priority: 1\r\n;
$headers .= X-MSMail-Priority: High\r\n;
$headers .= X-Mailer: Server here;
mail($contactemail, $subject, $message, $headers);
echo font face=\Arial\ size=\1\ color=\#00\  mail to $Realf
$RealL done .../fontbr  ;
}
fclose ($fp);

?




- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 7:23 PM
Subject: RE: [PHP] File array mailing Loop problem. Help needed urgently


 [snip]
  The script is working everything is send the way I wish, the only
 problem
  is
  that the 200 user would see all 199 useres email addresses  before him
 ..
  and so on each member Member 800 sees 799 emails in the email as well
 799
  times the from address big problem.
 
  I want to send each email in single loop ?  so that each client gets
 only
  one email address to see and my whole doing is not a security risk
 [snip]
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: .$myname. .$myemail.\r\n;
  $headers .= To: .$contactname. .$contactemail.\r\n;
  $headers .= Reply-To: .$myname. $myreplyemail\r\n;
  $headers .= X-Priority: 1\r\n;
  $headers .= X-MSMail-Priority: High\r\n;
  $headers .= X-Mailer: Server Text here;
 
  mail($contactemail, $subject, $message, $headers);

 You're constantly building up $headers with each loop. You're first line
 should be

 $headers = MIME-Version: 1.0\r\n;

 so that it starts from an empty string and adds the rest. Or, clear
 $headers after you call mail(), so the next loop starts with an empty
 variable.

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/



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



[PHP] assistance

2003-03-02 Thread DR MATTHEW LOUN
DR MATTHEW LOUN.
BRANCH MANAGER,
UNITED BANK FOR AFRICA PLC
LAGOS ISLAND BRANCH
LAGOS NIGERIA
TELL:234-803-300-3032
EMAIL:[EMAIL PROTECTED] or [EMAIL PROTECTED]
ATTN:PRESIDENT/C.E.O



I am pleased to get across to you for a very urgentand profitable business
proposal,Though I don't know you neither have I seenyou before but my confidence
was reposed On you when the Chief Executive of LagosState
chamber of Commerce and Industry handed me yourcontact for a confidential
business. I am the manager of United Bank for Africa Plc
(UBA),Ilupeju branch, LagosNigeria.
The intended business is thus; We had a customer, aForeigner (a Turkish)resident
in Nigeria, he was a Contractor with one of theGovernment Parastatals.
He has in his Account in my branch the sum of US 35Million(Thirty Five Million
U.S. Dollars). Unfortunately, the man died four years ago until today
non-of his next of kin hascome Forward to claim the money.
Having noticed this, I in collaboration with two othertop Officials of the bank
we have covered up the account all this while.
Now we want you (being a foreigner) to be fronted asone of his next of kin and
forward Your account and other relevant documents tobe advised to you by us to
attest to the Claim. We will use our positions to get all internal
documentations to back up theclaims .The whole procedures will last only ten
working days to get the fundretrieved successfully Without trace even in future.
Your response is only what we are waiting for as wehave arranged all necessary
things As soon as this message comes to you kindly get backto me indicating your
interest ,Then I will furnish you with the wholeprocedures to ensure that the
deal is successfully Concluded
For your assistance we have agreed to give you thirty
percent (30%) of the Total sum at the end of the
transaction while 65% would be for my colleagues and i
and the remaining 5% would be for any form of expenses
that may be incurred during the course of the
transaction which would be given to us when the money
is transferred into your account before splitting the
balance on the agreed percentage of 65% to 30%.


I await your earliest response. Thanks, Yours Sincerely


DR MATTHEW LOUN.



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



RE: [PHP] File array mailing What to do

2003-03-02 Thread John W. Holmes
 I do not use any loop comand yet

Yes you do. You have a while() loop. 

 how come I have all email addresses from the data file in the TO: line
 but each email is send with unique information to the client,

Because that info is the result of one split() call, but you're building
up headers with continuous data each time you loop through the lines of
the file.
 
 only TO and From: line is filled with all the values from the data
file.
 What do I do ?
 I hope I explain my self good enough can you help me a bit with the
code ?

Just try as I suggested and use

$headers = MIME-Version: 1.0\r\n;

as your first line of building headers.

---John Holmes...

 
 ?php
 $fp = fopen (data/default2.users, r);
 while (!feof ($fp)) {
 $buffer = fgets($fp, 4096);
 list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,
$Street,
 $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
$ex3,
 $ex4, $ex53, $ex7 ) = split (\|, $buffer);
 
 $myname = name text ;
 $myemail = [EMAIL PROTECTED];
 $myreplyemail = [EMAIL PROTECTED];
 $contactname = $Realf $RealL;
 $contactemail = $Email;
 
 $message = Dear $Realf $RealL br  message text here ... use of
above
 arrays . ;
 
 $subject = Subject text here;
 
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: .$myname. .$myemail.\r\n;
 $headers .= To: .$contactname. .$contactemail.\r\n;
 $headers .= Reply-To: .$myname. $myreplyemail\r\n;
 $headers .= X-Priority: 1\r\n;
 $headers .= X-MSMail-Priority: High\r\n;
 $headers .= X-Mailer: Server here;
 mail($contactemail, $subject, $message, $headers);
 echo font face=\Arial\ size=\1\ color=\#00\  mail to
$Realf
 $RealL done .../fontbr  ;
 }
 fclose ($fp);
 
 ?
 
 
 
 
 - Original Message -
 From: John W. Holmes [EMAIL PROTECTED]
 To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 7:23 PM
 Subject: RE: [PHP] File array mailing Loop problem. Help needed
urgently
 
 
  [snip]
   The script is working everything is send the way I wish, the only
  problem
   is
   that the 200 user would see all 199 useres email addresses  before
him
  ..
   and so on each member Member 800 sees 799 emails in the email as
well
  799
   times the from address big problem.
  
   I want to send each email in single loop ?  so that each client
gets
  only
   one email address to see and my whole doing is not a security risk
  [snip]
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: .$myname. .$myemail.\r\n;
   $headers .= To: .$contactname. .$contactemail.\r\n;
   $headers .= Reply-To: .$myname. $myreplyemail\r\n;
   $headers .= X-Priority: 1\r\n;
   $headers .= X-MSMail-Priority: High\r\n;
   $headers .= X-Mailer: Server Text here;
  
   mail($contactemail, $subject, $message, $headers);
 
  You're constantly building up $headers with each loop. You're first
line
  should be
 
  $headers = MIME-Version: 1.0\r\n;
 
  so that it starts from an empty string and adds the rest. Or, clear
  $headers after you call mail(), so the next loop starts with an
empty
  variable.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
  today. http://www.phparch.com/
 




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



Re: [PHP] File array mailing list

2003-03-02 Thread WebDev
well i can not do it I turned the code up side down put the header tags
above like u sugested but still dosnt work  I see your point that it is in a
growing loop  /but I am not so good yet in php to fix the code my self to do
it in a better way
I looked online ??? Does nobody has a data file like mine with name and
email addreses and info in and uses the data to mail his clients all at
ones??? Please if it that is easy for you can u help me out ?


- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 7:50 PM
Subject: RE: [PHP] File array mailing What to do


  I do not use any loop comand yet

 Yes you do. You have a while() loop.

  how come I have all email addresses from the data file in the TO: line
  but each email is send with unique information to the client,

 Because that info is the result of one split() call, but you're building
 up headers with continuous data each time you loop through the lines of
 the file.

  only TO and From: line is filled with all the values from the data
 file.
  What do I do ?
  I hope I explain my self good enough can you help me a bit with the
 code ?

 Just try as I suggested and use

 $headers = MIME-Version: 1.0\r\n;

 as your first line of building headers.

 ---John Holmes...

 
  ?php
  $fp = fopen (data/default2.users, r);
  while (!feof ($fp)) {
  $buffer = fgets($fp, 4096);
  list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,
 $Street,
  $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
 $ex3,
  $ex4, $ex53, $ex7 ) = split (\|, $buffer);
 
  $myname = name text ;
  $myemail = [EMAIL PROTECTED];
  $myreplyemail = [EMAIL PROTECTED];
  $contactname = $Realf $RealL;
  $contactemail = $Email;
 
  $message = Dear $Realf $RealL br  message text here ... use of
 above
  arrays . ;
 
  $subject = Subject text here;
 
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: .$myname. .$myemail.\r\n;
  $headers .= To: .$contactname. .$contactemail.\r\n;
  $headers .= Reply-To: .$myname. $myreplyemail\r\n;
  $headers .= X-Priority: 1\r\n;
  $headers .= X-MSMail-Priority: High\r\n;
  $headers .= X-Mailer: Server here;
  mail($contactemail, $subject, $message, $headers);
  echo font face=\Arial\ size=\1\ color=\#00\  mail to
 $Realf
  $RealL done .../fontbr  ;
  }
  fclose ($fp);
 
  ?
 
 
 
 
  - Original Message -
  From: John W. Holmes [EMAIL PROTECTED]
  To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Sunday, March 02, 2003 7:23 PM
  Subject: RE: [PHP] File array mailing Loop problem. Help needed
 urgently
 
 
   [snip]
The script is working everything is send the way I wish, the only
   problem
is
that the 200 user would see all 199 useres email addresses  before
 him
   ..
and so on each member Member 800 sees 799 emails in the email as
 well
   799
times the from address big problem.
   
I want to send each email in single loop ?  so that each client
 gets
   only
one email address to see and my whole doing is not a security risk
   [snip]
$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: .$myname. .$myemail.\r\n;
$headers .= To: .$contactname. .$contactemail.\r\n;
$headers .= Reply-To: .$myname. $myreplyemail\r\n;
$headers .= X-Priority: 1\r\n;
$headers .= X-MSMail-Priority: High\r\n;
$headers .= X-Mailer: Server Text here;
   
mail($contactemail, $subject, $message, $headers);
  
   You're constantly building up $headers with each loop. You're first
 line
   should be
  
   $headers = MIME-Version: 1.0\r\n;
  
   so that it starts from an empty string and adds the rest. Or, clear
   $headers after you call mail(), so the next loop starts with an
 empty
   variable.
  
   ---John W. Holmes...
  
   PHP Architect - A monthly magazine for PHP Professionals. Get your
 copy
   today. http://www.phparch.com/
  




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



RE: [PHP] File array mailing list

2003-03-02 Thread John W. Holmes
Instead of using fopen(), try using file(). It will read your file into
an array, with each line of your file being an element in the array. You
then use foreach() to loop through the array, one element (line) at a
time and act accordingly. 

$lines = file($email_file);
foreach($lines as $line)
{
  list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,$Street,
  $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
  $ex3,$ex4, $ex53, $ex7 ) = explode(|, $buffer);

  //send emails
}

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: WebDev [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 2:22 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] File array mailing list
 
 well i can not do it I turned the code up side down put the header
tags
 above like u sugested but still dosnt work  I see your point that it
is in
 a
 growing loop  /but I am not so good yet in php to fix the code my self
to
 do
 it in a better way
 I looked online ??? Does nobody has a data file like mine with name
and
 email addreses and info in and uses the data to mail his clients all
at
 ones??? Please if it that is easy for you can u help me out ?
 
 
 - Original Message -
 From: John W. Holmes [EMAIL PROTECTED]
 To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 7:50 PM
 Subject: RE: [PHP] File array mailing What to do
 
 
   I do not use any loop comand yet
 
  Yes you do. You have a while() loop.
 
   how come I have all email addresses from the data file in the TO:
line
   but each email is send with unique information to the client,
 
  Because that info is the result of one split() call, but you're
building
  up headers with continuous data each time you loop through the lines
of
  the file.
 
   only TO and From: line is filled with all the values from the data
  file.
   What do I do ?
   I hope I explain my self good enough can you help me a bit with
the
  code ?
 
  Just try as I suggested and use
 
  $headers = MIME-Version: 1.0\r\n;
 
  as your first line of building headers.
 
  ---John Holmes...
 
  
   ?php
   $fp = fopen (data/default2.users, r);
   while (!feof ($fp)) {
   $buffer = fgets($fp, 4096);
   list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,
  $Street,
   $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
  $ex3,
   $ex4, $ex53, $ex7 ) = split (\|, $buffer);
  
   $myname = name text ;
   $myemail = [EMAIL PROTECTED];
   $myreplyemail = [EMAIL PROTECTED];
   $contactname = $Realf $RealL;
   $contactemail = $Email;
  
   $message = Dear $Realf $RealL br  message text here ... use of
  above
   arrays . ;
  
   $subject = Subject text here;
  
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: .$myname. .$myemail.\r\n;
   $headers .= To: .$contactname. .$contactemail.\r\n;
   $headers .= Reply-To: .$myname. $myreplyemail\r\n;
   $headers .= X-Priority: 1\r\n;
   $headers .= X-MSMail-Priority: High\r\n;
   $headers .= X-Mailer: Server here;
   mail($contactemail, $subject, $message, $headers);
   echo font face=\Arial\ size=\1\ color=\#00\  mail to
  $Realf
   $RealL done .../fontbr  ;
   }
   fclose ($fp);
  
   ?
  
  
  
  
   - Original Message -
   From: John W. Holmes [EMAIL PROTECTED]
   To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Sunday, March 02, 2003 7:23 PM
   Subject: RE: [PHP] File array mailing Loop problem. Help needed
  urgently
  
  
[snip]
 The script is working everything is send the way I wish, the
only
problem
 is
 that the 200 user would see all 199 useres email addresses
before
  him
..
 and so on each member Member 800 sees 799 emails in the email
as
  well
799
 times the from address big problem.

 I want to send each email in single loop ?  so that each
client
  gets
only
 one email address to see and my whole doing is not a security
risk
[snip]
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: .$myname. .$myemail.\r\n;
 $headers .= To: .$contactname. .$contactemail.\r\n;
 $headers .= Reply-To: .$myname. $myreplyemail\r\n;
 $headers .= X-Priority: 1\r\n;
 $headers .= X-MSMail-Priority: High\r\n;
 $headers .= X-Mailer: Server Text here;

 mail($contactemail, $subject, $message, $headers);
   
You're constantly building up $headers with each loop. You're
first
  line
should be
   
$headers = MIME-Version: 1.0\r\n;
   
so that it starts from an empty string and adds the rest. Or,
clear
$headers after you call mail(), so the next loop starts with an
  empty
variable.
   
---John W. Holmes...
   
PHP Architect - A monthly magazine for PHP Professionals. Get
your
  copy
today. 

[PHP] fread problem

2003-03-02 Thread Paul Cohen
Hello all,

I am trying to read a php file to a varible and then print that variable.
Unfortunately, my php file is not being parsed by the fread function and I
can't figure out why.

Here is the code in my file and was taken directly from the manual:

$filename = test.php;
$handle = fopen ($filename, r);
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;

Here is test.php 

?PHP
echo Hello World;
?

 END test.php


When I run this, I get a blank page with my php code as my HTML source code.
Not good.

Finally, if you respond to this, please copy me directly as I get the
mailing list as a digest.

Thx,

Paul




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



RE: [PHP] fread problem

2003-03-02 Thread Martin Towell
you'll have to exec() the code

 $filename = test.php;
 $handle = fopen ($filename, r);
 $contents = fread ($handle, filesize ($filename));
 fclose ($handle);
 exec($contents);

see if that works
Martin

 -Original Message-
 From: Paul Cohen [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 3:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] fread problem
 
 
 Hello all,
 
 I am trying to read a php file to a varible and then print 
 that variable.
 Unfortunately, my php file is not being parsed by the fread 
 function and I
 can't figure out why.
 
 Here is the code in my file and was taken directly from the manual:
 
 $filename = test.php;
 $handle = fopen ($filename, r);
 $contents = fread ($handle, filesize ($filename));
 fclose ($handle);
 echo $contents;
 
 Here is test.php 
 
 ?PHP
 echo Hello World;
 ?
 
  END test.php
 
 
 When I run this, I get a blank page with my php code as my 
 HTML source code.
 Not good.
 
 Finally, if you respond to this, please copy me directly as I get the
 mailing list as a digest.
 
 Thx,
 
 Paul
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] Still no luck running a PHPCLI script from CRON

2003-03-02 Thread Justin Michael Couto
Tom,

Did you run the script from cron?  If so, what operating system are you
using?  Putting PHP info in my script won't do me any good since cron
won't run it.  The trouble is that cron does nothing.  When I run the
email script I get no mail.  If I run the script from the command line
by hand ./script_name etc it works fine.

Any other ideas would be great.

Thanks


X

Hi,

Monday, March 3, 2003, 6:33:46 AM, you wrote:
JMC Does anyone have a PHP CLI script running from cron?

JMC If so I would greatly appreciate any assistance.  Below is
everything
JMC from this on going problem.  It seems none has an answer so far.

JMC Please help.
JMC
XXX

JMC I tried to run the script directly from cron like:

JMC * * * * * /usr/local/bin/php -q /path/to/cron/script/file_name

JMC I also tried to run cron in the bash environment by writing a bash
JMC script that calls my PHP script.  I set cron you call the bash
script
JMC every minute. The bash script contained the following information:

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/bash
JMC /path/to/PHP/script/file_name
JMC = END SCRIPT
JMC ==

JMC If I run the bash script from the command line it definitely runs
my PHP
JMC script. I know this because my PHP script sends me an email. 

JMC Also, if I run my PHP script from the command line it also runs
fine and
JMC I receive an email.  However, anytime I try to run PHP script or
the
JMC bash script from cron nothing happens.  I get no emails.  I also
know
JMC cron is working properly because a regular bash script as I listed
in my
JMC earlier posting works fine.

JMC This is using the new CLI that come with PHP 4.3 I have in past
versions
JMC of used the CGI from cron with no problems at all.  As a matter of
fact
JMC I have another server that does all its maintenance via PHP scripts
that
JMC get ran by cron

JMC Here is the PHP CLI cron script I am testing to see if cron will
run my
JMC PHP

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/php -q
JMC ?

JMC mail([EMAIL PROTECTED],Message From cron,date(F j, Y @ h:i
a));

?
JMC = END SCRIPT
JMC ==
 

JMC Any more suggestions would be greatly appreciated.

JMC Justin

JMC -Original Message-
JMC From: CodersNightMare [mailto:[EMAIL PROTECTED] 
JMC Sent: Friday, February 28, 2003 10:32 AM
JMC To: [EMAIL PROTECTED]
JMC Subject: RE: [PHP] Can't run PHP cli script from Cron


JMC I am sure you have tried this, but,
JMC Do you call the full path to php for cron.

JMC something like:

JMC 40 * * * * /usr/local/bin/php -q /home/user/phpcliscript

JMC Hope this helps.


JMC At 10:10 AM 2/28/2003 -0800, you wrote:
The path is

#!/usr/local/bin/php -q

But like I said, that can't be the problem because when I run it from
the command line, it runs fine.  The only problem I am having is that
JMC it
won't run from cron.  That is why I think it is an issue with the cron
environment.  All other types of scripts like bash scripts run fine
JMC from
cron.  I am surprised no one else has come across this problem before.

Please help me!

  Justin Michael Couto[EMAIL PROTECTED]
Director of Operations  805.781.0420
Somnio World Web Solutions  http://www.somnioworld.com


-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 9:44 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Can't run PHP cli script from Cron

Shouldn't it be
#!/usr/local/bin/php

Or was it just a typo here?

- Original Message -
From: Justin Michael Couto [EMAIL PROTECTED]
To: 'Ernest E Vogelsinger' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 12:09 PM
Subject: RE: [PHP] Can't run PHP cli script from Cron


  I can run it from the shell prompt perfectly fine.  I just won't
run
  from cron.
 
  I do have the statement:
 
  #!/usr/local/php
 
  In the beginning of my script.  Like I said it works perfect when I
run
  it by hand from the shell prompt.  I think the reason it is not
running
  has to do with the cron environment, but I am not ssure what it is.
 
  Justin Michael Couto[EMAIL PROTECTED]
  Director of Operations  805.781.0420
  Somnio World Web Solutions  http://www.somnioworld.com
 
 
  -Original Message-
  From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
  Sent: Friday, February 28, 2003 12:55 AM
  To: Justin Michael Couto
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Can't run PHP cli script from Cron
 
  At 05:30 28.02.2003, Justin Michael Couto said:
  [snip]
  Here is my crontab entry:
  
  * * * * * 

RE: [PHP] fread problem

2003-03-02 Thread John W. Holmes
 I am trying to read a php file to a varible and then print that
variable.
 Unfortunately, my php file is not being parsed by the fread function
and I
 can't figure out why.
 
 Here is the code in my file and was taken directly from the manual:
 
 $filename = test.php;
 $handle = fopen ($filename, r);
 $contents = fread ($handle, filesize ($filename));
 fclose ($handle);
 echo $contents;
 
 Here is test.php 
 
 ?PHP
 echo Hello World;
 ?
 
  END test.php
 
 
 When I run this, I get a blank page with my php code as my HTML source
 code.
 Not good.

If you want the result of your PHP file, then open it through HTTP.

$filename = http://www.yourdomain.com/test.php;;

and everything else remains the same.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Deciding the directory for the uploaded file?

2003-03-02 Thread Denis L. Menezes
Hello friends.

I have seen some php scripts for uploading files. They all mention thet the file goes 
to a temporary folder.

How can I upload the file to a particular folder that I have created?

Thanks very much.
Denis

RE: [PHP] Deciding the directory for the uploaded file?

2003-03-02 Thread John W. Holmes
 I have seen some php scripts for uploading files. They all mention
thet
 the file goes to a temporary folder.
 
 How can I upload the file to a particular folder that I have created?

It's always uploaded into a temporary folder. Then you use
move_uploaded_file() to move it where you want.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] Deciding the directory for the uploaded file?

2003-03-02 Thread Justin French
It's all in the manual:

http://www.php.net/manual/en/features.file-upload.php

In particular, look at the lines involving move_uploaded_file()

Justin French


on 03/03/03 4:00 PM, Denis L. Menezes ([EMAIL PROTECTED]) wrote:

 Hello friends.
 
 I have seen some php scripts for uploading files. They all mention thet the
 file goes to a temporary folder.
 
 How can I upload the file to a particular folder that I have created?
 
 Thanks very much.
 Denis


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



[PHP] phpwebhosting + gethostbyaddr()

2003-03-02 Thread lists
- Original Message -
From: erich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 12:50
Subject: [PHP] gethostbyaddr woes


 for some reason i cannot retrieve a hostname using gethostbyaddr().

 if it helps, my host is http://phpwebhosting.com/. i have asked them
 countless times if it is something on their end causing this and have
 been told that it works for them and i must be doing
 something wrong. any suggestions?



Hi Erich,

I just happened to be browsing the list archives and came across your
post. What code are you using? I did a quick test with:

?php

$blah = gethostbyaddr(64.246.30.37);
print $blah\n;

?

and it outputs the correct output (rs1.php.net)

I couldn't find your email address in our system so I don't know
which specific server you are on but it should work on any of them.

Open a ticket in your CP if you still can't get it to work.

Greg
(phpwebhosting.com support)



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



Re[2]: [PHP] Still no luck running a PHPCLI script from CRON

2003-03-02 Thread Tom Rogers
Hi,

Monday, March 3, 2003, 2:54:47 PM, you wrote:
JMC Tom,

JMC Did you run the script from cron?  If so, what operating system are you
JMC using?  Putting PHP info in my script won't do me any good since cron
JMC won't run it.  The trouble is that cron does nothing.  When I run the
JMC email script I get no mail.  If I run the script from the command line
JMC by hand ./script_name etc it works fine.

JMC Any other ideas would be great.

JMC Thanks

JMC 
JMC X

JMC Hi,

JMC Monday, March 3, 2003, 6:33:46 AM, you wrote:
JMC Does anyone have a PHP CLI script running from cron?

JMC If so I would greatly appreciate any assistance.  Below is
JMC everything
JMC from this on going problem.  It seems none has an answer so far.

JMC Please help.
JMC
JMC XXX

JMC I tried to run the script directly from cron like:

JMC * * * * * /usr/local/bin/php -q /path/to/cron/script/file_name

JMC I also tried to run cron in the bash environment by writing a bash
JMC script that calls my PHP script.  I set cron you call the bash
JMC script
JMC every minute. The bash script contained the following information:

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/bash
JMC /path/to/PHP/script/file_name
JMC = END SCRIPT
JMC ==

JMC If I run the bash script from the command line it definitely runs
JMC my PHP
JMC script. I know this because my PHP script sends me an email. 

JMC Also, if I run my PHP script from the command line it also runs
JMC fine and
JMC I receive an email.  However, anytime I try to run PHP script or
JMC the
JMC bash script from cron nothing happens.  I get no emails.  I also
JMC know
JMC cron is working properly because a regular bash script as I listed
JMC in my
JMC earlier posting works fine.

JMC This is using the new CLI that come with PHP 4.3 I have in past
JMC versions
JMC of used the CGI from cron with no problems at all.  As a matter of
JMC fact
JMC I have another server that does all its maintenance via PHP scripts
JMC that
JMC get ran by cron

JMC Here is the PHP CLI cron script I am testing to see if cron will
JMC run my
JMC PHP

JMC  START SCRIPT
JMC =
JMC #!/usr/local/bin/php -q
JMC ?

JMC mail([EMAIL PROTECTED],Message From cron,date(F j, Y @ h:i
JMC a));

?
JMC = END SCRIPT
JMC ==
 

JMC Any more suggestions would be greatly appreciated.

JMC Justin

JMC -Original Message-
JMC From: CodersNightMare [mailto:[EMAIL PROTECTED] 
JMC Sent: Friday, February 28, 2003 10:32 AM
JMC To: [EMAIL PROTECTED]
JMC Subject: RE: [PHP] Can't run PHP cli script from Cron


JMC I am sure you have tried this, but,
JMC Do you call the full path to php for cron.

JMC something like:

JMC 40 * * * * /usr/local/bin/php -q /home/user/phpcliscript

JMC Hope this helps.


JMC At 10:10 AM 2/28/2003 -0800, you wrote:
The path is

#!/usr/local/bin/php -q

But like I said, that can't be the problem because when I run it from
the command line, it runs fine.  The only problem I am having is that
JMC it
won't run from cron.  That is why I think it is an issue with the cron
environment.  All other types of scripts like bash scripts run fine
JMC from
cron.  I am surprised no one else has come across this problem before.

Please help me!

  Justin Michael Couto[EMAIL PROTECTED]
Director of Operations  805.781.0420
Somnio World Web Solutions  http://www.somnioworld.com


-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 9:44 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Can't run PHP cli script from Cron

Shouldn't it be
#!/usr/local/bin/php

Or was it just a typo here?

- Original Message -
From: Justin Michael Couto [EMAIL PROTECTED]
To: 'Ernest E Vogelsinger' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 12:09 PM
Subject: RE: [PHP] Can't run PHP cli script from Cron


  I can run it from the shell prompt perfectly fine.  I just won't
JMC run
  from cron.
 
  I do have the statement:
 
  #!/usr/local/php
 
  In the beginning of my script.  Like I said it works perfect when I
run
  it by hand from the shell prompt.  I think the reason it is not
running
  has to do with the cron environment, but I am not ssure what it is.
 
  Justin Michael Couto[EMAIL PROTECTED]
  Director of Operations  805.781.0420
  Somnio World Web Solutions  http://www.somnioworld.com
 
 
  -Original Message-
  From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
  Sent: Friday, February 28, 2003 12:55 AM
  To: Justin Michael Couto
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Can't run PHP cli script from Cron
 
  At 

[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-02 Thread Moriyoshi Koizumi
Jean-Christian Imbeault [EMAIL PROTECTED] wrote:
 Sorry if my intentions were not clear but I am trying to protect myself 
 from SQL injection attacks by using addslashes() to user provided 
 information. I cannot assume anything about the incoming data (not even 
 the encoding) since anyone trying to hack my machine by using such a 
 technique could pretty much send whatever they wanted using a telnet 
 session or what not ...

Sorry for my misleading words too... SQL injection attacks can be 
prevented with a self-made addslashes() even if you choose SJIS for the 
internal charset.

example:

?php
mb_internal_encoding(Shift_JIS);
$escaped = mb_ereg_replace(([\\\'\0]), 1, $sjis_string);
?

   Anyway, Shift_JIS is not a great choice for PHP scripting.
 
 Tell me about it. I have the hardest time getting the people who 
 actually make the HTML page to use EUC instead of SJIS. Of course they 
 all use MS platforms to create the HTML content so they can't understand 
 why SJIS causes me pain when I try and edit it in *NIX box or parse it 
 in PHP ...

The main reason is that several SJIS characters, each of which is a 
compound of the lead byte and the second byte, may contain a byte for the 
second byte whose value is the same as the character code of \ 
(backslash = \x5c) and such double-byte characters are unfortunately 
mistreated by PHP since backslashes are also used for escape sequences in 
string literals.

http://www.microsoft.com/globaldev/reference/dbcs/932.htm

You can avoid this issue by configuring a PHP build 
with --enable-zend-multibyte option and set mbstring.script_encoding to 
SJIS.

Also keep in mind that the same thing applies to
CP936(a GB2312 variant, used in the simplified Chinese version of Windows), 
CP949(a KSC5601 variant, used in the Korean version of Windows), and 
CP950(big5, used in the traditional Chinese version of Windows).

However, as of the current implementation, the character sets / encodings 
mentioned above are not supported by the zend multibyte stuff.

Hope this helps,

Moriyoshi


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



[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-02 Thread Moriyoshi Koizumi
Just correcting a typo :)

Moriyoshi Koizumi [EMAIL PROTECTED] wrote:

 ?php
 mb_internal_encoding(Shift_JIS);
 $escaped = mb_ereg_replace(([\\\'\0]), 1, $sjis_string);
 ?

should be 

?php
mb_internal_encoding(Shift_JIS);
$escaped = mb_ereg_replace(([\'\0]), 1, $sjis_string);
?

Moriyoshi


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



[PHP] 'make' PHP4.3.1 returns the use of function`tempnam' is dangerous --- WHY?

2003-03-02 Thread Patrick LOK
When I tried to 'make' PHP-4.3.1, it returns warning message and died.  I am
using RH8.0 + Apache 2.0.44
The warning tells me the use of function name 'tempnam' is dangerous (why?
who can tell?), and the 'make' process died.

The error is:
ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/home/postgres/php-4.3.1/ext/mysql/libmysql/my_tempnam.c:103: the use of
`tempnam' is dangerous, better use `mkstemp'

I just follow the procedure from the php offical installation document from
( http://www.php.net/manual/en/install.apache2.php )

The command I use was:
#./configure --with-apxs2=/usr/local/apache2/bin/apxs
#make

Can somebody telling me why?  why function name 'tempnam' is dangerous (who
can tell whether it is dangerous, the compiler is not the GOD)? Can I
override this stupid idea?  Should I ask REDHAT about this STUPID thing?

How can I a 'make' PHP4.3.1 ?  Where can I find a PHP-4.3.1. rpm
instead.

I have attached all the make message, pls take a look if you have time.

Best regards
./pl



begin 666 make php error.txt
M6W)O;W1 V5R=F5R,2!P:' M-XS+C%=(R!M86ME#0HO8FEN+W-H(QI8G1O
M;[EMAIL PROTECTED]:6QE;[EMAIL PROTECTED];V1E/6-O;7!I;[EMAIL PROTECTED]( 
M26UA:6XO(U)+VAO
M;64O]S==R97,OAP+30N,RXQ+PT*;6%I;[EMAIL PROTECTED]/35])3D,@
M+4DO:]M92]P;W-T9W)ER]P:' M-XS+C$O:6YC;'5D92 M22]H;VUE+W!O
MW1GF5S+W!HTT+C,-BXQ+VUA:[EMAIL PROTECTED]:]M92]P;W-T9W)ER]P:' M
M-[EMAIL PROTECTED](O:6YC;'5D92 M22]H;VUE+W!O
MW1GF5S#0HOAP+30N,RXQ+UIE;[EMAIL PROTECTED]:]M92]P;W-T9W)ER]P:' M
M-XS+C$O97AT+WAM;]E'!A= @+4DO:]M92]P;W-T9W)ER]P:' M- T*
M+C,N,2]44U)-( M9R M3S(@(UPF5F97(MEC(UC(UA:6XO:6YT97)N
M86Q?9G5N8W1I;VYS+F,@+6\@;6%I;B]I;G1EFYA;%]F=6X-F-T:6]NRYL
M;PT*+V)I;B]S:!L:6)T;V]L(TMVEL96YT(TM;6]D93UL:6YK(=C8R M
M9R M3S(@+7!R969EBUP:6,@(UR%T: O:]M92]P;W-T9W(-F5S+W!H
MTT+C,N,2]L:6)S(UA=F]I9UV97)S:6]N(UM;V1U;4@(!E'0O8W1Y
M4O8W1Y4N;[EMAIL PROTECTED]W%L+W!H%]M7-Q#0IL+FQO(5X=]M7-Q
M;]L:6)M7-Q;]L:6)M7-Q;YL;R!E'0O;7ES6PO;EB;7ES6PO97)R
M;7-G+FQO(5X=]M7-Q;]L:6)M0T*W%L+VYE=YL;R!E'0O;7ES6PO
M;EB;7ES6PO=FEO;ET92YL;R!E'0O;7ES6PO;EB;7ES6PO%SW=O
MF0N;[EMAIL PROTECTED]W$-FPO;EB;7ES6PO;7E?:6YI=YL;R!E'0O;7ES
M6PO;EB;7ES6PO;7E?;EB+FQO(5X=]M7-Q;]L:6)M7-Q;]M5]S
M=%T:6,N#0IL;R!E'0O;7ES6PO;EB;7ES6PO;7E?;6%L;]C+FQO(5X
M=]M7-Q;]L:6)M7-Q;]M5]R96%L;]C+FQO(5X=]M7-Q;]L:0T*
M8FUYW%L+VUY7V-R96%T92YL;R!E'0O;7ES6PO;EB;7ES6PO;7E?95L
M971E+FQO(5X=]M7-Q;]L:6)M7-Q;]M5]T96UP;F$-FTN;[EMAIL PROTECTED]
M+VUYW%L+VQI8FUYW%L+VUY7V]P96XN;[EMAIL PROTECTED]W%L+VQI8FUYW%L
M+VUF7V-AV5C;G8N;[EMAIL PROTECTED]W%L+VQI#0IB;7ES6PO;7E?F5A9YL
M;R!E'0O;7ES6PO;EB;7ES6PO;7E?=W)I=4N;[EMAIL PROTECTED]W%L+VQI
M8FUYW%L+V5RF]RRYL;R!E T*=]M7-Q;]L:6)M7-Q;]M5]EG)O
MBYL;R!E'0O;7ES6PO;EB;7ES6PO;7E?9V5T=V0N;[EMAIL PROTECTED]W%L
M+VQI8FUYW%L+VT-GE?9EV+FQO(5X=]M7-Q;]L:6)M7-Q;]M9E]P
M86-K+FQO(5X=]M7-Q;]L:6)M7-Q;]M5]M97-S;F,N;[EMAIL PROTECTED]
MW%L#0HO;EB;7ES6PO;69?9ER;F%M92YL;R!E'0O;7ES6PO;EB;7ES
M6PO;69?9FY?97AT+FQO(5X=]M7-Q;]L:6)M7-Q;]M9E]W8PT*;VUP
M+FQO(5X=]M7-Q;]L:6)M7-Q;]T7!E;EB+FQO(5X=]M7-Q;]L
M:6)M7-Q;]S869E;6%L;]C+FQO(5X=]M7-Q;\-FQI8FUYW%L+VUY
M7V%L;]C+FQO(5X=]M7-Q;]L:6)M7-Q;]M9E]F;W)M870N;[EMAIL PROTECTED]
M+VUYW%L+VQI8FUYW%L+VUF7W!A=@N#0IL;R!E'0O;7ES6PO;EB;7ES
M6PO;69?=6YI'!A=@N;[EMAIL PROTECTED]W%L+VQI8FUYW%L+VUY7V9O5N
M+FQO(5X=]M7-Q;]L:0T*8FUYW%L+VUF7VQO861P871H+FQO(5X=]M
M7-Q;]L:6)M7-Q;]M5]P=AR96%D+FQO(5X=]M7-Q;]L:6)M7-Q
M;]M5]T:'(-E]I;FET+FQO(5X=]M7-Q;]L:6)M7-Q;]T:')?;75T
[EMAIL PROTECTED];[EMAIL PROTECTED]W%L+VQI8FUYW%L+VUU;%L;]C+FQO(5X=]M7-Q
M#0IL+VQI8FUYW%L+W-TFEN9RYL;R!E'0O;7ES6PO;EB;7ES6PO95F
M875L=YL;R!E'0O;7ES6PO;EB;7ES6PO;7E?8V]M')EPT*RYL;R!E
M'0O;7ES6PO;EB;7ES6PO87)R87DN;[EMAIL PROTECTED]W%L+VQI8FUYW%L
M+VUY7V]N8V4N;[EMAIL PROTECTED]W%L+VQI8FUYW$-FPO;ES=YL;R!E'0O
M;7ES6PO;EB;7ES6PO;7E?;F5T+FQO(5X=]M7-Q;]L:6)M7-Q;]D
M8G5G+FQO(5X=]M7-Q;]L:6)M#0IYW%L+W-TFUO=BYL;R!E'0O;7ES
M6PO;EB;7ES6POW1RUO=BYL;R!E'0O;7ES6PO;EB;7ES6POW1R
M;FUO=BYL;R!E'0O;0T*7-Q;]L:6)M7-Q;]S=')M86ME+FQO(5X=]M
M7-Q;]L:6)M7-Q;]S=')E;F0N;[EMAIL PROTECTED]W%L+VQI8FUYW%L+W-T
MF9I;P-BYL;R!E'0O;7ES6PO;EB;7ES6PO:7-?')E9FEX+FQO(5X
M=]M7-Q;]L:6)M7-Q;]I;G0RW1R+FQO(5X=]M7-Q;]L:6)M#0IY
MW%L+W-TC)I;G0N;[EMAIL PROTECTED]W%L+VQI8FUYW%L+W-TFENW1R+FQO
M(5X=]M7-Q;]L:6)M7-Q;]S=')C;VYT+FQO(5X= T*+VUYW%L+VQI
M8FUYW%L+W-TF-E;F0N;[EMAIL PROTECTED]W%L+VQI8FUYW%L+V)C:%N9V4N
M;[EMAIL PROTECTED]W%L+VQI8FUYW%L+V)M;W8-F4N;[EMAIL PROTECTED]W%L+VQI
M8FUYW%L+V)M;W9E7W5PYL;R!E'0O;7ES6PO;EB;7ES6PO;]N9VQO
M;FRW1R+FQO(5X=]M7-Q#0IL+VQI8FUYW%L+W-TG1O=6QL+FQO(5X
M=]M7-Q;]L:6)M7-Q;]S=')T;VQL+FQO(5X=]M7-Q;]L:6)M7-Q
M;]C:%R[EMAIL PROTECTED];[EMAIL PROTECTED]W%L+VQI8FUYW%L+V-T7!E+FQO(5X
M=]O=F5R;]A9]O=F5R;]A9YL;R!E'0O-R92]P8W)E;EB+VUA:V5T
M86(-FQERYL;R!E'0O-R92]P8W)E;EB+V=E=YL;R!E'0O-R92]P
M8W)E;EB+W-T=61Y+FQO(5X=]P8W)E+W!CF5L:6(O-R92YL#0IO(5X
M=]P8W)E+W!H%]P8W)E+FQO(5X=]P;W-I]P;W-IYL;R!E'0OV5S
MVEO;B]S97-S:6]N+FQO(5X=]S97-S:6]N+VUO9 T*7V9I;5S+FQO(5X
M=]S97-S:6]N+VUO9%]M;2YL;R!E'0OV5SVEO;B]M;V1?=7-EBYL;R!E
M'0OW1A;F1AF0O87)R87DN;[EMAIL PROTECTED]@-G0OW1A;F1AF0O8F%S938T+FQO
M(5X=]S=%N9%R9]B87-I8U]F=6YC=EO;G,N;[EMAIL PROTECTED])D

Re: [PHP] 'make' PHP4.3.1 returns the use of function`tempnam' isdangerous --- WHY?

2003-03-02 Thread Rasmus Lerdorf
 When I tried to 'make' PHP-4.3.1, it returns warning message and died.  I am
 using RH8.0 + Apache 2.0.44

It didn't die, that is simply the end of the build.  Warnings aren't 
fatal.

(Please do not cc all the lists)

-Rasmus


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



Re: [PHP] 'make' PHP4.3.1 returns the use of function`tempnam' is dangerous --- WHY?

2003-03-02 Thread Patrick LOK

I tried to complete the installation (I did 'make install')  but the test on
'php -l'  didn't return anything; it keeps on running... nothing returns, no
core-dump...

any further help?

Ok! I just want helpers can have a full investigation on the suspected
error.

Best best regards
./pl


Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  When I tried to 'make' PHP-4.3.1, it returns warning message and died.
I am
  using RH8.0 + Apache 2.0.44

 It didn't die, that is simply the end of the build.  Warnings aren't
 fatal.

 (Please do not cc all the lists)

 -Rasmus




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



Re: [PHP] 'make' PHP4.3.1 returns the use of function`tempnam' is dangerous --- WHY?

2003-03-02 Thread Patrick LOK
ooops...  Should be 'php -i'...
./pl


Patrick Lok [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 I tried to complete the installation (I did 'make install')  but the test
on
 'php -l'  didn't return anything; it keeps on running... nothing returns,
no
 core-dump...

 any further help?

 Ok! I just want helpers can have a full investigation on the suspected
 error.

 Best best regards
 ./pl


 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   When I tried to 'make' PHP-4.3.1, it returns warning message and died.
 I am
   using RH8.0 + Apache 2.0.44
 
  It didn't die, that is simply the end of the build.  Warnings aren't
  fatal.
 
  (Please do not cc all the lists)
 
  -Rasmus
 





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



[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-02 Thread Jean-Christian Imbeault
Moriyoshi Koizumi wrote:
You can avoid this issue by configuring a PHP build 
with --enable-zend-multibyte option and set mbstring.script_encoding to 
SJIS.
Or better yet, make sure that all pages are in EUC-JP and use that for 
internal encoding too, right :)

And also translate all user input to internal encoding by setting 
encoding_translation = On.

Doing those two things should let me use the regular PHP addslashes().

Jc

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