[PHP] Re: PHP and XML

2009-11-24 Thread Nathan Rixham
Juan wrote:
> El día 23 de noviembre de 2009 13:25, Nathan Rixham
>  escribió:
>> Juan Marcelo Rodríguez Monti wrote:
>>> Hi people,
>>> I have some doubts about this topic that I'm gonna explain.
>>>
>>> I have a few sites in flash, and I was requested to write a PHP frontend
>>> to send news. I have this already done and it works perfect. It's a LAMP
>>> App to send and edit news, post video, images and so on.
>>>
>>> Then, I need to put all this news into the Flash site. So, I need to use
>>> XML. I'm not gonna discuss about Flash, because this is a PHP List,
>>> however I would like to talk about PHP and XML.
>>>
>>> What do you recommend me to produce XML from those news of the SQL
>>> database?. What do you suggest to output XML from the existing content
>>> to then put those XML files into Flash.
>>>
>>> The posted news are saved in a MySQL database. I don't know if do I need
>>> to output from PHP then parse the output and convert it to XML, or if Do
>>> I need to get the array from the MySQL and directly output this to an
>>> XML file to then get from this file from Flash.
>>>
>>> Thanks,
>>> Juan.
>>>
>> flash remoting: you could use amf instead; its faster and easier to use.
>>
>> on the php side just use http://amfphp.org/ or suchlike
> 
> Thanks. I didn't know that. Did you test this applications ?  How well
> does it work ?.
> 
> Juan
> 


yeah it's great, all stable, and been used for years in most enterprise
apps - that's what flash remoting is; and AMF is adobe message format..
so official feature :) also mucho support in java etc (and all langs afaik).

regards!

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



[PHP] Re: PHP and XML

2009-11-24 Thread Juan
El día 23 de noviembre de 2009 13:25, Nathan Rixham
 escribió:
> Juan Marcelo Rodríguez Monti wrote:
>> Hi people,
>> I have some doubts about this topic that I'm gonna explain.
>>
>> I have a few sites in flash, and I was requested to write a PHP frontend
>> to send news. I have this already done and it works perfect. It's a LAMP
>> App to send and edit news, post video, images and so on.
>>
>> Then, I need to put all this news into the Flash site. So, I need to use
>> XML. I'm not gonna discuss about Flash, because this is a PHP List,
>> however I would like to talk about PHP and XML.
>>
>> What do you recommend me to produce XML from those news of the SQL
>> database?. What do you suggest to output XML from the existing content
>> to then put those XML files into Flash.
>>
>> The posted news are saved in a MySQL database. I don't know if do I need
>> to output from PHP then parse the output and convert it to XML, or if Do
>> I need to get the array from the MySQL and directly output this to an
>> XML file to then get from this file from Flash.
>>
>> Thanks,
>> Juan.
>>
>
> flash remoting: you could use amf instead; its faster and easier to use.
>
> on the php side just use http://amfphp.org/ or suchlike

Thanks. I didn't know that. Did you test this applications ?  How well
does it work ?.

Juan

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



[PHP] Re: PHP and XML

2009-11-23 Thread Nathan Rixham
Juan Marcelo Rodríguez Monti wrote:
> Hi people,
> I have some doubts about this topic that I'm gonna explain.
> 
> I have a few sites in flash, and I was requested to write a PHP frontend
> to send news. I have this already done and it works perfect. It's a LAMP
> App to send and edit news, post video, images and so on.
> 
> Then, I need to put all this news into the Flash site. So, I need to use
> XML. I'm not gonna discuss about Flash, because this is a PHP List,
> however I would like to talk about PHP and XML.
> 
> What do you recommend me to produce XML from those news of the SQL
> database?. What do you suggest to output XML from the existing content
> to then put those XML files into Flash.
> 
> The posted news are saved in a MySQL database. I don't know if do I need
> to output from PHP then parse the output and convert it to XML, or if Do
> I need to get the array from the MySQL and directly output this to an
> XML file to then get from this file from Flash.
> 
> Thanks,
> Juan.
> 

flash remoting: you could use amf instead; its faster and easier to use.

on the php side just use http://amfphp.org/ or suchlike

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



RE: [PHP] Re: PHP and CGI

2009-08-19 Thread Bob McConnell
From: sono...@fannullone.us
> On Aug 18, 2009, at 7:13 PM, Shawn McKenzie wrote:

> P.S.  Does anyone know of a good Perl mailing list?

beginn...@perl.org

Or you can try www.perlmonks.org.

Bob McConnell

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



Re: [PHP] Re: PHP and CGI

2009-08-19 Thread Ben Dunlap
>        That's exactly the case.  I have been running my business on a Perl
> cart for the last 5+ years, and I can't switch to a PHP cart just yet.  I
> was just hoping to add some functionality with PHP.  Perl was much harder

It would probably bomb your performance but you could always call a
separate PHP script from your Perl code:

#!/usr/bin/perl

# do some stuff in perl

my $php_output = `/usr/bin/php whatever.php`

# do something with $php_output

1;

If you're just looking to add some features quickly to your existing
Perl code: Have you searched CPAN for what you need?

Ben

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



Re: [PHP] Re: PHP and CGI

2009-08-18 Thread kranthi
try adding

AddType application/x-httpd-php .pl --> or whatever extension your
perl script has

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



Re: [PHP] Re: PHP and CGI

2009-08-18 Thread sono-io


On Aug 18, 2009, at 7:13 PM, Shawn McKenzie wrote:


I assumed that the problem was that he
knew PHP and he had downloaded a Perl cart and didn't know Perl.


	That's exactly the case.  I have been running my business on a Perl  
cart for the last 5+ years, and I can't switch to a PHP cart just  
yet.  I was just hoping to add some functionality with PHP.  Perl was  
much harder for me to grasp than PHP, and from what I can tell, you  
can't embed Perl in HTML as easy as you can with PHP, so I've switched  
languages.  I guess I was hoping for too much. =:(


Thanks,
Frank

P.S.  Does anyone know of a good Perl mailing list?

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



Re: [PHP] Re: PHP and CGI

2009-08-18 Thread Shawn McKenzie


Andrew Mason wrote:
> If you already have it written in Perl, I would recommend writing the
> rest of functionality in Perl.
>
>   
Please reply all.  I agree, but I assumed that the problem was that he
knew PHP and he had downloaded a Perl cart and didn't know Perl.

-Shawn

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



[PHP] Re: PHP and CGI

2009-08-18 Thread Shawn McKenzie
sono...@fannullone.us wrote:
> I've searched high and low for an answer to this.  Hopefully someone
> here might know.  Can PHP be used under a CGI?  I tried to put the
> following code on one of my perl shopping cart pages but it doesn't work:
> 
>  echo "";
> for ($year = date("Y") ; $year <= date("Y") + 8 ; $year++) {
> echo "$year\n";
> }
> echo "";
> ?>
> 
>  It works fine on a .php page.  I know that SSI will not work under
> CGI, so maybe it's the same for PHP.  Is there anyway to get this to work?
> 
> Thanks,
> Frank

PHP can run under CGI, however you're asking about mixing PHP with Perl.
 CGI != Perl.  CGI is the interface that your scripts have to the
programs that run them (i.e. Perl or PHP, etc...).

I've never done it, but to have both Perl and PHP parsed in one file,
you'd have to configure Apache (or your webserver) to parse the file
using PHP and then Perl.  Not sure if it would do this sequencially though.

Another option may be to put the PHP in its own PHP file and then fetch
it into your Perl script.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



RE: [PHP] ! and !=

2009-04-23 Thread Ford, Mike
On 23 April 2009 01:05, George Langley advised:

>   Doh, of course! Just not thinking about the scope of
> the operator. If $var1 = 1, then !$var1 = 0
>   Thanks everyone!

Well, actually, to be strictly accurate, since ! is a Boolean operator,
if $var1 = 1 then !$var1 = FALSE.

Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: m.f...@leedsmet.ac.uk
Tel: +44 113 812 4730


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] ! and !=

2009-04-22 Thread George Langley
Doh, of course! Just not thinking about the scope of the operator. If 
$var1 = 1, then !$var1 = 0
Thanks everyone!

George

- Original Message -
From: Tom Rogers 
Date: Wednesday, April 22, 2009 17:01
Subject: Re: [PHP] ! and !=
To: George Langley 
Cc: php-general@lists.php.net

