[PHP] Re: require() causing strange characters ?

2009-02-06 Thread Nisse Engström
On Fri, 6 Feb 2009 06:34:41 +0100, cr.vege...@gmail.com wrote:

> I have a script called "test.php":
> 
> 
> and a script called "echo.php":
> 
> 
> With IE and Firefox it shows: CtestD
> but when I view the source, it seems to be: C�testD
> 
> When debugging it, it seems that:
>> "CtestD"   has length 9 in stead of 6
>> pos1has char=C ord=67 
>> pos2has char=� ord=239 
>> pos3has char=� ord=187 
>> pos4has char=� ord=191 
>> rest okay ...
> 
> Any idea what's causing this and how to solve it ?

echo.php has a utf-8 BOM character (Byte Order Mark).
See if your editor has an option to store it without a BOM.


/Nisse

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



Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?

2009-02-06 Thread Alpár Török
2009/2/6 Daevid Vincent 

> Is there a way to use the default values of a function without
> specifying every single one until the parameter you want to modify in
> PHP5 ?
>
> I don't see it here, but feel this would be very useful indeed.
> http://www.php.net/manual/en/functions.arguments.php
>
> So given a function that takes seven parameters, I want to change one of
> them and leave the other defaults alone...
>
>  function SQL_QUERY($sql, $parameters = null, $showSQL = false,
> $showErrors = true, $execute = true, $noHTML = false, $profile = 0)
> {
>var_dump($sql, $parameters, $showSQL, $showErrors, $execute,
> $noHTML,
> $profile);
> }
> ?>
>
> 
> 
> 
> 
> 
>  true); ?>
> 
> 
> 
>  $execute=false); ?>
> 
>
> outputs:
> ---
> string(31) "SELECT * FROM foo WHERE bar = ?"
> NULL
> bool(false)
> bool(true)
> bool(true)
> bool(false)
> int(0)
> ---
> string(31) "SELECT * FROM foo WHERE bar = ?"
> array(1) {  [0]=>  string(4) "beep" }
> bool(true)
> bool(true)
> bool(true)
> bool(false)
> int(0)
> ---
> string(31) "SELECT * FROM foo WHERE bar = ?"
> array(1) {  [0]=>  string(4) "beep" }
> bool(false)
> bool(true)
> bool(true)  <-- I would have expected this one to be bool(false)
> bool(false)
> int(0)
>
> The above function call doesn't error out on me, it just seems it
> doesn't do anything either :-\
>
> So it seems I have to do this verboseness (AND know what the default
> values are to begin with too):
>
> SQL_QUERY('SELECT * FROM foo WHERE bar = ?', array('beep'), false, true,
> false, false);
>
> Just to change one default parameter?!? :-(
>
>
>

You could probably create  a class and break up the functionality of that
function, for somebody reading your code would be hard understanding all
that parameters, maybe even for you after a while.


-- 
Alpar Torok


Re: [PHP] Re: require() causing strange characters ?

2009-02-06 Thread cr.vegelin

Thanks Paul & Nisse,

I saved both scripts with ANSI in stead of UTF-8 and the problem is gone.
So the utf-8 BOM character (Byte Order Mark) caused it.
Unfortunately my editor has no option to store BOM-free scripts.

Is it standard that PHP scripts should be saved without a BOM character ?

Test results ...
If "test.php" (utf8) requires "echo.php" (utf8), page source has "C�testD", 
size 9
If "test.php" (ansi) requires "echo.php" (utf8), page source has 
"CtestD", size 7
If "test.php" (ansi) requires "echo.php" (ansi), page source has "CtestD", 
size 6


The reason for asking is that sometimes "" is displayed on some pages.

Regards, Cor


- Original Message - 
From: "Nisse Engström" 

To: 
Sent: Friday, February 06, 2009 9:21 AM
Subject: [PHP] Re: require() causing strange characters ?



On Fri, 6 Feb 2009 06:34:41 +0100, cr.vege...@gmail.com wrote:


I have a script called "test.php":


and a script called "echo.php":


With IE and Firefox it shows: CtestD
but when I view the source, it seems to be: C�testD

When debugging it, it seems that:

"CtestD"   has length 9 in stead of 6
pos1has char=C ord=67
pos2has char=� ord=239
pos3has char=� ord=187
pos4has char=� ord=191
rest okay ...


Any idea what's causing this and how to solve it ?


echo.php has a utf-8 BOM character (Byte Order Mark).
See if your editor has an option to store it without a BOM.


/Nisse

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






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



Re: [PHP] Email configuration

2009-02-06 Thread Thodoris



2009/2/5 Thodoris :
  

I think that the OP mentioned the word fedora somewhere above...




Oh sorry, I'm so stupid... Anyways, if you want to send mail to large
providers you'll need to use a relay. I found a nice tutorial about
how to set it up with google apps.
It was for Ubuntu but you just have to install msmtp and follow the other steps.
Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail
I did it on my little gentoo server here at home and it works great.



  


Well if I am not getting what you say in the wrong way I should say that 
you don't need to use a relay because you don't need a mail server at all.
The point is that PHP can send mail with the mail() function using a 
local mail client like sendmail's client part or something coded in pure 
PHP.


Keep in mind that you don't need to have a mail server in your PC in 
order to send mail. Similarly PHP doesn't need to have a local mail 
server in order to send mail.


So you don't need extra mail configuration assuming of course that you 
don't need to do something extreme. You just use mail() and the mail 
gets sent.


--
Thodoris



Re: [PHP] cgi vs php

2009-02-06 Thread Thodoris



Thodoris napsal(a):



Y

In cgi i can use perl ,c etc
suppose i use perl

now how efficiency differs?
How cgi written in perl  and php is differ in working in context of web
service?

other difference?.

but their differ.

On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard 
 wrote:


 

[snip]
can anybody tell me the benefits of php over cgi or vice versa?
i need to compare both?
[/snip]

CGI is a gateway to be used by languages
PHP is a language






  


First of all try not to top post this is what we usually do here.

Well CGI is a standard protocol implemented by many programming 
languages. You may start googling to find about it but this is a start:


http://en.wikipedia.org/wiki/Common_Gateway_Interface

Both Perl and PHP can work with CGI but working with Perl-CGI is not 
something that we should discuss in this list since this is a *PHP* 
list.


IMHO you should start reading some aspects of web development to make 
some things clear before start asking questions in the lsit. This 
will improve your understanding and it help us to make suggestions.




I admire your calmness.
Such a descriptive reply for someone who doesn't think before asking.



After smashing a ton of keyboards and yell at my screen when people 
started looking me with a weird expression in their faces I understood that:


1) I am paying a lot of money for keyboards
2) My screen will never answer my threats
3) People will start to think that I come from outer space
4) Everybody needs help

:-)

--
Thodoris


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



Re: [PHP] Pausing PHP scripts

2009-02-06 Thread Phpster

Sleep(20); will pause it for 20 secs

Bastien

Sent from my iPod

On Feb 6, 2009, at 0:37, Ron Piggott  wrote:


Is there a way to pause a PHP script while it is executing?  Ron


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



[PHP] php COM example usage

2009-02-06 Thread Alpár Török
Hi,

I have some cli scripts that previously ran on Linux, now i have to make
available on Linux. I use semaphores for synchronization. I also have to
develop some new scripts for windows that interact other custom programs. I
need to create and signale events. Basically what i need is acces to the win
api. If i am not mistaking (i am not much of a windows kind of person) i
cann acces this via COM. I have searched for  other methods too, but i foudn
thet the Com extension is the only trust worthy. Other extensions for
windows like the win32api is experimental, i need a stable solution for
this. I am now stuck on how to access the win api via COM if possible. I
have found  that something like

 $Object = new COM("WinNT://Semaphore");

works, but takes a long time to complete, and after that i no idea how to go
on from there. There is a callable create() function on the object, but it
complains about arguments.
where can i find information about thease com objects? Is the instantiation
of a Com objects really that slow or am i doing somthing wrong?

-- 
Alpar Torok


Re: [PHP] Boolean Assignment Operator

2009-02-06 Thread Thodoris



2009/2/2 Gavin Hodge 

  

Hi,

I'm fairly new to PHP, having migrated from the Java / C# world.

I wrote some code similar to the following:

$success = true;
$success &= operation1();
$success &= operation2();

if ($success === true) {
   operation3(); // depends on 1 and 2 being successful
}

This didn't work as expected. After a bit of digging I found:
* The &= operation isn't mentioned anywhere in the PHP documentation
* The &= function seems to work as expected, however the following is
observed...
  $success = true;
  $success &= true;
  print $success == true; // outputs 1
  print $sucesss === true; // no output
* The 'or' assignment operator |= causes no errors but doesn't work.

Can any PHP gurus explain why the &= operator works at all, and why
=== seems to fail afterwards?

Cheers,
Gavin.




Hey,

never heard of the "|=" operator. So I think php does not support it.
  


Not true. This works just fine:



And gives 1 as expected.


I cannot say how "&=" works in Java or C# but as of php it works like that
(IMO) (reference instead of copy):
$var1 = "test1";
$var2 = $var1;
$var3 &= $var1;
$var1 = "test2";

echo var1; // "test2"
echo var2; // "test1"
echo var3; // "test2"

  


The manual does describe these as "combined operators" in the assignment 
operators section. See the last example:


http://www.php.net/manual/en/language.operators.assignment.php



--
Thodoris



Re: [PHP] Garbage Collection

2009-02-06 Thread Frank Stanovcak

""Boyd, Todd M.""  wrote in message 
news:33bde0b2c17eef46acbe00537cf2a19003cb4...@exchcluster.ccis.edu...
> -Original Message-
> From: tedd [mailto:t...@sperling.com]
> Sent: Thursday, February 05, 2009 10:07 AM
> To: php-general@lists.php.net
> Subject: [PHP] Garbage Collection
>
> Hi gang:
>
> A related question to my last "Clarity needed" post.
>
> I have a tutor table (showing all the tutors), a course table
> (showing all the courses), and a course-to-tutor table (showing all
> the instances of what tutor teaches what course).
>
> Okay, everything works. Whenever I want to find out what courses a
> specific tutor teaches OR what tutors teach a specific course, I
> simply search the course-to-tutor table and bingo out pops the answer.
>
> Now, how do you handle the situation when a tutor quits or when a
> course is no longer offered?
>
> If I search the course-to-tutor table for all the tutors who teach a
> course and find a tutor who is no longer there OR search the
> course-to-tutor table for all the courses a tutor teaches and find a
> course that is no longer offered, how do you handle the record?
>
> I realize that if either search turns up nothing, I can check for
> that situation and then handle it accordingly. But my question is
> more specifically, in the event of a tutor quilting OR removing a
> course from the curriculum, what do you do about the course-to-tutor
> orphaned record?
>
> As I see it, my choices are to a) ignore the orphaned record or b)
> delete the orphaned record. If I ignore the record, then the database
> grows with orphaned records and searches are slowed. If I delete the
> orphaned record, then the problem is solved, right?
>
> I just want to get a consensus of how you people normally handle it.
> Do any of you see in danger in deleting an orphaned record?

tedd,

I believe relational integrity can solve your problem. In MySQL (and
maybe MSSQL, but I am less "versed" with that product) you should be
able to put a CASCADE option on the DELETE action for your tutor table
so that when a record is deleted, its associated record in
tutors-to-courses is also deleted. I'm assuming you would want to do the
same for removing a record in tutors-to-courses when a course is removed
(but not remove the tutor, the same as you do not remove the course
itself when the tutor is deleted).

I suppose you could also do it yourself with PHP code when a failed link
is turned up, but why bother separating DB logic from the DB itself? :)

HTH,


// Todd

I agree with todd.  Set up the relationship so that when a record in one of 
the two master tables is deleted the delete cascades to the linked table. 
One to many forced update/delete I think it's called if you want to do a 
search on it.

Frank 



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



[PHP] preg_match question...

2009-02-06 Thread bruce
hi...

trying to figure out the best approach to using preg_match to extract the
number from the follwing type of line...

" 131646 sometext follows.."

basically, i want to extract the number, without the text, but i have to be
able to match on the "text"

i've been playing with different preg_match regexs.. but i'm missing
something obvious!

thoughts/comments..


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



[PHP] Re: preg_match question...

2009-02-06 Thread Frank Stanovcak

""bruce""  wrote in message 
news:234801c98863$88f27260$0301a...@tmesa.com...
> hi...
>
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
>
> " 131646 sometext follows.."
>
> basically, i want to extract the number, without the text, but i have to 
> be
> able to match on the "text"
>
> i've been playing with different preg_match regexs.. but i'm missing
> something obvious!
>
> thoughts/comments..
>

