[PHP] PHP 5 Free Hosting

2004-03-20 Thread David Costa
Hello!
We are offering totally free PHP 5 Hosting packages at 
http://dotgeek.org
There is no extra plan to buy or anything else.

This could be a very good opportunity for developers interested in 
testing their script and code
under PHP 5.

On our site you can see the phpinfo page and some further information.

Best Regards

David Costa 

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


Re: [PHP] Re: php and CSS level 2

2004-03-20 Thread Ben Ramsey
RD> I do wonder if either of the above methods would force the
RD> browser to never cache the CSS file locally
You know, I didn't think about that, as I've never personally used this 
method.  I've never had a need.  Thinking about it now, I would also 
think that you may need to send a content-type header of "text/css" to 
the browser, as well, though I'm not positive on this.

OT --> Consequently, I've had a lot of trouble with IE caching any CSS 
file for a site I'm working on.  Works perfectly in Mozilla, but IE has 
all sorts of bugs.  It's loading the page before the CSS every time, so 
you get this flash of unformatted data.  The client and most of their 
site users use IE, so I have to make it work.  My boss found an odd 
work-around, though.  If you put " 
" at the very top, just inside the  tag, then it will 
work just fine and load in the CSS first every time.  I don't know the 
logic behind it, but, if it's IE, does there have to be any logic?  ;-)

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Upload file field not working as a form element

2004-03-20 Thread Ben Ramsey
Could you post both your HTML form code and the PHP code you're using to 
handle the file upload.  Also, just to make sure I understand what 
you're trying to do, you want to insert the uploaded file into a MySQL 
database?

Vernon wrote:
As much as I try I cannot get a file field in a form inserted into a MySQL
record. I've even tried to get it to echo to the page when the page is
submitted to itself and it's not reading the field.
What am I missing here?
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Upload file field not working as a form element

2004-03-20 Thread Vernon
As much as I try I cannot get a file field in a form inserted into a MySQL
record. I've even tried to get it to echo to the page when the page is
submitted to itself and it's not reading the field.

What am I missing here?

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



[PHP] Forum notify

2004-03-20 Thread thies
<>-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: php and CSS level 2

2004-03-20 Thread Richard Davey
Hello Ben,

Sunday, March 21, 2004, 4:02:40 AM, you wrote:

BR> 
BR> >
BR> 

BR> or

BR> 

Just out of interest Ben, I do wonder if either of the above methods
would force the browser to never cache the CSS file locally, forcing
it to download it every single time? I can think of instances when
this would be a desirable result, but they are far and few between :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: php and CSS level 2

2004-03-20 Thread Ben Ramsey
Why not just make your CSS script end with the .php extension instead of 
.css?  Then, the server will automatically parse it (most likely it 
will--depending on your server setup, of course).  You can link to it 
from your HTML page like you would your CSS:




or





Aidan Lister wrote:

Your question indicates you have very little understanding of what PHP
actually is.
PHP will be parsed anywhere in any script, as long as your webserver is set
to parse that type of file (ie, .php by default).
1. In your webserver config you need to make .css files parsed by php
2. Like you've done in your code snip?
I suggest you a) read the manual b) experiment before asking further
questions.


"Andy B" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
was just wondering if php will work inside a CSS level 2 style sheet?? for
example:



input#name {
display: none }

input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }

/*rest of style sheet */

if this will work i was wondering 2 things:

1. how would i have to set it up to work right with the style sheet with php
in it to work as a seperate file from the html file
and
2. how would i set the style sheet up to work inside the original html/php
file that contained the original html code...



--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Comparing values / Regex ?

2004-03-20 Thread Ben Ramsey
Please reply to the list so that everyone may benefit from your questions.

> --- Ben Ramsey <[EMAIL PROTECTED]> wrote:
>
>>Here's my take on it.  Pull all your values into one
>>long string:
>
> (cut)
>
>>if (($timestamp = strtotime($date_string)) === -1) {
>> // Not a valid date; do some error reporting
>>here
>>} else {
>> // It is a valid date, $timestamp is now a
>>valid Unix
>> // timestamp of $date_string; use it like
>>below:
>> echo date("m/d/Y", $timestamp);
>>}
>
Is that an error - Or propper PHP code ? 

Ive seen $a == 34 etc - with TWO equals signs. - But
havnt seen it with 3 before.
Yes, it's proper code.  See the manual for more details.
http://www.php.net/manual/en/language.operators.comparison.php
- Has PHP got 'regex' capability - & comparing text
case IN-sensitivly ?? IE "Cat" equals "CaT" equals
"cat" equals "CAT"..
Also "Cat in the hat" is TRUE - if I 'regex' & want to
see if 'Cat' is in the string (case in-sensitive)...
Indeed.  PHP does have regex capability.  You should take a good look at 
the manual.  It will answer all of your questions.

Perl-compatible regular expressions: http://www.php.net/pcre
POSIX Extended regular expressions: http://www.php.net/regex
I would suggest using PCRE.  There is a increased speed performance 
difference, I believe.  You can perform case insensitive and case 
sensitive searches with PCRE.  Just read the manual, and ask here if you 
have any questions with code after that.

Also, note that ("cat" == "cat") but ("Cat" != "CaT").  However, I 
wouldn't do a string comparison like that, though PHP is definately 
capable of it.  I would use strcmp() or strcasecmp(), the latter of 
which is case insensitive.  Check the manual for their usage, and note 
that they return zero (0) on true.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: ip to country

2004-03-20 Thread Filip de Waard
On Mar 21, 2004, at 3:27 AM, Tom Reed wrote:
I would think using HTTP_ACCEPT_LANGUAGE to get the users browser
language/country info would be quicker and easier to implement.
Using HTTP headers to identify the country where a visitor comes from 
is totally inaccurate. My browser identifies itself with: 
Accept-Language: en-us,en;q=0.5, while I live in the Netherlands where 
the main language is Dutch.

When you need a little bit of accuracy you can't avoid using an IP to 
country database.

Regards,

Filip de Waard

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


Re: [PHP] Re: string function that inserts a char

2004-03-20 Thread Five

"Jason Giangrande" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Five wrote:
> > "Five" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> >
> >>I just finished looking through string functions
> >>http://us2.php.net/manual/en/ref.strings.php
> >>and can't find one that inserts a character, not replaces one.
> >>
> >>If there's a string that's over 50 chars long without a space, I want to insert a 
> >>space without replacing or losing any of the
> >>original characters. Is there a function to do that?
> >>
> >>advance thanks,
> >>Dale
> >
> >
> > I should add that, unless there's a function that does it all, I'm not really 
> > concerned with the finding the 50th char part. I
know
> > there's other funcs for that kind of thing. It's just that all I'm trying to do is 
> > make sure that when the string is output, it
will
> > wrap to the width of a table and not stretch the table width to suit it's fancy.
> > If I manufacture a function to do all of the little things necessary to make this 
> > thing wrap, it seems like a lot of ugly code
to do
> > a simple task.
> >
>
> Use substr_replace() and set the length value to 0.  Here's an example:
>
> $text = "Thistext";
> echo "$text";
> $text = substr_replace($text, " ", 4, 0);
> echo $text;
>
> Test it and you will see that a space is added into the text without
> replacing any of it.
>
> -- 
> Jason Giangrande <[EMAIL PROTECTED]>
> http://www.giangrande.org
> http://www.dogsiview.com