> Hi,
> 
> Thursday, April 23, 2009, 8:30:34 AM, you wrote:
> GL> Hi 
> all. Maybe I'm just getting confused by all the
> GL> languages I'm trying to work with! But, isn't:
> 
> GL> if(!$var1 == $var2){
> 
> GL> the same thing as
> 
> GL> if($var1 != $var2){
> 
> GL> #1 doesn't 
> work, #2 does.
> GL> Thanks!
> 
> 
> GL> George Langley    Multimedia Developer    Audio/Video Editor   
> GL> Musician, Arranger, Composer www.georgelangley.ca
> 
> GL> "Too many choices, too little sleep."
> 
> Use brackets to make them the same:
> 
> if(!($var1 == $var2)) {
> 
> -- 
> regards,
> Tom
> 
> 

George Langley    Multimedia Developer    Audio/Video Editor    Musician, 
Arranger, Composer www.georgelangley.ca




Re: [PHP] ! and !=

2009-04-22 Thread Tom Rogers
Hi,

Thursday, April 23, 2009, 8:30:34 AM, you wrote:
GL> Hi all. Maybe I'm just getting confused by all the
GL> languages I'm trying to work with! But, isn't:

GL> if(!$var1 == $var2){

GL> the same thing as

GL> if($var1 != $var2){

GL> #1 doesn't work, #2 does.
GL> Thanks!


GL> George Langley    Multimedia Developer    Audio/Video Editor   
GL> Musician, Arranger, Composer www.georgelangley.ca

GL> "Too many choices, too little sleep."

Use brackets to make them the same:

if(!($var1 == $var2)) {

-- 
regards,
Tom


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



Re: [PHP] ! and !=

2009-04-22 Thread Chris

George Langley wrote:

Hi all. Maybe I'm just getting confused by all the languages I'm trying 
to work with! But, isn't:

if(!$var1 == $var2){

the same thing as

if($var1 != $var2){

#1 doesn't work, #2 does.
Thanks!


No.

The second is seeing if $var1 is not equal to $var2.

The first one is doing a "not $var1" is equal to $var2 - which will 
change it from whatever it is into false. (It's currently set - so 
that's true, you're switching that - so it becomes false).


$ cat test.php
http://www.designmagick.com/


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



Re: [PHP] ! and !=

2009-04-22 Thread 9el
On Thu, Apr 23, 2009 at 4:30 AM, George Langley  wrote:
>        Hi all. Maybe I'm just getting confused by all the languages I'm 
> trying to work with! But, isn't:
>
> if(!$var1 == $var2){

Means  if (NOT($var1) == $var2)
>
> the same thing as
>
> if($var1 != $var2){

means $var1 NOTEQUALS $var2

>
>        #1 doesn't work, #2 does.
:)

Lenin

www.twitter.com/nine_L

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



Re: [PHP] Re: PHP and Send Mail

2009-04-09 Thread Michael A. Peters

Bob McConnell wrote:
*snip*


Just be aware that it does have a few bugs you may need to work around
or patch. The SourceForge tracker is at
. I
submitted two reports last year against 1.73 which the tracker says were
summarily closed with no comment and apparently no action. The first one
is listed as fixed in the change logs for 2.0.3 and 2.3, but that was
not recorded in the tracker.

1. Incorrect line ending character. RFC 2821 and 2822 require CR/LF line
endings. PHPMailer only puts in the LF. Just because most current
clients can handle the single character is no excuse for doing it wrong.

2. Invalid use of Return-path for Sender. When you request a Sender
header, the email is written with Return-path instead. According to
those RFCs, the latter is reserved for use by transport agents and may
be rewritten or replaced anywhere in the chain. It should insert a
Sender line instead.

Bob McConnell



I wonder if that could be fixed by extending the class.
I'll have to look at it, I like standards compliance, the web would be a 
better place if standards were always strictly enforced.



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



RE: [PHP] Re: PHP and Send Mail

2009-04-09 Thread Bob McConnell
From: Michael A. Peters
> 9el wrote:
>> On Thu, Apr 9, 2009 at 7:19 AM, Shawn McKenzie 
wrote:
>>> Alejandro Esteban Galvez wrote:
 Hi!, I am making a web system and i need known how send a mail
using PHP
>> Hi,
>> Use PHPmailer or PEAR:mail()
> 
> I second PHPmailer.
> It rocks!

Just be aware that it does have a few bugs you may need to work around
or patch. The SourceForge tracker is at
. I
submitted two reports last year against 1.73 which the tracker says were
summarily closed with no comment and apparently no action. The first one
is listed as fixed in the change logs for 2.0.3 and 2.3, but that was
not recorded in the tracker.

1. Incorrect line ending character. RFC 2821 and 2822 require CR/LF line
endings. PHPMailer only puts in the LF. Just because most current
clients can handle the single character is no excuse for doing it wrong.

2. Invalid use of Return-path for Sender. When you request a Sender
header, the email is written with Return-path instead. According to
those RFCs, the latter is reserved for use by transport agents and may
be rewritten or replaced anywhere in the chain. It should insert a
Sender line instead.

Bob McConnell

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



Re: [PHP] Re: PHP and Send Mail

2009-04-08 Thread Michael A. Peters

9el wrote:

On Thu, Apr 9, 2009 at 7:19 AM, Shawn McKenzie  wrote:

Alejandro Esteban Galvez wrote:

Hi!, I am making a web system and i need known how send a mail using PHP

Hi,
Use PHPmailer or PEAR:mail()


I second PHPmailer.
It rocks!

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



Re: [PHP] Re: PHP and Send Mail

2009-04-08 Thread 9el
On Thu, Apr 9, 2009 at 7:19 AM, Shawn McKenzie  wrote:
> Alejandro Esteban Galvez wrote:
>> Hi!, I am making a web system and i need known how send a mail using PHP
Hi,
Use PHPmailer or PEAR:mail()

And I'm Lenin

Bye :)

www.twitter.com/nine_L

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



[PHP] Re: PHP and Send Mail

2009-04-08 Thread Shawn McKenzie
Alejandro Esteban Galvez wrote:
> Hi!, I am making a web system and i need known how send a mail using PHP 
> 
> Bye
> 
> 
> 
> ---
> Alejandro Esteban Galvez
> Administrador de Red IPICHMC Rimed,
> Radio-Aficionado CL2AEG
> Linux User #472120 - http://i18n.counter.li.org/
> Correo: alejan...@infomed.sld.cu
> Correo y Jabber: alejan...@ipichmc.rimed.cu
> www.ipichmc.rimed.cu
> ---
> 
> 
> 
> 
> 
> ---
> Red Telematica de Salud - Cuba
> CNICM - Infomed
> 
> 
Hi! I'm Shawn.

Bye

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] & and && and weird results

2009-04-01 Thread Chris



Thanks for that. I understand. Somehow, I had tried OR at one point but
I got one of those orange boxes probably for some other error and in the
confusion of my neurons I overlooked it.
However, I am puzzled that using & (not &&) did give a lot of results,
almost the whole db which is thankfully not very big for testing purposes.


&& means "and".

"&" is a bitwise operation.

These pages explain it much better than I can.

http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html
http://au.php.net/manual/en/language.operators.bitwise.php


--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP] & and && and weird results

2009-04-01 Thread PJ
Lex Braun wrote:
> PJ,
>
> On Wed, Apr 1, 2009 at 1:40 PM, PJ  > wrote:
>
> SELECT * FROM book
>WHERE id IN (SELECT bookID
>FROM book_author WHERE authID IN (SELECT author.id
> 
>FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
> LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));
>
>
> Say $Auth = "I", $Auth1 = "J", $Auth2 = "K".
> The above sub-query is stating select author ids where the first digit
> in last_name is I AND the first digit in last_name is J AND the first
> digit in last_name is K.  For any given last_name (thus, author id),
> the first digit can only be one of those options, thus this sub-query
> will return ZERO results.
>
> To get a sub-query that will only return results that start with I, J,
> or K, you can instead use the following sub-query:
> SELECT author.id  FROM author WHERE LEFT(last_name,
> 1) = '$Auth' OR LEFT(last_name, 1) = '$Auth1' OR LEFT(last_name, 1) =
> '$Auth2'
>
> The above will return all author IDs where the surname starts with I,
> J, or K.
>
> - Lex
>
Thanks for that. I understand. Somehow, I had tried OR at one point but
I got one of those orange boxes probably for some other error and in the
confusion of my neurons I overlooked it.
However, I am puzzled that using & (not &&) did give a lot of results,
almost the whole db which is thankfully not very big for testing purposes.

-- 
unheralded genius: "A clean desk is the sign of a dull mind. "
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] & and && and weird results

2009-04-01 Thread Lex Braun
PJ,

On Wed, Apr 1, 2009 at 1:40 PM, PJ  wrote:

> SELECT * FROM book
>WHERE id IN (SELECT bookID
>FROM book_author WHERE authID IN (SELECT author.id
>FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
> LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));
>

Say $Auth = "I", $Auth1 = "J", $Auth2 = "K".
The above sub-query is stating select author ids where the first digit in
last_name is I AND the first digit in last_name is J AND the first digit in
last_name is K.  For any given last_name (thus, author id), the first digit
can only be one of those options, thus this sub-query will return ZERO
results.

To get a sub-query that will only return results that start with I, J,
or K,you can instead use the following sub-query:
SELECT author.id FROM author WHERE LEFT(last_name, 1) = '$Auth' OR
LEFT(last_name, 1) = '$Auth1' OR LEFT(last_name, 1) = '$Auth2'

The above will return all author IDs where the surname starts with I, J, or
K.

- Lex


Re: [PHP] & and && and weird results NOT solved but FIXED ....

2009-04-01 Thread PJ
PJ wrote:
> Kyle Smith wrote:
>   
>> Kyle Smith wrote:
>> 
>>> PJ wrote:
>>>   
 I hope somebody can make sense of this.
 First, I don't understand what the difference is supposed to be between
 & and && - is there a difference for php and/or mysql?
 Second, I am trying to select all occurrences in a table.column where
 the first letter of the name is I, J, or K but not I or J or K; I want
 the all. Now, entering the following is no problem for any one letter:
 SELECT * FROM book
 WHERE id IN (SELECT bookID
 FROM book_author WHERE authID IN (SELECT author.id
 FROM author
 WHERE LEFT(last_name, 1 ) = '$Auth' ));

 But the following does not work:

 SELECT * FROM book
 WHERE id IN (SELECT bookID
 FROM book_author WHERE authID IN (SELECT author.id
 FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
 LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));

 Yet this gives off the wall results where the last names are nowhere
 near what they should be.
 Anyone have a rational explanation?

   
 
>>> I wasn't aware that && was an option in MySQL, I've always used
>>> "AND".  If there is a difference it's probably the same as in PHP and
>>> many other languages.  Allow me to explain.
>>>
>>> In the case of & the left-side expression is evaluated for true and
>>> if not true, the right side expression is not evaluated.  In the case
>>> of && both sides are evaluated regardless of the value of either
>>> side.  Here's an example:
>>>
>>> $a = 1;
>>> $b = 2;
>>>
>>> $result = ($a == 2) && $b++; //  In this case, $a does not equal two
>>> and therefor the left-side is false, thus the right-side is never
>>> evaluated.  $b remains 2.
>>>
>>> $result = ($a == 2) & $b++;
>>> //  In this case, $a still does not equal two and therefor the
>>> left-side is still false, however because we use the '&' operator the
>>> right side is evaluated anyway and $b now equals 3.
>>>
>>> echo $result;
>>> //  In both cases, $result is false.
>>>
>>> HTH,
>>> Kyle
>>>
>>>
>>>   
>> Oops, my first paragraph is backwards.  I'm sure that was confusing! 
>> My example is the correct logic for && and &, and the paragraph before
>> that is exactly wrong.
>>
>> 
> Not really clear... I thought that $b+ would == 3 ; why two + ?
>
> But this does not explain the weir results I am getting; and BTW, if I
> use AND does not work either.
> What am I supposed to use to get the results I am looking for?
>
>   
I did fix it - it seems that OR does the trick.
But I sure would like to understand why & does not work?

-- 
unheralded genius: "A clean desk is the sign of a dull mind. "
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] & and && and weird results

2009-04-01 Thread PJ
Kyle Smith wrote:
> Kyle Smith wrote:
>> PJ wrote:
>>> I hope somebody can make sense of this.
>>> First, I don't understand what the difference is supposed to be between
>>> & and && - is there a difference for php and/or mysql?
>>> Second, I am trying to select all occurrences in a table.column where
>>> the first letter of the name is I, J, or K but not I or J or K; I want
>>> the all. Now, entering the following is no problem for any one letter:
>>> SELECT * FROM book
>>> WHERE id IN (SELECT bookID
>>> FROM book_author WHERE authID IN (SELECT author.id
>>> FROM author
>>> WHERE LEFT(last_name, 1 ) = '$Auth' ));
>>>
>>> But the following does not work:
>>>
>>> SELECT * FROM book
>>> WHERE id IN (SELECT bookID
>>> FROM book_author WHERE authID IN (SELECT author.id
>>> FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
>>> LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));
>>>
>>> Yet this gives off the wall results where the last names are nowhere
>>> near what they should be.
>>> Anyone have a rational explanation?
>>>
>>>   
>> I wasn't aware that && was an option in MySQL, I've always used
>> "AND".  If there is a difference it's probably the same as in PHP and
>> many other languages.  Allow me to explain.
>>
>> In the case of & the left-side expression is evaluated for true and
>> if not true, the right side expression is not evaluated.  In the case
>> of && both sides are evaluated regardless of the value of either
>> side.  Here's an example:
>>
>> $a = 1;
>> $b = 2;
>>
>> $result = ($a == 2) && $b++; //  In this case, $a does not equal two
>> and therefor the left-side is false, thus the right-side is never
>> evaluated.  $b remains 2.
>>
>> $result = ($a == 2) & $b++;
>> //  In this case, $a still does not equal two and therefor the
>> left-side is still false, however because we use the '&' operator the
>> right side is evaluated anyway and $b now equals 3.
>>
>> echo $result;
>> //  In both cases, $result is false.
>>
>> HTH,
>> Kyle
>>
>>
> Oops, my first paragraph is backwards.  I'm sure that was confusing! 
> My example is the correct logic for && and &, and the paragraph before
> that is exactly wrong.
>
Not really clear... I thought that $b+ would == 3 ; why two + ?

But this does not explain the weir results I am getting; and BTW, if I
use AND does not work either.
What am I supposed to use to get the results I am looking for?

-- 
unheralded genius: "A clean desk is the sign of a dull mind. "
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] & and && and weird results

2009-04-01 Thread Kyle Smith

Kyle Smith wrote:

PJ wrote:

I hope somebody can make sense of this.
First, I don't understand what the difference is supposed to be between
& and && - is there a difference for php and/or mysql?
Second, I am trying to select all occurrences in a table.column where
the first letter of the name is I, J, or K but not I or J or K; I want
the all. Now, entering the following is no problem for any one letter:
SELECT * FROM book
WHERE id IN (SELECT bookID
FROM book_author WHERE authID IN (SELECT author.id
FROM author
WHERE LEFT(last_name, 1 ) = '$Auth' ));

But the following does not work:

SELECT * FROM book
WHERE id IN (SELECT bookID
FROM book_author WHERE authID IN (SELECT author.id
FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));

Yet this gives off the wall results where the last names are nowhere
near what they should be.
Anyone have a rational explanation?

  
I wasn't aware that && was an option in MySQL, I've always used 
"AND".  If there is a difference it's probably the same as in PHP and 
many other languages.  Allow me to explain.


In the case of & the left-side expression is evaluated for true and if 
not true, the right side expression is not evaluated.  In the case of 
&& both sides are evaluated regardless of the value of either side.  
Here's an example:


$a = 1;
$b = 2;

$result = ($a == 2) && $b++; //  In this case, $a does not equal two 
and therefor the left-side is false, thus the right-side is never 
evaluated.  $b remains 2.


$result = ($a == 2) & $b++;
//  In this case, $a still does not equal two and therefor the 
left-side is still false, however because we use the '&' operator the 
right side is evaluated anyway and $b now equals 3.


echo $result;
//  In both cases, $result is false.

HTH,
Kyle


Oops, my first paragraph is backwards.  I'm sure that was confusing!  My 
example is the correct logic for && and &, and the paragraph before that 
is exactly wrong.


--
*Kyle Smith*
UNIX/Linux Systems Administrator
Inforonics, LLC



Re: [PHP] & and && and weird results

2009-04-01 Thread Kyle Smith

PJ wrote:

I hope somebody can make sense of this.
First, I don't understand what the difference is supposed to be between
& and && - is there a difference for php and/or mysql?
Second, I am trying to select all occurrences in a table.column where
the first letter of the name is I, J, or K but not I or J or K; I want
the all. Now, entering the following is no problem for any one letter:
SELECT * FROM book
WHERE id IN (SELECT bookID
FROM book_author WHERE authID IN (SELECT author.id
FROM author
WHERE LEFT(last_name, 1 ) = '$Auth' ));

But the following does not work:

SELECT * FROM book
WHERE id IN (SELECT bookID
FROM book_author WHERE authID IN (SELECT author.id
FROM author WHERE LEFT(last_name, 1 ) = '$Auth' &&
LEFT(last_name, 1 ) = '$Auth1' && LEFT(last_name, 1 ) = '$Auth2'));

Yet this gives off the wall results where the last names are nowhere
near what they should be.
Anyone have a rational explanation?

  
I wasn't aware that && was an option in MySQL, I've always used "AND".  
If there is a difference it's probably the same as in PHP and many other 
languages.  Allow me to explain.


In the case of & the left-side expression is evaluated for true and if 
not true, the right side expression is not evaluated.  In the case of && 
both sides are evaluated regardless of the value of either side.  Here's 
an example:


$a = 1;
$b = 2;

$result = ($a == 2) && $b++; 
//  In this case, $a does not equal two and therefor the left-side is 
false, thus the right-side is never evaluated.  $b remains 2.


$result = ($a == 2) & $b++;
//  In this case, $a still does not equal two and therefor the left-side 
is still false, however because we use the '&' operator the right side 
is evaluated anyway and $b now equals 3.


echo $result;
//  In both cases, $result is false.

HTH,
Kyle


--
*Kyle Smith*
UNIX/Linux Systems Administrator
Inforonics, LLC



Re: [PHP] Re: Re: Re: Php and CSS where to put it

2009-01-14 Thread Ashley Sheridan
On Thu, 2009-01-15 at 01:42 +0100, Michelle Konzack wrote:
> Hello Ashley,
> 
> Am 2009-01-13 22:14:53, schrieb Ashley Sheridan:
> > Yeah. Now my development goes like this:
> > 
> >  1. Design for Firefox
> >  2. Fix for Opera, Safari et al
> >  3. Fix for IE
> > But generally speaking, if it works in Firefox, it'll most likely behave
> > itself in everything except IE ;)
> 
> My experience too.
> 
> However, my Website is about Renewable Energies, Low-Energie Electronics
> and Open Source (GNU/Linux) so I do not realy care about IE.  :-D
> 
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
> Systemadministrator
> 24V Electronic Engineer
> Tamay Dogan Network
> Debian GNU/Linux Consultant
> 
> 
I unfortunately have to with my job, as most of the visitors to our
sites and users of the internal systems I build use IE, although I am
"encouraging" them to move to Firefox ;)


Ash
www.ashleysheridan.co.uk


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



[PHP] Re: Re: Re: Php and CSS where to put it

2009-01-14 Thread Michelle Konzack
Hello Ashley,

Am 2009-01-13 22:14:53, schrieb Ashley Sheridan:
> Yeah. Now my development goes like this:
> 
>  1. Design for Firefox
>  2. Fix for Opera, Safari et al
>  3. Fix for IE
> But generally speaking, if it works in Firefox, it'll most likely behave
> itself in everything except IE ;)