How about
preg_match('#(\d+)(.)+#',$haystack,$match)

if I remember right
$match[0] would be all of it
$match[1] would be the numbers
$match[2] would be the text 



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



Re: [PHP] Email configuration

2009-02-06 Thread Yannick Mortier
2009/2/6 Thodoris :
>
> 2009/2/5 Thodoris :
>
>
> I think that the OP mentioned the word fedora somewhere above...
>
>
>
> Oh sorry, I'm so stupid... Anyways, if you want to send mail to large
> providers you'll need to use a relay. I found a nice tutorial about
> how to set it up with google apps.
> It was for Ubuntu but you just have to install msmtp and follow the other
> steps.
> Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail
> I did it on my little gentoo server here at home and it works great.
>
>
>
>
>
> Well if I am not getting what you say in the wrong way I should say that you
> don't need to use a relay because you don't need a mail server at all.
> The point is that PHP can send mail with the mail() function using a local
> mail client like sendmail's client part or something coded in pure PHP.
>
> Keep in mind that you don't need to have a mail server in your PC in order
> to send mail. Similarly PHP doesn't need to have a local mail server in
> order to send mail.
>
> So you don't need extra mail configuration assuming of course that you don't
> need to do something extreme. You just use mail() and the mail gets sent.
>
> --
> Thodoris


Of course he can send mails this way, but they won't be accepted by
many mail providers because of their anti-spam measurments.
They bounce mails that come from dynamic ip ranges like his home
server. I just wanted to help him avoid this because you won't see the
reason until you look at the syslog.



-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me at twitter!
http://twitter.com/moortier

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



Re: [PHP] Garbage Collection

2009-02-06 Thread Shawn McKenzie
Frank Stanovcak wrote:
> ""Boyd, Todd M.""  wrote in message 
> news:33bde0b2c17eef46acbe00537cf2a19003cb4...@exchcluster.ccis.edu...
>> -Original Message-
>> From: tedd [mailto:t...@sperling.com]
>> Sent: Thursday, February 05, 2009 10:07 AM
>> To: php-general@lists.php.net
>> Subject: [PHP] Garbage Collection
>>
>> Hi gang:
>>
>> A related question to my last "Clarity needed" post.
>>
>> I have a tutor table (showing all the tutors), a course table
>> (showing all the courses), and a course-to-tutor table (showing all
>> the instances of what tutor teaches what course).
>>
>> Okay, everything works. Whenever I want to find out what courses a
>> specific tutor teaches OR what tutors teach a specific course, I
>> simply search the course-to-tutor table and bingo out pops the answer.
>>
>> Now, how do you handle the situation when a tutor quits or when a
>> course is no longer offered?
>>
>> If I search the course-to-tutor table for all the tutors who teach a
>> course and find a tutor who is no longer there OR search the
>> course-to-tutor table for all the courses a tutor teaches and find a
>> course that is no longer offered, how do you handle the record?
>>
>> I realize that if either search turns up nothing, I can check for
>> that situation and then handle it accordingly. But my question is
>> more specifically, in the event of a tutor quilting OR removing a
>> course from the curriculum, what do you do about the course-to-tutor
>> orphaned record?
>>
>> As I see it, my choices are to a) ignore the orphaned record or b)
>> delete the orphaned record. If I ignore the record, then the database
>> grows with orphaned records and searches are slowed. If I delete the
>> orphaned record, then the problem is solved, right?
>>
>> I just want to get a consensus of how you people normally handle it.
>> Do any of you see in danger in deleting an orphaned record?
> 
> tedd,
> 
> I believe relational integrity can solve your problem. In MySQL (and
> maybe MSSQL, but I am less "versed" with that product) you should be
> able to put a CASCADE option on the DELETE action for your tutor table
> so that when a record is deleted, its associated record in
> tutors-to-courses is also deleted. I'm assuming you would want to do the
> same for removing a record in tutors-to-courses when a course is removed
> (but not remove the tutor, the same as you do not remove the course
> itself when the tutor is deleted).
> 
> I suppose you could also do it yourself with PHP code when a failed link
> is turned up, but why bother separating DB logic from the DB itself? :)
> 
> HTH,
> 
> 
> // Todd
> 
> I agree with todd.  Set up the relationship so that when a record in one of 
> the two master tables is deleted the delete cascades to the linked table. 
> One to many forced update/delete I think it's called if you want to do a 
> search on it.
> 
> Frank 
> 
> 
Yes, and you haven't tried it, MySQL Workbench is very handy for
designing DBs.  It was Windows only, but they now have a beta out for
Linux and it seems to work fine.

-- 
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] Re: preg_match question...

2009-02-06 Thread bruce
hmmm...

tried your preg__match/regex...

i get:
0 - 1145 total
1 - 1145
2 - l

i would have thought that the 2nd array item should have had "total"...



-Original Message-
From: Frank Stanovcak [mailto:blindspot...@comcast.net]
Sent: Friday, February 06, 2009 6:15 AM
To: php-general@lists.php.net
Subject: [PHP] Re: preg_match question...



""bruce""  wrote in message 
news:234801c98863$88f27260$0301a...@tmesa.com...
> hi...
>
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
>
> " 131646 sometext follows.."
>
> basically, i want to extract the number, without the text, but i have to 
> be
> able to match on the "text"
>
> i've been playing with different preg_match regexs.. but i'm missing
> something obvious!
>
> thoughts/comments..
>

How about
preg_match('#(\d+)(.)+#',$haystack,$match)

if I remember right
$match[0] would be all of it
$match[1] would be the numbers
$match[2] would be the text 



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


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



Re: [PHP] Re: preg_match question...

2009-02-06 Thread Shawn McKenzie
bruce wrote:
> hmmm...
> 
> tried your preg__match/regex...
> 
> i get:
> 0 - 1145 total
> 1 - 1145
> 2 - l
> 
> i would have thought that the 2nd array item should have had "total"...
> 

Probably want this: '#(\d+)(.+)#'

-- 
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] Email configuration

2009-02-06 Thread Thodoris



2009/2/6 Thodoris :
  

2009/2/5 Thodoris :


I think that the OP mentioned the word fedora somewhere above...



Oh sorry, I'm so stupid... Anyways, if you want to send mail to large
providers you'll need to use a relay. I found a nice tutorial about
how to set it up with google apps.
It was for Ubuntu but you just have to install msmtp and follow the other
steps.
Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail
I did it on my little gentoo server here at home and it works great.





Well if I am not getting what you say in the wrong way I should say that you
don't need to use a relay because you don't need a mail server at all.
The point is that PHP can send mail with the mail() function using a local
mail client like sendmail's client part or something coded in pure PHP.

Keep in mind that you don't need to have a mail server in your PC in order
to send mail. Similarly PHP doesn't need to have a local mail server in
order to send mail.

So you don't need extra mail configuration assuming of course that you don't
need to do something extreme. You just use mail() and the mail gets sent.

--
Thodoris




Of course he can send mails this way, but they won't be accepted by
many mail providers because of their anti-spam measurments.
They bounce mails that come from dynamic ip ranges like his home
server. I just wanted to help him avoid this because you won't see the
reason until you look at the syslog.



  


I am sorry didn't get right what you meant after all.

In that case a simple mail() won't do.

--
Thodoris



Re: [PHP] Read a XML (not a file)

2009-02-06 Thread Carlos Medina

Phpster schrieb:



On Feb 6, 2009, at 9:12, Jônatas Zechim  wrote:


Hi there, i want do read a XML like this:

Server.php
   
 1
  teste
  /images/teste.jpg

";
?>

How can do this?

zechim


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



Remove the php tags and code, and just save the file as XML. Then you 
can have another file read in and or echo the HTML



Bastien

Hi,
call the site to generate the XML data with simplexml function

$xml = simplexml_load_string( fopen("http://www.example.com/";, "r") );

But if we want to be serious: Use classes to do this is better.

Regards

Carlos


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



Re: [PHP] Re: preg_match question...

2009-02-06 Thread Alpár Török
2009/2/6 Shawn McKenzie 

> bruce wrote:
> > hmmm...
> >
> > tried your preg__match/regex...
> >
> > i get:
> > 0 - 1145 total
> > 1 - 1145
> > 2 - l
> >
> > i would have thought that the 2nd array item should have had "total"...
> >
>
> Probably want this: '#(\d+)(.+)#'

That's it sorry. Take a look at preg_match_all(), you can put the total in
you regexp like /^([0-9]+) total/

>
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Alpar Torok


Re: [PHP] Re: preg_match question...

2009-02-06 Thread Frank Stanovcak

"Shawn McKenzie"  wrote in message 
news:e1.67.59347.e494c...@pb1.pair.com...
> bruce wrote:
>> hmmm...
>>
>> tried your preg__match/regex...
>>
>> i get:
>> 0 - 1145 total
>> 1 - 1145
>> 2 - l
>>
>> i would have thought that the 2nd array item should have had "total"...
>>
>
> Probably want this: '#(\d+)(.+)#'
>
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com

yep.  Relized it after I saw his post.

the space doesn't hurt either

'#(\d+) (.+)#'

Frank...doh! 



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



[PHP] Read a XML (not a file)

2009-02-06 Thread Jônatas Zechim
Hi there, i want do read a XML like this:

Server.php
   
  1
   teste
   /images/teste.jpg
 
";
?>

How can do this?

zechim


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



Re: [PHP] Re: DB Comparisons

2009-02-06 Thread Murray
In fact, ASP.NET happily connects with other DBMSes. I have several C#
ASP.NET web apps happily working with MySQL.

M is for Murray


On Fri, Feb 6, 2009 at 7:39 AM, Ashley Sheridan 
wrote:

> although I think ASP can only connect to MSSQL and
> ASP.Net connects only to MSSQL and Oracle (but I'm not 100% certain on
> this)
>


Re: [PHP] preg_match question...

2009-02-06 Thread Alpár Török
preg_match('/^([0-9]+) (.)+/',$sString,$aMatches);

Matches will be 1 => the number ; 2 => the text. The expression only matches
if there is any character after the space.  Not necessarily text, it might
be another number or special characters

2009/2/6 bruce 

> hi...
>
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
>
> " 131646 sometext follows.."
>
> basically, i want to extract the number, without the text, but i have to be
> able to match on the "text"
>
> i've been playing with different preg_match regexs.. but i'm missing
> something obvious!
>
> thoughts/comments..
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Alpar Torok


Re: [PHP] Read a XML (not a file)

2009-02-06 Thread Phpster



On Feb 6, 2009, at 9:12, Jônatas Zechim  wrote:


Hi there, i want do read a XML like this:

Server.php
   
 1
  teste
  /images/teste.jpg

";
?>

How can do this?

zechim


--  
PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php



Remove the php tags and code, and just save the file as XML. Then you  
can have another file read in and or echo the HTML



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



Re: [PHP] Question about version control.. sorta..

2009-02-06 Thread Michael Kubler

I'll put in a +1 for Subversion. I use it and love it.
I have the actual repository sitting on a linux box and usually use 
TortiseSVN to update, and commit to the repository.
It's pretty easy to use, and was much easier to setup than I expected. I 
simply apt-get install svn, and then edited some Apache config files, of 
which the code is available with a quick google.


I keep all the websites I code in the repository and even though I have 
3 computers on the same network I'll sometimes commit related files on 
one PC, and update the local copy on another computer because it's even 
easier than using windows network file transfer. Plus the fact that I 
have a script to automatically backup the repository regularly, so once 
the data is in the repository I'm highly unlikely to loose it (esp as 
I've got local cached copies on 3 computers).


Best of all? IT'S FREE!

my 2c.

Michael Kubler
*G*rey *P*hoenix *P*roductions 



TG wrote:
So, for my purposes.. after trying a handful of solutions.. open source and 
commercial..  I think I've decided that Reliable Software's "Code Co-op" 
is what's going to work best for me.


My trial is almost up, so as soon as my next paycheck comes, I think I'll 
be purchasing the full version for $150.


For me, it's totally worth it.   It stores everything in a local database, 
but allows collaboration if that's what you're into.  Via email for the 
$150 version, via LAN for the $200 version.


It lets me add files by type, is easy to check out files.  Anyway.. if 
anyone's looking for an easy Windows version control system, check it out.


(no, I don't work for them, just passing along the recommendation since I'm 
digging this software)


Thanks for all the input!

-TG
  


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



Re: [PHP] Read a XML (not a file)

2009-02-06 Thread Jim Lucas
Jônatas Zechim wrote:
> Hi there, i want do read a XML like this:
> 
> Server.php
>  
>   header ("content-type: text/xml");
> 
> echo "   
>   1
>teste
>/images/teste.jpg
>  
> ";
> ?>
> 
> How can do this?
> 
> zechim
> 
> 

