[PHP] Re: Code and Good Design Methods

2003-07-13 Thread rush
"Dan J. Rychlik" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am reading PHP and MySQL web development 2nd edition book.  Chapter 6
talks about displaying >dynamic web content using class objects.  For the
type of project that I am building, this is not optimal.  >How do I keep my
self from having html mixed with my PHP code?  In other words how do I
serperate the >two.  I need to concentrate on writing good code and not
designing a nice looking website.  (someone else >is going to do that)


You could try TemplateTamer, it offers good separation of html and code, has
"clean" templates, and it commes with IDE to support template based
development.


rush
--
http://www.templatetamer.com/




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



Re: [PHP] Strange Problem

2003-07-13 Thread Curt Zirzow
Haseeb <[EMAIL PROTECTED]> wrote:
>  
>  
> Hi all,
> this is a very strange problem. i don't know where i am doing something that
> is causing this. the problem is that i am working on a web portal  entirely
> in  php. i have a few hidden pages. that do the queries to the DB. now when
> i redirect to any page for query i get this error
> CGI Error
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
>  
> strangely  when i hit F5 or refresh the page i get redirected to the desired
> page. i have checked for any whitespaces. there are none. i have checked and
> double checked this. i am using win2k,IIS, php 4.3.0
>  

Have you checked your log file, usually there is an error in the log
file telling you what went wrong.


> again i have checked all the files for any space left that could be causing
> problem but i found none.

This usually happens when non http headers are sent to the server when
it wasnt expecting them, php should be handling this. But to check this
make sure you try sending out a header('Content-Type: text/plain') first
thing in the script then dont do a redirect and see if some text is
showing up that shouldn't be.

>  
> i hope i make my self clear.
> Haseeb
  

Curt.
-- 


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



[PHP] Strange Problem

2003-07-13 Thread Haseeb






 
 
Hi all,
this is a very strange problem. i don't know where i am doing something that is causing this. the problem is that i am working on a web portal  entirely in  php. i have a few hidden pages. that do the queries to the DB. now when i redirect to any page for query i get this error
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
 
strangely  when i hit F5 or refresh the page i get redirected to the desired page. i have checked for any whitespaces. there are none. i have checked and double checked this. i am using win2k,IIS, php 4.3.0
 
again i have checked all the files for any space left that could be causing problem but i found none.
 
i hope i make my self clear.
Haseeb
 







  IncrediMail - Email has finally evolved - Click Here

Re: [PHP] Is it possible to test an uploaded file to check the type?

2003-07-13 Thread Gerard Samuel
Gerard Samuel wrote:

A client-supplied value isn't going to be too useful - it can be 
spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this 
myself).

Then my apologies.  I thought php determined the file type on upload, 
and not rely on user input as your're saying.
Makes me rethink some of my own code :) 
Looking for opinions.  Can a spoofed uploaded file hurt a script or a 
webserver??
Reason why Im asking is because, I looked over the magic.mime file on my 
server, and I see that it
doesn't support flash files (I may be wrong), of which I currently allow 
flash files to be uploaded.
So who knows what else it may not support.
I guess, can it really be bad for your script, your server, and/or your 
health??

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


[PHP] Lots of PHP

2003-07-13 Thread César Aracena
Hi all,

I'm in the early steps of the design of a portal kid of site dedicated to
Fly Fishing and one of the most relevant section will be a "Shopping Guru"
that visitors will be able to use to determine what is the best equipment
they should buy or bring, in order to catch the size and kind of trout
they want to get, wherever they want to go and whenever they decide to go.

This sounds simple, but I have to take in consideration that my Country
has LOTS of places to fish and every time of year it's different as trout
are never in the same place, so equipments to be used are different
depending the time of year (grouped in two weeks), etc.

A solution will be to start writing several miles of text into text files
or databases so PHP can fire these up and seek for a solution depending on
what the visitor has chosen, but this is an extremely log solution,
specially having in mind that this site will be in two languages.

What would be the best solution for this? I even want to let visitors
select the equipment (what they own), the place and the time of year and
get the kind of trout they will be fishing, or maybe even more ways
around... is this possible? has anyone made something so "intelligent" in
PHP before?

I use PHP 4+ and MySQL 3.4

Thanks in advance,

---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel/Fax: +54.299.477-4532
Cipolletti, Rio Negro
R8324BEG
Argentina




---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar



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



php-general Digest 14 Jul 2003 03:19:12 -0000 Issue 2174

2003-07-13 Thread php-general-digest-help

php-general Digest 14 Jul 2003 03:19:12 - Issue 2174

Topics (messages 155004 through 155037):

Re: Weird Date problem driving me crazy...
155004 by: John W. Holmes
155013 by: Boaz Yahav

Re: Need PHP on Win2000 Pro
155005 by: Simon Fredriksson
155008 by: John Nichel

Re: Private and protected variables in PHP 5?
155006 by: Marek Kilimajer

Re: Is it possible to test an uploaded file to check the type?
155007 by: Marek Kilimajer
155009 by: Gerard Samuel
155010 by: David Otton
155036 by: Gerard Samuel

Re: Code and Good Design Methods
155011 by: Ray Hunter

Re: How does PHP interact when using Java?
155012 by: Ray Hunter

About fopen() for write and PHP settings
155014 by: George Papatheodorou

Turning string into a table
155015 by: zavaboy

MySql Rollback in PHP within a website
155016 by: bruce
155017 by: John W. Holmes

Replacing newlines (\n) with smething else
155018 by: Jason Giangrande
155020 by: J. Cox
155021 by: Jason Giangrande
155022 by: David Otton
155023 by: Jason Giangrande
155025 by: David Otton
155026 by: Jason Giangrande

PHP weirdness with files named tos.php
155019 by: motorpsychkill
155024 by: John A. Thomason

Re: Replacing newlines (n) with smething else
155027 by: David Nicholson
155029 by: Jason Giangrande

Re: session data missing
155028 by: ulf sundin

ImageTTFText for mac? win? linux?
155030 by: Miranda, Joel Louie M
155034 by: Ralph Guzman

Grabbing info from other Sites
155031 by: Ow Mun Heng
155033 by: Michael Geier
155035 by: Ow Mun Heng
155037 by: Suhas Pharkute

Client script opensource plea
155032 by: Larry Brown

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]


--
--- Begin Message ---
Boaz Yahav wrote:

I have two date strings coming out from MySQL.
Both fields are defined as datetime.
When i come to print them like this :