My experience too.

However, my Website is about Renewable Energies, Low-Energie Electronics
and Open Source (GNU/Linux) so I do not realy care about IE.  :-D

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
   
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Re: Re: Php and CSS where to put it

2009-01-13 Thread Andrew Ballard
On Tue, Jan 13, 2009 at 5:14 PM, Ashley Sheridan
 wrote:
> Yeah. Now my development goes like this:
>
> 1. Design for Firefox
> 2. Fix for Opera, Safari et al
> 3. Fix for IE
> But generally speaking, if it works in Firefox, it'll most likely behave
> itself in everything except IE ;)
>
>
> Ash
> www.ashleysheridan.co.uk

In my experience, it's usually IE that is doing the misbehaving.

Andrew

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



Re: [PHP] Re: Re: Php and CSS where to put it

2009-01-13 Thread Ashley Sheridan
On Tue, 2009-01-13 at 18:41 +0100, Michelle Konzack wrote:
> Am 2009-01-12 21:56:00, schrieb Ashley Sheridan:
> > Here's something for fixing IE with hacks:
> > 
> > http://www.ashleysheridan.co.uk/coding_html_comments.php
> > 
> > basically it lets you add in extra IE-only stylesheets using comment
> > code only recognised by IE, and you can use !important to stress your IE
> > styles. Best thing though is it validates through the W3C because it is
> > just an HTML comment.
> 
> Right and you can use it to free IE from ANY Cascading Style Sheets. :-D
> 
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
> Systemadministrator
> 24V Electronic Engineer
> Tamay Dogan Network
> Debian GNU/Linux Consultant
> 
> 
Yeah. Now my development goes like this:

 1. Design for Firefox
 2. Fix for Opera, Safari et al
 3. Fix for IE
But generally speaking, if it works in Firefox, it'll most likely behave
itself in everything except IE ;)


Ash
www.ashleysheridan.co.uk


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



[PHP] Re: Re: Php and CSS where to put it

2009-01-13 Thread Michelle Konzack
Am 2009-01-12 21:56:00, schrieb Ashley Sheridan:
> Here's something for fixing IE with hacks:
> 
> http://www.ashleysheridan.co.uk/coding_html_comments.php
> 
> basically it lets you add in extra IE-only stylesheets using comment
> code only recognised by IE, and you can use !important to stress your IE
> styles. Best thing though is it validates through the W3C because it is
> just an HTML comment.

Right and you can use it to free IE from ANY Cascading Style Sheets. :-D

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
   
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Re: Php and CSS where to put it

2009-01-13 Thread Al



Terion Miller wrote:

I have this code and the css seems to not work in IE at all, do I need to
put it somewhere different on the page maybe?


 xCount ORDER BY RAND()
LIMIT 3";
$result = mysql_query($sql);

echo "




";

while ($row = mysql_fetch_array($result)) {
echo "
{$row['title']}{$row['blurb']}
{$row['href']}";
//Add to exposure count
$views = $row['xCount'] + 1;
mysql_query("UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
'{$row['ID']}'");
}

echo " 
";

?>



Terion: Install Firefox and the "HTML Validator" extension. It is a perfect tool 
for you. It will clearly identify all the HTML errors and warnings, AND point 
you to how to fix them. It uses Tidy, which classifies many errors as warnings.


However, you should fix them. Your page has 21 serious warnings many of which 
are errors that will affect rendering. After you've fixed the warnings and 
errors it finds, run the W3C HTML Validator.


Also, install the Firefox extension "Validate CSS". Run it on your page. It has 
8 bad errors.


These tools are great learning aids.

Incidentally, I'm not a fan of frames, often causes problems.

Al.

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



Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Paul M Foster
On Mon, Jan 12, 2009 at 09:56:00PM +, Ashley Sheridan wrote:



> 
> Here's something for fixing IE with hacks:
> 
> http://www.ashleysheridan.co.uk/coding_html_comments.php
> 
> basically it lets you add in extra IE-only stylesheets using comment
> code only recognised by IE, and you can use !important to stress your IE
> styles. Best thing though is it validates through the W3C because it is
> just an HTML comment.

Don't move that page; I've bookmarked it. ;-}

Paul

-- 
Paul M. Foster

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



Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Ashley Sheridan
On Mon, 2009-01-12 at 16:27 -0500, tedd wrote:

> At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:
> >Hello Terion,
> >
> >Am 2009-01-12 10:42:10, schrieb Terion Miller:
> >  > I have this code and the css seems to not work in IE at all, do I need to
> >  > put it somewhere different on the page maybe?
> >
> >The CSS must be in the HTML Header like
> >
> >
> >
> >   CSS Example
> >   
> >   
> > #body { background-color: magenta; }
> >   
> >
> >
> >
> >...rest of the page
> 
> Today must be my "Arrr" day.
> 
> Don't embed css in document -- just put what you want in your css file.
> 
> If IE has a problem with it, then deal with IE within the css file. 
> There are css hacks if you can't find a way around the problem.
> 
> But embedding css style rules is a real "no-no" in my book -- there's 
> no reason to do it.
> 
> Cheers,
> 
> tedd
> 
> 
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 

Here's something for fixing IE with hacks:

http://www.ashleysheridan.co.uk/coding_html_comments.php

basically it lets you add in extra IE-only stylesheets using comment
code only recognised by IE, and you can use !important to stress your IE
styles. Best thing though is it validates through the W3C because it is
just an HTML comment.


Ash
www.ashleysheridan.co.uk


Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Robert Cummings
On Mon, 2009-01-12 at 16:27 -0500, tedd wrote:
> At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:
> >Hello Terion,
> >
> >Am 2009-01-12 10:42:10, schrieb Terion Miller:
> >  > I have this code and the css seems to not work in IE at all, do I need to
> >  > put it somewhere different on the page maybe?
> >
> >The CSS must be in the HTML Header like
> >
> >
> >
> >   CSS Example
> >   
> >   
> > #body { background-color: magenta; }
> >   
> >
> >
> >
> >...rest of the page
> 
> Today must be my "Arrr" day.
> 
> Don't embed css in document -- just put what you want in your css file.
> 
> If IE has a problem with it, then deal with IE within the css file. 
> There are css hacks if you can't find a way around the problem.
> 
> But embedding css style rules is a real "no-no" in my book -- there's 
> no reason to do it.