test.php


mind you that the header() call within the include is going to change the 
default headers(), so be sure to reset the content-type one you come out of
the include file.


-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] preg_match question...

2009-02-06 Thread Jim Lucas
bruce wrote:
> hi...
> 
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
> 
> " 131646 sometext follows.."
> 
> basically, i want to extract the number, without the text, but i have to be
> able to match on the "text"
> 
> i've been playing with different preg_match regexs.. but i'm missing
> something obvious!
> 
> thoughts/comments..
> 
> 

Why don't you show us some of the attempts that you have tried that didn't work.

When you say that you need to match on some of the text, give us an example of 
the text that you are trying to match.

And give us examples of the input text you are trying to match to.

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Clarity needed

2009-02-06 Thread tedd

At 9:48 AM +0200 2/6/09, Thodoris wrote:
There is a very good schema for doing thing like that in this pdf. 
Its main purpose is to explain join temporary, tables and 
transactions but you will find it useful because I think it is 
relevant with your case.


http://dev.mysql.com/tech-resources/articles/mysql-db-design-ch5.pdf

Why don't you give it a try.



Yes, I did read it and it most certainly fits part of the problem I'm 
facing. In fact, it says the same things that all my other MySQL 
books do. The problem is that sometimes, regardless of all that you 
read, it's good to see how others solve similar problems.


Keep in mind that not all problems fall into the camp of requiring 
such in-depth solutions. Sometimes, the full-blown solution can be an 
overkill.


So, discussing such things on this list does exactly as the subject 
line indicated -- it provides clarity.


Thanks everyone,

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



[PHP] long echo statement performance question

2009-02-06 Thread Frank Stanovcak
I'm in the process of seperating logic from display in a section of code, 
and wanted to make sure I wasn't treading on a performance landmine here, so 
I ask you wizened masters of the dark arts this...

is there a serious performance hit, or reason not to use long, ie more than 
30 - 40 lines, comma conjoined echo statments...

echo 'blah', $var, 'blah', $var2,...ad nauseum

... to output mixed html and php var values?  If so could you refer me to a 
work around, or better way?

Frank 



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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Richard Heyes
> ...

Wouldn't have thought so. But for readability, you may find this a
little easier instead:

?>
{$var1} Blah {$var2}
...
http://www.rgraph.org (Updated January 31st)

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from presentation in a elegant way.

2009/2/6 Frank Stanovcak :
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here, so
> I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to a
> work around, or better way?
>
> Frank
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
Dinamize SC - Joinville - Fone 47 3025.1182
Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
Dinamize SP - São Paulo - Fone 11 6824.6250
Dinamize PR - Curitiba - Fone 41 3306.4388
Dinamize RS - Caxias do Sul - Fone 54 3533.4333
Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Richard Heyes
> Wouldn't have thought so. But for readability, you may find this a
> little easier instead:

Slight correction:

?>
 blah 
http://www.rgraph.org (Updated January 31st)

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Frank Stanovcak

"Richard Heyes"  wrote in message 
news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
>> Wouldn't have thought so. But for readability, you may find this a
>> little easier instead:
>
> Slight correction:
>
> ?>
> blah 
> 
> -- 
> Richard Heyes
>
> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
> http://www.rgraph.org (Updated January 31st)

Actually that's what I'm in the middle of undoing.  The first revision was 
jumping in and out of PHP mode upwards of 60 times per page on the shorter 
pages.  I've read a couple places that that can put a huge performace hit on 
things, so I was just trying to simplify the code a bit.  Plus I don't have 
the fast tags, http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] Read a XML (not a file)

2009-02-06 Thread Jônatas Zechim
But the 'server.php' is on another Server, i did this and is ok now.

function ctalk_fopen($u){
$b=parse_url($u);
$h=$b['host'];
$p=(isset($b['query']))?$b['path']."?".$b['query']:$b['path'];
$s=socket_create(AF_INET,SOCK_STREAM,0);
socket_set_block($s);
$r=socket_connect($s,gethostbyname($h),getservbyname('www','tcp'));
$i="GET $p HTTP/1.1\r\nHost: $h\r\nConnection: close\r\n\r\n";
socket_write($s,$i,strlen($i));
$r='';
while($o=socket_read($s,4096)){$r=$r.$o;}
socket_close($s);
$c=preg_split("/\r?\n\r?\n/", $r,2);
return $c[1];
}

$u = "http://localhost/xml/server.php";;

function ctalk_se($xp,$a){global $f;}
function ctalk_ee($xp,$n){global $f,$i;$k=$n;$f[$k]=$i;$i="";}
function ctalk_dt($xp,$d){global $i;$i.=$d;}

$xp=xml_parser_create();
xml_set_element_handler($xp,"ctalk_se","ctalk_ee");
xml_set_character_data_handler($xp,"ctalk_dt");
xml_parse($xp,ctalk_fopen($u),true);

print_r($f);
returns an array of the XML that server.php had output.

Zechim



-Mensagem original-
De: Jim Lucas [mailto:li...@cmsws.com] 
Enviada em: sexta-feira, 6 de fevereiro de 2009 14:39
Para: Jônatas Zechim
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Read a XML (not a file)

Jônatas Zechim wrote:
> Hi there, i want do read a XML like this:
> 
> Server.php
>  
>   header ("content-type: text/xml");
> 
> echo "   
>   1
>teste
>/images/teste.jpg
>  
> ";
> ?>
> 
> How can do this?
> 
> zechim
> 
> 

test.php


mind you that the header() call within the include is going to change the 
default headers(), so be sure to reset the content-type one you come out of
the include file.


-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Frank Stanovcak

"Bruno Fajardo"  wrote in message 
news:eeb6980b0902060915k2b34ec31nc6ad166e2c544...@mail.gmail.com...
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from presentation in a elegant way.

2009/2/6 Frank Stanovcak :
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here, 
> so
> I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more 
> than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to 
> a
> work around, or better way?
>
> Frank
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

I'm going to take a serious look at that for ver 2.0, but unfortunately live 
beta 1 rollout is monday, and I'm just cleaning house right now.  Thanks for 
the advice though!

Frank 



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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Stuart
2009/2/6 Frank Stanovcak :
>
> "Richard Heyes"  wrote in message
> news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
>>> Wouldn't have thought so. But for readability, you may find this a
>>> little easier instead:
>>
>> Slight correction:
>>
>> ?>
>> blah 
>> >
>> --
>> Richard Heyes
>>
>> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
>> http://www.rgraph.org (Updated January 31st)
>
> Actually that's what I'm in the middle of undoing.  The first revision was
> jumping in and out of PHP mode upwards of 60 times per page on the shorter
> pages.  I've read a couple places that that can put a huge performace hit on
> things, so I was just trying to simplify the code a bit.  Plus I don't have
> the fast tags, http://stut.net/projects/phpspeed/?iterations=1

As you can see, the difference is so minimal that unless you're doing
it hundreds of thousands of times per script it makes little
difference how you do it.

In short it's usually not worth optimising at this level since greater
gains are certainly to be had by looking at your interaction with
databases or other external resources.

-Stuart

-- 
http://stut.net/

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



[PHP] going blind for looking...need eyes

2009-02-06 Thread Terion Miller
Need eyes on this query, it is not inserting, I am going to highlight
what/where  I thought the problem is (there is no " )but when I add the " it
then changes the syntax coloring on the rest of the code  in my editor which
makes me wonder if I'm wrong... argh. and either way it's not inserting ...

-
$sql = "INSERT INTO admin (UserName, Password, Name, Email, Property,
Department, AddWorkOrder, ";
$sql .= "ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt, ";
$sql .= "ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
DelWorkOrder, ChangeStatus, AddEditAdmin";
$sql .= ") VALUES(  '$UserName', '$Password', '$Name', '$Email',
'$Property', '$Department', '$AddWorkOrder', ";
$sql .= "'$ViewAllWorkOrders', '$ViewNewOrders', '$ViewNewArt',
'$ViewPendingWorkOrders', '$ViewPendingArtwork', ";
$sql .= "'$ViewCompletedArt', '$ViewCompletedWorkOrders',
'$SearchWorkOrder', '$EditWorkOrder', '$DelWorkOrder',  ";
$sql .= "'$ChangeStatus', '$AddEditAdmin', '$ViewMyOrders')";
$result = mysql_query($sql);


Re: [PHP] going blind for looking...need eyes

2009-02-06 Thread Daniel Brown
On Fri, Feb 6, 2009 at 12:44, Terion Miller  wrote:
>
> -
> $sql = "INSERT INTO admin (UserName, Password, Name, Email, Property,
> Department, AddWorkOrder, ";
>$sql .= "ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
> ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt, ";
>$sql .= "ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
> DelWorkOrder, ChangeStatus, AddEditAdmin";
>$sql .= ") VALUES(  '$UserName', '$Password', '$Name', '$Email',
> '$Property', '$Department', '$AddWorkOrder', ";
>$sql .= "'$ViewAllWorkOrders', '$ViewNewOrders', '$ViewNewArt',
> '$ViewPendingWorkOrders', '$ViewPendingArtwork', ";
>$sql .= "'$ViewCompletedArt', '$ViewCompletedWorkOrders',
> '$SearchWorkOrder', '$EditWorkOrder', '$DelWorkOrder',  ";
>$sql .= "'$ChangeStatus', '$AddEditAdmin', '$ViewMyOrders')";
>$result = mysql_query($sql);

1.) You have 19 columns named, but 20 values given.
2.) Make sure you use mysql_real_escape_string() or otherwise
sanitize the data.
3.) When you run into similar issues, use 

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] going blind for looking...need eyes

2009-02-06 Thread Jochem Maas
Daniel Brown schreef:
> On Fri, Feb 6, 2009 at 12:44, Terion Miller  wrote:
>> -
>> $sql = "INSERT INTO admin (UserName, Password, Name, Email, Property,
>> Department, AddWorkOrder, ";
>>$sql .= "ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
>> ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt, ";
>>$sql .= "ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
>> DelWorkOrder, ChangeStatus, AddEditAdmin";
>>$sql .= ") VALUES(  '$UserName', '$Password', '$Name', '$Email',
   ^-- does the lack of space here screw things up?

>> '$Property', '$Department', '$AddWorkOrder', ";
>>$sql .= "'$ViewAllWorkOrders', '$ViewNewOrders', '$ViewNewArt',
>> '$ViewPendingWorkOrders', '$ViewPendingArtwork', ";
>>$sql .= "'$ViewCompletedArt', '$ViewCompletedWorkOrders',
>> '$SearchWorkOrder', '$EditWorkOrder', '$DelWorkOrder',  ";
>>$sql .= "'$ChangeStatus', '$AddEditAdmin', '$ViewMyOrders')";
>>$result = mysql_query($sql);
> 
> 1.) You have 19 columns named, but 20 values given.
> 2.) Make sure you use mysql_real_escape_string() or otherwise
> sanitize the data.
> 3.) When you run into similar issues, use  or die(mysql_error()); ?>

good points from Dan, I suggest additionally something a little more
vague and possibly not to your taste ... but ... try making your
query a little more readable:

$sql = "INSERT INTO admin (
 UserName, Password, Name, Email, Property, Department,
 AddWorkOrder, ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
 ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt,
 ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
 DelWorkOrder, ChangeStatus, AddEditAdmin
) VALUES (
 '$UserName', '$Password', '$Name', '$Email', '$Property', 
'$Department',
 '$AddWorkOrder', '$ViewAllWorkOrders', '$ViewNewOrders', 
'$ViewNewArt',
 '$ViewPendingWorkOrders', '$ViewPendingArtwork', 
'$ViewCompletedArt',
 '$ViewCompletedWorkOrders', '$SearchWorkOrder', 
'$EditWorkOrder',
 '$DelWorkOrder', '$ChangeStatus', '$AddEditAdmin', 
'$ViewMyOrders'
)";

there are a zillion variations on this theme (e.g. using HEREDOC syntax and/or 
putting each field & value
on a single line, which is sometimes helpful in counting whether no. of fields 
matches no. of values)

> 


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



Re: [PHP] going blind for looking...need eyes

2009-02-06 Thread Daniel Brown
On Fri, Feb 6, 2009 at 13:03, Jochem Maas  wrote:
>
> there are a zillion variations on this theme (e.g. using HEREDOC syntax 
> and/or putting each field & value

That's right, when reading the OP's email, there was meant to be a
#4 as well.

4.) Use HEREDOC syntax:



-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Eric Butera
On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo  wrote:
> In my opinion, you would achieve better results using a template
> engine, like Smarty (http://www.smarty.net/). In addition, your code
> would be entirely separated from presentation in a elegant way.
>
> 2009/2/6 Frank Stanovcak :
>> I'm in the process of seperating logic from display in a section of code,
>> and wanted to make sure I wasn't treading on a performance landmine here, so
>> I ask you wizened masters of the dark arts this...
>>
>> is there a serious performance hit, or reason not to use long, ie more than
>> 30 - 40 lines, comma conjoined echo statments...
>>
>> echo 'blah', $var, 'blah', $var2,...ad nauseum
>>
>> ... to output mixed html and php var values?  If so could you refer me to a
>> work around, or better way?
>>
>> Frank
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> --
> Bruno Fajardo - Desenvolvimento
> bruno.faja...@dinamize.com - www.dinamize.com
> Dinamize RS - Porto Alegre-RS - CEP 90420-111
> Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150
>
> Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
> Dinamize SC - Joinville - Fone 47 3025.1182
> Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
> Dinamize SP - São Paulo - Fone 11 6824.6250
> Dinamize PR - Curitiba - Fone 41 3306.4388
> Dinamize RS - Caxias do Sul - Fone 54 3533.4333
> Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

In a thread about performance you suggest Smarty?  Really?  :D

-- 
http://www.voom.me | EFnet: #voom

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread tedd

At 1:55 AM +0100 2/6/09, Jochem Maas wrote:

that tedd's unlimited educational resources (tutors/courses) might
go someway to undoing all the harm Fox News inflicts on the masses.


Or to provide clarity to those who think that Fox News is doing harm.

Alter all, the main-stream news doesn't like reporting unfavorable 
things about their favorites celebrities, do they? Keep in mind that 
"not paying taxes by elected officials" has not met the same 
threshold of reporting "not knowing how to speak publicly" has made.


I would rather have all politicians stammer in their speeches and pay 
their taxes than the other way around.


In fact, it would be nice if the politicians would get their 
facts/words straight. For example, the "Speaker of the House" just 
announced that "Last month over 500 million people lost their jobs" 
in her support for the importance of rushing the approval of the 
"Stimulus package" (whatever that is).


In any event, it's interesting to realize that accordingly to her, 
EVERYONE in the USA lost their job last month and two thirds of the 
population lost it twice!


It would be nice if the "Speaker of the House" at least realized how 
many people actually live in the country she represents. BUT -- you 
didn't hear that on the main-stream news -- or -- if you did, they 
didn't make much of it, right? However, if Bush had said it, that 
would have been something different -- it would be headline news and 
on Saturday Night Live.


Clearly, there is a difference in news reporting today. There are no 
impartial sources -- everything has biases and spin. The days of 
Walter Cronkite reporting are over.


Viva opposing opinions.

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] Clarity needed OT

2009-02-06 Thread Eric Butera
On Fri, Feb 6, 2009 at 1:13 PM, tedd  wrote:
> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
>>
>> that tedd's unlimited educational resources (tutors/courses) might
>> go someway to undoing all the harm Fox News inflicts on the masses.
>
> Or to provide clarity to those who think that Fox News is doing harm.
>
> Alter all, the main-stream news doesn't like reporting unfavorable things
> about their favorites celebrities, do they? Keep in mind that "not paying
> taxes by elected officials" has not met the same threshold of reporting "not
> knowing how to speak publicly" has made.
>
> I would rather have all politicians stammer in their speeches and pay their
> taxes than the other way around.
>
> In fact, it would be nice if the politicians would get their facts/words
> straight. For example, the "Speaker of the House" just announced that "Last
> month over 500 million people lost their jobs" in her support for the
> importance of rushing the approval of the "Stimulus package" (whatever that
> is).
>
> In any event, it's interesting to realize that accordingly to her, EVERYONE
> in the USA lost their job last month and two thirds of the population lost
> it twice!
>
> It would be nice if the "Speaker of the House" at least realized how many
> people actually live in the country she represents. BUT -- you didn't hear
> that on the main-stream news -- or -- if you did, they didn't make much of
> it, right? However, if Bush had said it, that would have been something
> different -- it would be headline news and on Saturday Night Live.
>
> Clearly, there is a difference in news reporting today. There are no
> impartial sources -- everything has biases and spin. The days of Walter
> Cronkite reporting are over.
>
> Viva opposing opinions.
>
> 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
>
>

I think people should just be wise enough to understand the world they
live in, how things work, and when people are puppets.  There are lots
of ways to find information out there...

-- 
http://www.voom.me | EFnet: #voom

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Luke Slater
On Friday 06 Feb 2009 18:13:02 tedd wrote:
> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
> >that tedd's unlimited educational resources (tutors/courses) might
> >go someway to undoing all the harm Fox News inflicts on the masses.
>
> Or to provide clarity to those who think that Fox News is doing harm.
>
> Alter all, the main-stream news doesn't like reporting unfavorable
> things about their favorites celebrities, do they? Keep in mind that
> "not paying taxes by elected officials" has not met the same
> threshold of reporting "not knowing how to speak publicly" has made.
>
> I would rather have all politicians stammer in their speeches and pay
> their taxes than the other way around.
>
> In fact, it would be nice if the politicians would get their
> facts/words straight. For example, the "Speaker of the House" just
> announced that "Last month over 500 million people lost their jobs"
> in her support for the importance of rushing the approval of the
> "Stimulus package" (whatever that is).
>
> In any event, it's interesting to realize that accordingly to her,
> EVERYONE in the USA lost their job last month and two thirds of the
> population lost it twice!
>
> It would be nice if the "Speaker of the House" at least realized how
> many people actually live in the country she represents. BUT -- you
> didn't hear that on the main-stream news -- or -- if you did, they
> didn't make much of it, right? However, if Bush had said it, that
> would have been something different -- it would be headline news and
> on Saturday Night Live.
>
> Clearly, there is a difference in news reporting today. There are no
> impartial sources -- everything has biases and spin. The days of
> Walter Cronkite reporting are over.
>
> Viva opposing opinions.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com

Yes even the BBC who are under governmental bill to be impartial get round the 
issue by saying that it's the particular reporter/author of the article that 
is being biased rather than the BBC as a collective entity...


signature.asc
Description: This is a digitally signed message part.


Re: [PHP] Clarity needed

2009-02-06 Thread Jochem Maas
***RANT WARNING***

Shawn McKenzie schreef:
> Jochem Maas wrote:
>> Daniel Brown schreef:
>>> On Thu, Feb 5, 2009 at 07:56, Jochem Maas  wrote:
 and the answer to you Q, like everyone else said: yup :-)

 PS - given you unlimited resources you might consider doing a
 charitable donation to FoxNews aficionados :-)
>>> Or reminding you how to speak English, Jochem.  What the hell are
>>> you trying to say here?!? ;-P
>> that tedd's unlimited educational resources (tutors/courses) might
>> go someway to undoing all the harm Fox News inflicts on the masses.
>>
>>> Man, a guy disappears for a while and his speech goes to gibberish
>>> almost as bad as my own.  ;-P
>> almost :-P
>>
>>
> Or fox may go someway towards dulling the socialist propaganda of the
> tutors/courses. 

I didn't assume any particular leaning on the part of the education resource
in question ... merely that to count as education I would require ciriculum
to foster peoples ability to question/analyse/research for *themselves*,
but heck, why bother when Bill O'Reilly can do it for you right?

> We're headed there, but thank God I'm not schreefing
> from an insanely socialist country!  :-)

ir dismissive to call something insane just because you either
don't understand it or don't agree with it.

not to mention that my country 'boasts' a rather wide spectrum
political viewpoints, many of which are hardly socialist.

... and it certainly wasn't socialists that shipped countless
slaves from Africa to America ... but the culprits we're often
dutch.

oh and here's a bit of Socialist Doctrine:
"We hold these truths to be self-evident, that all men are created equal ..."

not that I'm much of a socialist, mainly because i think all politics
is inherently bogus - just a bigpile of strawmen, but wait ...
capitalism ... that's working out a treat isn't it (in a "gonna
make the 'Great Depression' look like a day in park" kind of way).

with regard to capitalism, were do you think the staple concepts and
structures came from? 13th century europe, specifically the 'lowlands',
not to mention the AEX (now Euronext), which is generally considered to be
the oldest formal stock exchange.

... so stick that in your pipe and smoke it ... oh wait you can't,
which is why there's a constant stream of planes touching down here,
full of yanks gagging to get shitfaced.




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



[PHP] Re: going blind for looking...need eyes

2009-02-06 Thread Frank Stanovcak

"Terion Miller"  wrote in message 
news:37405f850902060944y74a7a5e8ndce0c3456a32d...@mail.gmail.com...
> Need eyes on this query, it is not inserting, I am going to highlight
> what/where  I thought the problem is (there is no " )but when I add the " 
> it
> then changes the syntax coloring on the rest of the code  in my editor 
> which
> makes me wonder if I'm wrong... argh. and either way it's not inserting 
> ...
>
> -
> $sql = "INSERT INTO admin (UserName, Password, Name, Email, Property,
> Department, AddWorkOrder, ";
>$sql .= "ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
> ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt, ";
>$sql .= "ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
> DelWorkOrder, ChangeStatus, AddEditAdmin";
>$sql .= ") VALUES(  '$UserName', '$Password', '$Name', '$Email',
> '$Property', '$Department', '$AddWorkOrder', ";
>$sql .= "'$ViewAllWorkOrders', '$ViewNewOrders', '$ViewNewArt',
> '$ViewPendingWorkOrders', '$ViewPendingArtwork', ";
>$sql .= "'$ViewCompletedArt', '$ViewCompletedWorkOrders',
> '$SearchWorkOrder', '$EditWorkOrder', '$DelWorkOrder',  ";
>$sql .= "'$ChangeStatus', '$AddEditAdmin', '$ViewMyOrders')";
>$result = mysql_query($sql);
>

Try this for readability

$sql = "INSERT INTO admin SET
  UserName='$UserName',
  Password='$Password',
  Name='$Name',
  Email='$Email',
  Property='$Property',
  Department='$Department',
  AddWorkOrder='$AddWorkOrder',
  ViewAllWorkOrders='$ViewAllWorkOrders',
  ViewNewOrders='$ViewNewOrders',
  ViewNewArt='$ViewNewArt',
  ViewPendingWorkOrders='$ViewPendingWorkOrders',
  ViewPendingArtwork='$ViewPendingArtwork',
  ViewCompletedArt='$ViewCompletedArt',
  ViewCompletedWorkOrders='$ViewCompletedWorkOrders',
  SearchWorkOrder='$SearchWorkOrder',
  EditWorkOrder='$EditWorkOrder',
  DelWorkOrder='$DelWorkOrder',
  ChangeStatus='$ChangeStatus',
  AddEditAdmin='$AddEditAdmin'";


plus there is an extra value with no matching field in the original query. 
$ViewMyOrders has no field assigned to it.

Hope that helps some!

Frank 



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



Re: [PHP] Clarity needed

2009-02-06 Thread Bastien Koert
On Fri, Feb 6, 2009 at 1:35 PM, Jochem Maas  wrote:

> ***RANT WARNING***
>
> Shawn McKenzie schreef:
> > Jochem Maas wrote:
> >> Daniel Brown schreef:
> >>> On Thu, Feb 5, 2009 at 07:56, Jochem Maas 
> wrote:
>  and the answer to you Q, like everyone else said: yup :-)
> 
>  PS - given you unlimited resources you might consider doing a
>  charitable donation to FoxNews aficionados :-)
> >>> Or reminding you how to speak English, Jochem.  What the hell are
> >>> you trying to say here?!? ;-P
> >> that tedd's unlimited educational resources (tutors/courses) might
> >> go someway to undoing all the harm Fox News inflicts on the masses.
> >>
> >>> Man, a guy disappears for a while and his speech goes to gibberish
> >>> almost as bad as my own.  ;-P
> >> almost :-P
> >>
> >>
> > Or fox may go someway towards dulling the socialist propaganda of the
> > tutors/courses.
>
> I didn't assume any particular leaning on the part of the education
> resource
> in question ... merely that to count as education I would require ciriculum
> to foster peoples ability to question/analyse/research for *themselves*,
> but heck, why bother when Bill O'Reilly can do it for you right?
>
> > We're headed there, but thank God I'm not schreefing
> > from an insanely socialist country!  :-)
>
> ir dismissive to call something insane just because you either
> don't understand it or don't agree with it.
>
> not to mention that my country 'boasts' a rather wide spectrum
> political viewpoints, many of which are hardly socialist.
>
> ... and it certainly wasn't socialists that shipped countless
> slaves from Africa to America ... but the culprits we're often
> dutch.
>
> oh and here's a bit of Socialist Doctrine:
> "We hold these truths to be self-evident, that all men are created equal
> ..."
>
> not that I'm much of a socialist, mainly because i think all politics
> is inherently bogus - just a bigpile of strawmen, but wait ...
> capitalism ... that's working out a treat isn't it (in a "gonna
> make the 'Great Depression' look like a day in park" kind of way).
>
> with regard to capitalism, were do you think the staple concepts and
> structures came from? 13th century europe, specifically the 'lowlands',
> not to mention the AEX (now Euronext), which is generally considered to be
> the oldest formal stock exchange.
>
> ... so stick that in your pipe and smoke it ... oh wait you can't,
> which is why there's a constant stream of planes touching down here,
> full of yanks gagging to get shitfaced.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
WOW! Jochem, you need to relax just a little bit and bring down that blood
pressure...

And the dutch were hardly the only ones in there..

Greets from Canada

-- 

Bastien

Cat, the other other white meat


Re: [PHP] Clarity needed OT

2009-02-06 Thread Frank Stanovcak

"Eric Butera"  wrote in message 
news:6a8639eb0902061020v793d22b9x1430872c2170b...@mail.gmail.com...
> On Fri, Feb 6, 2009 at 1:13 PM, tedd  wrote:
>> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
>>>
>>> that tedd's unlimited educational resources (tutors/courses) might
>>> go someway to undoing all the harm Fox News inflicts on the masses.
>>
>> Or to provide clarity to those who think that Fox News is doing harm.
>>
>> Alter all, the main-stream news doesn't like reporting unfavorable things
>> about their favorites celebrities, do they? Keep in mind that "not paying
>> taxes by elected officials" has not met the same threshold of reporting 
>> "not
>> knowing how to speak publicly" has made.
>>
>> I would rather have all politicians stammer in their speeches and pay 
>> their
>> taxes than the other way around.
>>
>> In fact, it would be nice if the politicians would get their facts/words
>> straight. For example, the "Speaker of the House" just announced that 
>> "Last
>> month over 500 million people lost their jobs" in her support for the
>> importance of rushing the approval of the "Stimulus package" (whatever 
>> that
>> is).
>>
>> In any event, it's interesting to realize that accordingly to her, 
>> EVERYONE
>> in the USA lost their job last month and two thirds of the population 
>> lost
>> it twice!
>>
>> It would be nice if the "Speaker of the House" at least realized how many
>> people actually live in the country she represents. BUT -- you didn't 
>> hear
>> that on the main-stream news -- or -- if you did, they didn't make much 
>> of
>> it, right? However, if Bush had said it, that would have been something
>> different -- it would be headline news and on Saturday Night Live.
>>
>> Clearly, there is a difference in news reporting today. There are no
>> impartial sources -- everything has biases and spin. The days of Walter
>> Cronkite reporting are over.
>>
>> Viva opposing opinions.
>>
>> 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
>>
>>
>
> I think people should just be wise enough to understand the world they
> live in, how things work, and when people are puppets.  There are lots
> of ways to find information out there...
>
> -- 
> http://www.voom.me | EFnet: #voom

Ok...I'm sure that somewhere in here has to be reference to the original 
topic, and php...right?

Frank...there is isn't there? *sigh* 



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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
Well, Smarty's caching layer is very fast. Maybe not as fast as an
echo statement, but apparentely Frank was also interested in separate
logic from presentation, and a series of echo's is not the best
solution in my opinion. :-)
But the best solution depends of the context of the application, i agree.