Thanks Jason

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



[PHP] Re: ip to country

2004-03-20 Thread Tom Reed
I would think using HTTP_ACCEPT_LANGUAGE to get the users browser
language/country info would be quicker and easier to implement.

Example:

$string = getenv('HTTP_ACCEPT_LANGUAGE');
list($language, $country) = split('[-,]', $string);

-Tom Reed
[EMAIL PROTECTED]


"Enda Nagle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a site that will have different pricing by world region / country
and
> also offer different currencies.
>
> Presently, the user has to select their country from a select menu and
> submit the form, but I would like to eliminate this step if possible, and
> set the country according to their IP address.
>
> I had a quick look at http://www.iptocountry.com but was wondering if
there
> was a way of doing this with PHP functions?
>
> I know its in use on the php.net and google.com sites (when I go to either
I
> get ie.php.net or google.ie) so was wondering if its costly / easy to
> implement?
>
> Thanks for the help,
>
> Enda
> --
>
>
> Enda Nagle
> +353 86 168 0774
> [EMAIL PROTECTED]
> www.nightsol.net

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



[PHP] Re: Function to check a valid date

2004-03-20 Thread Tom Reed
Try this:
http://us4.php.net/checkdate

-Tom Reed
[EMAIL PROTECTED]

"Chris Bruce" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello all,

I was going to build a function to check whether a selected date
exists, but thought that I would see if anyone has done this type of
thing already which would indeed save me some time.

I have a form where the users select the day of the week, month, date
and year from 4 pulldowns. (Saturday, March 20, 2004). I need to have a
function that will check to see if that is indeed a real date.

Does this sound familiar to anyone?

Thanks a bunch :)

--

Chris Bruce
[EMAIL PROTECTED]

Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189


This e-mail and its contents are privileged, confidential and
subject to copyright. If you are not the intended recipient,
please delete this e-mail immediately. Any unauthorized use
or disclosure of the information herein is prohibited.

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



[PHP] Re: php and CSS level 2

2004-03-20 Thread Aidan Lister
Your question indicates you have very little understanding of what PHP
actually is.

PHP will be parsed anywhere in any script, as long as your webserver is set
to parse that type of file (ie, .php by default).

1. In your webserver config you need to make .css files parsed by php
2. Like you've done in your code snip?

I suggest you a) read the manual b) experiment before asking further
questions.



"Andy B" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
was just wondering if php will work inside a CSS level 2 style sheet?? for
example:




input#name {
display: none }

input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }


[PHP] php and CSS level 2

2004-03-20 Thread Andy B
was just wondering if php will work inside a CSS level 2 style sheet?? for example:




input#name {
display: none }

input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }


[PHP] Re: Inconv in PHP5 compile

2004-03-20 Thread PHPDiscuss - PHP Newsgroups and mailing lists
I'm having PHP5 compile problems as well. Here's some shortened output
from commands giving a picture of my problem.

The first thing that troubles me is vi giving this output:

[EMAIL PROTECTED] php-5.0.0RC1]# vi ext/mysql/php_mysql.c
"ext/mysql/php_mysql.c" 2514L, 70348C
Error detected while processing modelines:
line 2512:
E518: Unknown option: fdm=marker
Hit ENTER or type command to continue

I ran into this after:

[EMAIL PROTECTED] php-5.0.0RC1]# gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
..


[EMAIL PROTECTED] php-5.0.0RC1]# ./configure
--with-apsx2=/usr/local/apache2/bin/apxs --with-mysql=/data/sw/mysql-4.0.18
..


[EMAIL PROTECTED] php-5.0.0RC1]# make
..

..
gcc  -Iext/mysql/ -I/data/sw/php-5.0.0RC1/ext/mysql/ -DPHP_ATOM_INC
-I/data/sw/php-5.0.0RC1/include -I/data/sw/php-5.0.0RC1/main
-I/data/sw/php-5.0.0RC1 -I/data/sw/php-5.0.0RC1/Zend
-I/usr/include/libxml2 -I/data/sw/mysql-4.0.18/include 
-I/data/sw/php-5.0.0RC1/TSRM  -g -O2  -c
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c -o ext/mysql/php_mysql.o  &&
echo > ext/mysql/php_mysql.lo
In file included from /data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:59:
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.h:51:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:72:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:82:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:86:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:90:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:101:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:122:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:181:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:376:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function
`php_mysql_do_connect':
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: syntax error at
'@' token
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: syntax error at
'@' token
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: `MYSQL_TCP_PORT'
undeclared (first use in this function)
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: (Each undeclared
identifier is reported only once
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:482: error: for each function
it appears in.)
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:485:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:502: error: syntax error at
'@' token
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:502: error: syntax error at
'@' token
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:639:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:666:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:674: warning: comparison
between pointer and integer
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:703:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:706: error: `handler'
undeclared (first use in this function)
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:715:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:718: warning: comparison
between pointer and integer
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:726:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:771:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:779: warning: comparison
between pointer and integer
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1123:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1259:5: token "@" is not valid
in preprocessor expressions
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function
`zif_mysql_result':
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1779: warning: assignment from
incompatible pointer type
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function
`php_mysql_fetch_hash':
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:1949: warning: assignment from
incompatible pointer type
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c: In function
`zif_mysql_fetch_lengths':
/data/sw/php-5.0.0RC1/ext/mysql/php_mysql.c:2135: warning: assignment from
incompatible pointer type
make: *** [ext/mysql/php_mysql.lo] Error 1

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



php-general Digest 21 Mar 2004 00:45:35 -0000 Issue 2658

2004-03-20 Thread php-general-digest-help

php-general Digest 21 Mar 2004 00:45:35 - Issue 2658

Topics (messages 181020 through 181059):

Re: too much trimming
181020 by: Gerben
181021 by: Gerben

Image size ??
181022 by: Tom Wuyts
181023 by: Marek Kilimajer

Re: [PEAR] Auth
181024 by: Firman Wandayandi
181026 by: Firman Wandayandi

Re: Turn on E_ALL Error Reporting
181025 by: Jason Wong

Apache - PHP Load-n-Go ?
181027 by: gordon stewart

HELP! Apache dies on regular MySQL query :-/
181028 by: -{ Rene Brehmer }-
181057 by: Raditha Dissanayake

mail headers
181029 by: Will

PS : [PHP] Apache - PHP Load-n-Go ? : FIXED
181030 by: gordon stewart

Convert Date Format?
181031 by: Jeff Oien
181033 by: trlists.clayst.com
181035 by: Jeff Oien
181036 by: John W. Holmes
181037 by: Michael Lewis

This Group
181032 by: gordon stewart
181034 by: John W. Holmes

9 Months Ago
181038 by: Jeff Oien
181039 by: Red Wingate

string function that inserts a char
181040 by: Five
181041 by: Five
181043 by: Jason Giangrande

Coding Style Guide Neded
181042 by: Sheeraz Fazal
181044 by: Michal Migurski

ip to country
181045 by: Enda Nagle
181046 by: Manuel Lemos
181055 by: Marek Kilimajer
181056 by: Filip de Waard

Re: PHP encounters Access Violation
181047 by: Ben Ramsey