On my dev sites I embed the CSS, on production it gets exported to an
external version-named file as part of the build process.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



[PHP] Re: Php and CSS where to put it

2009-01-12 Thread tedd

At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:

Hello Terion,

Am 2009-01-12 10:42:10, schrieb Terion Miller:
 > I have this code and the css seems to not work in IE at all, do I need to
 > put it somewhere different on the page maybe?

The CSS must be in the HTML Header like



  CSS Example
  
  
#body { background-color: magenta; }
  



...rest of the page


Today must be my "Arrr" day.

Don't embed css in document -- just put what you want in your css file.

If IE has a problem with it, then deal with IE within the css file. 
There are css hacks if you can't find a way around the problem.


But embedding css style rules is a real "no-no" in my book -- there's 
no reason to do it.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Terion Miller
Resolved! Thanks!

On Mon, Jan 12, 2009 at 12:38 PM, Michelle Konzack <
linux4miche...@tamay-dogan.net> wrote:

> Hello Terion,
>
> Am 2009-01-12 10:42:10, schrieb Terion Miller:
> > I have this code and the css seems to not work in IE at all, do I need to
> > put it somewhere different on the page maybe?
>
> The CSS must be in the HTML Header like
>
> 
> 
>  CSS Example
>   
>   
>#body { background-color: magenta; }
>  
> 
> 
>
> ...rest of the page
>
> > 
> >  >
> > ini_set('error_reporting', E_ALL);
> > ini_set('display_errors', true);
> >
> >  $sql = "SELECT * FROM `textads` WHERE `expos` > xCount ORDER BY RAND()
> > LIMIT 3";
> > $result = mysql_query($sql);
> >
> > echo "
> >  > cellpadding=10 bordercolor=#66 background= 'inc/bg.gif'
> bgcolor=#CC>
>
> according to W3C any values must be quoted like:
>
> echo "
>  align=\"center\"
> cellpadding=\"10\" bordercolor=\"#66\" background= \"inc/bg.gif\"
> bgcolor=\"#CC\">
>
> Do not forget to ESCAPE!  And of course, I would put the stuff into  the
> CSS definition and not into the TABLE tag.
>
> > 
> > 
> > 
>
> QUOT the values!
>
> > ";
> >
> > while ($row = mysql_fetch_array($result)) {
> > echo "
> >  > width=33%>{$row['title']}{$row['blurb']}
> > {$row['href']}";
> > //Add to exposure count
> > $views = $row['xCount'] + 1;
> > mysql_query("UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
> > '{$row['ID']}'");
> > }
> >
> > echo " 
> > ";
> >
> > ?>
>
> Your HTML page has to be closed with:
>
> 
> 
>
> Thanks, Greetings and nice Day/Evening
>Michelle Konzack
>Systemadministrator
>24V Electronic Engineer
>Tamay Dogan Network
>Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant #
>    
> Michelle Konzack   Apt. 917  ICQ #328449886
> +49/177/935194750, rue de Soultz MSN LinuxMichi
> +33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)
>


[PHP] Re: Php and CSS where to put it

2009-01-12 Thread Michelle Konzack
Hello Terion,

Am 2009-01-12 10:42:10, schrieb Terion Miller:
> I have this code and the css seems to not work in IE at all, do I need to
> put it somewhere different on the page maybe?

The CSS must be in the HTML Header like



  CSS Example
  
  
#body { background-color: magenta; }
  



...rest of the page

> 
>  
> ini_set('error_reporting', E_ALL);
> ini_set('display_errors', true);
> 
>  $sql = "SELECT * FROM `textads` WHERE `expos` > xCount ORDER BY RAND()
> LIMIT 3";
> $result = mysql_query($sql);
> 
> echo "
>  cellpadding=10 bordercolor=#66 background= 'inc/bg.gif' bgcolor=#CC>

according to W3C any values must be quoted like:

echo "


Do not forget to ESCAPE!  And of course, I would put the stuff into  the
CSS definition and not into the TABLE tag.

> 
> 
> 

QUOT the values!