2009/2/6 Eric Butera :
> On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo  wrote:
>> In my opinion, you would achieve better results using a template
>> engine, like Smarty (http://www.smarty.net/). In addition, your code
>> would be entirely separated from presentation in a elegant way.
>>
>> 2009/2/6 Frank Stanovcak :
>>> I'm in the process of seperating logic from display in a section of code,
>>> and wanted to make sure I wasn't treading on a performance landmine here, so
>>> I ask you wizened masters of the dark arts this...
>>>
>>> is there a serious performance hit, or reason not to use long, ie more than
>>> 30 - 40 lines, comma conjoined echo statments...
>>>
>>> echo 'blah', $var, 'blah', $var2,...ad nauseum
>>>
>>> ... to output mixed html and php var values?  If so could you refer me to a
>>> work around, or better way?
>>>
>>> Frank
>>>
>>>
>>>
>>> --
>>> 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
>>
>>
>
> In a thread about performance you suggest Smarty?  Really?  :D
>
> --
> http://www.voom.me | EFnet: #voom
>

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Eric Butera
On Fri, Feb 6, 2009 at 1:46 PM, Frank Stanovcak
 wrote:
>
> "Eric Butera"  wrote in message
> news:6a8639eb0902061020v793d22b9x1430872c2170b...@mail.gmail.com...
>> On Fri, Feb 6, 2009 at 1:13 PM, tedd  wrote:
>>> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:

 that tedd's unlimited educational resources (tutors/courses) might
 go someway to undoing all the harm Fox News inflicts on the masses.
>>>
>>> Or to provide clarity to those who think that Fox News is doing harm.
>>>
>>> Alter all, the main-stream news doesn't like reporting unfavorable things
>>> about their favorites celebrities, do they? Keep in mind that "not paying
>>> taxes by elected officials" has not met the same threshold of reporting
>>> "not
>>> knowing how to speak publicly" has made.
>>>
>>> I would rather have all politicians stammer in their speeches and pay
>>> their
>>> taxes than the other way around.
>>>
>>> In fact, it would be nice if the politicians would get their facts/words
>>> straight. For example, the "Speaker of the House" just announced that
>>> "Last
>>> month over 500 million people lost their jobs" in her support for the
>>> importance of rushing the approval of the "Stimulus package" (whatever
>>> that
>>> is).
>>>
>>> In any event, it's interesting to realize that accordingly to her,
>>> EVERYONE
>>> in the USA lost their job last month and two thirds of the population
>>> lost
>>> it twice!
>>>
>>> It would be nice if the "Speaker of the House" at least realized how many
>>> people actually live in the country she represents. BUT -- you didn't
>>> hear
>>> that on the main-stream news -- or -- if you did, they didn't make much
>>> of
>>> it, right? However, if Bush had said it, that would have been something
>>> different -- it would be headline news and on Saturday Night Live.
>>>
>>> Clearly, there is a difference in news reporting today. There are no
>>> impartial sources -- everything has biases and spin. The days of Walter
>>> Cronkite reporting are over.
>>>
>>> Viva opposing opinions.
>>>
>>> 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
>>>
>>>
>>
>> I think people should just be wise enough to understand the world they
>> live in, how things work, and when people are puppets.  There are lots
>> of ways to find information out there...
>>
>> --
>> http://www.voom.me | EFnet: #voom
>
> Ok...I'm sure that somewhere in here has to be reference to the original
> topic, and php...right?
>
> Frank...there is isn't there? *sigh*
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Notice the OT appended? :P

-- 
http://www.voom.me | EFnet: #voom

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Eric Butera
On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo  wrote:
> Well, Smarty's caching layer is very fast. Maybe not as fast as an
> echo statement, but apparentely Frank was also interested in separate
> logic from presentation, and a series of echo's is not the best
> solution in my opinion. :-)
> But the best solution depends of the context of the application, i agree.

Right on.  I was just playing anyways.  I'm a strong supporter of
things like Savant & Zend_View.  Use PHP, but for read only type of
things with no logic.

-- 
http://www.voom.me | EFnet: #voom

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



Re: [PHP] Clarity needed

2009-02-06 Thread Shawn McKenzie
***FACT WARNING***

Jochem Maas wrote:
> ***RANT WARNING***
>
> Shawn McKenzie schreef:
>> Jochem Maas wrote:
>>> Daniel Brown schreef:
 On Thu, Feb 5, 2009 at 07:56, Jochem Maas
  wrote:
> and the answer to you Q, like everyone else said: yup :-)
>
> PS - given you unlimited resources you might consider doing a
>  charitable donation to FoxNews aficionados :-)
 Or reminding you how to speak English, Jochem.  What the hell
 are you trying to say here?!? ;-P
>>> that tedd's unlimited educational resources (tutors/courses)
>>> might go someway to undoing all the harm Fox News inflicts on the
>>>  masses.
>>>
 Man, a guy disappears for a while and his speech goes to
 gibberish almost as bad as my own.  ;-P
>>> almost :-P
>>>
>>>
>> Or fox may go someway towards dulling the socialist propaganda of
>> the tutors/courses.
>
> I didn't assume any particular leaning on the part of the education
> resource in question ... merely that to count as education I would
> require ciriculum to foster peoples ability to
> question/analyse/research for *themselves*, but heck, why bother when
>  Bill O'Reilly can do it for you right?

Bill is a dumb-ass.  I wasn't talking about editorial or commentary,
which is expected to be biased.  I was talking about unbiased news
reporting.

>
>> We're headed there, but thank God I'm not schreefing from an
>> insanely socialist country!  :-)
>
> ir dismissive to call something insane just because you either don't
> understand it or don't agree with it.

No , insanity is trying the same thing over and over and expecting a
different result, i.e. socialism.

> not to mention that my country 'boasts' a rather wide spectrum
> political viewpoints, many of which are hardly socialist.

On one point I apologize, though NL is still European socialism, I
misinterpreted schreef as German! :-(

> ... and it certainly wasn't socialists that shipped countless slaves
> from Africa to America ... but the culprits we're often dutch.
>
> oh and here's a bit of Socialist Doctrine: "We hold these truths to
> be self-evident, that all men are created equal ..."

Well, if you change it up a bit, like "We hold these truths to be self
evident, that it is the government's responsibility to attempt to make
all men equal." then I would agree.

> not that I'm much of a socialist, mainly because i think all politics
>  is inherently bogus - just a bigpile of strawmen, but wait ...
> capitalism ... that's working out a treat isn't it (in a "gonna make
> the 'Great Depression' look like a day in park" kind of way).

Yes, I am down on all politicians as well, however, capitalism works
great.  What you are seeing now is socialist engineering of the
capitalist market, starting with mildly socialist Clinton, moderately to
very socialist Bush and then of course hard leftist Obama.  The world
economy is bolted onto the U.S. economy because European Socialism
doesn't work.  We're all in for a miserable time as European style
socialism takes root and spreads across the U.S.

> with regard to capitalism, were do you think the staple concepts and
>  structures came from? 13th century europe, specifically the
> 'lowlands', not to mention the AEX (now Euronext), which is generally
>  considered to be the oldest formal stock exchange.

If by lowlands you mean Scotland, then yes I agree.  :-)

> ... so stick that in your pipe and smoke it ... oh wait you can't,
> which is why there's a constant stream of planes touching down here,
>  full of yanks gagging to get shitfaced.

I would be happy if those yanks stayed there permanently :-)  I handle
my problems by dealing with them, so no need to toke them away.

I was just taking a playful stab at you earlier.  Not trying to piss you
off!

-Shawn

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Shawn McKenzie
Frank Stanovcak wrote:
> "Eric Butera"  wrote in message 
> news:6a8639eb0902061020v793d22b9x1430872c2170b...@mail.gmail.com...
>> On Fri, Feb 6, 2009 at 1:13 PM, tedd  wrote:
>>> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
 that tedd's unlimited educational resources (tutors/courses) might
 go someway to undoing all the harm Fox News inflicts on the masses.
>>> Or to provide clarity to those who think that Fox News is doing harm.
>>>
>>> Alter all, the main-stream news doesn't like reporting unfavorable things
>>> about their favorites celebrities, do they? Keep in mind that "not paying
>>> taxes by elected officials" has not met the same threshold of reporting 
>>> "not
>>> knowing how to speak publicly" has made.
>>>
>>> I would rather have all politicians stammer in their speeches and pay 
>>> their
>>> taxes than the other way around.
>>>
>>> In fact, it would be nice if the politicians would get their facts/words
>>> straight. For example, the "Speaker of the House" just announced that 
>>> "Last
>>> month over 500 million people lost their jobs" in her support for the
>>> importance of rushing the approval of the "Stimulus package" (whatever 
>>> that
>>> is).
>>>
>>> In any event, it's interesting to realize that accordingly to her, 
>>> EVERYONE
>>> in the USA lost their job last month and two thirds of the population 
>>> lost
>>> it twice!
>>>
>>> It would be nice if the "Speaker of the House" at least realized how many
>>> people actually live in the country she represents. BUT -- you didn't 
>>> hear
>>> that on the main-stream news -- or -- if you did, they didn't make much 
>>> of
>>> it, right? However, if Bush had said it, that would have been something
>>> different -- it would be headline news and on Saturday Night Live.
>>>
>>> Clearly, there is a difference in news reporting today. There are no
>>> impartial sources -- everything has biases and spin. The days of Walter
>>> Cronkite reporting are over.
>>>
>>> Viva opposing opinions.
>>>
>>> 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
>>>
>>>
>> I think people should just be wise enough to understand the world they
>> live in, how things work, and when people are puppets.  There are lots
>> of ways to find information out there...
>>
>> -- 
>> http://www.voom.me | EFnet: #voom
> 
> Ok...I'm sure that somewhere in here has to be reference to the original 
> topic, and php...right?
> 
> Frank...there is isn't there? *sigh* 
> 
> 
Yes, 3 tables :-)