Scheduling PHP on Windows
181048 by: Ben Ramsey

Function to check a valid date
181049 by: Chris Bruce
181050 by: Ben Ramsey

CMS Templating with Standards Based HTML Delima...
181051 by: Adam Reiswig
181052 by: Ben Ramsey
181053 by: Filip de Waard
181054 by: Yann Larrivee

Re: Comparing 2 files
181058 by: Raditha Dissanayake

Re: Question on PDF upload
181059 by: Raditha Dissanayake

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 ---
you need to add an space after "?>" for to output the newline after it.


"Ivan Sergio Borgonovo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've simple code like this:
>
> -- begin --
> #!/usr/bin/php -q
>  $pippo='goofy'
> ?>
>
> hey my name is 
> and
> I feel good
> -- end --
>
> I would expect this output:
>
> -- begin --
>
> hey my name is goofy
> and
> I feel good
> -- end --
>
> but I obtain this:
> -- begin --
>
> hey my name is goofy and
> I feel good
> -- end --
>
> Lines are indented with tabs.
> I suspect something related to -w flag, but I haven't been able to
> switch this behaviour off.
>
> thx
--- End Message ---
--- Begin Message ---
you need to add an space after "?>" for to output the newline after it.



"Ivan Sergio Borgonovo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've simple code like this:
>
> -- begin --
> #!/usr/bin/php -q
>  $pippo='goofy'
> ?>
>
> hey my name is 
> and
> I feel good
> -- end --
>
> I would expect this output:
>
> -- begin --
>
> hey my name is goofy
> and
> I feel good
> -- end --
>
> but I obtain this:
> -- begin --
>
> hey my name is goofy and
> I feel good
> -- end --
>
> Lines are indented with tabs.
> I suspect something related to -w flag, but I haven't been able to
> switch this behaviour off.
>
> thx
--- End Message ---
--- Begin Message ---
Hi, 
 
Is there any way to know the size of an image ??
 
 
Thanx in advance,
RCTycooner
 
-
Admin of The Silver Luna Forums
http://www.wuyts.org/tom/phpbb2/
[EMAIL PROTECTED]
-
--- End Message ---
--- Begin Message ---
http://www.php.net/getimagesize

Tom Wuyts wrote:
Hi, 
 
Is there any way to know the size of an image ??
 
 
Thanx in advance,
RCTycooner
 
-
Admin of The Silver Luna Forums
http://www.wuyts.org/tom/phpbb2/
[EMAIL PROTECTED]
-

--- End Message ---
--- Begin Message ---
Hi Frederic,

Stefan right, I just notice on the error
Fatal error: _factory(): Failed opening required 'Auth/Container/DB.php'
(include_path='.:') in /www/news/Auth-1.2.3/Auth.php on line 218

I'd bet you didn't turned On include_path directive on php.ini. Please
correct
thism, just remove semicolon at front of include_path.

include_path = "path/to/pear"

Firman

- Original Message -
From: "Stefan Neufeind" <[EMAIL PROTECTED]>
To: "pear-general" <[EMAIL PROTECTED]>; "Frederic SOSSON"
<[EMAIL PROTECTED]>
Sent: Saturday, March 20, 2004 8:41 PM
Subject: Re: [PEAR] Auth


> Seems you didn't really "install" the package on your server but
> simply unpacked it? This is not the recommended way. See the docs on
> the possibilities available for installing pear-packages
> (

Re: [PHP] Question on PDF upload

2004-03-20 Thread Raditha Dissanayake

Finally, may I ask a question?  In my case, all of the PDFs that generated
from MS Word + Acrobat can be upload with the content-length=512KB, but the
PDFs generated from PageMaker, its content-length is greater than 512KB, why
the content-lengths are different?
 

Probably because they use two different libraries to produce the PDF. It 
is an open standard and there are a handfull of different libraries out 
there.

Sorry for my poor english.

Thanks for your help.

Jeffrey

 


chkFields();">
   

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] Comparing 2 files

2004-03-20 Thread Raditha Dissanayake
You are reinventng the wheel try
`diff file1 file2`;
Jens Schmeiser wrote:

Dear list.

I want to compare two text files and print the differences. The text files
contain the structure of a database, so they are very big (>6000 lines).
The file looks like that:
TABLENAME#COLUMNNAME#DATATYPE#DATALENGTH#DATAPRECISION#NULLS
...
I only check if the datatype and nulls are different. If so, then the two
lines of the files will be printed.
I tried to do that and it works excellent if there aren't many differences,
but if there are many diffs, it takes time and time.
What I do now is to read the to files to an array and get the differences
with array_diff
$array1=file('file1.txt');
$array2=file('file2.txt');
$result1 = array_diff($array1,$array2);
$result2 = array_diff($array2,$array1);
After that I do the following:
foreach ($result1 as $line1) {
foreach ($result2 as $line2) {
// compare the two lines and show the differences;
continue;
}
}
Is there a better way to do that (and of course faster)?

Regards
Jens
 



--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] HELP! Apache dies on regular MySQL query :-/

2004-03-20 Thread Raditha Dissanayake

Internal Server Error

The server encountered an internal error or misconfiguration and was 
unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and 
inform them of the time the error occurred, and anything you might 
have done that may have caused the error.

More information about this error may be available in the server error 
log.
Apached does not die just because a script misbehave. Please refer to 
the line above.

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


Re: [PHP] Re: ip to country

2004-03-20 Thread Filip de Waard
On Mar 21, 2004, at 1:01 AM, Marek Kilimajer wrote:
Manuel Lemos wrote:
On 03/20/2004 06:48 PM, Enda Nagle wrote:
I have a site that will have different pricing by world region / 
country and
also offer different currencies.

Presently, the user has to select their country from a select menu 
and
submit the form, but I would like to eliminate this step if 
possible, and
set the country according to their IP address.

I had a quick look at http://www.iptocountry.com but was wondering 
if there
was a way of doing this with PHP functions?

I know its in use on the php.net and google.com sites (when I go to 
either I
get ie.php.net or google.ie) so was wondering if its costly / easy to
implement?
You may also want to try this NetGeo interface class.
http://www.phpclasses.org/netgeoclass
You can use this class but remember that these services limit the 
number of requests per ip address. php.net and google certainly don't 
use the free service but instead bought a database. If your site is 
busy you should buy one too.
PHP.net uses a free database: http://ip-to-country.webhosting.info/ 
which is actually quite good.

Regards,

Filip de Waard

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


Re: [PHP] Re: ip to country

2004-03-20 Thread Marek Kilimajer
Manuel Lemos wrote:
On 03/20/2004 06:48 PM, Enda Nagle wrote:

I have a site that will have different pricing by world region / 
country and
also offer different currencies.

Presently, the user has to select their country from a select menu and
submit the form, but I would like to eliminate this step if possible, and
set the country according to their IP address.
I had a quick look at http://www.iptocountry.com but was wondering if 
there
was a way of doing this with PHP functions?

I know its in use on the php.net and google.com sites (when I go to 
either I
get ie.php.net or google.ie) so was wondering if its costly / easy to
implement?


You may also want to try this NetGeo interface class.

http://www.phpclasses.org/netgeoclass

You can use this class but remember that these services limit the number 
of requests per ip address. php.net and google certainly don't use the 
free service but instead bought a database. If your site is busy you 
should buy one too.

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