> ";
> 
> while ($row = mysql_fetch_array($result)) {
> echo "
>  width=33%>{$row['title']}{$row['blurb']}
> {$row['href']}";
> //Add to exposure count
> $views = $row['xCount'] + 1;
> mysql_query("UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
> '{$row['ID']}'");
> }
> 
> echo " 
> ";
> 
> ?>

Your HTML page has to be closed with:




Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
   
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Re: PHP and Cyrus problem

2008-11-10 Thread Emerson Virti
Thank's for response.
This solution I tried many times but didn't resolved.
The reconstruct command don't modify this cyrus.header file.



2008/11/7 Colin Guthrie <[EMAIL PROTECTED]>

> Emerson Virti wrote:
>
>> Where is the problem?
>>
>
> Probably not the right list, but have you tried using cyradm and running:
> reconstruct user.name.mailbox.name
>
> (correct the folder as needed).
>
> When a cyrus database file gets corrupted or generally borked this fixes it
> 99% of the time for me.
>
> Col
>
> --
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
>  Tribalogic Limited [http://www.tribalogic.net/]
> Open Source:
>  Mandriva Linux Contributor [http://www.mandriva.com/]
>  PulseAudio Hacker [http://www.pulseaudio.org/]
>  Trac Hacker [http://trac.edgewall.org/]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Émerson Salvadori Virti
Engenheiro de Computação
Mestre em Ciência da Computação
[EMAIL PROTECTED]


[PHP] Re: PHP and Cyrus problem

2008-11-07 Thread Colin Guthrie

Richard Heyes wrote:

...PHP for webmail.


Did you know you can use Gmail for webmail, even having the From:
address set to your own domain? It will require a little more setup
(well, with ten thousand mailboxes that would be "a lot") but you end
with one of the best webmail clients there is.


While this is a little off topic there are lots of reasons not to do 
this. For one, the IMAP support in GMail, while very welcome, does have 
different paradigms than traditional email systems. I actually prefer 
the GMail approach of labels rather than "real" folders, but until this 
is exported as part of the IMAP protocol and clients like thunderbird 
support and are aware of it, it's sadly quite clunky to work with. 
(things like copying/moving mails is bit of a headfuk cos you're not 
really copying them, you're labeling them and it shouldn't be purged 
from the inbox, because the inbox is just a "new mail" filter etc. etc.


As the original problem showed a IMAP+Webmail solution, I'd imagine IMAP 
support and a dedicated client is important.



Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



[PHP] Re: PHP and Cyrus problem

2008-11-07 Thread Colin Guthrie

Emerson Virti wrote:

Where is the problem?


Probably not the right list, but have you tried using cyradm and 
running: reconstruct user.name.mailbox.name


(correct the folder as needed).

When a cyrus database file gets corrupted or generally borked this fixes 
it 99% of the time for me.


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



Re: [PHP] Re: PHP and SQL Server

2008-09-23 Thread Andrew Ballard
On Tue, Sep 23, 2008 at 10:43 AM, Nathan Rixham <[EMAIL PROTECTED]> wrote:
> Andrew Ballard wrote:
> [snip]
>>
>> 4K limit on TEXTSIZE
>
> [/snip]
>
> As far as I was aware this was a PHP thing that can be changed in your
> php.ini [mssql.textlimit and mssql.textsize]
>

We have, and it affects the regular MSSQL functions, but not
PDO_MSSQL. What's more, I just discovered that with PDO_MSSQL, not
only are TEXT/NTEXT fields truncated to 4K, VARCHAR/NVARCHAR fields
are apparently truncated to 255 characters.

Andrew

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



[PHP] Re: PHP and SQL Server

2008-09-23 Thread Nathan Rixham

Andrew Ballard wrote:
[snip]
4K limit on TEXTSIZE 

[/snip]

As far as I was aware this was a PHP thing that can be changed in your 
php.ini [mssql.textlimit and mssql.textsize]


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



Re: [PHP] Re: PHP and MySQL SELECT COUNT (*)

2008-09-18 Thread Vinny Gullotta
Thanks all, I appreciate the follow ups and the help with the code. I'm 
still relatively new with this stuff, and never had any formal training, 
it's all just been learn as I go, and I have to learn fast as this project 
is relatively urgent to get completed. I plan on going through all of my 
code on all of these pages and cleaning it up at the end to make it more 
efficient, so I will use these tips to help do that.


Thanks again to all who helped troubleshoot this. It is working great now 
and I think my bosses will be happy. =D



"Nathan Rixham" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

learn something new every day! cheers Micah :)

Micah Gersten wrote:

While it's true that '.' concatenates and ',' is a list separator, The
comma is actually more appropriate in this instance since you are just
outputting each piece.  It saves the overhead of concatenation before
output.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Nathan Rixham wrote:

6: " vs '
when you use " php will parse the enclosed string for variables, when
you use ' it won't; so ' leads for faster code, and also encourages
you to code strongly by closing strings and concatenating variables.
Further it allows you to use valid html " around attributes rather
than the invalid '

7: , vs .
there is no vs :) to concatenate we use . (period) not , (comma)

so for 6 & 7..
echo '' . $i['servername'] . '';

I'm going to stop there, hope it helps a little bit; and I won't go
any further as half the fun is learning; so you finding out how to
save time on queries and write your own db handlers etc is not my
domain I reckons

Regards

nathan




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



Re: [PHP] Re: PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Chris



1: SQL
in mysql queries /should/ use backticks (`) around database, table and 
column names, stop's them getting confused with variables or reserved 
words (like timestamp) and saves you future trouble :)


.. which is a mysql-ism - no other database supports this. As soon as 
you need to use another db (regardless of whether it's this application 
or not), you're stuffed.


For reserved word column names, you don't have much choice but don't do 
that in the first place ;)


http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

Other db's will have a similar list - though in most cases, if it's a 
function or sql keyword (eg 'table'), it'll be reserved in all.


further, you'll be needing to use AS to turn COUNT(steps) into a nice 
name like "stepcount"


Which is also a mysql-ism. Most other db's don't let you use aggregate 
aliases in an order by clause (I think because the sql standard says 
don't do that).


--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP] Re: PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Nathan Rixham

learn something new every day! cheers Micah :)

Micah Gersten wrote:

While it's true that '.' concatenates and ',' is a list separator, The
comma is actually more appropriate in this instance since you are just
outputting each piece.  It saves the overhead of concatenation before
output.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Nathan Rixham wrote:

6: " vs '
when you use " php will parse the enclosed string for variables, when
you use ' it won't; so ' leads for faster code, and also encourages
you to code strongly by closing strings and concatenating variables.
Further it allows you to use valid html " around attributes rather
than the invalid '

7: , vs .
there is no vs :) to concatenate we use . (period) not , (comma)

so for 6 & 7..
echo '' . $i['servername'] . '';

I'm going to stop there, hope it helps a little bit; and I won't go
any further as half the fun is learning; so you finding out how to
save time on queries and write your own db handlers etc is not my
domain I reckons

Regards

nathan



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



Re: [PHP] Re: PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
While it's true that '.' concatenates and ',' is a list separator, The
comma is actually more appropriate in this instance since you are just
outputting each piece.  It saves the overhead of concatenation before
output.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Nathan Rixham wrote:
>
> 6: " vs '
> when you use " php will parse the enclosed string for variables, when
> you use ' it won't; so ' leads for faster code, and also encourages
> you to code strongly by closing strings and concatenating variables.
> Further it allows you to use valid html " around attributes rather
> than the invalid '
>
> 7: , vs .
> there is no vs :) to concatenate we use . (period) not , (comma)
>
> so for 6 & 7..
> echo '' . $i['servername'] . '';
>
> I'm going to stop there, hope it helps a little bit; and I won't go
> any further as half the fun is learning; so you finding out how to
> save time on queries and write your own db handlers etc is not my
> domain I reckons
>
> Regards
>
> nathan
>

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



[PHP] Re: PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Nathan Rixham

Vinny Gullotta wrote:
What I want to do is find the top 10 servers where the column steps = 
iisreset. The following code works great except that the page is not 
displaying the servername in the 'Server Name' column of my results 
(nothing appears, the column is just blank).


servername and steps are the important columns in the database table. 
$_POST[time1] and $_POST[time2] come from a form submitted.


When I copy and paste the entire select statement into the SQL tab in 
phpmyadmin (and replace the time variables with actual times 
corresponding to the timestamp column), it displays the correct results 
including servername. Everything works in the php page's results except 
for the servername. I feel like it's right in front of my face and 
that's why I can't see it lol. Any help would be greatly appreciated. 
Thanks in advance =)


My code...

$query = "SELECT servername, COUNT(steps) FROM monitoring WHERE steps 
LIKE 'iisreset' AND timestamp <= '$_POST[time2]' AND timestamp >= 
'$_POST[time1]' GROUP BY servername ORDER BY COUNT(*) DESC LIMIT 10";

$result = mysql_query($query) or die(mysql_error());

# display column titles
echo "";
echo "Count";
echo "Server 
Name";

echo "";

#display results
while($i = mysql_fetch_row($result))
{
echo "", $i[COUNT('steps')], 
"";

echo "", $i[servername] ,"";
}
echo "";


just a few little notes.. because I'm like this today

(none of it is a you must do, or meant badly, just aiming to save you 
some time by passing on a few *things*)


1: SQL
in mysql queries /should/ use backticks (`) around database, table and 
column names, stop's them getting confused with variables or reserved 
words (like timestamp) and saves you future trouble :)


further, you'll be needing to use AS to turn COUNT(steps) into a nice 
name like "stepcount"


so..
$query = 'SELECT `servername`, COUNT(`steps`) AS stepcount FROM 
`monitoring` WHERE `steps` LIKE "iisreset" AND `timestamp` <= ' . 
$_POST[time2] . ' AND `timestamp` >= ' . $_POST[time1] . ' GROUP BY 
`servername` ORDER BY COUNT(*) DESC LIMIT 10';


2: you should be cleaning those posts before you add them to a mysql 
query; this has been covered many times so I won't repost it 
(mysql_real_escape() or sprintf or.. many different methods]


3: Needless multiple echo's; one will suffice just fine and show it up 
in your editor as a nice easily visible block of html :)


echo '
Count
Server Name
';

4: valid xhtml; in my opinion there's no excuse now; it's been years 
since it came out (and you're already using css); this will do the same 
as above:

echo '

Count
Server Name
';

[css to center the table would be]
table.center {
margin: 0 auto;
}

5: mysql_fetch_row() returns a numerical indexed array.. not associative 
thus:

$i = mysql_fetch_row($result)
print_r($i);

will show..
$i[0] => the server name
$i[1] => stepcount value

you'll be needing
$i = mysql_fetch_assoc($result);
print_r($i);

which will show
$i['servername'] => the server name
$i['stepcount'] => stepcount value

6: " vs '
when you use " php will parse the enclosed string for variables, when 
you use ' it won't; so ' leads for faster code, and also encourages you 
to code strongly by closing strings and concatenating variables.
Further it allows you to use valid html " around attributes rather than 
the invalid '


7: , vs .
there is no vs :) to concatenate we use . (period) not , (comma)

so for 6 & 7..
echo '' . $i['servername'] . '';

I'm going to stop there, hope it helps a little bit; and I won't go any 
further as half the fun is learning; so you finding out how to save time 
on queries and write your own db handlers etc is not my domain I reckons


Regards

nathan

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



[PHP] Re: PHP and Apache

2008-06-23 Thread Jon Drukman

R B wrote:

Hello,

I´m developing a PHP system that needs one of these lines in the .htaccess,
depending of the server configuration:

AddHandler application/x-httpd-php .xyz
or

AddHandler application/x-httpd-php4 .xyz

or

AddHandler application/x-httpd-php5 .xyz

How can i detect "on the fly" which line i have to use?




AddHandler application/x-httpd-php5 .xyz



AddHandler application/x-httpd-php4 .xyz



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



Re: [PHP] and newlines under windows

2007-08-10 Thread Richard Lynch
On Fri, August 10, 2007 11:48 am, Faither wrote:
> I'm kind of lost with how str_replace , preg_replace, ereg_replace or
> even explode are handling a "\n"-ewline.
.
.
.
> Is it even possible under windows? ^^

In Linux, the newline is "\n", but...

Under Windows, the newline isn't "\n", it's "\r\n"

In the Mac world it's "\r"

Now the browsers are running on whatever platform, and the user is
copying/pasting in text or whatever, and the data you get PROBABLY is
using the newline encoding of the web browser client platform.

So, to normalize any input with newlines, do this:

//assuming basic ASCII text data input:
$data = str_replace("\r\n", "\n", $data);
$data = str_replace("\r", "\n", $data);

Store that normalized text in the database.

When you DISPLAY the text to the user, you might want to use:
echo nl2br($data);

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] RE: RE: PHP and XML

2006-11-26 Thread Børge Holen
so I see... just follow the guidelines on php.net on what NOT to do after a 
 hello all
> I have created a simple xml file address.php i.e
>  $xmlstr = << 
>  
> 
> 
> 
> 
> 
>  ]>
>
>
> XML;
>
>
> ?>
> and one simple form: -
> 
> 
> My Address Book
> 
> 
> 
> 
> Group: name="group">
> Name : name="name">
> organization: name="organization"> 
> addresss: name="ation">
> Email Address: name="email">
> 
> 
>
>
> 
> 
> 
> But it gives lot of error : -
> Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
> line 9: parser error : DOCTYPE improperly terminated in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Warning: SimpleXMLElement::__construct() [function.--construct]:  email (#PCDATA)> ]> in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
> line 9: parser error : Start tag expected, '<' not found in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Warning: SimpleXMLElement::__construct() [function.--construct]:  email (#PCDATA)> ]> in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> Fatal error: Uncaught exception 'Exception' with message 'String could not
> be parsed as XML' in
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php:5
> Stack trace: #0
> /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php(5
>): SimpleXMLElement->__construct('? /home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php
> on line 5
>
> please help me out..
> onewaylife
>
> Edward Kay wrote:
> > In that case you need to do some of your own research. Google is your
> > friend.
> >
> >> Hello Edward
> >> Just i don't  now where to start.
> >>
> >> Edward Kay wrote:
> >> > Hello,
> >> >
> >> > You say that you are "unable to store the files in XML". Why is
> >>
> >> this? Are
> >>
> >> > you getting an error message or do you just not know where to start?
> >> >
> >> > Edward
> >> >
> >> >> Dear All
> >> >>
> >> >> I am novice in PHP & XML, while trying I am creating a small
> >>
> >> application
> >>
> >> >> i.e. Address Book.
> >> >> In this I am using Apache2, PHP5 and XML no database is used.
> >>
> >> I have FC5
> >>
> >> >> machines. but I am unable to store the files in XML. If any one
> >> >> share their
> >> >> experience in this by providing Examples or tutorials etc...
> >> >> So far I have found tutorial related to porting the information
> >> >> of data from
> >> >> MySQL to XML and then php with help of DOM.
> >> >>
> >> >> Thanks
> >> >> onewaylife
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
> >> >> Sent from the PHP - General mailing list archive at Nabble.com.
> >> >>
> >> >> --
> >> >> PHP General Mailing List (http://www.php.net/)
> >> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >> >
> >> > --
> >> > PHP General Mailing List (http://www.php.net/)
> >> > To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >> --
> >> View this message in context:
> >
> > http://www.nabble.com/PHP-and-XML-tf2692397.html#a7517770
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> View this message in context:
> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7555006 Sent from the PHP
> - General mailing list archive at Nabble.com.

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



[PHP] RE: RE: PHP and XML

2006-11-26 Thread onewaylife

hello all
I have created a simple xml file address.php i.e 







 ]>


XML;


?>
and one simple form: -


My Address Book




Group:
Name :
organization: 
addresss:
Email Address:







But it gives lot of error : -
Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
line 9: parser error : DOCTYPE improperly terminated in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]:  ]> in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
line 9: parser error : Start tag expected, '<' not found in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]:  ]> in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Fatal error: Uncaught exception 'Exception' with message 'String could not
be parsed as XML' in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php:5
Stack trace: #0
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php(5):
SimpleXMLElement->__construct('? 
> In that case you need to do some of your own research. Google is your
> friend.
> 
>> Hello Edward
>> Just i don't  now where to start.
>>
>>
>> Edward Kay wrote:
>> >
>> > Hello,
>> >
>> > You say that you are "unable to store the files in XML". Why is
>> this? Are
>> > you getting an error message or do you just not know where to start?
>> >
>> > Edward
>> >
>> >> Dear All
>> >>
>> >> I am novice in PHP & XML, while trying I am creating a small
>> application
>> >> i.e. Address Book.
>> >> In this I am using Apache2, PHP5 and XML no database is used.
>> I have FC5
>> >> machines. but I am unable to store the files in XML. If any one
>> >> share their
>> >> experience in this by providing Examples or tutorials etc...
>> >> So far I have found tutorial related to porting the information
>> >> of data from
>> >> MySQL to XML and then php with help of DOM.
>> >>
>> >> Thanks
>> >> onewaylife
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
>> >> Sent from the PHP - General mailing list archive at Nabble.com.
>> >>
>> >> --
>> >> PHP General Mailing List (http://www.php.net/)
>> >> To unsubscribe, visit: http://www.php.net/unsub.php
>> >>
>> >>
>> >>
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>> >
>>
>> --
>> View this message in context:
> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7517770
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
-- 
View this message in context: 
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7555006
Sent from the PHP - General mailing list archive at Nabble.com.

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



[PHP] Re: PHP and XML

2006-11-24 Thread Myron Turner
I'm not sure you are going about this the right way.  It's my impression 
that you may not yet have learned the basics of XML.  Really, the very 
basics are quite simple.  For your address book, for instance, you could 
create a simple XML structure such as this:















Then write a script which fills in the data.

1. Start out with the document root:
echo "";
2. Fill in the data:
echo "$first_name";
echo "$last_name";
   And so forth.

3. Finish off with the document root:
echo "";

You can include the XML header once at the top of your file:



You don't need a special class or set of third-party functions to do a 
simple task like this.  You can easily write your own, and it will parse 
with any XML parser.



Myron

onewaylife wrote:


Hello Edward
Just i don't  now where to start.


Edward Kay wrote:

Hello,

You say that you are "unable to store the files in XML". Why is this? Are
you getting an error message or do you just not know where to start?

Edward


Dear All

I am novice in PHP & XML, while trying I am creating a small application
i.e. Address Book.
In this I am using Apache2, PHP5 and XML no database is used. I have FC5
machines. but I am unable to store the files in XML. If any one
share their
experience in this by providing Examples or tutorials etc...
So far I have found tutorial related to porting the information
of data from
MySQL to XML and then php with help of DOM.

Thanks
onewaylife
--
View this message in context:
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
Sent from the PHP - General mailing list archive at Nabble.com.

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




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








--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



RE: [PHP] RE: PHP and XML

2006-11-24 Thread Edward Kay
In that case you need to do some of your own research. Google is your
friend.

> Hello Edward
> Just i don't  now where to start.
>
>
> Edward Kay wrote:
> >
> > Hello,
> >
> > You say that you are "unable to store the files in XML". Why is
> this? Are
> > you getting an error message or do you just not know where to start?
> >
> > Edward
> >
> >> Dear All
> >>
> >> I am novice in PHP & XML, while trying I am creating a small
> application
> >> i.e. Address Book.
> >> In this I am using Apache2, PHP5 and XML no database is used.
> I have FC5
> >> machines. but I am unable to store the files in XML. If any one
> >> share their
> >> experience in this by providing Examples or tutorials etc...
> >> So far I have found tutorial related to porting the information
> >> of data from
> >> MySQL to XML and then php with help of DOM.
> >>
> >> Thanks
> >> onewaylife
> >> --
> >> View this message in context:
> >> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
> >> Sent from the PHP - General mailing list archive at Nabble.com.
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7517770
Sent from the PHP - General mailing list archive at Nabble.com.

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

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



[PHP] RE: PHP and XML

2006-11-23 Thread onewaylife


Hello Edward
Just i don't  now where to start.


Edward Kay wrote:
> 
> Hello,
> 
> You say that you are "unable to store the files in XML". Why is this? Are
> you getting an error message or do you just not know where to start?
> 
> Edward
> 
>> Dear All
>>
>> I am novice in PHP & XML, while trying I am creating a small application
>> i.e. Address Book.
>> In this I am using Apache2, PHP5 and XML no database is used. I have FC5
>> machines. but I am unable to store the files in XML. If any one
>> share their
>> experience in this by providing Examples or tutorials etc...
>> So far I have found tutorial related to porting the information
>> of data from
>> MySQL to XML and then php with help of DOM.
>>
>> Thanks
>> onewaylife
>> --
>> View this message in context:
>> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
>> Sent from the PHP - General mailing list archive at Nabble.com.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7517770
Sent from the PHP - General mailing list archive at Nabble.com.

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



[PHP] Re: php and session issues continued...

2006-09-16 Thread Tom Atkinson

How are you setting the location?

If the user starts at www.yoursite.com and you redirect to yoursite.com 
after the first form then you'll lose the session since it's a different 
domain.




Dave Goodchild wrote:

Hi all. I have a session issue and wondered if anyone else has encountered
this:

I have an app where a user fills out 3 forms. In each case, after 
validation

and cleaning the form data is passed into session variables and after the
final submission the data is entered into the database. I am using both
Firefox and IE6 on Windows XP and the system works like a dream. However, a
user testing on IE6/XP is having some problems. The values from the first
form are not being passed into the session.

When each form is successfully processed the user is redirected to the next
stage using header('Location...'). I call session_write_close before 
that to

ensure the session data is written out before the redirect, but the problem
persists.

Anyone recognise this issue. It is not IE-specific as it happens to me on
Firefox intermittently. I am at my wits end! Thanks in advance for any 
help!




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



[PHP] Re: PHP and mySQL dates

2006-09-13 Thread Colin Guthrie

> "SELECT id FROM dates WHERE FROM_UNIXTIME($date_string) = date"
> 
> then
> 
> "SELECT id FROM dates WHERE UNIX_TIMESTAMP(date) = $date_string"
> 
> neither is working. Am I making some fundamental error here or missing
> something? Any help appreciated!

I know yui've alreayd solved this, but for what it's worth, the first
form of statement is preferred to the second.

In the second you are applying a MYSQL function to a field which will
have to be repeated many times, in the first, you are applying a MYSQL
function to a constant which only has to be computed once.

Even now you have the solution, it may be worth considering the order of
your check and if possible use the MYSQL function ont he constant not
the field to get the additional performance gain.

Col.

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



Re: [PHP] Re: Php and Cygwin SVN

2006-08-31 Thread Adam Zey
Look into the syntax of the Windows command "start" (open a console and 
type "start /?"). It's purpose is to start other processes, and it 
provides some flexibility as to how they're launched. One of the options 
is to hide the console windows.


Regards, Adam Zey.

Mariano Guadagnini wrote:
Thanks for your reply. I checked those ports and seem nice. Actually, 
i use cygwin mainly because it was already installed on the Windows 
server. But the same problem arises with any command I execute trough 
shell_exec, no matter if it's a cygwin executable or a windows native 
app, the command shell pop ups always.
There should be some way to execute something without the cmd windows 
opening again and again, i guess. Any ideas?



Adam Zey wrote:

Mariano Guadagnini wrote:

Hello list,
I'm developing an application that fetches some files from a local 
svn repository, and shows them on request (using svn cat, svn list 
and such). Originally, it was deployed in Linux (Apache, PHP5.0) and 
worked perfectly well. I tried to port it to Windows (specifically, 
WinXP Pro SP2, PHP5, IIS5), and because it depends on many command 
line utilities, i decided to install cygwin. After struggling a bit, 
i got it working. The thing is that, when executing any cygwin svn 
command (via shell_exec), many command windows pops up appears on 
the windows desktop, making the sistem quite slow during the 
process. I realized that, this happens because of shell_exec opening 
a new shell on every command call, i tried the other exec functions, 
but the same happened. I wonder if it is posible to launch those 
commands in a silent manner.



Thanks,


Mariano.-




There is a windows port of Subversion, and the GNU utilities you're 
referring to have mostly been ported to Windows without the use of 
cygwin (see gnuwin32). Do you really need to rely on cygwin?


Regards, Adam Zey.







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



Re: [PHP] Re: Php and Cygwin SVN

2006-08-31 Thread Mariano Guadagnini
Thanks for your reply. I checked those ports and seem nice. Actually, i 
use cygwin mainly because it was already installed on the Windows 
server. But the same problem arises with any command I execute trough 
shell_exec, no matter if it's a cygwin executable or a windows native 
app, the command shell pop ups always.
There should be some way to execute something without the cmd windows 
opening again and again, i guess. Any ideas?



Adam Zey wrote:

Mariano Guadagnini wrote:

Hello list,
I'm developing an application that fetches some files from a local 
svn repository, and shows them on request (using svn cat, svn list 
and such). Originally, it was deployed in Linux (Apache, PHP5.0) and 
worked perfectly well. I tried to port it to Windows (specifically, 
WinXP Pro SP2, PHP5, IIS5), and because it depends on many command 
line utilities, i decided to install cygwin. After struggling a bit, 
i got it working. The thing is that, when executing any cygwin svn 
command (via shell_exec), many command windows pops up appears on the 
windows desktop, making the sistem quite slow during the process. I 
realized that, this happens because of shell_exec opening a new shell 
on every command call, i tried the other exec functions, but the same 
happened. I wonder if it is posible to launch those commands in a 
silent manner.



Thanks,


Mariano.-




There is a windows port of Subversion, and the GNU utilities you're 
referring to have mostly been ported to Windows without the use of 
cygwin (see gnuwin32). Do you really need to rely on cygwin?


Regards, Adam Zey.





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006

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



[PHP] Re: Php and Cygwin SVN

2006-08-31 Thread Adam Zey

Mariano Guadagnini wrote:

Hello list,
I'm developing an application that fetches some files from a local svn 
repository, and shows them on request (using svn cat, svn list and 
such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked 
perfectly well. I tried to port it to Windows (specifically, WinXP Pro 
SP2, PHP5, IIS5), and because it depends on many command line utilities, 
i decided to install cygwin. After struggling a bit, i got it working. 
The thing is that, when executing any cygwin svn command (via 
shell_exec), many command windows pops up appears on the windows 
desktop, making the sistem quite slow during the process. I realized 
that, this happens because of shell_exec opening a new shell on every 
command call, i tried the other exec functions, but the same happened. I 
wonder if it is posible to launch those commands in a silent manner.



Thanks,


Mariano.-




There is a windows port of Subversion, and the GNU utilities you're 
referring to have mostly been ported to Windows without the use of 
cygwin (see gnuwin32). Do you really need to rely on cygwin?


Regards, Adam Zey.

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



Re: [PHP] Re: php and dynamic forms

2006-08-15 Thread tedd

At 1:24 AM -0400 8/15/06, Robert Cummings wrote:

On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote:

 Does anyone have a simple example script.



In the first form include a hidden field that identifies the form when
you are checking the post values after submission. This way you know
exactly what form was submitted. Second if the first form has been
submitted then you know that you need to present the second form also.
THe second form should also have a hidden field so that it may be
identified upon submission. In this way you can detect which form was
submitted (submit buttons are problematic for determining which form was
submitted). Then when you detect that the second form was submitted you
can handle it's data as you please and then only present the first form.

A basic example follows (completely unchecked for typos/errors):


-snip- Rob's most excellent code.

To expand, one could also run the self referencing loop through a 
switch statement controlled by the hidden value and have as many 
"forms" as you wanted. I do this all the time.


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: php and dynamic forms

2006-08-15 Thread Robert Cummings
On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote:
> Does anyone have a simple example script.
> 

In the first form include a hidden field that identifies the form when
you are checking the post values after submission. This way you know
exactly what form was submitted. Second if the first form has been
submitted then you know that you need to present the second form also.
THe second form should also have a hidden field so that it may be
identified upon submission. In this way you can detect which form was
submitted (submit buttons are problematic for determining which form was
submitted). Then when you detect that the second form was submitted you
can handle it's data as you please and then only present the first form.

A basic example follows (completely unchecked for typos/errors):






1
2
3
...









Foo
Fee
Fii
Foh
Fum






Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Re: php and dynamic forms

2006-08-14 Thread Robert Cummings
On Tue, 2006-08-15 at 01:24 -0400, Robert Cummings wrote:
> On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote:
> > Does anyone have a simple example script.
> > 
> 
> In the first form include a hidden field that identifies the form when
> you are checking the post values after submission. This way you know
> exactly what form was submitted. Second if the first form has been
> submitted then you know that you need to present the second form also.
> THe second form should also have a hidden field so that it may be
> identified upon submission. In this way you can detect which form was
> submitted (submit buttons are problematic for determining which form was
> submitted). Then when you detect that the second form was submitted you
> can handle it's data as you please and then only present the first form.
> 
> A basic example follows (completely unchecked for typos/errors):

And of course it had errors :) See below...

> 
>  
> $submittedForm = null;
> if( isset( $_POST['formSubmitted'] ) )
> {
> $submittedForm = $_POST['formSubmitted'];
> 
> if( $_POST['formSubmitted'] == 'form1' )
> {
> // do something with its data.
> }
> else
> if( $_POST['formSubmitted'] == 'form2' )
> {
> // do something with its data.
> }
> }
> ?>
> 
> 
> 

Should be:



> 
> 1
> 2
> 3
> ...
> 
> 
> 
> 
>  if( $submittedForm == 'form1' )
> {
> ?>
> 
> 
> 

Should be:



> 
> Foo
> Fee
> Fii
> Foh
> Fum
> 
> 
> 
> 
>  }
> ?>
> 
> Cheers,
> Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: php and dynamic forms

2006-08-14 Thread Bigmark
Does anyone have a simple example script.

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



[PHP] Re: PHP and mySQL getting smashed...

2006-05-18 Thread Robert Samuel White
Upgrade your MySQL distribution to the latest version (5+).

 

Upgrade any shared MySQL libraries to the latest distribute.

 

Recompile MySQL with mysqli support.

 

http://php.net/mysqli

 

And use that instead of the regular MySQL functions.

 

That's what I did and it has made a huge difference.

 

Not to mention, the mysqli library has so many more functions available to
you.

 

~Samuel

 

 



Re: [PHP] Re: php and ssl

2006-05-04 Thread Schalk

Schalk Neethling wrote:

Barry wrote:

Schalk schrieb:

Greetings All,

I am currently implementing a form for a client that will run over 
https. Now, all is good and well except, for some reason when the 
form loads in IE the lock in the status bar displays for a short 
while and then goes away, it is fine in Firefox though. The way I 
have the form coded is something like this:


The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to 
think that the form is not secure and not loaded over https? Thank 
you in advance!


Since you load it framewise. is there probably a problem with the 
loaded frames?


It has nothing to do with PHP though.

Barry,

Not sure what you mean by frames If you look at the HTML source 
there are no frames in there. Do you mean the ?
Has anyone been able to see what might be causing the problem in IE? I 
am really stumped :( It may even be something simple but, I cannot see 
why the way the form is coded will cause this problem.


Any thoughts on this will be much appreciated. Thanks!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

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



Re: [PHP] Re: php and ssl

2006-05-04 Thread Schalk Neethling

Barry wrote:

Schalk schrieb:

Greetings All,

I am currently implementing a form for a client that will run over 
https. Now, all is good and well except, for some reason when the 
form loads in IE the lock in the status bar displays for a short 
while and then goes away, it is fine in Firefox though. The way I 
have the form coded is something like this:


The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to 
think that the form is not secure and not loaded over https? Thank 
you in advance!


Since you load it framewise. is there probably a problem with the 
loaded frames?


It has nothing to do with PHP though.

Barry,

Not sure what you mean by frames If you look at the HTML source 
there are no frames in there. Do you mean the ?



--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
US Tel: (440) 499-5484
Fax: +27125468436
Web
email:[EMAIL PROTECTED]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [EMAIL PROTECTED]

We support OpenSource
Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/

The information transmitted is intended solely for the individual or entity to 
which it is addressed and may contain confidential and/or privileged material. 
Any review, retransmission, dissemination or other use of or taking action in 
reliance upon this information by persons or entities other than the intended 
recipient is prohibited. If you have received this email in error, please 
contact the sender and please delete all traces of this material from all 
devices.

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



[PHP] Re: php and ssl

2006-05-04 Thread Barry

Schalk schrieb:

Greetings All,

I am currently implementing a form for a client that will run over 
https. Now, all is good and well except, for some reason when the form 
loads in IE the lock in the status bar displays for a short while and 
then goes away, it is fine in Firefox though. The way I have the form 
coded is something like this:


{ $name = 
$_POST['name'];

$street_address = $_POST['street_address'];

$to = 'address';
$subject = "subject";
$headers = "MIME-Version: 1.0\r\n".
  "Content-type: text/html; charset=iso-8859-1\r\n".
  "From: ".$name."\r\n".
  "Reply-to: ".$email."\r\n".   
   "Date: ".date("r")."\r\n";


// Compose message:
$message = "message";

// Send message
mail($to, $subject, $message, $headers);

// Thank the generous user
echo "Thank You!";
}
else {

?>
method="post">


Fill in your details



Name:
maxlength="150" />


   





The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to think 
that the form is not secure and not loaded over https? Thank you in 
advance!


Since you load it framewise. is there probably a problem with the loaded 
frames?


It has nothing to do with PHP though.

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



Re: [PHP] Re: PHP and DBase...

2006-01-31 Thread Barry

Jochem Maas wrote:

Barry wrote:


David BERCOT wrote:


Hi,

I'd like to connect to DBase files (.dbf) in order to do SQL requests.
Do you know if it is possible ?
If yes, do you have an example ?
I'm working on Debian with PHP5.

Thank you very much.

David.



Blind?



'Blind' ... is that a php framework? ;-)


It's at least not a bug, it's a feature! ^_^

--
Smileys rule (cX.x)C --o(^_^o)

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



Re: [PHP] Re: PHP and DBase...

2006-01-31 Thread Jochem Maas

Barry wrote:

David BERCOT wrote:


Hi,

I'd like to connect to DBase files (.dbf) in order to do SQL requests.
Do you know if it is possible ?
If yes, do you have an example ?
I'm working on Debian with PHP5.

Thank you very much.

David.


Blind?


'Blind' ... is that a php framework? ;-)



http://de.php.net/dbase



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



[PHP] Re: PHP and DBase...

2006-01-31 Thread Barry

David BERCOT wrote:

Hi,

I'd like to connect to DBase files (.dbf) in order to do SQL requests.
Do you know if it is possible ?
If yes, do you have an example ?
I'm working on Debian with PHP5.

Thank you very much.

David.

Blind?

http://de.php.net/dbase

--
Smileys rule (cX.x)C --o(^_^o)

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



[PHP] Re: PHP and Apache 2.2.0

2005-12-18 Thread Kevin McBride

Manuel Lemos wrote:

I built PHP 5.1 with Apache 2.2 following these instructions and it
works:

http://ww.php.net/manual/en/install.unix.apache2.php



Seems to work now... maybe Apache meant that the 2.0 vs. 2.2 module info
was valid only for precompiled binaries...

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



[PHP] Re: PHP and Apache 2.2.0

2005-12-17 Thread Manuel Lemos

Hello,

on 12/17/2005 04:58 PM Kevin McBride said the following:

Use the same as for Apache 2.0 .



I get "garbled code" errors; tried it before I even posted to the list.

Here's an excerpt from the Apache download page:

Apache 2.2 add-in modules are not compatible with Apache 2.0 or 1.3 
modules. If you are running third party add-in modules, you will need
to obtain new modules written for Apache 2.2 from that third party 
before you attempt to upgrade from Apache 2.0.


I built PHP 5.1 with Apache 2.2 following these instructions and it works:

http://ww.php.net/manual/en/install.unix.apache2.php

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: PHP and Apache 2.2.0

2005-12-17 Thread Kevin McBride

Manuel Lemos wrote:


Use the same as for Apache 2.0 .



I get "garbled code" errors; tried it before I even posted to the list.

Here's an excerpt from the Apache download page:

Apache 2.2 add-in modules are not compatible with Apache 2.0 or 1.3 
modules. If you are running third party add-in modules, you will need
to obtain new modules written for Apache 2.2 from that third party 
before you attempt to upgrade from Apache 2.0.


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



[PHP] Re: PHP and Apache 2.2.0

2005-12-17 Thread Manuel Lemos

Hello,

on 12/16/2005 12:36 PM Kevin McBride said the following:

I am curious to know if there are plans to make a module for Apache
2.2.0.  I couldn't find it in the anonymous CVS, but if it's already
there, can someone point to me where it is?


Use the same as for Apache 2.0 .


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: PHP and Apache 2.2.0

2005-12-16 Thread Kevin McBride

belia wrote:

Hi,

You can download at http://www.apachelounge.com/download/


I am using Linux, not Windows, so the content there will not work.

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



Re: [PHP] Re: PHP and email

2005-11-23 Thread Anas Mughal
I have implemeted a system that dispatches between 600 to 2000 emails every
night. An email is sent for each recepient. My system is hosted on a shared
Linus server. I have not heard any complaints from the hosting company so
far.

Here are my recommendations:

- Have a cron job that kicks off your PHP script at intervals long enough to
guarantee the completion of an earlier execution of the script.
- Have a sleep interval between a predefined number of emails sent. You need
to figure out what works well for you depending on your dispatch frequency,
etc. (I would keep the sleep interval short.)
- No need to nice anything. The problem is the load on the smtp server. You
need to give it some time to process what you sent already before sending
more emails.
- Log all outbound activity. We log the email addresses of who receives each
message. That provides auditing and helps in recovering any failures.
- We use flags in our database to flag what messages were sent successfully.
That way, we can search and resend any failed messages.

Hope this helps.
--
Anas Mughal


Re: [PHP] Re: PHP and email

2005-11-23 Thread John Nichel

Petr Smith wrote:
Thanks to those who have replied so far, yes our main concern is the 
smtp server falling over or dying. So to come back to John Nichel's 
answer:


 John, have you done this personally and I assume the effects were 
good?? IE everything ran smoothly?




I have done it just as John has described above, though I didn't have 
8000
to send.  All went well, no hiccups.  A couple of things I would 
mention is

that I seem to remember reading somewhere that the sleep() function on
Windows eats a lot of processor.  Not an issue for me since I'm on Linux,
but worth a mention.  And the function John suggested above will take 
over

22 hours to send 8000 emails.  Since you say its a one shot deal, its
probably OK.



I don't think the long running script with sleep function is the best 
approach to this problem. I would recommend writing the whole queue 
somewhere (to database) and run script every 5 minutes, load some not 
sent yet e-mails (100), send them and write info (it_was_sent tag) back 
to database.


What's to stop you from writing this 'sent tag' using the sleep method? 
 What I wouldn't like about the every 5 minutes cron method is that the 
script will run _every_ five minutes regardless if it's sending mail or 
not.  Not to mention the fact that even with a small number like a 100, 
you could still cause problems with the mail server trying to make that 
many SMTP connections in less than a second or two.


It's always better to not have long running script, you never know what 
can go wrong and if it fails somewhere or process is killed or machine 
rebooted or something happens, you don't know which emails were sent and 
which not. And there's no stupidest thing as sending the same company 
newsletter twice to the same client.


You computer is full of scripts/programs/daemons that have long 
runs...some 24/7.  That isn't a problem as long as you think ahead. 
With proper logging, I can easily pick up where I left off should the 
script fail for one reason or another.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Re: PHP and email

2005-11-23 Thread Petr Smith
Thanks to those who have replied so far, yes our main concern is the 
smtp server falling over or dying. So to come back to John 
Nichel's answer:


 John, have you done this personally and I assume the effects were 
good?? IE everything ran smoothly?



I have done it just as John has described above, though I didn't have 8000
to send.  All went well, no hiccups.  A couple of things I would mention is
that I seem to remember reading somewhere that the sleep() function on
Windows eats a lot of processor.  Not an issue for me since I'm on Linux,
but worth a mention.  And the function John suggested above will take over
22 hours to send 8000 emails.  Since you say its a one shot deal, its
probably OK.



I don't think the long running script with sleep function is the best 
approach to this problem. I would recommend writing the whole queue 
somewhere (to database) and run script every 5 minutes, load some not 
sent yet e-mails (100), send them and write info (it_was_sent tag) back 
to database.


It's always better to not have long running script, you never know what 
can go wrong and if it fails somewhere or process is killed or machine 
rebooted or something happens, you don't know which emails were sent and 
which not. And there's no stupidest thing as sending the same company 
newsletter twice to the same client.


Petr

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



Re: [PHP] Re: Php and Ruby

2005-10-23 Thread Greg Donald
On 10/23/05, Jacob Friis Saxberg <[EMAIL PROTECTED]> wrote:
> > How can I use Ruby with Php?
>
> I mean Rails. sorry :)

http://www.rubyonrails.org/

I have a couple of Rails apps on my own server with other PHP apps
running there too.  Apache will run mod_fcgi and mod_php at the same
time with no problems.


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/


[PHP] Re: Php and Ruby

2005-10-23 Thread Jacob Friis Saxberg
> How can I use Ruby with Php?

I mean Rails. sorry :)