-- 
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] long echo statement performance question

2009-02-06 Thread Bruno Fajardo
I am so stick to Smarty that I never tried other solutions, like
Savant. Thanks for the tip, I'll try it right away.

Cheers.

2009/2/6 Eric Butera :
> On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo  wrote:
>> Well, Smarty's caching layer is very fast. Maybe not as fast as an
>> echo statement, but apparentely Frank was also interested in separate
>> logic from presentation, and a series of echo's is not the best
>> solution in my opinion. :-)
>> But the best solution depends of the context of the application, i agree.
>
> Right on.  I was just playing anyways.  I'm a strong supporter of
> things like Savant & Zend_View.  Use PHP, but for read only type of
> things with no logic.
>
> --
> http://www.voom.me | EFnet: #voom
>



-- 
Bruno Fajardo - Desenvolvimento
bruno.faja...@dinamize.com - www.dinamize.com
Dinamize RS - Porto Alegre-RS - CEP 90420-111
Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150

Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
Dinamize SC - Joinville - Fone 47 3025.1182
Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
Dinamize SP - São Paulo - Fone 11 6824.6250
Dinamize PR - Curitiba - Fone 41 3306.4388
Dinamize RS - Caxias do Sul - Fone 54 3533.4333
Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Eric Butera
On Fri, Feb 6, 2009 at 2:10 PM, Bruno Fajardo  wrote:
> I am so stick to Smarty that I never tried other solutions, like
> Savant. Thanks for the tip, I'll try it right away.
>
> Cheers.
>
> 2009/2/6 Eric Butera :
>> On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo  wrote:
>>> Well, Smarty's caching layer is very fast. Maybe not as fast as an
>>> echo statement, but apparentely Frank was also interested in separate
>>> logic from presentation, and a series of echo's is not the best
>>> solution in my opinion. :-)
>>> But the best solution depends of the context of the application, i agree.
>>
>> Right on.  I was just playing anyways.  I'm a strong supporter of
>> things like Savant & Zend_View.  Use PHP, but for read only type of
>> things with no logic.
>>
>> --
>> http://www.voom.me | EFnet: #voom
>>
>
>
>
> --
> Bruno Fajardo - Desenvolvimento
> bruno.faja...@dinamize.com - www.dinamize.com
> Dinamize RS - Porto Alegre-RS - CEP 90420-111
> Fones (51) 3027 7158 / 8209 4181 - Fax (51) 3027 7150
>
> Dinamize BA - Lauro de Freitas - Fone 71 3379.7830
> Dinamize SC - Joinville - Fone 47 3025.1182
> Dinamize DF - Asa Norte - Brasília - Fone 61 3274.1172
> Dinamize SP - São Paulo - Fone 11 6824.6250
> Dinamize PR - Curitiba - Fone 41 3306.4388
> Dinamize RS - Caxias do Sul - Fone 54 3533.4333
> Dinamize RJ - Rio de Janeiro - Fone 21 2169.6311
>

Keep in mind it won't keep people from running whatever code they
want.  It's more of a discipline you must enforce upon yourself and
development team.  It works out well for me though, but all
requirements are different.

-- 
http://www.voom.me | EFnet: #voom

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Paul M Foster
On Fri, Feb 06, 2009 at 01:09:13PM -0500, Eric Butera wrote:

> On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo  wrote:
> > In my opinion, you would achieve better results using a template
> > engine, like Smarty (http://www.smarty.net/). In addition, your code
> > would be entirely separated from presentation in a elegant way.
> >



> 
> In a thread about performance you suggest Smarty?  Really?  :D
> 

You know, I was gonna say something about that, but I figure I've
complained enough on list. I agree, though.

Paul

-- 
Paul M. Foster

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Frank Stanovcak

"Stuart"  wrote in message 
news:a5f019de0902060932k1ccf2948ua42f3cfa33694...@mail.gmail.com...
> 2009/2/6 Frank Stanovcak :
>>
>> "Richard Heyes"  wrote in message
>> news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
 Wouldn't have thought so. But for readability, you may find this a
 little easier instead:
>>>
>>> Slight correction:
>>>
>>> ?>
>>> blah 
>>> >>
>>> --
>>> Richard Heyes
>>>
>>> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
>>> http://www.rgraph.org (Updated January 31st)
>>
>> Actually that's what I'm in the middle of undoing.  The first revision 
>> was
>> jumping in and out of PHP mode upwards of 60 times per page on the 
>> shorter
>> pages.  I've read a couple places that that can put a huge performace hit 
>> on
>> things, so I was just trying to simplify the code a bit.  Plus I don't 
>> have
>> the fast tags, 
> They're called short tags, not fast tags. There is nothing faster
> about them beyond the typing effort required.
>
> This question, or rather variations of it, appear on this list at
> pretty regular intervals. A little while ago I wrote a script to test
> the speed of various output methods.
>
>http://stut.net/projects/phpspeed/?iterations=1
>
> As you can see, the difference is so minimal that unless you're doing
> it hundreds of thousands of times per script it makes little
> difference how you do it.
>
> In short it's usually not worth optimising at this level since greater
> gains are certainly to be had by looking at your interaction with
> databases or other external resources.
>
> -Stuart
>
> -- 
> http://stut.net/

Thanks Stuart!
So for clarity's sake jumping into and out of PHP parsing mode to echo a var 
isn't going to do as great a performance hit as these naysayers would have 
me believe.  Good.  I like the color coding of my html in my editor that is 
lost when I have to quote it to get it to echo/print properly!

Frank 



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



Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?

2009-02-06 Thread Daevid Vincent
On Fri, 2009-02-06 at 14:10 +1300, German Geek wrote:

> I've thought about this problem before but couldn't think of a
> solution either. 


Well, I guess I *did* think of a solution, it just happens that PHP
doesn't do "the logical thing"(tm) 

;-)

I would hope the PHP developers would implement this idea for a future
version. The concept is simple, just specify which parameters in the
function call you want to change and leave the others as their default.

I've added it here: http://bugs.php.net/bug.php?id=47331 with comments
about similar/related bugs.

Feel free to vote on this. I think it's a necessary addition to the
language and often a source of frustration for me in large projects
especially where functions get older and older and more parameters are
needed to maintain backwards compatibility yet get new functionality
too.




Re: [PHP] Clarity needed

2009-02-06 Thread Jochem Maas
Shawn McKenzie schreef:
> ***FACT WARNING***

that would be funny if it wasn't so sad.


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



RE: [PHP] How can I use a function's default arguments but change one of the end ones in the list?

2009-02-06 Thread Boyd, Todd M.
> -Original Message-
> From: Daevid Vincent [mailto:dae...@daevid.com]
> Sent: Friday, February 06, 2009 2:26 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] How can I use a function's default arguments but
> change one of the end ones in the list?
> 
> On Fri, 2009-02-06 at 14:10 +1300, German Geek wrote:
> 
> > I've thought about this problem before but couldn't think of a
> > solution either.
> 
> 
> Well, I guess I *did* think of a solution, it just happens that PHP
> doesn't do "the logical thing"(tm)
> 
> ;-)
> 
> I would hope the PHP developers would implement this idea for a future
> version. The concept is simple, just specify which parameters in the
> function call you want to change and leave the others as their
default.
> 
> I've added it here: http://bugs.php.net/bug.php?id=47331 with comments
> about similar/related bugs.
> 
> Feel free to vote on this. I think it's a necessary addition to the
> language and often a source of frustration for me in large projects
> especially where functions get older and older and more parameters are
> needed to maintain backwards compatibility yet get new functionality
> too.

Just tell 'em that .NET already has it; that'll light a fire under them!
:D
C# can do function calls like:

FunctionName(VariableName:=Value);

I wholeheartedly prefer PHP to .NET for most things... but you've got to
admit--that's a pretty slick feature. Me likey.


// Todd

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Daevid Vincent
On Fri, 2009-02-06 at 17:32 +, Stuart wrote:


> They're called short tags, not fast tags. There is nothing faster
> about them beyond the typing effort required.

Mostly true.

However, the only thing that  does is an "echo/print", so aside
from saving you  all the time, you can't do  

Personally, I love them.

> http://stut.net/projects/phpspeed/?iterations=1

God bless you son for making this f'n amazing page! 

Ironically it doesn't have  in it though. HAHA! can you add
that to your test suite too?

D.Vin
http://daevid.com



[PHP] Using DLL with PHP

2009-02-06 Thread Dan Shirah
Howdy,

I'm looking for a little guidance here.

I'm trying to re-write a VB function in PHP.

This is the function I'm working with:


Private Declare Function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _

(ByVal FullPathFrom As String, ByVal FullPathTo As String) As
Integer

 Naturally I would start off with function() from PHP as well and I will
also already have my two variables that I need to pass to the DLL:

$FullPathFrom = "this\is\my\path";
$FullPathTo = "this\is\my\path";

function DTM_CONVDMSToMultiTIFF ( )

But I am unsure of how I would call and pass the variables to the DLL. I've
looked into W32api, but not sure if that's even what I need.

Any ideas?

Thanks,
Dan


Re: [PHP] Clarity needed (Really OT)

2009-02-06 Thread tedd

At 7:35 PM +0100 2/6/09, Jochem Maas wrote:

***RANT WARNING***

oh and here's a bit of Socialist Doctrine:
"We hold these truths to be self-evident, that all men are created equal ..."


Socialist Doctrine?

Here's a group of people under treat of "loss of life" tell their 
government that everyone is created equal and you say that what they 
said is a Socialist Doctrine? A doctrine that came into being some 
140 years later?


Look, you are a gifted programmer and I learn a lot from you, but 
this goes to prove that often we are gifted in only a limited number 
of subjects.


As Will Rogers once said, "We're all ignorant, only in different 
subjects." I say "We're all gifted, but not in everything."


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] How can I use a function's default arguments but change one of the end ones in the list?

2009-02-06 Thread Frank Stanovcak

""Boyd, Todd M.""  wrote in message 
news:33bde0b2c17eef46acbe00537cf2a19003d07...@exchcluster.ccis.edu...
> -Original Message-
> From: Daevid Vincent [mailto:dae...@daevid.com]
> Sent: Friday, February 06, 2009 2:26 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] How can I use a function's default arguments but
> change one of the end ones in the list?
>
> On Fri, 2009-02-06 at 14:10 +1300, German Geek wrote:
>
> > I've thought about this problem before but couldn't think of a
> > solution either.
>
>
> Well, I guess I *did* think of a solution, it just happens that PHP
> doesn't do "the logical thing"(tm)
>
> ;-)
>
> I would hope the PHP developers would implement this idea for a future
> version. The concept is simple, just specify which parameters in the
> function call you want to change and leave the others as their
default.
>
> I've added it here: http://bugs.php.net/bug.php?id=47331 with comments
> about similar/related bugs.
>
> Feel free to vote on this. I think it's a necessary addition to the
> language and often a source of frustration for me in large projects
> especially where functions get older and older and more parameters are
> needed to maintain backwards compatibility yet get new functionality
> too.

Just tell 'em that .NET already has it; that'll light a fire under them!
:D
C# can do function calls like:

FunctionName(VariableName:=Value);

I wholeheartedly prefer PHP to .NET for most things... but you've got to
admit--that's a pretty slick feature. Me likey.


// Todd

I don't remember what it was I was using, but I remember a lang that allowed 
func(,,,change,,,change) where all the empty comas just went to default. 
*shrug* 



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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Daniel Brown
On Fri, Feb 6, 2009 at 13:46, Frank Stanovcak  wrote:
>
> Ok...I'm sure that somewhere in here has to be reference to the original
> topic, and php...right?
>
> Frank...there is isn't there? *sigh*

Stick around you'll see this happens frequently.  It's
considered a Good Thing[tm].  It maintains a level of sanity among the
community.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Frank Stanovcak