Re: [PHP] CMS Templating with Standards Based HTML Delima...

2004-03-20 Thread Yann Larrivee
Hi,

There are a few steps to do befor you go ahead and choose a CMS.

One of them, is determining your needs.
Second is looking at the major projects and see how each of them answer
your needs.
The size of the community supporting the project.
Code quality (does it re-use existing code from the community ie: did
they recode their database abstraction layer or used PearDB)
How many database it support (mysql is good, but maybe you want to offer
the choice to your customer)
Is done in 00 ?
Does it have search engine friendly url by default (many cms generate
really long url)
Does it support many languages (in my case this is important to be able
to manage a multi-langual website).
And the most important one, Is it easy to modify and is their a good
user and programmer reference and manual.

Plus doing a set of bench mark might be interesting to do, to know how
many visitors the system can handle

If none answer exactly your need, (say 90%) why not code the 10% and
give it to the community instead of recoding the hole thing.

Coding such a system is complexe, and will require alot of energy, will
the community could provid most of the work.

Here are a couple website that could help you choose.
http://www.opensourcecms.com/
http://www.cmsreview.com/
http://www.cmsinfo.org/

Another quit way to get around the most popular CMS would be to attend
to our CMS debate (will be in french) at the PHP Quebec Conference.

In 2 hours we will go around the most critical needs that a CMS should
offer, and how the most popular project like :TikiWiki, Spip, Xoops,
Typo3, Zope, answer them.

Personally i use xoops for the PHP Quebec community website
http://www.phpquebec.org i also saw breifly tikiwiki seems a great
product.


Good luck.

Yann Larrivée


On Sat, 2004-03-20 at 18:01, Adam Reiswig wrote:
> I have just been to hotscripts.com looking under their php area for good 
> cms software.  The sheer number of choices is staggering to say the 
> least.  I found Smarty and it seems like it might make a good choice for 
> my needs.   I am really looking to fill two needs.
> 
> One, a robust cms in which I can create standards based web templates 
> (ie, table less layouts using xhtml strict and css)
> 
> and Two, an easy method in which my clients can still edit their own 
> content with out having to learn anything new, or at least as little as 
> possible.  Some sort of wysiwyg would be great if that's possible with 
> out conflicting with existing css styles and as long as it didn't insert 
> font tags and tables all over.
> 
> Is there a good open source php based cms system out there that can do 
> the above?  I'd sure like to know about it.  Thanks for any pointers!
> 
> -Adam R.

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



Re: [PHP] CMS Templating with Standards Based HTML Delima...

2004-03-20 Thread Filip de Waard
On Mar 21, 2004, at 12:01 AM, Adam Reiswig wrote:
Is there a good open source php based cms system out there that can do 
the above?  I'd sure like to know about it.  Thanks for any pointers!
No :-(

There are some options that might interest you, like Drupal. But there 
isn't anything like 'a perfect Open Source CMS'.

Regards,

Filip de Waard

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


[PHP] Re: CMS Templating with Standards Based HTML Delima...

2004-03-20 Thread Ben Ramsey
Adam,

The question you ask is an important one.  Is there a CMS out there that 
meets your client's needs that you don't have to write from scratch?  In 
short, the answer is "no."  I've sifted through mounds and mounds of 
CMSes, and I haven't found one that I really like.  It's really up to 
your own tastes and the requirements of the project.  I've always had to 
write one from scratch due to project requirements.  Though, I hope to 
eliminate that need in the future with the CMS I am currently developing.

So, how can I help you?  I can't tell you the name of an end-all-be-all 
CMS solution.  But I can point you to a place to look for open-source 
solutions.  That place is Sourceforge.net.  Go there and search 
Software/Group for "Content Management".  You'll get tons of results. 
Sift through those results and try the ones that sound like they fit 
your needs.  There're are a couple of notable ones that may fit your 
requirements (e.g. phpWebSite boasts compliant XHTML 1.0 output--though 
I've never tried it).

-Ben

Adam Reiswig wrote:

I have just been to hotscripts.com looking under their php area for good 
cms software.  The sheer number of choices is staggering to say the 
least.  I found Smarty and it seems like it might make a good choice for 
my needs.   I am really looking to fill two needs.

One, a robust cms in which I can create standards based web templates 
(ie, table less layouts using xhtml strict and css)

and Two, an easy method in which my clients can still edit their own 
content with out having to learn anything new, or at least as little as 
possible.  Some sort of wysiwyg would be great if that's possible with 
out conflicting with existing css styles and as long as it didn't insert 
font tags and tables all over.

Is there a good open source php based cms system out there that can do 
the above?  I'd sure like to know about it.  Thanks for any pointers!

-Adam R.
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] CMS Templating with Standards Based HTML Delima...

2004-03-20 Thread Adam Reiswig
I have just been to hotscripts.com looking under their php area for good 
cms software.  The sheer number of choices is staggering to say the 
least.  I found Smarty and it seems like it might make a good choice for 
my needs.   I am really looking to fill two needs.

One, a robust cms in which I can create standards based web templates 
(ie, table less layouts using xhtml strict and css)

and Two, an easy method in which my clients can still edit their own 
content with out having to learn anything new, or at least as little as 
possible.  Some sort of wysiwyg would be great if that's possible with 
out conflicting with existing css styles and as long as it didn't insert 
font tags and tables all over.

Is there a good open source php based cms system out there that can do 
the above?  I'd sure like to know about it.  Thanks for any pointers!

-Adam R.

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


[PHP] Re: Function to check a valid date

2004-03-20 Thread Ben Ramsey
Your likely to find many ways to do this and many functions with many 
lines of code that do many variations of what you want.  Can I use the 
word "many" many more times?

Such is the way with programming.

Here's my take on it.  Pull all your values into one long string:

$date_string = "{$_POST["week_day"]}, {$_POST["month"]} {$_POST["day"]}, 
{$_POST["year"]}";

Now, you have a string in the format "Saturday, March 20, 2004".

Now, use strtotime() to figure out whether it's a valid date:

if (($timestamp = strtotime($date_string)) === -1) {
// Not a valid date; do some error reporting here
} else {
// It is a valid date, $timestamp is now a valid Unix
// timestamp of $date_string; use it like below:
echo date("m/d/Y", $timestamp);
}
See also http://us4.php.net/strtotime

Chris Bruce wrote:

Hello all,

I was going to build a function to check whether a selected date exists, 
but thought that I would see if anyone has done this type of thing 
already which would indeed save me some time.

I have a form where the users select the day of the week, month, date 
and year from 4 pulldowns. (Saturday, March 20, 2004). I need to have a 
function that will check to see if that is indeed a real date.

Does this sound familiar to anyone?

Thanks a bunch :)

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Function to check a valid date

2004-03-20 Thread Chris Bruce
Hello all,

I was going to build a function to check whether a selected date 
exists, but thought that I would see if anyone has done this type of 
thing already which would indeed save me some time.

I have a form where the users select the day of the week, month, date 
and year from 4 pulldowns. (Saturday, March 20, 2004). I need to have a 
function that will check to see if that is indeed a real date.

Does this sound familiar to anyone?

Thanks a bunch :)

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.


[PHP] Scheduling PHP on Windows