> My goal is to have (Independence of Presentation Logic(IoPL)).

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



[PHP] Re: PHP and files Upload

2005-10-19 Thread Mark Rees

> the script always says it was sucessful to upload the file, but the
destination
> directory was always empty...
> even when checking the $_FILES global
>
> $_FILES['var_name']['tmp_name'] and
> $_FILES['var_name']['name'] and
> $_FILES['var_name']['size'], the vars alwyas return empty values...
>
> is there any issue with php5 about files uploads ?

I have it working on Windows, Apache, PHP5

A few checks you could make:

Are you sure that var_name is the name of the file upload field in your
form?
Have you set the form enctype to "multipart/form-data"?
Have you set the maxfilesize attribute, and does the file you are trying to
upload exceed that size?

Good luck

Mark

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



[PHP] Re: PHP and Active Directory

2005-10-03 Thread Mark Rees
How do I connect a php script running on linux with Active Directory on
a windows machine? I would like to have my php script autmotatically
read email addresses from the AD server. Can this be done? I've found a
bunch of ldap functions for php but they seem to require ldap to be
installed on linux. I'm confused. Thanks in advance for your help.

---

Have you seen this?
http://uk2.php.net/ldap

I've managed to do it from Windows, after a lot of trial and error, but in
the end it wasn't that complicated.  Have you got any specific questions,
based on following the steps in the manual?