"Daniel Brown"  wrote in message 
news:ab5568160902061416u10e761dal224ec7177d83e...@mail.gmail.com...
> On Fri, Feb 6, 2009 at 13:46, Frank Stanovcak  
> wrote:
>>
>> Ok...I'm sure that somewhere in here has to be reference to the original
>> topic, and php...right?
>>
>> Frank...there is isn't there? *sigh*
>
>Stick around you'll see this happens frequently.  It's
> considered a Good Thing[tm].  It maintains a level of sanity among the
> community.
>
> -- 
> 
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> Unadvertised dedicated server deals, too low to print - email me to find 
> out!

since when have the words 'sanity', and 'programmer' ever been used together 
outside of the setup for a joke?

Frank...still faithfully taking his pills. 



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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Daniel Brown
On Fri, Feb 6, 2009 at 17:26, Frank Stanovcak  wrote:
>
> since when have the words 'sanity', and 'programmer' ever been used together
> outside of the setup for a joke?
>
> Frank...still faithfully taking his pills.

This guy fits in well 'round there here parts.  ;-P

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Sancar Saran
On Friday 06 February 2009 19:12:08 Frank Stanovcak wrote:
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here,
> so I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to a
> work around, or better way?
>
> Frank

Seperate logic.

Not the template.

 was good for templating. With opcode cache all your template 
was cached.

And of course you should not use write functions in templates.

and if you really want to do this with

echo  yada yada I suggest this one.

$output = '';


do someting remove echo  and put $output.

and end of the script

do echo $output.

This was the best way. Of course you can use output buffering. 



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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Stephen

I have been reading this thread with interest ... and amusement.

FWII for my web sites I have

1) Most PHP code in files outside of the document root
2) Site specific variables (constants, really) in an include.php file
3) All HTML is also in this include file and is the content a variable.
4) Nested in the HTML code are variables for the content, like the menu 
and body text

5) All presentation is done using CSS
6) Each page just has PHP code (mostly function calls) where the content 
variables are built

7) Finally the content variable is echoed.

Stephen

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



Re: [PHP] Clarity needed (Really OT)

2009-02-06 Thread Nathan Rixham

tedd wrote:

At 7:35 PM +0100 2/6/09, Jochem Maas wrote:

Socialist Doctrine?


"the community orm"?



Here's a group of people under treat of "loss of life" tell their 
government that everyone is created equal and you say that what they 
said is a Socialist Doctrine? A doctrine that came into being some 140 
years later?




and required a tonne of xml to set-up?

Look, you are a gifted programmer and I learn a lot from you, but this 
goes to prove that often we are gifted in only a limited number of 
subjects.




he is ! and his surname sounds like a technology
"Wanted Senior MAAS Developer, London £35k"

As Will Rogers once said, "We're all ignorant, only in different 
subjects." I say "We're all gifted, but not in everything."




"we'll never be gifted at everything but it won't stop us trying and 
pretending we are to clients"

- the developers motto


Cheers,


Regards,


tedd



nath

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



Re: [PHP] Clarity needed (Really OT)

2009-02-06 Thread Shawn McKenzie
Nathan Rixham wrote:
> tedd wrote:
>> At 7:35 PM +0100 2/6/09, Jochem Maas wrote:
>>
>> Socialist Doctrine?
> 
> "the community orm"?
> 
>>
>> Here's a group of people under treat of "loss of life" tell their
>> government that everyone is created equal and you say that what they
>> said is a Socialist Doctrine? A doctrine that came into being some 140
>> years later?
>>
> 
> and required a tonne of xml to set-up?
> 
>> Look, you are a gifted programmer and I learn a lot from you, but this
>> goes to prove that often we are gifted in only a limited number of
>> subjects.
>>
> 
> he is ! and his surname sounds like a technology
> "Wanted Senior MAAS Developer, London £35k"
> 
>> As Will Rogers once said, "We're all ignorant, only in different
>> subjects." I say "We're all gifted, but not in everything."
>>
> 
> "we'll never be gifted at everything but it won't stop us trying and
> pretending we are to clients"
> - the developers motto
> 
>> Cheers,
>>
> Regards,
> 
>> tedd
>>
> 
> nath

+5 Funny

-- 
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] Re: DB Comparisons

2009-02-06 Thread Ashley Sheridan
On Fri, 2009-02-06 at 21:56 +1000, Murray wrote:
> In fact, ASP.NET happily connects with other DBMSes. I have several C#
> ASP.NET web apps happily working with MySQL.
> 
> M is for Murray
> 
> 
> On Fri, Feb 6, 2009 at 7:39 AM, Ashley Sheridan 
> wrote:
> 
> > although I think ASP can only connect to MSSQL and
> > ASP.Net connects only to MSSQL and Oracle (but I'm not 100% certain on
> > this)
> >
C# is bad, and will get you sent to hell... I asked M$, and they
adamantly refused to answer... so draw your own conclusions...


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Email configuration

2009-02-06 Thread Ashley Sheridan
On Fri, 2009-02-06 at 16:30 +0200, Thodoris wrote:
> > 2009/2/6 Thodoris :
> >   
> >> 2009/2/5 Thodoris :
> >>
> >>
> >> I think that the OP mentioned the word fedora somewhere above...
> >>
> >>
> >>
> >> Oh sorry, I'm so stupid... Anyways, if you want to send mail to large
> >> providers you'll need to use a relay. I found a nice tutorial about
> >> how to set it up with google apps.
> >> It was for Ubuntu but you just have to install msmtp and follow the other
> >> steps.
> >> Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail
> >> I did it on my little gentoo server here at home and it works great.
> >>
> >>
> >>
> >>
> >>
> >> Well if I am not getting what you say in the wrong way I should say that 
> >> you
> >> don't need to use a relay because you don't need a 
> mail server at all.
> >> The point is that PHP can send mail with the mail() function using a local
> >> mail client like sendmail's client part or something coded in pure PHP.
> >>
> >> Keep in mind that you don't need to have a mail server in your PC in order
> >> to send mail. Similarly PHP doesn't need to have a local mail server in
> >> order to send mail.
> >>
> >> So you don't need extra mail configuration assuming of course that you 
> >> don't
> >> need to do something extreme. You just use mail() and the mail gets sent.
> >>
> >> --
> >> Thodoris
> >> 
> >
> >
> > Of course he can send mails this way, but they won't be accepted by
> > many mail providers because of their anti-spam measurments.
> > They bounce mails that come from dynamic ip ranges like his home
> > server. I just wanted to help him avoid this because you won't see the
> > reason until you look at the syslog.
> >
> >
> >
> >   
>  
> I am sorry didn't get right what you meant after all.
> 
> In that case a simple mail() won't do.
> 
I've never had an email bounced because of where it came from based on
IP. I have had emails bounced based on the email headers that were sent.
Always check the headers first. Even MessageLabs won't block an email
based on the IP.


Ash
www.ashleysheridan.co.uk



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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Ashley Sheridan
On Fri, 2009-02-06 at 13:13 -0500, tedd wrote:
> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
> >that tedd's unlimited educational resources (tutors/courses) might
> >go someway to undoing all the harm Fox News inflicts on the masses.
> 
> Or to provide clarity to those who think that Fox News is doing harm.
> 
> Alter all, the main-stream news doesn't like reporting unfavorable 
> things about their favorites celebrities, do they? Keep in mind that 
> "not paying taxes by elected officials" has not met the same 
> threshold of reporting "not knowing how to speak publicly" has made.
> 
> I would rather have all politicians stammer in their speeches and pay 
> their taxes than the other way around.
> 
> In fact, it would be nice if the politicians would get their 
> facts/words straight. For example, the "Speaker of the House" just 
> announced that "Last month over 500 million people lost their jobs" 
> in her support for the importance of rushing the approval of the 
> "Stimulus package" (whatever that is).
> 
> In any event, it's interesting to realize that accordingly to her, 
> EVERYONE in the USA lost their job last month and two thirds of the 
> population lost it twice!
> 
> It would be nice if the "Speaker of the House" at least realized how 
> many people actually live in the country she represents. BUT -- you 
> didn't hear that on the main-stream news -- or -- if you did, they 
> didn't make much of it, right? However, if Bush had said it, that 
> would have been something different -- it would be headline news and 
> on Saturday Night Live.
> 
> Clearly, there is a difference in news reporting today. There are no 
> impartial sources -- everything has biases and spin. The days of 
> Walter Cronkite reporting are over.
> 
> Viva opposing opinions.
> 
> Cheers,
> 
> tedd
> 
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
Come off it. Look around you, there are government conspiracies
everywhere. I shouldn't even be saying this, their silent black
helicopters are already after me... I can hear them now...


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Email configuration

2009-02-06 Thread Shawn McKenzie
Ashley Sheridan wrote:
> On Fri, 2009-02-06 at 16:30 +0200, Thodoris wrote:
>>> 2009/2/6 Thodoris :
>>>   
 2009/2/5 Thodoris :


 I think that the OP mentioned the word fedora somewhere above...



 Oh sorry, I'm so stupid... Anyways, if you want to send mail to large
 providers you'll need to use a relay. I found a nice tutorial about
 how to set it up with google apps.
 It was for Ubuntu but you just have to install msmtp and follow the other
 steps.
 Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail
 I did it on my little gentoo server here at home and it works great.





 Well if I am not getting what you say in the wrong way I should say that 
 you
 don't need to use a relay because you don't need a 
>> mail server at all.
 The point is that PHP can send mail with the mail() function using a local
 mail client like sendmail's client part or something coded in pure PHP.

 Keep in mind that you don't need to have a mail server in your PC in order
 to send mail. Similarly PHP doesn't need to have a local mail server in
 order to send mail.

 So you don't need extra mail configuration assuming of course that you 
 don't
 need to do something extreme. You just use mail() and the mail gets sent.

 --
 Thodoris
 
>>>
>>> Of course he can send mails this way, but they won't be accepted by
>>> many mail providers because of their anti-spam measurments.
>>> They bounce mails that come from dynamic ip ranges like his home
>>> server. I just wanted to help him avoid this because you won't see the
>>> reason until you look at the syslog.
>>>
>>>
>>>
>>>   
>>  
>> I am sorry didn't get right what you meant after all.
>>
>> In that case a simple mail() won't do.
>>
> I've never had an email bounced because of where it came from based on
> IP. I have had emails bounced based on the email headers that were sent.
> Always check the headers first. Even MessageLabs won't block an email
> based on the IP.
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
> 
Ever heard of RBL or DNSBL?  I use it on my email server and so do many
others.  It checks the IP of the sending host against a list or set of
lists that contain addresses such as, known spammers, known open relays,
 blocks of IPs that are dynamic (used by ISPs for home customers), etc.
 If the sender is found in the list, the receiver terminates the
connection and doesn't even accept the email.

It's actually very slick.  I use the list at spamhaus.org.

-- 
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] Clarity needed OT

2009-02-06 Thread Shawn McKenzie
Ashley Sheridan wrote:
> On Fri, 2009-02-06 at 13:13 -0500, tedd wrote:
>> At 1:55 AM +0100 2/6/09, Jochem Maas wrote:
>>> that tedd's unlimited educational resources (tutors/courses) might
>>> go someway to undoing all the harm Fox News inflicts on the masses.
>> Or to provide clarity to those who think that Fox News is doing harm.
>>
>> Alter all, the main-stream news doesn't like reporting unfavorable 
>> things about their favorites celebrities, do they? Keep in mind that 
>> "not paying taxes by elected officials" has not met the same 
>> threshold of reporting "not knowing how to speak publicly" has made.
>>
>> I would rather have all politicians stammer in their speeches and pay 
>> their taxes than the other way around.
>>
>> In fact, it would be nice if the politicians would get their 
>> facts/words straight. For example, the "Speaker of the House" just 
>> announced that "Last month over 500 million people lost their jobs" 
>> in her support for the importance of rushing the approval of the 
>> "Stimulus package" (whatever that is).
>>
>> In any event, it's interesting to realize that accordingly to her, 
>> EVERYONE in the USA lost their job last month and two thirds of the 
>> population lost it twice!
>>
>> It would be nice if the "Speaker of the House" at least realized how 
>> many people actually live in the country she represents. BUT -- you 
>> didn't hear that on the main-stream news -- or -- if you did, they 
>> didn't make much of it, right? However, if Bush had said it, that 
>> would have been something different -- it would be headline news and 
>> on Saturday Night Live.
>>
>> Clearly, there is a difference in news reporting today. There are no 
>> impartial sources -- everything has biases and spin. The days of 
>> Walter Cronkite reporting are over.
>>
>> Viva opposing opinions.
>>
>> Cheers,
>>
>> tedd
>>
>> -- 
>> ---
>> http://sperling.com  http://ancientstones.com  http://earthstones.com
>>
> Come off it. Look around you, there are government conspiracies
> everywhere. I shouldn't even be saying this, their silent black
> helicopters are already after me... I can hear them now...
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
What happened to your tin foil hat?