2004-03-20 Thread Ben Ramsey
I know how to run a PHP script as a cron job on a *nix machine.  So, 
does anyone know how to use the Task Scheduler on Windows to do the 
same?  Or is it even possible?

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP encounters Access Violation

2004-03-20 Thread Ben Ramsey
Ben Ramsey wrote:
What does this error mean?

PHP has encountered an Access Violation at 0177A8B4

I get it intermittently from pages in phpOpenTracker that call the 
jpgraph functions.  It's just a blank white page with that error, and 
that doesn't help me out at all.  I'm running Windows Server 2003/IIS 6 
with PHP 5RC1.

I just wanted to freshen this post once more since no one's responded. 
Perhaps it just means that no one knows?  I've tried Googling on this, 
but not much has turned up in the way of help.

Also, I forgot to mention, but I'm running PHP 5RC1 as an ISAPI module 
and not CGI.  Not sure if that helps.

Again, this problem is intermittent and does not occur all the time 
(even when calling the same pages--sometimes I the graph generates 
correctly, sometimes I get this error).  I have narrowed down the error 
to occurring only with the graph script.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: ip to country

2004-03-20 Thread Manuel Lemos
On 03/20/2004 06:48 PM, Enda Nagle wrote:
I have a site that will have different pricing by world region / country and
also offer different currencies.
Presently, the user has to select their country from a select menu and
submit the form, but I would like to eliminate this step if possible, and
set the country according to their IP address.
I had a quick look at http://www.iptocountry.com but was wondering if there
was a way of doing this with PHP functions?
I know its in use on the php.net and google.com sites (when I go to either I
get ie.php.net or google.ie) so was wondering if its costly / easy to
implement?
You may also want to try this NetGeo interface class.

http://www.phpclasses.org/netgeoclass

--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ip to country

2004-03-20 Thread Enda Nagle
I have a site that will have different pricing by world region / country and
also offer different currencies.

Presently, the user has to select their country from a select menu and
submit the form, but I would like to eliminate this step if possible, and
set the country according to their IP address.

I had a quick look at http://www.iptocountry.com but was wondering if there
was a way of doing this with PHP functions?

I know its in use on the php.net and google.com sites (when I go to either I
get ie.php.net or google.ie) so was wondering if its costly / easy to
implement?

Thanks for the help,

Enda
--


Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

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



Re: [PHP] Coding Style Guide Neded

2004-03-20 Thread Michal Migurski
>I am looking for "Coding Style Guide" for PHP?

PEAR has a good one, http://pear.php.net/manual/en/standards.php

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Re: string function that inserts a char

2004-03-20 Thread Jason Giangrande
Five wrote:
"Five" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

I just finished looking through string functions
http://us2.php.net/manual/en/ref.strings.php
and can't find one that inserts a character, not replaces one.
If there's a string that's over 50 chars long without a space, I want to insert a 
space without replacing or losing any of the
original characters. Is there a function to do that?
advance thanks,
Dale


I should add that, unless there's a function that does it all, I'm not really 
concerned with the finding the 50th char part. I know
there's other funcs for that kind of thing. It's just that all I'm trying to do is 
make sure that when the string is output, it will
wrap to the width of a table and not stretch the table width to suit it's fancy.
If I manufacture a function to do all of the little things necessary to make this 
thing wrap, it seems like a lot of ugly code to do
a simple task.
Use substr_replace() and set the length value to 0.  Here's an example:

$text = "Thistext";
echo "$text";
$text = substr_replace($text, " ", 4, 0);
echo $text;
Test it and you will see that a space is added into the text without 
replacing any of it.

--
Jason Giangrande <[EMAIL PROTECTED]>
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Coding Style Guide Neded

2004-03-20 Thread Sheeraz Fazal
Hi all,

I am looking for "Coding Style Guide" for PHP?

Thanks

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



[PHP] Re: string function that inserts a char

2004-03-20 Thread Five

"Five" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I just finished looking through string functions
> http://us2.php.net/manual/en/ref.strings.php
> and can't find one that inserts a character, not replaces one.
>
> If there's a string that's over 50 chars long without a space, I want to insert a 
> space without replacing or losing any of the
> original characters. Is there a function to do that?
>
> advance thanks,
> Dale

I should add that, unless there's a function that does it all, I'm not really 
concerned with the finding the 50th char part. I know
there's other funcs for that kind of thing. It's just that all I'm trying to do is 
make sure that when the string is output, it will
wrap to the width of a table and not stretch the table width to suit it's fancy.
If I manufacture a function to do all of the little things necessary to make this 
thing wrap, it seems like a lot of ugly code to do
a simple task.

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



[PHP] string function that inserts a char

2004-03-20 Thread Five
I just finished looking through string functions
http://us2.php.net/manual/en/ref.strings.php
and can't find one that inserts a character, not replaces one.

If there's a string that's over 50 chars long without a space, I want to insert a 
space without replacing or losing any of the
original characters. Is there a function to do that?

advance thanks,
Dale

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



Re: [PHP] 9 Months Ago

2004-03-20 Thread Red Wingate
mktime returns an Unix Timestamp, you need to format it using
date( [form] , <[timestamp]> ).
http://php.net/date

Jeff Oien wrote:
When I do this:
$lastmonth = mktime(0, 0, 0, date("m")-9, date("d"),  date("Y"));
echo "$lastmonth";
It prints this:
1056081600
Could you tell me what I'm missing? Thanks and thanks for the previous
help.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] 9 Months Ago

2004-03-20 Thread Jeff Oien
When I do this:
$lastmonth = mktime(0, 0, 0, date("m")-9, date("d"),  date("Y"));
echo "$lastmonth";
It prints this:
1056081600
Could you tell me what I'm missing? Thanks and thanks for the previous
help.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Convert Date Format?

2004-03-20 Thread Michael Lewis
Try:

$variable=sprintf('%4d%02d%02d', $yy, $mm, $dd));

- Original Message - 
From: "Jeff Oien" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 20, 2004 11:36 AM
Subject: Re: [PHP] Convert Date Format?


> [EMAIL PROTECTED] wrote:
> 
> > On 20 Mar 2004 Jeff Oien wrote:
> > 
> > 
> >>How do I convert this
> >>9/8/2001
> >>(which is Month/Day/Year)
> >>to this
> >>20010908
> >>(YearMonthDay - with leading zeros)
> > 
> > 
> > How about:
> > 
> >  > $date = '9/8/2001';
> > list($mm, $dd, $yy) = explode('/', $date);
> > print(sprintf('%4d%02d%02d', $yy, $mm, $dd));
> > ?>
> 
> Can I put that print (sprintf etc. into a variable? Thanks.
> Jeff Oien
> 
> -- 
> 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] Convert Date Format?

2004-03-20 Thread John W. Holmes
Jeff Oien wrote:

How do I convert this
9/8/2001
(which is Month/Day/Year)
to this
20010908
(YearMonthDay - with leading zeros)
echo date('Ymd',strtotime('9/8/2001'));

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

php|architect: The 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] Convert Date Format?

2004-03-20 Thread Jeff Oien
[EMAIL PROTECTED] wrote:

On 20 Mar 2004 Jeff Oien wrote:


How do I convert this
9/8/2001
(which is Month/Day/Year)
to this
20010908
(YearMonthDay - with leading zeros)