Mark

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



Re: [PHP] Re: Php and postfix error <[EMAIL PROTECTED]>: Sender address rejected: Domain not found

2005-09-02 Thread choksi
Thanks
 This is sorted now.
 Rgds
Dhaval

 On 02/09/05, JamesBenson <[EMAIL PROTECTED]> wrote: 
> 
> http://php.net/mail
> 
> 
> 
> choksi wrote:
> > Hi All,
> > I have php running over Apache on a debian box. I am tryin to use the 
> php
> > mail function. When i run this command from console (php email.php) it 
> will
> > run and the mail is delivered as it will get the from username from the
> > postfix config file but when i run the command from browser it runs 
> through
> > apache it uses the apache user nobody and give me error.
> > Can some help with how can i change the from username.
> > Sep 2 12:00:11 localhost postfix/smtp[17821]: 3B83A52CF6: to=<
> > [EMAIL PROTECTED]>, said: 450 <[EMAIL PROTECTED]>: 
> Sender
> > address rejected: Domain not found (in reply to RCPT TO command))
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Rgds
Choksi


[PHP] Re: Php and postfix error <[EMAIL PROTECTED]>: Sender address rejected: Domain not found

2005-09-02 Thread JamesBenson

http://php.net/mail



choksi wrote:

Hi All,
 I have php running over Apache on a debian box. I am tryin to use the php 