-- 
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] Email configuration

2009-02-06 Thread Nathan Rixham

Ashley Sheridan wrote:

I've never had an email bounced because of where it came from based on
IP. I have had emails bounced based on the email headers that were sent.
Always check the headers first. Even MessageLabs won't block an email
based on the IP.



ash:
http://en.wikipedia.org/wiki/DNSBL
that's what RBL is, stopping email because of the IP it was sent from

if you've never had it then you can't be a spammer :D *hoorah*

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



Re: [PHP] Email configuration

2009-02-06 Thread Nathan Rixham

Shawn McKenzie wrote:

Ever heard of RBL or DNSBL?  I use it on my email server and so do many


lol snap, just sent same message at same time - tis so easy to jump on 
ash's back cos he's always so sure he's right lolol


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



Re: [PHP] Re: DB Comparisons

2009-02-06 Thread Andrew Ballard
On Fri, Feb 6, 2009 at 7:27 PM, Ashley Sheridan
 wrote:
> On Fri, 2009-02-06 at 21:56 +1000, Murray wrote:
>> In fact, ASP.NET happily connects with other DBMSes. I have several C#
>> ASP.NET web apps happily working with MySQL.
>>
>> M is for Murray
>>
>>
>> On Fri, Feb 6, 2009 at 7:39 AM, Ashley Sheridan 
>> wrote:
>>
>> > although I think ASP can only connect to MSSQL and
>> > ASP.Net connects only to MSSQL and Oracle (but I'm not 100% certain on
>> > this)
>> >
> C# is bad, and will get you sent to hell... I asked M$, and they
> adamantly refused to answer... so draw your own conclusions...
>
>
> Ash
> www.ashleysheridan.co.uk

I suspect either would be able to connect to MySQL as long as you had
the MySQL ODBC driver installed. I don't know if there are other
drivers or not. I never needed to connect to MySQL when I was using
anything other than PHP.

Andrew

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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Daniel Brown
On Fri, Feb 6, 2009 at 19:36, Shawn McKenzie  wrote:
>>
> What happened to your tin foil hat?

Who needs that when your fillings pick up the live and encrypted
radio broadcast of the CIA cafeteria lunch schedule?

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



[PHP] Re: PHP pop-up windows

2009-02-06 Thread Clancy
On Thu, 05 Feb 2009 01:47:28 +, nrix...@gmail.com (Nathan Rixham) wrote:

>Clancy wrote:
>> I'm working on a website editor, primarily for my own use. Normally it will 
>> be used on my
>> own computer, and much of what I wish to achieve could arguably be better 
>> done in either C
>> or JavaScript, but both of these have a similar programming syntax to PHP, 
>> but with subtle
>> differences, and I don't think my brain could cope with trying to work in 
>> two similar but
>> different languages simultaneously.
...

>> Is this a feasible mode of operation, and if so would anyone like to suggest 
>> ways to
>> implement it, and/or traps to be avoided?
>
>if ever somebody needed flex, it's you

Thanks. But what is flex?

1. Flex electrical cable: I've got plenty of that out in the shed, but it 
doesn't seem to
be relevant here (unless I decide that it is all too much, and decide to hang 
myself with
it!)

2. Single tasking operating system for the Motorola 6800: I once programmed in 
6800
assembler, but I rather doubt if you can buy it, or them, these days.

3. Bodybuilding magazine: too late for that!

4. Adobe application builder - widely criticised for being inflexible: not what 
I'm
looking for.

Perhaps I ought to just give up, and get somebody else to do the job for me, 
but then I
would get the solution to somebody else's problem.  

Also, although my mental agility is less than it used to be, so that I can't 
really handle
working in multiple environments, I still enjoy programming, and it does keep 
my brain
from going rusty!

I have had what seems to me to be a bright idea, and I wondered if anybody had 
tried
anything similar, and could cast any light either on how to go about it, or on 
problems
that I might encounter. 

Just telling me to use something else, without explaining what it is or why it 
is better,
is not really being helpful.

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



Re: [PHP] Email configuration

2009-02-06 Thread Shawn McKenzie
Nathan Rixham wrote:
> Shawn McKenzie wrote:
>> Ever heard of RBL or DNSBL?  I use it on my email server and so do many
> 
> lol snap, just sent same message at same time - tis so easy to jump on
> ash's back cos he's always so sure he's right lolol

Hmmm...  So Ashley is a "him"?

-- 
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] Email configuration

2009-02-06 Thread Nathan Rixham

Shawn McKenzie wrote:

Nathan Rixham wrote:

Shawn McKenzie wrote:

Ever heard of RBL or DNSBL?  I use it on my email server and so do many

lol snap, just sent same message at same time - tis so easy to jump on
ash's back cos he's always so sure he's right lolol


Hmmm...  So Ashley is a "him"?



yeah quot:
"Actually I'm a guy, but we can't all be perfect ;)"
http://www.mail-archive.com/php-general@lists.php.net/msg235765.html

dunno why I insist on winding him up either, he's pretty sound lol

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



Re: [PHP] Email configuration

2009-02-06 Thread Ashley M. Kirchner

Nathan Rixham wrote:

Hmmm...  So Ashley is a "him"?



yeah quot:
"Actually I'm a guy, but we can't all be perfect ;)"
http://www.mail-archive.com/php-general@lists.php.net/msg235765.html
   Wouldn't be the first Ashley who's a guy.  I happen to be one of 
those too ...


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



Re: [PHP] Clarity needed OT

2009-02-06 Thread Phpster
And the pentagon was not hit by a jumbo jet. check the photos and ask  
yourself 'where are the wings'?


Sorry couldn't resist after the conspiracy comment

:-P

Bastien

Sent from my iPod

On Feb 6, 2009, at 19:37, Ashley Sheridan   
wrote:



On Fri, 2009-02-06 at 13:13 -0500, tedd wrote:

At 1:55 AM +0100 2/6/09, Jochem Maas wrote:

that tedd's unlimited educational resources (tutors/courses) might
go someway to undoing all the harm Fox News inflicts on the masses.


Or to provide clarity to those who think that Fox News is doing harm.

Alter all, the main-stream news doesn't like reporting unfavorable
things about their favorites celebrities, do they? Keep in mind that
"not paying taxes by elected officials" has not met the same
threshold of reporting "not knowing how to speak publicly" has made.

I would rather have all politicians stammer in their speeches and pay
their taxes than the other way around.

In fact, it would be nice if the politicians would get their
facts/words straight. For example, the "Speaker of the House" just
announced that "Last month over 500 million people lost their jobs"
in her support for the importance of rushing the approval of the
"Stimulus package" (whatever that is).

In any event, it's interesting to realize that accordingly to her,
EVERYONE in the USA lost their job last month and two thirds of the
population lost it twice!

It would be nice if the "Speaker of the House" at least realized how
many people actually live in the country she represents. BUT -- you
didn't hear that on the main-stream news -- or -- if you did, they
didn't make much of it, right? However, if Bush had said it, that
would have been something different -- it would be headline news and
on Saturday Night Live.

Clearly, there is a difference in news reporting today. There are no
impartial sources -- everything has biases and spin. The days of
Walter Cronkite reporting are over.

Viva opposing opinions.

Cheers,

tedd

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


Come off it. Look around you, there are government conspiracies
everywhere. I shouldn't even be saying this, their silent black
helicopters are already after me... I can hear them now...


Ash
www.ashleysheridan.co.uk


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



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



Re: [PHP] Using DLL with PHP

2009-02-06 Thread Phpster

Check out the com [www.php.net/com] functionality

Bastien

Sent from my iPod

On Feb 6, 2009, at 15:58, Dan Shirah  wrote:


Howdy,

I'm looking for a little guidance here.

I'm trying to re-write a VB function in PHP.

This is the function I'm working with:


Private Declare Function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _

   (ByVal FullPathFrom As String, ByVal FullPathTo As  
String) As

Integer

Naturally I would start off with function() from PHP as well and I  
will

also already have my two variables that I need to pass to the DLL:

$FullPathFrom = "this\is\my\path";
$FullPathTo = "this\is\my\path";

function DTM_CONVDMSToMultiTIFF ( )

But I am unsure of how I would call and pass the variables to the  
DLL. I've

looked into W32api, but not sure if that's even what I need.

Any ideas?

Thanks,
Dan


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



[PHP] Session variables

2009-02-06 Thread Paul M Foster
I'm not too clear on HTTP headers, cookies, and such. So here are
questions related to that. Let's say I generate a random number that I
want the user to enter in a form. When I generate the number, I store it
in a session variable ($_SESSION). When the user submits the form, I
check the number they enter with what I've stored in the session
variable.

Since this session variable survives across page loads (assuming
session_start() is appropriately called), how is it stored and recalled?

Is it automatically stored as a cookie on the user's system? 

Or is it stored on the server? 

And how does a server "get" a cookie? 

Is it a separate request made by the server to the client? 

If the value I've asked the user for is *not* stored as a cookie, then
is it passed as part of the HTTP submission or what?

Thanks for any enlightenment on this.

Paul
-- 
Paul M. Foster

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



Re: [PHP] Session variables

2009-02-06 Thread Phpster
A Session is stored on the user browser in a session ( in memory  
cookie) and on the server as a file. The session mgmt tools will read  
the file as needed.


Bastien

Sent from my iPod

On Feb 7, 2009, at 1:58, Paul M Foster  wrote:


I'm not too clear on HTTP headers, cookies, and such. So here are
questions related to that. Let's say I generate a random number that I
want the user to enter in a form. When I generate the number, I  
store it

in a session variable ($_SESSION). When the user submits the form, I
check the number they enter with what I've stored in the session
variable.

Since this session variable survives across page loads (assuming
session_start() is appropriately called), how is it stored and  
recalled?


Is it automatically stored as a cookie on the user's system?

Or is it stored on the server?

And how does a server "get" a cookie?

Is it a separate request made by the server to the client?

If the value I've asked the user for is *not* stored as a cookie, then
is it passed as part of the HTTP submission or what?

Thanks for any enlightenment on this.

Paul
--
Paul M. Foster

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



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



Re: [PHP] Session variables

2009-02-06 Thread German Geek
The session data is stored on the server. In the user's browser, only a
session cookie is stored, usually a random session id string. I could never
retrieve the session variables with any browser tools, always only with PHP
by echoing them out or something. Also, a cookie is simply a text file with
a maximum of 4096 characters on the user's browser, not enough to store big
session variables with big objects. So, the user's browser just stores a
cookie with the session id, so that the server knows which user to map to
which session variables. The session variables (in PHP) are stored in the
temporary directory on the server in a text file (flattened or serialized),
where the server can retrieve them across requests. This is important for
security reasons. You might not want the user to be able to view certain
variables in their browser otherwise they could change them and cause some
damage, e.g. imagine a user has a permission level between 1 and 10 and 1 is
the super user. You can store this level in a session variable, and the user
cannot change it. If they could, it would be a disaster! Also, if one could
store more than 4096 characters, it would be relatively easy to write out
some session variables in order to flood the browser memory and make it
crash or even worse.

Oh, and the Cookies, as far as i know, are always sent in the http headers.
They are stored on both client and server and can be set on both sides, with
javascript or server side code (php). So they can only be checked in every
request by the server side code, and while javascript is being executed on
the client.

Please correct me if I'm wrong because I would need to review a lot of code
in which it is assumed that session variables are NOT stored on the user's
machine.


Makes sense?

Regards,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com


On Sat, Feb 7, 2009 at 8:11 PM, Phpster  wrote:

> A Session is stored on the user browser in a session ( in memory cookie)
> and on the server as a file. The session mgmt tools will read the file as
> needed.
>
> Bastien
>
> Sent from my iPod
>
>
> On Feb 7, 2009, at 1:58, Paul M Foster  wrote:
>
>  I'm not too clear on HTTP headers, cookies, and such. So here are
>> questions related to that. Let's say I generate a random number that I
>> want the user to enter in a form. When I generate the number, I store it
>> in a session variable ($_SESSION). When the user submits the form, I
>> check the number they enter with what I've stored in the session
>> variable.
>>
>> Since this session variable survives across page loads (assuming
>> session_start() is appropriately called), how is it stored and recalled?
>>
>> Is it automatically stored as a cookie on the user's system?
>>
>> Or is it stored on the server?
>>
>> And how does a server "get" a cookie?
>>
>> Is it a separate request made by the server to the client?
>>
>> If the value I've asked the user for is *not* stored as a cookie, then
>> is it passed as part of the HTTP submission or what?
>>
>> Thanks for any enlightenment on this.
>>
>> Paul
>> --
>> Paul M. Foster
>>
>> --
>> 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
>
>