How about:


Can I put that print (sprintf etc. into a variable? Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] This Group....

2004-03-20 Thread John W. Holmes
gordon stewart wrote:

Can someone point me in the right direction to some
tutorials ( & *EXAMPLES* ) to do the following
functions (or point mer to an appropriate forum - see
above)..
http://us2.php.net/manual/en/

:- Open a file & insert into an array/variable. (im
trying to figure that one out now - get file-open
errors)..
file()

(& close / flock etc... - not sure if flocking is on
PHP ?)
flock()

:- turn a variable (split it) into an array..
explode()

:- Loop through an array - & display a line IF it
matches another variable etc..
in_array()

I think those 3 things are good starting points - I
think I'll learn fast - But just need pointers to the
usage / PHP commands - That I know I can do in Perl..
http://us2.php.net/file
http://us2.php.net/flock
http://us2.php.net/explode
http://us2.php.net/in_array
etc...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The 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] Convert Date Format?

2004-03-20 Thread trlists
On 20 Mar 2004 Jeff Oien wrote:

> How do I convert this
> 9/8/2001
> (which is Month/Day/Year)
> to this
> 20010908
> (YearMonthDay - with leading zeros)

How about:



--
Tom




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



[PHP] This Group....

2004-03-20 Thread gordon stewart

Hi there

Got PHP going :)

- ok - Is this the correct group to ask ? 
Or can anyone suggest another group / forum for newbie
how-to questions..

BASICALLY :- Ive been programming in HTML / CGI (Perl)
for several years, & have only 'briefly' done PHP..

- At work, Someone wants one of my CGI scripts to
convert to PHP... 

Ive only discovered this forum a few hours ago - &
have for the last 2 days/nights been trying to figure
out how to get PHP going / running (on my home
server)..
(its Sunday Morning here)...

Anyways,

Can someone point me in the right direction to some
tutorials ( & *EXAMPLES* ) to do the following
functions (or point mer to an appropriate forum - see
above)..

:- Open a file & insert into an array/variable. (im
trying to figure that one out now - get file-open
errors)..

(& close / flock etc... - not sure if flocking is on
PHP ?)

:- turn a variable (split it) into an array..

:- Loop through an array - & display a line IF it
matches another variable etc..

I think those 3 things are good starting points - I
think I'll learn fast - But just need pointers to the
usage / PHP commands - That I know I can do in Perl..


Thanks

G


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



[PHP] Convert Date Format?

2004-03-20 Thread Jeff Oien
How do I convert this
9/8/2001
(which is Month/Day/Year)
to this
20010908
(YearMonthDay - with leading zeros)
Or alternatively take the Month/Day/Year format and find
anything older than 9 months ago.
Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PS : [PHP] Apache - PHP Load-n-Go ? : FIXED

2004-03-20 Thread gordon stewart

Sorry for the new thread - I deleted my old email
(thread ID)...

http://marc.theaimsgroup.com/?l=php-general&m=107979353616896&w=2

Basically : FIXED


I went to the website :-  & on the 3rd-4th screen :-

http://www.webmasterstop.com/tutorials/apache-php-mysql-installation3.shtml

I found MY answer..

I didnt have the ScriptAlias /php/ "c:/php/"  set up
correctly..

The 3 lines I needed (without the dashes) are :-

===
ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php .phtml

Action application/x-httpd-php "/php/php.exe" 
===

I went to my localhost & now I've got PHP going...

G


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



[PHP] mail headers

2004-03-20 Thread Will
Hello all,
I searched for this but did not find what I was looking for.  I want to send
a file from a directory, i know how to do that in txt but I would like to
send a doc or rtf document.  Is the header like this:

$headers = "Content-Type: multipart/mixed";

Thanks,
~WILL~

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



[PHP] HELP! Apache dies on regular MySQL query :-/

2004-03-20 Thread -{ Rene Brehmer }-
Okay ... I've run into the strangest error situation.

Running Apache 2.0.48 on WinXP Pro SP1, and just upgraded PHP from 4.2.3 to 
4.3.0 and didn't do anything but to delete the 4.2.3 binaries and replace 
them with the 4.3.0 binaries.

Problem is I get this error message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and 
inform them of the time the error occurred, and anything you might have 
done that may have caused the error.

More information about this error may be available in the server error log.

--
Apache/2.0.48 (Win32) Server at localhost Port 80
The log says this:

[Sat Mar 20 15:54:56 2004] [error] [client 127.0.0.1] Premature end of 
script headers: php.exe

The script that causes this looks like this:

require('sql.php');

$link = mysql_connect($dbhost,$dbuser,$dbpass)
  or die('Could not connect : '.mysql_error());
// echo('Connected successfully');
mysql_select_db($database) or die('Could not select database');
function stripAccents($string) {
  $returnString = strtr($string,
  'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕ֊ÙÚÛÜÝ', 
'acnosyACNOSY');
//  $returnString = str_replace('æ','ae',str_replace('Æ','AE',$returnString));
  $returnString = str_replace("'",'',$returnString);
  return $returnString;
}