mail function. When i run this command from console (php email.php) it will 
run and the mail is delivered as it will get the from username from the 
postfix config file but when i run the command from browser it runs through 
apache it uses the apache user nobody and give me error. 
 Can some help with how can i change the from username.

  Sep 2 12:00:11 localhost postfix/smtp[17821]: 3B83A52CF6: to=<
[EMAIL PROTECTED]>, said: 450 <[EMAIL PROTECTED]>: Sender 
address rejected: Domain not found (in reply to RCPT TO command))


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



Re: [PHP] & and mySQL

2005-08-28 Thread Richard Lynch
On Sat, August 27, 2005 2:43 pm, mastershay wrote:
> Hi, I am trying to search mySQL for URLs that include & in them. I
> start
> with a standard URL that uses &, use str_replace to put in &, and
> then
> do a mySQL query. However, nothing is found when I run the search
> through
> PHP. When I do the search directly through phpMyadmin, it works fine.
> Anyone
> know what the problem is?

The problem is you haven't shown us the code you are using, nor the
query you think you are using, much less the query you are actually
using...
:-v

Might as well call up a garage and say "My car won't start; Do you
know what the problem is?"

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: PHP and ISMAP

2005-07-29 Thread André Medeiros
On Fri, 2005-07-29 at 14:47 +0200, Michelle Konzack wrote:
> Please no CC, I am on the list.
> 
> Am 2005-07-29 14:20:47, schrieb André Medeiros:
> > Why not using a rewrite rule that would point to an index.php or
> > somesuch?
> 
> And then ?
> I have e.g. 8x6 click maps, pointing all to the same index.php ?
> How do the CGI know on which map I have clicked ?
> 
> And using rewrites on my webserver is no option because they are
> people which can not do that.
>  
> Greetings
> Michelle
> 

Whenever you hit a rewrite rule, the file knows what the original
request was. So, in this case, you'd know whitch image was called ;)

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



[PHP] Re: PHP and ISMAP

2005-07-29 Thread Michelle Konzack
Please no CC, I am on the list.

Am 2005-07-29 14:20:47, schrieb André Medeiros:
> Why not using a rewrite rule that would point to an index.php or
> somesuch?

And then ?
I have e.g. 8x6 click maps, pointing all to the same index.php ?
How do the CGI know on which map I have clicked ?

And using rewrites on my webserver is no option because they are
people which can not do that.
 
Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Re: PHP and Perl

2005-07-23 Thread Jasper Bryant-Greene

Linda H wrote:
I am needing to write a front end for an online application written in 
Perl. Is there a way for PHP to call a module or function written in Perl?


Firstly, please don't reply to existing threads with a completely new 
topic. For those of us that use threaded newsreaders, your message is 
hidden within another thread and is very likely to be missed.


In this situation I would simply use the PHP execution functions 
(exec(), system(), shell_exec(), etc.) to call Perl scripts that use the 
modules or functions written in Perl.


Jasper

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



[PHP] Re: PHP and USB Devices

2005-05-31 Thread Jason Barnett

Joe Harman wrote:

Has anyone out there found a way to get information from a USB device
running on their computer... what i am trying to do is retrive the
fingerprint ID that the Microsoft USB fingerprint reader returns for a
finger print and put it in a webpage form???

There has to be a way to do it...



I haven't ever done anything with that new-fangled fingerprint reader 
stuff.  But if there is some digital form of the person's fingerprint 
coming from that machine then there is some way to capture that ID and 
send it to a webserver.  So just find out how a user can obtain this 
digital fingerprint in file / text format and then send the file / text 
to the server via a form.


But as the other poster has already suggested this is a client side 
issue and about the only thing that you can do is find some way for the 
person to send the fingerprint to you.


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



Re: [PHP] Re: PHP and Access

2005-02-26 Thread Bruno Santos
pete M wrote:
Check this out
http://adodb.sourceforge.net/
http://phplens.com/adodb/code.initialization.html#init
have fun
Pete
Bruno Santos wrote:
Hello.
I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??
cheers
Bruno Santos

Hello all. Thanks for all the answeres but i have a small problem.
Im using Linux, not windows... Ive heard about unixODBC, can i used it
to connect to a access database ??
cheers
--
[EMAIL PROTECTED]
www.feiticeir0.no-ip.org
--
[EMAIL PROTECTED]
www.hal.min-saude.pt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP and Access

2005-02-26 Thread pete M
Check this out
http://adodb.sourceforge.net/
http://phplens.com/adodb/code.initialization.html#init
have fun
Pete
Bruno Santos wrote:
Hello.
I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??
cheers
Bruno Santos
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php and flash

2004-12-15 Thread Manuel Lemos
Hello,
on 12/16/2004 12:40 AM Dustin Krysak said the following:
Can anyone point to some good tutorials on using PHP with flash? I am 
mostly interested in displaying info from a database in the flash movie, 
as well as loading movies and pictures into the flash file (referenced 
in the database).
Not really a tutorial as there is a lot to say about that, but this book 
 provides information on most of what you need to know:

http://www.phpclasses.org/reviews/id/095792187X.html
--
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


Re: [PHP] and statement

2004-11-28 Thread John Nichel
Brad Ciszewski wrote:
is there an 'and' statement for mysql, when you are doing multiple "where"s?
Is there a PHP question in your MySQL question?
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP and send XML

2004-10-28 Thread Manuel Lemos
Hello,
On 10/28/2004 11:01 AM, Victor C. wrote:
I'm trying to pass XML file from Site  A to Site B for Site B to parse.
Site B is maintained by other company, so I only need to worry about sending
over the XML file. I've been hinted that fsockopen() can do the job.
You may want to try this HTTP client class that lets you POST arbitrary 
HTTP request bodies and even comes with an example of how to do that ( 
test_http_soap.php ):

http://www.phpclasses.org/httpclient
BTW, if you want to compose XML documents for sending you may also want 
to try this other XML writer class:

http://www.phpclasses.org/xmlwriter
--
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


Re: [PHP] Re: php and print

2004-10-12 Thread Greg Donald
On Tue, 12 Oct 2004 20:57:54 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> I'm also using Hypertext Mark-up Language and Hypertext Pre-processor but
> hey - who cares about the TLAs...?

No idea what a 'TLA' is in this context, but you're definitely missing
the point.

There is no such thing as 'client side java', it's just Java, whether
it's an applet or a servlet or a cli app.  Java is compiled into
bytecode then executed, while Javascript is parsed like (you guessed
it) a scripting language.  Furthermore, Java was created by Sun, while
Javascript was created by Netscape.  Other than the name collision,
they have very little to do with each other.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: php and print

2004-10-12 Thread Jason Wong
On Wednesday 13 October 2004 03:57, Harlequin wrote:
> I'm also using Hypertext Mark-up Language and Hypertext Pre-processor but
> hey - who cares about the TLAs...?

Java and Javascript are completely different things. You would be fooling 
yourself and making a fool of yourself if you think otherwise.

-- 
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
--
/*
Truth has always been found to promote the best interests of mankind...
- Percy Bysshe Shelley
*/

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



Re: [PHP] Re: php and print

2004-10-12 Thread Harlequin
I'm also using Hypertext Mark-up Language and Hypertext Pre-processor but 
hey - who cares about the TLAs...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Harlequin wrote:
>
>>Bruno
>>
>>I'm still rather new to PHP so I use client side Java:
>>
> you are not using java you are using javascript.
>
>>[CODE]
>>
>>Click Here To Print This Page: >src="../images/Icon_Printer.gif" border="0" alt="Print This Page">
>>[/CODE]
>>
>>That may be os use to you...
>>
>>
>
>
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar. 

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



RE: [PHP] Re: php and print

2004-10-11 Thread Steve Murphy
Why not just use CSS?

http://www.alistapart.com/articles/goingtoprint/

Steve

-Original Message-
From: raditha dissanayake [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 12:23 PM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: php and print


Harlequin wrote:

>Bruno
>
>I'm still rather new to PHP so I use client side Java:
>  
>
you are not using java you are using javascript.

>[CODE]
>
>Click Here To Print This Page: src="../images/Icon_Printer.gif" border="0" alt="Print This Page">
>[/CODE]
>
>That may be os use to you...
>
>  
>


-- 
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

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


Re: [PHP] Re: php and print

2004-10-11 Thread raditha dissanayake
Harlequin wrote:
Bruno
I'm still rather new to PHP so I use client side Java:
 

you are not using java you are using javascript.
[CODE]

Click Here To Print This Page: 
[/CODE]

That may be os use to you...
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   3   4   >