Echo"Ticket Opened : " . date("l, F jS Y
H:i",$row->OpenDate) . "";
Echo"Problem Start : " .  date("l, F jS Y
H:i",$row->ProblemStart) . "";
I get :

Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Thursday, January 1st 1970 02:33
Notice that the 2nd date is wrong and it's some kind of default that the
function
returns. Only if i add strtotime() and only to the 2nd field do i get
the correct answer :
Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Saturday, July 12th 2003 20:36
date() expects a UNIX timestamp to be passed to it. MySQL does not store 
dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns. 
strtotime() will take a MySQL timestamp, though, and convert it to a 
UNIX timestamp.

Also look into using DATE_FORMAT() in your query to format the data 
there so you don't have to do anything in PHP.

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com




--- End Message ---
--- Begin Message ---
Thanks John, your answer is right on the $$$.
Changing the query to  something like : SELECT
UNIX_TIMESTAMP(ProblemStart) as ProblemStart

solved the problem.

Do i feel sheepish... actually double sheepish cause i already solved
this
long ago and forgot about it :(

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 13, 2003 5:01 PM
To: Boaz Yahav
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Weird Date problem driving me crazy...


Boaz Yahav wrote:

> I have two date strings coming out from MySQL.
> Both fields are defined as datetime.
> 
> When i come to print them like this :
> 
>   Echo"Ticket Opened : " . date("l, F jS Y
> H:i",$row->OpenDate) . "";
>   Echo"Problem Start : " .  date("l, F jS Y
> H:i",$row->ProblemStart) . "";
> 
> I get :
> 
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Thursday, January 1st 1970 02:33
> 
> Notice that the 2nd date is wrong and it's some kind of default that 
> the function returns. Only if i add strtotime() and only to the 2nd 
> field do i get the correct answer :
> 
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Saturday, July 12th 2003 20:36

date() expects a UNIX timestamp to be passed to it. MySQL does not store

dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns. 
strtotime() will take a MySQL timestamp, though, and convert it to a 
UNIX timestamp.

Also look into using DATE_FORMAT() in your query to format the data 
there so you don't have to do anything in PHP.

-- 
---John

Re: [PHP] Grabbing info from other Sites

2003-07-13 Thread Suhas Pharkute
Why don't you use MSN services to get quotes. MSN does care for login. I am
using this to get quotes after 15 minutes on my Cell Phone.

I am using culr functions to get it.

Suhas
_

Encrypt your PHP code for FREE at

http://encphp.sspsoft.com

_

- Original Message - 
From: "Ow Mun Heng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 7:43 PM
Subject: [PHP] Grabbing info from other Sites


Hi,

I have this need/want to grab information from sites for my own
usage and wondering how to do it.

Here's an example.

1. Log into finance.yahoo.com (assuming I need to log on)
2. Type the list of shares I want
3. Let Yahoo process it
4. Use PHP or some other scripting language to pull the data and put it into
my database.

Is this possible at all?



Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: php-general Digest 13 Jul 2003 14:58:27 - Issue 2173



php-general Digest 13 Jul 2003 14:58:27 - Issue 2173

Topics (messages 154985 through 155003):

Re: touch file on shared web server?
154985 by: Paul O'Neil
154991 by: Jason Wong

Re: Code and Good Design Methods
154986 by: zbranigan
154987 by: zbranigan
154988 by: Dan J. Rychlik
154994 by: Ray Hunter
154995 by: Robert Cummings

Re: OK, So I am new to these List. Win2000 help!
154989 by: John Nichel
155002 by: John Nichel

Re: Newbie Directory question
154990 by: olinux

Re: Mailing list server with PHP frontend
154992 by: Juan Nin
154993 by: Manuel Lemos
154996 by: Paul Chvostek

How does PHP interact when using Java?
154997 by: Jan Bro

Weird Date problem driving me crazy...
154998 by: Boaz Yahav

php script billing receipt
154999 by: Duncan

Re: Need PHP on Win2000 Pro
155000 by: Burhan Khalid
155001 by: John A. Thomason

Re: dump $_POST into variables
155003 by: Marek Kilimajer

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]


--

-- 
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] Is it possible to test an uploaded file to check the type?

2003-07-13 Thread Gerard Samuel
David Otton wrote:

$_FILES['userfile']['type']

   The mime type of the file, if the browser provided this
   information. An example would be "image/gif".
 

So,  check $_FILES['userfile']['type'] against a set of allowed file 
types, and you're set...
   

A client-supplied value isn't going to be too useful - it can be spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this myself).
Then my apologies.  I thought php determined the file type on upload, 
and not rely on user input as your're saying.
Makes me rethink some of my own code :)

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


RE: [PHP] Grabbing info from other Sites

2003-07-13 Thread Ow Mun Heng
Hi,

Unfortunately, Yahoo.com is just an example.. The site really does
need Login.

The thing is this, I'm developing for an internal site, (My dept) but I need
to access other dept's site to get info but unfortunately They won't give me
access to query the db directly. Prefering me to go through the site and
input accordingly to grab the data. 

I just find this to be "SO" troublesome as I need to get this data
for every week. Week In.. Week Out and for a lot of items..

But I will take a look at SNOOPY. (hey.. isn't the name snoopy
copyrighted??)

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Michael Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 9:47 AM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Grabbing info from other Sites


assuming the login isn't necessary (which it probably is), you could use 
something like Snoopy (http://sourceforge.net/projects/snoopy/) to POST/GET
the 
required web page and process as required.

Quoting Ow Mun Heng <[EMAIL PROTECTED]>:

> Hi,
> 
>   I have this need/want to grab information from sites for my own
> usage and wondering how to do it.
> 
>   Here's an example.
> 
> 1. Log into finance.yahoo.com (assuming I need to log on)
> 2. Type the list of shares I want
> 3. Let Yahoo process it 
> 4. Use PHP or some other scripting language to pull the data and put it
into
> my database.
> 
> Is this possible at all?
> 
> 
> 
> Cheers,
> Mun Heng, Ow
> H/M Engineering
> Western Digital M'sia 
> DID : 03-7870 5168
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 13, 2003 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: php-general Digest 13 Jul 2003 14:58:27 - Issue 2173
> 
> 
> 
> php-general Digest 13 Jul 2003 14:58:27 - Issue 2173
> 
> Topics (messages 154985 through 155003):
> 
> Re: touch file on shared web server?
>   154985 by: Paul O'Neil
>   154991 by: Jason Wong
> 
> Re: Code and Good Design Methods
>   154986 by: zbranigan
>   154987 by: zbranigan
>   154988 by: Dan J. Rychlik
>   154994 by: Ray Hunter
>   154995 by: Robert Cummings
> 
> Re: OK, So I am new to these List. Win2000 help!
>   154989 by: John Nichel
>   155002 by: John Nichel
> 
> Re: Newbie Directory question
>   154990 by: olinux
> 
> Re: Mailing list server with PHP frontend
>   154992 by: Juan Nin
>   154993 by: Manuel Lemos
>   154996 by: Paul Chvostek
> 
> How does PHP interact when using Java?
>   154997 by: Jan Bro
> 
> Weird Date problem driving me crazy...
>   154998 by: Boaz Yahav
> 
> php script billing receipt
>   154999 by: Duncan
> 
> Re: Need PHP on Win2000 Pro
>   155000 by: Burhan Khalid
>   155001 by: John A. Thomason
> 
> Re: dump $_POST into variables
>   155003 by: Marek Kilimajer
> 
> 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]
> 
> 
> --
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


===
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

---
 This email sent using CDM Sports Webmail v3.1
  [ http://webmail.cdmsports.com ]

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



RE: [PHP] ImageTTFText for mac? win? linux?

2003-07-13 Thread Ralph Guzman

http://www.codephobia.com/tutorials/view.php3?idnum=6
-Original Message-
From: Miranda, Joel Louie M [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 11, 2003 12:04 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] ImageTTFText for mac? win? linux?

Im confused.. I know I have TrueType support on php. Now I wonder where
will
I put my fonts into my server? Like verdana, etc just a sample. Does
this
means even macintosh truetype fonts I can also load in?

--
Thank you,
Louie Miranda ([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] Grabbing info from other Sites

2003-07-13 Thread Michael Geier
assuming the login isn't necessary (which it probably is), you could use 
something like Snoopy (http://sourceforge.net/projects/snoopy/) to POST/GET the 
required web page and process as required.

Quoting Ow Mun Heng <[EMAIL PROTECTED]>:

> Hi,
> 
>   I have this need/want to grab information from sites for my own
> usage and wondering how to do it.
> 
>   Here's an example.
> 
> 1. Log into finance.yahoo.com (assuming I need to log on)
> 2. Type the list of shares I want
> 3. Let Yahoo process it 
> 4. Use PHP or some other scripting language to pull the data and put it into
> my database.
> 
> Is this possible at all?
> 
> 
> 
> Cheers,
> Mun Heng, Ow
> H/M Engineering
> Western Digital M'sia 
> DID : 03-7870 5168
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 13, 2003 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: php-general Digest 13 Jul 2003 14:58:27 - Issue 2173
> 
> 
> 
> php-general Digest 13 Jul 2003 14:58:27 - Issue 2173
> 
> Topics (messages 154985 through 155003):
> 
> Re: touch file on shared web server?
>   154985 by: Paul O'Neil
>   154991 by: Jason Wong
> 
> Re: Code and Good Design Methods
>   154986 by: zbranigan
>   154987 by: zbranigan
>   154988 by: Dan J. Rychlik
>   154994 by: Ray Hunter
>   154995 by: Robert Cummings
> 
> Re: OK, So I am new to these List. Win2000 help!
>   154989 by: John Nichel
>   155002 by: John Nichel
> 
> Re: Newbie Directory question
>   154990 by: olinux
> 
> Re: Mailing list server with PHP frontend
>   154992 by: Juan Nin
>   154993 by: Manuel Lemos
>   154996 by: Paul Chvostek
> 
> How does PHP interact when using Java?
>   154997 by: Jan Bro
> 
> Weird Date problem driving me crazy...
>   154998 by: Boaz Yahav
> 
> php script billing receipt
>   154999 by: Duncan
> 
> Re: Need PHP on Win2000 Pro
>   155000 by: Burhan Khalid
>   155001 by: John A. Thomason
> 
> Re: dump $_POST into variables
>   155003 by: Marek Kilimajer
> 
> 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]
> 
> 
> --
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


===
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

---
 This email sent using CDM Sports Webmail v3.1
  [ http://webmail.cdmsports.com ]

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



[PHP] Client script opensource plea

2003-07-13 Thread Larry Brown
This, most certainly OT, is a plea for fellow developers oriented in
OpenSource solutions to help resolve a problem in case you have dealt with
it before.  I have written a PHP app that uses function keys at times to
help speed data processing for my client VIA javascript.  This app works
fine when the client is using IE or Netscape on the windows platform.
However, when the client is on Linux, the function keys are not being
captured on Mozilla or Netscape.  I presented this problem in my Javascript
mailing list and on the RedHat mailing list and no one seems to have had any
experience dealing with it and consequently I haven't a work around.  My
apologies for presenting a clearly OT question, but I know there are a ton
of experienced developers here and I reaching for someone who might have
dealt with this.

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




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



[PHP] Grabbing info from other Sites

2003-07-13 Thread Ow Mun Heng
Hi,

I have this need/want to grab information from sites for my own
usage and wondering how to do it.

Here's an example.

1. Log into finance.yahoo.com (assuming I need to log on)
2. Type the list of shares I want
3. Let Yahoo process it 
4. Use PHP or some other scripting language to pull the data and put it into
my database.

Is this possible at all?



Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: php-general Digest 13 Jul 2003 14:58:27 - Issue 2173



php-general Digest 13 Jul 2003 14:58:27 - Issue 2173

Topics (messages 154985 through 155003):

Re: touch file on shared web server?
154985 by: Paul O'Neil
154991 by: Jason Wong

Re: Code and Good Design Methods
154986 by: zbranigan
154987 by: zbranigan
154988 by: Dan J. Rychlik
154994 by: Ray Hunter
154995 by: Robert Cummings

Re: OK, So I am new to these List. Win2000 help!
154989 by: John Nichel
155002 by: John Nichel

Re: Newbie Directory question
154990 by: olinux

Re: Mailing list server with PHP frontend
154992 by: Juan Nin
154993 by: Manuel Lemos
154996 by: Paul Chvostek

How does PHP interact when using Java?
154997 by: Jan Bro

Weird Date problem driving me crazy...
154998 by: Boaz Yahav

php script billing receipt
154999 by: Duncan

Re: Need PHP on Win2000 Pro
155000 by: Burhan Khalid
155001 by: John A. Thomason

Re: dump $_POST into variables
155003 by: Marek Kilimajer

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]


--

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



[PHP] ImageTTFText for mac? win? linux?

2003-07-13 Thread Miranda, Joel Louie M
Im confused.. I know I have TrueType support on php. Now I wonder where will
I put my fonts into my server? Like verdana, etc just a sample. Does this
means even macintosh truetype fonts I can also load in?

--
Thank you,
Louie Miranda ([EMAIL PROTECTED])

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



Re: [PHP] Replacing newlines (n) with smething else

2003-07-13 Thread Jason Giangrande
My problem is solved.  Thank you to everyone who responded.

Jason

On Sun, 2003-07-13 at 18:33, David Nicholson wrote:
> Hello,
> 
> 
> This is a reply to an e-mail that you wrote on Sun, 13 Jul 2003 at 23:12,
> lines prefixed by '>' were originally written by you.
> 
> Maybe the browser you are using to fill in the form field is using a
> different type of line break. Although I have never seen it done, r by
> itself can be used to cause a line break and if that is being done your
> code will not be detecting it.
> 
> David
> 
> -- 
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
> 
>   Professional Web Development by David Nicholson
> http://www.djnicholson.com/
> 
> QuizSender.com - How well do your friends actually know you?
>  http://www.quizsender.com/
> (developed entirely in PHP)


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



Re: [PHP] session data missing

2003-07-13 Thread ulf sundin
I'm not the admin on the server, so I'll have to manage with the software
provided. And that is php 4.0.6.
I've tried a number of ways to store variables in the session file. This
works:

session_start();
$foo = 'bar';
session_register('foo');

then after session_write_close(); or end of script:
echo $HTTP_SESSION_VARS['foo']; will output 'bar'.

just adding variables directly into the HTTP_SESSION_VARS array won't make
them stick in the session file. Use of session_register() seems to be
required.

Ulf

"Mike Ford" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> > -Original Message-
> > From: Kevin Stone [mailto:[EMAIL PROTECTED]
> > Sent: 09 July 2003 20:30
> >
> > - Original Message -
> > From: "ulf sundin" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 09, 2003 1:00 PM
> > Subject: Re: [PHP] session data missing
> >
> >
> > > ok, so now the variable names are registred and stored in
> > the file. But
> > > without values.
> > > check this:
> > >
> > > --firstpage.php
> > > session_start()
> > > session_register('foo');
> > > $HTTP_SESSION_VARS['foo'] = 'bar';
> > > echo $HTTP_SESSION_VARS['foo']; //outputs bar;
> > >
> > > transport by a href to:
> > > secondpage.php
> > > session_start();
> > > echo $HTTP_SESSION_VARS['foo']; //outputs nothing
> > >
> > > ---
> > > checking the contents of the file called /tmp/sess_{session_id}:
> > >  !foo|
> > (snip)
> >
> >
> > Make a choice here..
> >
> > => session_register('foo');
> > => $HTTP_SESSION_VARS['foo'] = 'bar';
> >
> > Use either the session_register() function or the session
> > global array.  Not
> > both.
>
> Not true -- $HTTP_SESSION_VARS is *not* like $_SESSION, and its values are
*not* auto-registered.  In fact, I still have my copy of the 4.0.6 manual
around, and it specifically gives this as an example:
>
> > Example 1. Registering a variable
> >
> >  > session_register("count");
> > $HTTP_SESSION_VARS["count"]++;
> > ?>
>
> However, it's a little unclear on whether this should still work
regardless of the register_globals setting, as it also gives this as an
example:
>
> > Example 2. Registering a variable with register_globals enabled
> >
> >  > session_register("count");
> > $count++;
> > ?>
>
> I guess I'd have to go away and try it to be sure of what behaviour occurs
for each setting of register_globals -- but there seems little point given
that using $_SESSION has been much the best option for several versions now!
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



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



Re: [PHP] Replacing newlines (n) with smething else

2003-07-13 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Sun, 13 Jul 2003 at 23:12,
lines prefixed by '>' were originally written by you.

Maybe the browser you are using to fill in the form field is using a
different type of line break. Although I have never seen it done, r by
itself can be used to cause a line break and if that is being done your
code will not be detecting it.

David

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



Re: [PHP] Replacing newlines (\n) with smething else

2003-07-13 Thread Jason Giangrande
It's really strange because I type the following into the form field.

Test
Test

Test

And get this as output.
Test Test Test

Do form fields not preserve spacing or line breaks?

Jason


On Sun, 2003-07-13 at 17:45, David Otton wrote:
> On 13 Jul 2003 17:27:04 -0400, you wrote:
> 
> >Perhaps.  When getting text from a form field, what is substituted for a
> >newline (i.e. when someone hits enter).
> 
> You can work it out for yourself. Run over the string, displaying each
> character as it's ASCII equivalent with ord(). Eg
> 
>   for ($i = 0; $i < strlen($article); $i++) {
>   echo ("'" . $article[$i] . "'=" . ord($article[$i]) . ', ');
>   }
> 
> (My guess is that you're seeing the difference between a wrapped line and
> the user explicitly hitting enter)
> 


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



Re: [PHP] Replacing newlines (\n) with smething else

2003-07-13 Thread David Otton
On 13 Jul 2003 17:27:04 -0400, you wrote:

>Perhaps.  When getting text from a form field, what is substituted for a
>newline (i.e. when someone hits enter).

You can work it out for yourself. Run over the string, displaying each
character as it's ASCII equivalent with ord(). Eg

for ($i = 0; $i < strlen($article); $i++) {
echo ("'" . $article[$i] . "'=" . ord($article[$i]) . ', ');
}

(My guess is that you're seeing the difference between a wrapped line and
the user explicitly hitting enter)


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



[PHP] Re: PHP weirdness with files named tos.php

2003-07-13 Thread John A. Thomason
I'm running Apache 2/php/perl/mysql on Win2000 and tos.php worked.

john
[EMAIL PROTECTED]

"Motorpsychkill" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm running PHP 4.3.1 with Apache 2.0 on Windows XP.  Everything works
great
> except if I name a file tos.php, Apache won't serve it.  I'm not really
sure
> if this is an Apache or PHP thing.  Can anyone else replicate this error
on
> their machines?
>
> Thanks!
>



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



Re: [PHP] Replacing newlines (\n) with smething else

2003-07-13 Thread Jason Giangrande
Perhaps.  When getting text from a form field, what is substituted for a
newline (i.e. when someone hits enter).

Jason

On Sun, 2003-07-13 at 17:21, David Otton wrote:
> On 13 Jul 2003 17:01:24 -0400, you wrote:
> 
> >I'm trying to replace newlines with something else.  For this example
> >I'll use  as the thing to replace a newline with.  This is what I
> >tried and it doesn't work.
> 
> nl2br() in the specific case
> 
> >$article = str_replace("\n", "", $article);
> >
> >What am I doing wrong?  $article is the string to replace the newlines
> >in.  I tried this with a period and that works as expected.  Can I not
> >replace newlines this way?
> 
> But in the general case, your code looks ok to me.
> 
> echo (str_replace("\n", "", "foo\nbar"));
> 
> returns "foobar" here. Maybe $article doesn't contain what you think it
> does?
> 
> (BTW, I prefer to replace "\n" with "\n", but that's just a style
> thing.)
> 


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



Re: [PHP] Replacing newlines (\n) with smething else

2003-07-13 Thread David Otton
On 13 Jul 2003 17:01:24 -0400, you wrote:

>I'm trying to replace newlines with something else.  For this example
>I'll use  as the thing to replace a newline with.  This is what I
>tried and it doesn't work.

nl2br() in the specific case

>$article = str_replace("\n", "", $article);
>
>What am I doing wrong?  $article is the string to replace the newlines
>in.  I tried this with a period and that works as expected.  Can I not
>replace newlines this way?

But in the general case, your code looks ok to me.

echo (str_replace("\n", "", "foo\nbar"));

returns "foobar" here. Maybe $article doesn't contain what you think it
does?

(BTW, I prefer to replace "\n" with "\n", but that's just a style
thing.)


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



Re: [PHP] Re: Replacing newlines (\n) with smething else

2003-07-13 Thread Jason Giangrande
I did not know about nl2br.  Thanks.

But what if say I want to replace a newline with something else, say
.  How would I do that?

Jason


On Sun, 2003-07-13 at 17:09, J. Cox wrote:
> "Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > I'm trying to replace newlines with something else.  For this example
> > I'll use  as the thing to replace a newline with.  This is what I
> > tried and it doesn't work.
> >
> > $article = str_replace("\n", "", $article);
> >
> > What am I doing wrong?  $article is the string to replace the newlines
> > in.  I tried this with a period and that works as expected.  Can I not
> > replace newlines this way?
> 
> why not just:
> 
> $article = nl2br($article);
> 
> --
> J. Cox
> http://www.xaraya.com
> 
> 
> 


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



[PHP] Re: Replacing newlines (\n) with smething else

2003-07-13 Thread J. Cox

"Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to replace newlines with something else.  For this example
> I'll use  as the thing to replace a newline with.  This is what I
> tried and it doesn't work.
>
> $article = str_replace("\n", "", $article);
>
> What am I doing wrong?  $article is the string to replace the newlines
> in.  I tried this with a period and that works as expected.  Can I not
> replace newlines this way?

why not just:

$article = nl2br($article);

--
J. Cox
http://www.xaraya.com




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



[PHP] PHP weirdness with files named tos.php

2003-07-13 Thread motorpsychkill
I'm running PHP 4.3.1 with Apache 2.0 on Windows XP.  Everything works great
except if I name a file tos.php, Apache won't serve it.  I'm not really sure
if this is an Apache or PHP thing.  Can anyone else replicate this error on
their machines?

Thanks!


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



[PHP] Replacing newlines (\n) with smething else

2003-07-13 Thread Jason Giangrande
Hi,

I'm trying to replace newlines with something else.  For this example
I'll use  as the thing to replace a newline with.  This is what I
tried and it doesn't work.

$article = str_replace("\n", "", $article);

What am I doing wrong?  $article is the string to replace the newlines
in.  I tried this with a period and that works as expected.  Can I not
replace newlines this way?

Thanks,
Jason Giangrande




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



Re: [PHP] MySql Rollback in PHP within a website

2003-07-13 Thread John W. Holmes
bruce wrote:
I have a question. I need to be able to try to perform a database update,
but if it doesn't succeed, I need to be able to rollback the changes, and to
inform the user that the changes didn't succeed.
I've looked at the MySql site, and can see somewhat how the Commit/RollBack
functions work. However, I'm not sure how to create the required PHP code to
implement this kind of process...
Basically I need to:

Create query...
Perform Update on the table(s)
Perform my check(s)
If the checks fail
alert user
rollback updates
else
success
It's my understanding that I need to somehow set "START TRANSACTION" prior
to beginning the update. But I'm not sure how to do that within the PHP
code... Nor am I sure if there's something else I need to do...
$rs1 = mysql_query("START TRANSACTION");

$rs2 = mysql_query($query1);
$rs3 = mysql_query($query2);
if($error)
{ $rsx = mysql_query("ROLLBACK"); }
else
{ $rsx = mysql_query("COMMIT"); }
Use mysql_error() or mysql_errno() to see if an error occurred.

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





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


[PHP] MySql Rollback in PHP within a website

2003-07-13 Thread bruce
Hey...

I have a question. I need to be able to try to perform a database update,
but if it doesn't succeed, I need to be able to rollback the changes, and to
inform the user that the changes didn't succeed.

I've looked at the MySql site, and can see somewhat how the Commit/RollBack
functions work. However, I'm not sure how to create the required PHP code to
implement this kind of process...

Basically I need to:

Create query...
Perform Update on the table(s)
Perform my check(s)
If the checks fail
alert user
rollback updates
else
success

It's my understanding that I need to somehow set "START TRANSACTION" prior
to beginning the update. But I'm not sure how to do that within the PHP
code... Nor am I sure if there's something else I need to do...

Any examples/hints/sample code will be appreciated. Thanks for any
assistance!

Regards,

Bruce
[EMAIL PROTECTED]
(925) 866-2790



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



[PHP] Turning string into a table

2003-07-13 Thread zavaboy
Is there a way to make for example:

// (Column info)
// String 1:
[This column holds
[Col 1]
[Col 2]]
[This second column holds
[Col 3]
[Col 4]]

// (Row)
// String 2:
[Col 1 (row1)]
[Col 2 (row1)]
[Col 3 (row1)]
[Col 4 (row1)]

// (Row)
// String 3:
[Col 1 (row2)]
[Col 2 (row2)]
[Col 3 (row2)]
[Col 4 (row2)]

// How do I turn the above strings into a table?
// Like this:



This column holds
This second column holds


Col 1
Col 2
Col 3
Col 4


Col 1 (row 1)
Col 2 (row 1)
Col 3 (row 1)
Col 4 (row 1)


Col 1 (row 2)
Col 2 (row 2)
Col 3 (row 2)
Col 4 (row 2)



You get the idea...
So, any idea how to do that?
I want it to work correctly no matter how many rows and columns there are.

-- 

- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com



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



[PHP] About fopen() for write and PHP settings

2003-07-13 Thread George Papatheodorou
First of all I apology for my poor use of English of my newbish(?)
questions because I didn't find any solutions the first time I e-mailed
this list. What my problem is:
I am on a server that has these configurations like these:
http://kainga.quasarnet.org/php.php . Let's say my username is user1 and
server files' owner is httpd  . I have a script in my public html dir
that tries to fopen("./somefile.txt", "w") [note: is_writable for this
file returns false but its permissions are rw-rw-r--) but it always
fails. However, when the servers' owner changed the somefile.txt's owner
to httpd the script could write to it without any problem. Is there any
way that I can make the script write to somefile.txt without changing
its owner to httpd (I even changed the file's permissions to rwx-rwx-rwx
and it still wouldn't let the script write to it)? I really need help
with this and I hope it can be solved easily. 
 
PS. Whatever I did PHP would return false on is_writable, which returned
true when the file's owner changed to httpd.
 
Thank you in advance,
 
Arty2 
 


RE: [PHP] Weird Date problem driving me crazy...

2003-07-13 Thread Boaz Yahav
Thanks John, your answer is right on the $$$.
Changing the query to  something like : SELECT
UNIX_TIMESTAMP(ProblemStart) as ProblemStart

solved the problem.

Do i feel sheepish... actually double sheepish cause i already solved
this
long ago and forgot about it :(

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 13, 2003 5:01 PM
To: Boaz Yahav
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Weird Date problem driving me crazy...


Boaz Yahav wrote:

> I have two date strings coming out from MySQL.
> Both fields are defined as datetime.
> 
> When i come to print them like this :
> 
>   Echo"Ticket Opened : " . date("l, F jS Y
> H:i",$row->OpenDate) . "";
>   Echo"Problem Start : " .  date("l, F jS Y
> H:i",$row->ProblemStart) . "";
> 
> I get :
> 
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Thursday, January 1st 1970 02:33
> 
> Notice that the 2nd date is wrong and it's some kind of default that 
> the function returns. Only if i add strtotime() and only to the 2nd 
> field do i get the correct answer :
> 
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Saturday, July 12th 2003 20:36

date() expects a UNIX timestamp to be passed to it. MySQL does not store

dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns. 
strtotime() will take a MySQL timestamp, though, and convert it to a 
UNIX timestamp.

Also look into using DATE_FORMAT() in your query to format the data 
there so you don't have to do anything in PHP.

-- 
---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals - www.phparch.com





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



Re: [PHP] How does PHP interact when using Java?

2003-07-13 Thread Ray Hunter
Not to sure how they work together in a php environment, however another
alternative it so use php in a java (servlet,j2ee) environment.  It is
harder to set up, however, there are not as many errors. Sometimes there
is a performance increase.

--
BigDog

On Sun, 2003-07-13 at 01:50, Jan Bro wrote:
> Hi,
> I've just got PHP working with Java. It connects to a remote Oracle DB
> with Java and without the Oracle Client installed on my machine,
> it's sure a beauty. What I was wondering, what's behind it, I mean how
> does it work? I transfer Objects in Java and get data out. How do PHP
> and Java interact, after all they are two different technologies.
> 
> I've searched google and pretty much every site I could think off, but
> I've found nothing more than a setup tutorial.
> 
> By the way, I should mention if you have them interact, Apache + PHP
> doesn't like java packages at all. PHP blows off with a severe error
> message.
> 
> thx
> Jan Bro


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



Re: [PHP] Code and Good Design Methods

2003-07-13 Thread Ray Hunter
True xsl(t) is a language in and of itself along with xpath, xpointer,
and a host of others.

However, it is safe to point out that this is another alternative that
can be reviewed. It possibly may be the hardest to incorporate; however,
it needs to be mentioned as well.

--
BigDog


On Sun, 2003-07-13 at 01:20, Robert Cummings wrote:
> Let's be honest, XSL is is one big logic step itself -- moreover it's a
> whole other language to learn.
> 
> Cheers,
> Rob.
> 
> On Sun, 2003-07-13 at 02:07, Ray Hunter wrote:
> > Also u could build your own system that is php xml and xslt based. That
> > will really help you separate the logic from the presentation.
> > 
> > Check out (dom)xml and (dom)xslt. Sometimes there is still logic in the
> > presentation with template systemswith xslt however, it might be to
> > much for the design (interface) guys.
> > 
> > Those should help u out.
> > 
> > --
> > BigDog
> > 
> > 
> > On Sat, 2003-07-12 at 20:08, Dan J. Rychlik wrote:
> > > I am reading PHP and MySQL web development 2nd edition book.  Chapter 6 talks 
> > > about displaying dynamic web content using class objects.  For the type of 
> > > project that I am building, this is not optimal.  How do I keep my self from 
> > > having html mixed with my PHP code?  In other words how do I serperate the two.  
> > > I need to concentrate on writing good code and not designing a nice looking 
> > > website.  (someone else is going to do that)  
> > > 
> > > Can I assign include() statements to a variable ?  How would you guys accomplish 
> > > this?
> > > 
> > > Thanks so much in advance,
> > > Daniel 
> > 
> > 
> > -- 
> > 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] Is it possible to test an uploaded file to check the type?

2003-07-13 Thread David Otton
On Sun, 13 Jul 2003 13:32:00 -0400, you wrote:

>The upload process, already collects info on file types when you upload.
> From the manual ->
>
>> $_FILES['userfile']['type']
>>
>> The mime type of the file, if the browser provided this
>> information. An example would be "image/gif".
>>
>So,  check $_FILES['userfile']['type'] against a set of allowed file 
>types, and you're set...

A client-supplied value isn't going to be too useful - it can be spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this myself).

>Marek Kilimajer wrote:
>
>> If you have compiled php with --enable-mime-magic, you can use 
>> mime_content_type()

This is the most-benefit least-effort choice if it's available, though I
believe that flag has been changed since 4.32[?]


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



Re: [PHP] Is it possible to test an uploaded file to check the type?

2003-07-13 Thread Gerard Samuel
The upload process, already collects info on file types when you upload.
From the manual ->
$_FILES['userfile']['type']

The mime type of the file, if the browser provided this
information. An example would be "image/gif".
So,  check $_FILES['userfile']['type'] against a set of allowed file 
types, and you're set...

Marek Kilimajer wrote:

If you have compiled php with --enable-mime-magic, you can use 
mime_content_type()

Dan Anderson wrote:

Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format?  I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,

Dan Anderson






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


Re: [PHP] Need PHP on Win2000 Pro

2003-07-13 Thread John Nichel
Simon Fredriksson wrote:
When I make console scripts for *nix in PHP I have the shebang line and 
after that 

#!/usr/bin/php -q

Is PHP as powerful as perl on the console area yet?
In my opinion, no.  But Perl has a big head start on php when it comes 
to system scripts (not to mention that PHP is designed for web based 
applications).  I can easily forsee PHP taking over Perl in the system 
area (course, they may both fall out of favor as more and more people 
are using languages like Python and TCL for system scripts).

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


Re: [PHP] Is it possible to test an uploaded file to check the type?

2003-07-13 Thread Marek Kilimajer
If you have compiled php with --enable-mime-magic, you can use 
mime_content_type()

Dan Anderson wrote:

Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format?  I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,

Dan Anderson




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


Re: [PHP] Private and protected variables in PHP 5?

2003-07-13 Thread Marek Kilimajer
Don't have the possibilities to try it out now, but I think you are wrong:

Example:

class Parent {
protected $var = "test";
function blah($somevar) {
...
}
}
class Child extends Parent {
...
}
$parent = new Parent;
print $parent->var; //ouputs "test"
This will error out, you access a protected variable that is accessible 
only from the class itself or derived classes (using $this->var).

$child = new Child;
print $child->var; //outputs nothing
Gives error for the same reason as above. But if you declare a public 
method in Child class:
function getVar() {
	return $this->var;
}
, then this would work:
print $child->getVar();
as you can see $var is only accessible by objects that are specifically 
Parents, not Children.
Protected variables are accessible also from derived classes, private 
are not. But both are NOT accessible from outside (e.g. using $a=new A; 
$a->var;), but only from within class methods (using $this->var).



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


Re: [PHP] Need PHP on Win2000 Pro

2003-07-13 Thread Simon Fredriksson
When I make console scripts for *nix in PHP I have the shebang line and 
after that 

#!/usr/bin/php -q

Is PHP as powerful as perl on the console area yet?

//Simon

John A. Thomason wrote:
Thanks for your help. Also, I checked out your tutorial and Apache and PHP.
I have Apache installed, and I am using it for backend work. I have been
using Perl, but have discovered PHP, and want to be able to use it on the
command line. Another email told me the solution.
Replace the shebang line with 
And that is how simple the fix was, and now I am going to rewrite all of my
batch files and perl scripts using PHP. I do need a little more
understanding of Apache and will be studying your Apache tutorial. Thanks
again.
John A. Thomason
[EMAIL PROTECTED]
- Original Message - 
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 8:08 AM
Subject: Re: [PHP] Need PHP on Win2000 Pro



On Saturday, July 12, 2003, 10:31:14 PM, John wrote:

JAT> Hello,

JAT> I need some advice on getting PHP 4 up and running on my Windows 2000
JAT> Professional. I have followed all of the instructions in the
installation

JAT> file, but when I try to run a PHP as a batch from the command prompt,
all I

JAT> get is the file listed. Help!

You need a web server in order to run the scripts (unless you are
strictly doing it command line).
I have a tutorial that shows you how to setup Apache with PHP on
Windows (its not OS specific, but it can be applied to any Windows
version).
Here is the link 

Please read the use comments, and if  you have any questions, you can
email me off-list :)


--
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com






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


Re: [PHP] Weird Date problem driving me crazy...

2003-07-13 Thread John W. Holmes
Boaz Yahav wrote:

I have two date strings coming out from MySQL.
Both fields are defined as datetime.
When i come to print them like this :

Echo"Ticket Opened : " . date("l, F jS Y
H:i",$row->OpenDate) . "";
Echo"Problem Start : " .  date("l, F jS Y
H:i",$row->ProblemStart) . "";
I get :

Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Thursday, January 1st 1970 02:33
Notice that the 2nd date is wrong and it's some kind of default that the
function
returns. Only if i add strtotime() and only to the 2nd field do i get
the correct answer :
Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Saturday, July 12th 2003 20:36
date() expects a UNIX timestamp to be passed to it. MySQL does not store 
dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns. 
strtotime() will take a MySQL timestamp, though, and convert it to a 
UNIX timestamp.

Also look into using DATE_FORMAT() in your query to format the data 
there so you don't have to do anything in PHP.

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





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


php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173

2003-07-13 Thread php-general-digest-help

php-general Digest 13 Jul 2003 14:58:27 - Issue 2173

Topics (messages 154985 through 155003):

Re: touch file on shared web server?
154985 by: Paul O'Neil
154991 by: Jason Wong

Re: Code and Good Design Methods
154986 by: zbranigan
154987 by: zbranigan
154988 by: Dan J. Rychlik
154994 by: Ray Hunter
154995 by: Robert Cummings

Re: OK, So I am new to these List. Win2000 help!
154989 by: John Nichel
155002 by: John Nichel

Re: Newbie Directory question
154990 by: olinux

Re: Mailing list server with PHP frontend
154992 by: Juan Nin
154993 by: Manuel Lemos
154996 by: Paul Chvostek

How does PHP interact when using Java?
154997 by: Jan Bro

Weird Date problem driving me crazy...
154998 by: Boaz Yahav

php script billing receipt
154999 by: Duncan

Re: Need PHP on Win2000 Pro
155000 by: Burhan Khalid
155001 by: John A. Thomason

Re: dump $_POST into variables
155003 by: Marek Kilimajer

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]


--
--- Begin Message ---
Yes, create a temp directory like this -rw-rw-rw-   1 nobody   nogroup

-Original Message-
From: Paul O'Neil [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 12, 2003 5:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] touch file on shared web server?


you can only TOUCH a file that you own. Usually PHP is *nobody*. Is there a
way for a script to create a file on the web server?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.498 / Virus Database: 297 - Release Date: 7/8/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.498 / Virus Database: 297 - Release Date: 7/8/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.498 / Virus Database: 297 - Release Date: 7/8/2003

--- End Message ---
--- Begin Message ---
On Sunday 13 July 2003 10:13, Paul O'Neil wrote:
> Yes, create a temp directory like this -rw-rw-rw-   1 nobody   nogroup

The directory needs the 'x' bits as well otherwise no-one will be able to get 
into it.

-- 
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
--
/*
Death comes on every passing breeze,
He lurks in every flower;
Each season has its own disease,
Its peril -- every hour.
--Reginald Heber
*/

--- End Message ---
--- Begin Message ---
> "Dan" == Dan J Rychlik <[EMAIL PROTECTED]> writes:

Dan> I am reading PHP and MySQL web development 2nd edition book.
Dan> Chapter 6 talks about displaying dynamic web content using
Dan> class objects.  For the type of project that I am building,
Dan> this is not optimal.  How do I keep my self from having html
Dan> mixed with my PHP code? 

try having a look at the Smarty templating engine.


-- 
no toll on the internet; there are paths of many kinds;
whoever passes this portal will travel freely in the world
--- End Message ---
--- Begin Message ---
> "Dan" == Dan J Rychlik <[EMAIL PROTECTED]> writes:

Dan> I am reading PHP and MySQL web development 2nd edition book.
Dan> Chapter 6 talks about displaying dynamic web content using
Dan> class objects.  For the type of project that I am building,
Dan> this is not optimal.  How do I keep my self from having html
Dan> mixed with my PHP code?

Ok, here's another one.  I've never used the php port of TAL, but I've
used TAL a little bit in Zope and it's really nice.  

Here's a link to an article on the zope site about TAL.  One really
good thing about TAL (below) is that HTML editing tools tools like
Dreamweaver, Amaya or and GoLive, for instance, can be used to edit
the templates.  So the Interface Engineers can do their 'thang' and the
programmers can do their 'thang' with less interference.

 
,[ http://www.zope.org/Documentation/Articles/ZPT1 ]
| The tal:content attribute is a TAL statement. Since it has an XML
|  namespace (the tal: part) most editing tools will not complain that
|  they don't understand it, and will not remove it. It will not change
|  the structure or appearance of the template when loaded into a
|  WYSIWYG editor or a web browser. The name content indicates that it
|  will set the content of the title tag, and the

Re: [PHP] dump $_POST into variables????

2003-07-13 Thread Marek Kilimajer
Remember this is identical to having register_globals on with the same 
security risks. Read http://www.php.net/register_globals first.

Joe Harman wrote:
Ah... Jason Man Of Few Words! THANKs... You have saved me time and
lines in my code :-)



extract()



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


Re: [PHP] OK, So I am new to these List. Win2000 help!

2003-07-13 Thread John Nichel
John A. Thomason wrote:
Thanks, that did it. And yes, I am trying to run this as a shell script.
Thank you very much.
John.

- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 10:01 PM
Subject: Re: [PHP] OK, So I am new to these List. Win2000 help!



John A. Thomason wrote:

The following is my output in the command prompt window(DOS Prompt?)

C:\PHP>hello.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
!#C:\php\;
echo"Hello World!";
if ($foo):
echo "yep\n";
elseif ($bar):
echo "almost\n";
else:
echo "nope\n";
endif;
phpinfo();
C:\PHP>
And the following is the PHP code to generate it.

!#C:\php\;

echo"Hello World!";

if ($foo):

echo "yep\n";

elseif ($bar):

echo "almost\n";

else:

echo "nope\n";

endif;

phpinfo();

Now, I know that the variables are not set, so they should be false, but

the

output just displays a "listing" of the code and doesn't process it. In

the

documentation, it states that PHP can be run from the command prompt,

like a

batch file. Now what am I doing wrong.

I do have it working correctly with an Apache server, that I am using
backend.
and my install dir is "C:\php", and it is listed first in the path.

John A. Thomason

[EMAIL PROTECTED]

Looks like you're trying to run it as a shell script, or a cgi program.
 Replace the sh-bang on the first line with 
eg:


Yeah, you just need to enclose the actual script in the opening/closing 
php tags ().  And to run it as a shell script, you can 
either call the script as...

c:\path\to\php\php.exe filename.php (or just 'php filename.php' if the 
php interperter is in your path), or put the sh-bang as the first line 
(before the opening php tag).

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


Re: [PHP] Need PHP on Win2000 Pro

2003-07-13 Thread John A. Thomason
Thanks for your help. Also, I checked out your tutorial and Apache and PHP.
I have Apache installed, and I am using it for backend work. I have been
using Perl, but have discovered PHP, and want to be able to use it on the
command line. Another email told me the solution.
Replace the shebang line with 
And that is how simple the fix was, and now I am going to rewrite all of my
batch files and perl scripts using PHP. I do need a little more
understanding of Apache and will be studying your Apache tutorial. Thanks
again.

John A. Thomason
[EMAIL PROTECTED]

- Original Message - 
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 8:08 AM
Subject: Re: [PHP] Need PHP on Win2000 Pro


> On Saturday, July 12, 2003, 10:31:14 PM, John wrote:
>
> JAT> Hello,
>
> JAT> I need some advice on getting PHP 4 up and running on my Windows 2000
> JAT> Professional. I have followed all of the instructions in the
installation
> JAT> file, but when I try to run a PHP as a batch from the command prompt,
all I
> JAT> get is the file listed. Help!
>
> You need a web server in order to run the scripts (unless you are
> strictly doing it command line).
>
> I have a tutorial that shows you how to setup Apache with PHP on
> Windows (its not OS specific, but it can be applied to any Windows
> version).
>
> Here is the link 
>
> Please read the use comments, and if  you have any questions, you can
> email me off-list :)
>
>
>
> -- 
> Regards,
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>
>



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



Re: [PHP] Need PHP on Win2000 Pro

2003-07-13 Thread Burhan Khalid
On Saturday, July 12, 2003, 10:31:14 PM, John wrote:

JAT> Hello,

JAT> I need some advice on getting PHP 4 up and running on my Windows 2000
JAT> Professional. I have followed all of the instructions in the installation
JAT> file, but when I try to run a PHP as a batch from the command prompt, all I
JAT> get is the file listed. Help!

You need a web server in order to run the scripts (unless you are
strictly doing it command line).

I have a tutorial that shows you how to setup Apache with PHP on
Windows (its not OS specific, but it can be applied to any Windows
version).

Here is the link 

Please read the use comments, and if  you have any questions, you can
email me off-list :)



-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



[PHP] php script billing receipt

2003-07-13 Thread Duncan
Hi,

I just finished a script for an US company and now have to provide them 
with a billing receipt stating my work and the price for it.
google didn't come up with anything usefull, most search results came up 
with billing scripts and not an example text of such a billing receipt.
Does anyone have an example text, which you use when you have to charge 
a client for your work?
I am asking because english isn't my first language and instead of 
making s.th. up in my own words it would surely look better, if I can 
present s.th. which is 100% correct :)

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


[PHP] Weird Date problem driving me crazy...

2003-07-13 Thread Boaz Yahav
I have two date strings coming out from MySQL.
Both fields are defined as datetime.

When i come to print them like this :

Echo"Ticket Opened : " . date("l, F jS Y
H:i",$row->OpenDate) . "";
Echo"Problem Start : " .  date("l, F jS Y
H:i",$row->ProblemStart) . "";

I get :

Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Thursday, January 1st 1970 02:33

Notice that the 2nd date is wrong and it's some kind of default that the
function
returns. Only if i add strtotime() and only to the 2nd field do i get
the correct answer :

Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Saturday, July 12th 2003 20:36


any idea?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.






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



[PHP] How does PHP interact when using Java?

2003-07-13 Thread Jan Bro
Hi,
I've just got PHP working with Java. It connects to a remote Oracle DB
with Java and without the Oracle Client installed on my machine,
it's sure a beauty. What I was wondering, what's behind it, I mean how
does it work? I transfer Objects in Java and get data out. How do PHP
and Java interact, after all they are two different technologies.

I've searched google and pretty much every site I could think off, but
I've found nothing more than a setup tutorial.

By the way, I should mention if you have them interact, Apache + PHP
doesn't like java packages at all. PHP blows off with a severe error
message.

thx
Jan Bro

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



[PHP] Re: Mailing list server with PHP frontend

2003-07-13 Thread Paul Chvostek
On Sat, Jul 12, 2003 at 08:17:03PM -0300, Manuel Lemos wrote:
> 
> You may want to try this class for creating lists with the ezmlm mailing 
> list manager. It has support for creating and editing the lists 
> properties and even has a SOAP interface for accessing the subscriptions 
> from remote machines.

The ezmlm package has a number of problems that make it really annoying
to deal with; it has its own way of interpreting message headers which
isn't much related to any RFC.  The primary problem is the fact that it
considers the "Return-Path" header (i.e. the envelope sender) to be the
authoritative address of the sender, superceding the From and Reply-To
headers.  The only way around it is to "spoof" the envelope sender,
thereby falsifying your headers.  Gahgh.

Now ... if you were to write a class to manage Mailman configs ... that
would be useful.  ;-)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/


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



Re: [PHP] Code and Good Design Methods

2003-07-13 Thread Robert Cummings
Let's be honest, XSL is is one big logic step itself -- moreover it's a
whole other language to learn.

Cheers,
Rob.

On Sun, 2003-07-13 at 02:07, Ray Hunter wrote:
> Also u could build your own system that is php xml and xslt based. That
> will really help you separate the logic from the presentation.
> 
> Check out (dom)xml and (dom)xslt. Sometimes there is still logic in the
> presentation with template systemswith xslt however, it might be to
> much for the design (interface) guys.
> 
> Those should help u out.
> 
> --
> BigDog
> 
> 
> On Sat, 2003-07-12 at 20:08, Dan J. Rychlik wrote:
> > I am reading PHP and MySQL web development 2nd edition book.  Chapter 6 talks 
> > about displaying dynamic web content using class objects.  For the type of project 
> > that I am building, this is not optimal.  How do I keep my self from having html 
> > mixed with my PHP code?  In other words how do I serperate the two.  I need to 
> > concentrate on writing good code and not designing a nice looking website.  
> > (someone else is going to do that)  
> > 
> > Can I assign include() statements to a variable ?  How would you guys accomplish 
> > this?
> > 
> > Thanks so much in advance,
> > Daniel 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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