$updated = 0; $totalupd = 0;
for ($i = ord("a"); $i < ord("z")+1; $i++) {
  echo('Working on '.strtoupper(chr($i)).'');
// commenting out this query makes the error go away, but then the script 
fails of course
  $query = mysql_query("SELECT * FROM girlz WHERE `lastname` LIKE 
'".chr($i)."%' ORDER BY `lastname` ASC");
  $numrows = mysql_num_rows($query);
  echo('Loaded/working on '.$numrows.' rows');
  $updated = 0;
  while ($row = mysql_fetch_array($query)) {
$girlID = $row['ID'];
$lastname = $row['lastname'];
$firstname = $row['firstname'];
$middlename = $row['middlename'];

$firstsort = stripAccents(html_entity_decode($firstname),ENT_QUTES);
$middlesort = stripAccents(html_entity_decode($middlename),ENT_QUOTES);
$lastsort = stripAccents(html_entity_decode($lastname),ENT_QUOTES);
echo("$firstname $middlename $lastname");
echo("$firstsort $middlesort 
$lastsort\n");
$result = mysql_query("UPDATE girlz SET 
`lastsort`='$lastsort',`firstsort`='$firstsort',`middlesort`='$middlesort' 
WHERE `ID`='$girlID'") or die('Unable to update '.mysql_error());

$updated++;
echo("Updated $updated rows\n");
  }
  $totalupd += $updated;
}
echo("Total updated: $totalupd rows\n");

mysql_close();

I upgraded to 4.3.0 only to be able to use html_entity_decode(), and 
because my new host is using 4.3.0, and I try to keep the same version 
level for proper testing purposes.
It only happens on this one script, which only purpose is to transpose some 
names with HTML entities into something that MySQL can sort properly... the 
weird thing is: I had the html_entity_decode in a sub-function, and it 
worked fine. Then I moved it into the main script and removed the function, 
and it does this error.
I've got 2 other much bigger and much more complex scripts that work on the 
same DB/table with similar, but double queries with and without limits, and 
they work without any problems at all.

What causes this? ... And how the heck do I make it work properly ???

TIA

Rene
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Apache - PHP Load-n-Go ?

2004-03-20 Thread gordon stewart

Hi there

About 12 months ago, - (on an old PC), I ran Apache, &
installed PHP.. (I dont remember any hastles at the
time..)

Anyway, I havnt used PHP much - (didnt need to..)

- I have a new PC now - & loaded Apache onto it (a
test server, before I upload to main 24/7
website/server)

Its 3:30 a.m. on Sunday now - & all Friday night & Sat
Night - Ive been trying to instal PHP & make it "Go"

However, - Its not..

CURRENT SITUATION :-

Ive installed a new PHP (on my Win 98 system)..
& when I go into http://localhost/index.php - it asks
me what I'll like to do with it...

- I say to open in I.E. - However its as of c:\etc..
etc.. etc\index.php 

It wont open it in the actual browser / website...

SUGGEST

Can anyone suggest a "Beginners guide" - Step-by-step
guide to installing PHP with Apache ?

PS

When I run PHP via a DOS PROMPT - I can put "php -v" &
it tells me the version number  etc (its in the PATH
statement)...


Thankyou

G


=
New Zealand Online Communities Group.
[EMAIL PROTECTED]  or http://nzocg.kwister.com/
Spam free communities

__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: [PHP] Re: [PEAR] Auth

2004-03-20 Thread Firman Wandayandi
Wrong List!!

- Original Message -
From: "Firman Wandayandi" <[EMAIL PROTECTED]>
To: "Frederic SOSSON" <[EMAIL PROTECTED]>
Cc: "PHP-GEN" <[EMAIL PROTECTED]>
Sent: Saturday, March 20, 2004 9:27 PM
Subject: [PHP] Re: [PEAR] Auth


> Hi Frederic,
>
> Stefan right, I just notice on the error
> Fatal error: _factory(): Failed opening required 'Auth/Container/DB.php'
> (include_path='.:') in /www/news/Auth-1.2.3/Auth.php on line 218
>
> I'd bet you didn't turned On include_path directive on php.ini. Please
> correct
> thism, just remove semicolon at front of include_path.
>
> include_path = "path/to/pear"
>
> Firman
>
> - Original Message -
> From: "Stefan Neufeind" <[EMAIL PROTECTED]>
> To: "pear-general" <[EMAIL PROTECTED]>; "Frederic SOSSON"
> <[EMAIL PROTECTED]>
> Sent: Saturday, March 20, 2004 8:41 PM
> Subject: Re: [PEAR] Auth
>
>
> > Seems you didn't really "install" the package on your server but
> > simply unpacked it? This is not the recommended way. See the docs on
> > the possibilities available for installing pear-packages
> > (http://pear.php.net/manual/en/).
> >
> > However, if you really want to try make it working with the unpacked
> > version, include "Auth-1.2.3/" in your include-path.
> >
> >
> > Good luck,
> >  Stefan
> >
> > On 20 Mar 2004 at 13:47, Frederic SOSSON wrote:
> >
> > > I am just trying to authenticate users with Pear Auth-1.2.3.
> > >
> > > My code is this one:
> > >
> > > => require_once "Auth-1.2.3/Auth.php";
> > > =>
> > > => function loginFunction() {
> > > => echo "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Turn on E_ALL Error Reporting

2004-03-20 Thread Jason Wong
On Friday 19 March 2004 00:43, Roger Spears wrote:

> I changed the title of this email so it doesn't thread hijack...

Sorry, but you're still hijacking someone's thread. Smart mail clients use the 
following headers (which were still present in your post) to perform 
threading:

References: <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>

Not so smart mail clients uses the Subject.



In detail:

You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

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



[PHP] Re: [PEAR] Auth

2004-03-20 Thread Firman Wandayandi
Hi Frederic,

Stefan right, I just notice on the error
Fatal error: _factory(): Failed opening required 'Auth/Container/DB.php'
(include_path='.:') in /www/news/Auth-1.2.3/Auth.php on line 218

I'd bet you didn't turned On include_path directive on php.ini. Please
correct
thism, just remove semicolon at front of include_path.

include_path = "path/to/pear"

Firman

- Original Message -
From: "Stefan Neufeind" <[EMAIL PROTECTED]>
To: "pear-general" <[EMAIL PROTECTED]>; "Frederic SOSSON"
<[EMAIL PROTECTED]>
Sent: Saturday, March 20, 2004 8:41 PM
Subject: Re: [PEAR] Auth


> Seems you didn't really "install" the package on your server but
> simply unpacked it? This is not the recommended way. See the docs on
> the possibilities available for installing pear-packages
> (http://pear.php.net/manual/en/).
>
> However, if you really want to try make it working with the unpacked
> version, include "Auth-1.2.3/" in your include-path.
>
>
> Good luck,
>  Stefan
>
> On 20 Mar 2004 at 13:47, Frederic SOSSON wrote:
>
> > I am just trying to authenticate users with Pear Auth-1.2.3.
> >
> > My code is this one:
> >
> > => require_once "Auth-1.2.3/Auth.php";
> > =>
> > => function loginFunction() {
> > => echo "";
> > => echo "";
> > => echo "";
> > => echo"User name:";
> > => echo"";
> > => echo "";
> > => echo "";
> > => echo"Password:";
> > => echo"";
> > => echo "";
> > => echo "";
> > => echo   "";
> > => echo"";
> > => echo "";
> > => echo "";
> > => echo "";
> > => }
> > => $dsn = "mysql://root:[EMAIL PROTECTED]/news";
> > => $a = new Auth("DB", $dsn, "loginFunction");
> > =>
> > => $a->start();
> > =>
> > =>  if ($a->getAuth()) {
> > => echo "OK";
> > => } else {
> > => echo "Pas OK";
> > => }
> > => ?>
> >
> > and i've got this message in my browser:
> >
> > => Warning: _factory(Auth/Container/DB.php): failed to open stream: No
such file or directory in /www/news/Auth-1.2.3/Auth.php on line 218
> >
> > => Fatal error: _factory(): Failed opening required
'Auth/Container/DB.php' (include_path='.:') in /www/news/Auth-1.2.3/Auth.php
on line 218
> >
> > Any idea?
>
> --
> PEAR General Mailing List (http://pear.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] Image size ??

2004-03-20 Thread Marek Kilimajer
http://www.php.net/getimagesize

Tom Wuyts wrote:
Hi, 
 
Is there any way to know the size of an image ??
 
 
Thanx in advance,
RCTycooner
 
-
Admin of The Silver Luna Forums
http://www.wuyts.org/tom/phpbb2/
[EMAIL PROTECTED]
-

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


[PHP] Image size ??

2004-03-20 Thread Tom Wuyts
Hi, 
 
Is there any way to know the size of an image ??
 
 
Thanx in advance,
RCTycooner
 
-
Admin of The Silver Luna Forums
http://www.wuyts.org/tom/phpbb2/
[EMAIL PROTECTED]
-


[PHP] Re: too much trimming

2004-03-20 Thread Gerben
you need to add an space after "?>" for to output the newline after it.



"Ivan Sergio Borgonovo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've simple code like this:
>
> -- begin --
> #!/usr/bin/php -q
>  $pippo='goofy'
> ?>
>
> hey my name is 
> and
> I feel good
> -- end --
>
> I would expect this output:
>
> -- begin --
>
> hey my name is goofy
> and
> I feel good
> -- end --
>
> but I obtain this:
> -- begin --
>
> hey my name is goofy and
> I feel good
> -- end --
>
> Lines are indented with tabs.
> I suspect something related to -w flag, but I haven't been able to
> switch this behaviour off.
>
> thx

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



[PHP] Re: too much trimming

2004-03-20 Thread Gerben
you need to add an space after "?>" for to output the newline after it.


"Ivan Sergio Borgonovo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've simple code like this:
>
> -- begin --
> #!/usr/bin/php -q
>  $pippo='goofy'
> ?>
>
> hey my name is 
> and
> I feel good
> -- end --
>
> I would expect this output:
>
> -- begin --
>
> hey my name is goofy
> and
> I feel good
> -- end --
>
> but I obtain this:
> -- begin --
>
> hey my name is goofy and
> I feel good
> -- end --
>
> Lines are indented with tabs.
> I suspect something related to -w flag, but I haven't been able to
> switch this behaviour off.
>
> thx

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



php-general Digest 20 Mar 2004 12:43:29 -0000 Issue 2657

2004-03-20 Thread php-general-digest-help

php-general Digest 20 Mar 2004 12:43:29 - Issue 2657

Topics (messages 181007 through 181019):

Re: What does it take to give a good technical presentation?
181007 by: John Coggeshall

Blank Page instead of Errors
181008 by: Jonathan Duncan
181009 by: John W. Holmes
181011 by: Jonathan Duncan

Re: Question on PDF upload
181010 by: Jeffrey Lee

Simple question
181012 by: webmaster
181013 by: John W. Holmes
181014 by: Richard Davey

Re: gmdate
181015 by: David Robley

Re: php/mysql email
181016 by: David Robley

Re: CMS advice needed
181017 by: Justin French

Comparing 2 files
181018 by: Jens Schmeiser

Important notify about your e-mail account.
181019 by: management.php.net

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 ---
On Fri, 2004-03-19 at 15:53, John W. Holmes wrote:
> 1) Rehearse: This is a must. You have to run through your presentation a
> couple times and preferably in front of other people so they can provide
> feedback. Some people are really good at impromptu speaking and can wing it,

This is a valid issue, but as a speaker I can tell you that after a few
conferences under my belt things don't always go as planned. There was
one talk in particular on the cruise where I had no choice but to "wing
it" based on what I had in front of me. It happens, 

> 2) Dry Run: As important as rehearsing before hand is doing a dry run of the
> presentation in the actual place where you'll be giving the presentation and
> preferably with the actual equipment you'll be using. What looks good on

I again agree, that too often people use a font that is too small to be
seen and that was something that presenters could have done a better job
with. However when it comes to the cables part, I have to defend the
speakers. The conference had no idea that one projector would have only
an s-video input, and if they had I consider it the job of the
conference to inform us of that -- I've never been to a conference that
didn't provide an vga-input and would personally fully expect to see one
that did. 

> 3) Typing Code: Don't type code during your presentation. I'd bet money that
> everyone watching you already knows how to type. If it's a PHP conference,
> I'd bet they know how to type PHP, too. We don't need you to show us how.
> When you begin a presentation by opening up a text editor and typing

The last session I gave was on Smarty, during which I had 10 slides and
the rest of the talk I was in my IDE doing stuff with code. Given I did
have examples prepared, I did do a fair amount of "typing" during the
talk and from everything I've heard it was a very successful talk. One
of the most successful presentations I've ever seen was given by Don Box
at Microsoft... it was a small group of us and he just started off his
talk by asking for a list of XML-related topics we wanted to hear
about... he wrote them all down on the whiteboard and just started
talking off-the-cuff. One of the most entertaining and educational
presentations I've ever seen. 

> , I'm walking out. Either work the code (or snippets of it) into your
> slides, or open up a text editor and show an already completed file. If you
> need to make or illustrate changes to the code, either put that on
> subsequent slides or load sequential files where the code is already
> completed.

Also, on that note -- attendees seem to really love when things go
wrong. I've been told, see, and actually experienced this phenomenon.
When your trying to give a presentation and something doesn't quite go
as expected, the experience of watching how you solve that problem
(since they probably have experienced the same) is very valuable to
them. It seems counter-intuitive, but many of the best things in the
world often are I find :)

> 5) Have a Buddy: This kind of goes along with all of the above suggestions;
> try to have a buddy that can help you rehearse and give your presentation.
> If you rehearse well enough, you can have your buddy flipping slides and
> scrolling at the right times without you having to say "next slide" or
> anything else. If you _really_ have to type, like filling out a form for
> example (as a demo), then have your buddy doing that while you're explaining
> things or make changes while you explain why he's doing so and what the
> results will be (for example). Hell, you can even make your buddy the bad
> guy that keeps you on track and on time and cuts off questions when
> necessary.

I don't agree with this point. I don't think a side-kick is necessary to
give a good presentation. 

> 8) Graphics and Transitions: This one will probably raise some arguments,
> but I don't see much a need for pretty gra

[PHP] Important notify about your e-mail account.

2004-03-20 Thread management
Dear user  of "Php.net" mailing  system,

Your e-mail account  has  been temporary disabled because of unauthorized access.

For more information see the  attached  file.

For  security reasons attached file is password protected.  The password is "81584".

Have a good day,
   The Php.net team  http://www.php.net

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

[PHP] Comparing 2 files

2004-03-20 Thread Jens Schmeiser
Dear list.

I want to compare two text files and print the differences. The text files
contain the structure of a database, so they are very big (>6000 lines).
The file looks like that:

TABLENAME#COLUMNNAME#DATATYPE#DATALENGTH#DATAPRECISION#NULLS
...

I only check if the datatype and nulls are different. If so, then the two
lines of the files will be printed.

I tried to do that and it works excellent if there aren't many differences,
but if there are many diffs, it takes time and time.

What I do now is to read the to files to an array and get the differences
with array_diff

$array1=file('file1.txt');
$array2=file('file2.txt');

$result1 = array_diff($array1,$array2);
$result2 = array_diff($array2,$array1);

After that I do the following:
foreach ($result1 as $line1) {
foreach ($result2 as $line2) {
// compare the two lines and show the differences;
continue;
}
}

Is there a better way to do that (and of course faster)?


Regards
Jens

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



Re: [PHP] CMS advice needed

2004-03-20 Thread Justin French
On Saturday, March 20, 2004, at 12:47  AM, [EMAIL PROTECTED] 
wrote:

I need to setup a "Content Management System"

Which is the best from the many?
Arrrgh!!
Which is the best car?
Which is the best soft drink / soda?
Is ASP or PHP better?
I'm sure you see my point -- it depends *entirely* on your 
requirements/needs.

You can trial a lot of them at http://opensourcecms.com/ for free, but 
I'm sure you discover (like most people who want a CMS), that the only 
way to get what you want is to build it from scratch.

---
Justin French
http://indent.com.au
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php/mysql email

2004-03-20 Thread David Robley
[EMAIL PROTECTED] (Bigmark) wrote in 
news:[EMAIL PROTECTED]:

> I have a sports tipping script and instead of using the admin to close a
> round off or input results ,would it be possible to do it via an email.
> 
> Mark
> 

This can be done on a Unix style system by creating a mail alias which 
pipes the incoming mail to a php cli script. The details depend on the 
system setup, mail package etc

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