Re: [PHP] PHP: Writing to CD/DVD?

2009-07-23 Thread Diogo Neves
On Fri, Jul 24, 2009 at 12:20 AM, Clancy  wrote:

> Does anyone know of an extension/utility that will enable PHP to write
> backup files to a
> CD/DVD?
>
> Ideally I would like the CD to appear as 'just another drive'.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
If,
1. You are using linux
2. You can make system calls
It will help:
http://www.andrews-corner.org/burning.html

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Need unrounded precision

2009-10-12 Thread Diogo Neves
A simple way to do that would be:

$elapsed = strval( 28.56018 );
$pos = strpos( $elapsed, '.' );
echo $elapsed[ ++$pos ];

On Sat, Jan 2, 2010 at 2:20 AM, Andre Dubuc  wrote:

> Hi,
>
> I need to extract the first digit after the decimal point from a number
> such
> as 28.56018, which should be '5'.
>
> I've tried a few methods to accomplish this. If I use 'ini_set' I would
> need
> to know the number of digits before the decimal (which, unfortunately, I
> would not have access to).
>
> Then I've tried:
>
> 
>$elapsed = 28.56018;
>
>$digit = round($elapsed, 1); // rounds result is '6'
>$digit = number_format($elapsed, 1); // still rounds result to '6'
>
> ?>
>
> What I need is only the first digit after the decimal -- all the rest could
> be 'chopped' or discarded but without rounding the first digit after the
> decimal point.
>
> Is there any way of doing this?
>
> I'm stumped.
>
> Tia,
> Andre
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


[PHP] Function __call

2008-08-30 Thread Diogo Neves
hi all,

I'm sending this email only to ask if someone know if the works of
__call in private methods is bug or feature.

ex.

class user {
public function __call ( $name, $arguments ) {
do something
return call_user_func( array( $this, $name ), $arguments );
}
private function xpto ( $arguments ) {
do something
}
}

new $user = new user();
$user->xpto();

error:
Fatal error:  Call to private method user::xpto() from context '' in
xpto.php on line 11

PS:
what a fucking I was thinking?

well, it don't have this public method, then it sholdn't know it
exists, then go to __call()
i really don't know if it make any sense to someone else, but it still
make sense to me

any thoughts?


 
Thanks by your attention,

Diogo Neves
Developer @ Sapo.pt by PrimeIT.pt

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



Re: [PHP] Function __call

2008-08-30 Thread Diogo Neves
thanks,

well, the 'new' woks the same with ou without '()' after class, I think...

and I now how it works, i only don't understand why... if the method
is not available outside of class it should go to __call function like
if it doesn't exist...
it doesn't make any sense to anyone else?


On Sat, Aug 30, 2008 at 2:38 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Diogo Neves schreef:
>>
>> hi all,
>>
>> I'm sending this email only to ask if someone know if the works of
>> __call in private methods is bug or feature.
>>
>> ex.
>>
>> class user {
>> public function __call ( $name, $arguments ) {
>> do something
>> return call_user_func( array( $this, $name ), $arguments );
>
> the fatal error occurs because the method exists, but it's
> private ... __call() is only called if the method does not exist
> at all:
>
> class user {
>public function __call($m, $a) {
>if (is_callable(array($this, "_".$m)))
>return $this->{"_".$m}( $a );
>}
>
>private function _xpto($a)
>{
>var_dump($a);
>}
> }
>
> $u = new user;
> $u->xpto(1, 2, 3);
>
>> }
>> private function xpto ( $arguments ) {
>> do something
>> }
>> }
>>
>> new $user = new user();
>
> the first 'new' is incorrect me thinks.
>
>> $user->xpto();
>>
>> error:
>> Fatal error:  Call to private method user::xpto() from context '' in
>> xpto.php on line 11
>>
>> PS:
>> what a fucking I was thinking?
>>
>> well, it don't have this public method, then it sholdn't know it
>> exists, then go to __call()
>> i really don't know if it make any sense to someone else, but it still
>> make sense to me
>>
>> any thoughts?
>>
>>
>>  
>> Thanks by your attention,
>>
>> Diogo Neves
>> Developer @ Sapo.pt by PrimeIT.pt
>>
>
>

 
Thanks by your attention,

Diogo Neves
Developer @ Sapo.pt by PrimeIT.pt

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



Re: [PHP] Function __call

2008-08-30 Thread Diogo Neves
Hi,

On Sat, Aug 30, 2008 at 6:20 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> please keep replies on list unless your intending to pay me
> an hourly fee ...

Yeap, i'm new in the list and i missed te cc of list... i'll try to
remember, sorry

>
> Diogo Neves schreef:

Now in understand "schreef" is from da system...

>>
>> On Sat, Aug 30, 2008 at 4:40 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>>>
>>> Diogo Neves schreef:
>
> ...
>
>>
>> nop... I wanna manipulate the $this and the $arguments, and possible
>> don't even execute the private method...
>>
>> I'm tring to develop a "hook system" for my classes... and i simple
>> don't wanna to do all the hook verification every method of the class
>>
>> I'll send my files for you to see what I'm doing in "do something" on
>> my __call() funtion
>
> the code looks messy what with the global $hooks, functions required for
> hooking

Yeap, but i'm only making tests... i'm not too horried about mess yet...

> (the function name class_hooker() is very funny btw)

ok... i missed that in my english... added :)

> and you seem to
> be mixing static/non-static class calls willy-nilly.
>

I'm never calling something static, i'm?

> I'd rethink this if I we're you. if every can be hooked, then make the
> hooking should be part of a base class, possibly a factory method for object
> creation will help to keep things clean and in one place. a generic
> 'hooking'
> decorator object might also be an idea. or maybe just using subclasses to
> change/augment behaviour is a much simpler and cleaner approach.

yep... i'm thinking of a base class, but that has nothing to do with
the __call, if u see, i'm already passing the "get_class( $this )" and
not __CLASS__ on call_user_func of the user, but again only testing

>
> your code makes me think of the hooking mechanism in WordPress ... works
> okay,
> but it's a nightmare to code to (imho).

right again, i'm trying to do a wapper for phpbb class's that have a
similar hook system, but needs to be defined method by method,
function by function... like a big mess... and even like that i don't
get yet the criteria to have a hook or not :)

>
> BTW. function and method names beginning with '__' are considered reserved
> by the engine, it's not best practice to name userland functions/methods
> things like '__magic'
>

Yeap, in this case is my naming that is really pretty bad, but i
needed something diferent from the normal hookable methods, then I
simple added a '_'... but again tests, naming and code organization
was not a horry, only logic...


But again, i don't see why your php should see your class's private
methods outside of itself, it should simple look for a public one, if
it exists then call it, otherwise call the _call and let it handle it
:S


Anyway, thanks for answer me and give me that points, and if u know a
really good hoking system, please give me reference ;)


And please anyone else has an opinion of it should work or not?
Thanks

-- 
Thanks by your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] Re: What's with the Rx symbol?

2008-08-30 Thread Diogo Neves
Your reply is a bit off-topic, and i agree u should care about all
those with red/green color blindness, but u should care with all those
how dislike spam too.
Then, unless u know a really good alternative to a CAPTCHA, i believe
its yet the better solution...

PS: u can answer and discuse this on the original thread too ;)

-- 
Thanks by your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] Re: What's with the Rx symbol?

2008-08-30 Thread Diogo Neves
Well, i really really believe that urls should keep clear as water...

http://forcaaerea.pt should exist, and not http://forçaaérea.pt...
even because in reality its http://xn--foraarea-u0aw.pt

Its a big mess...

How to keep it clear? don't mess up with your domains if you care
about your clients

-- 
Thanks by your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] Individual bulk e-mails - performance question

2008-08-30 Thread Diogo Neves
Well, i have done that once and it worked pretty well...
Only diference was that i had a hour limit ( think dreamhost hosting )
and used Swift Mailer, but i think it don't matter a lot ;)
I think is a good solution...

On Sat, Aug 30, 2008 at 6:40 PM, Merlin <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I am running a travel community where users want to get informed on changes
> inside different groups they have subscribed to.
>
> At the moment I am doing this with a for loop that generates an individual
> e-mail sent to them via phpmailer. That works, however the submit of the
> content upload form (that triggers the e-mail notification) now takes
> several seconds, as more and more users subscribe.
>
> I am thinking about placing the info on the individual e-mail inside a ascii
> txt file that will be read by a cron job which will send the e-mail instead.
> Something like every 5 minutes reading it line by line and then after
> sending it removing the line.
> e.g:
> for:[EMAIL PROTECTED]; body:individual
> for:[EMAIL PROTECTED]; body:other email
>
> Does this sound like a plan? Or do you believe that there are better ways
> doing it? I could imagine that I would run into problems a few months from
> now if for example the cron job will be triggered a second time, while the
> first one has not finished.
>
> Any ideas or suggestions? Thank you for any help.
>
> Best regards,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Thanks by your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] Re: Individual bulk e-mails - performance question

2008-08-30 Thread Diogo Neves
Well, I agree that sending it by an external process more specialized
in sending emails can be faster and more eficient, but it's harder to
control... sometimes you need to know in your php if email was really
sent and do something, and while I'm not saying it's impossible, I'm
sure it's a little more complicated...

Yet, if sending email don't need to be tracked, then external tool
world possible be better...

Anyway, don't ask me how to do that, I'm more confortable doing things in PHP :)

On Sun, Aug 31, 2008 at 2:31 AM, Manuel Lemos <[EMAIL PROTECTED]> wrote:
> Hello,
>
> on 08/30/2008 02:40 PM Merlin said the following:
>>
>> I am running a travel community where users want to get informed on
>> changes inside different groups they have subscribed to.
>>
>> At the moment I am doing this with a for loop that generates an individual
>> e-mail sent to them via phpmailer. That works, however the submit of the
>> content upload form (that triggers the e-mail notification) now takes
>> several seconds, as more and more users subscribe.
>>
>> I am thinking about placing the info on the individual e-mail inside a
>> ascii txt file that will be read by a cron job which will send the e-mail
>> instead. Something like every 5 minutes reading it line by line and then
>> after sending it removing the line.
>> e.g:
>> for:[EMAIL PROTECTED]; body:individual
>> for:[EMAIL PROTECTED]; body:other email
>>
>> Does this sound like a plan? Or do you believe that there are better ways
>> doing it? I could imagine that I would run into problems a few months from
>> now if for example the cron job will be triggered a second time, while the
>> first one has not finished.
>>
>> Any ideas or suggestions? Thank you for any help.
>
> While it is a good idea to off-load e-mail delivery to a script run from
> cron, it seems odd that each mail takes several seconds to deliver.
>
> I suspect that you sending messages in a less efficient way. Maybe you are
> queueing messages using SMTP (which is the slowest way to queue messages) or
> you are using sendmail on your system and it is configured by default to
> attempt to deliver the messages immediately, making your PHP script hang
> while the message is not accepted by the remote server.
>
> There are much better ways to do it by just telling the mail system to queue
> the messages without holding on the PHP script.
>
> On the other hand, if the time it takes build your messages but the messages
> have the same contents for all the receipients, you can also use some good
> e-mail components with caching support.
>
> In that case, I recommend that you use for instance this MIME message class
> that provides message body caching support, so you can send messages to
> different receipients and cache the building of message body parts and avoid
> overhead when sending to a new receipient.
>
> It also provides different means to send messages and solve the overhead of
> message delivery by forcing the messages to queue by your local and be
> delivered later whenever possible, so your PHP script is freed to send
> messages to other recipients.
>
>
> http://www.phpclasses.org/mimemessage
>
>
> --
>
> Regards,
> Manuel Lemos
>
> Find and post PHP jobs
> http://www.phpclasses.org/jobs/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] ASCII Captcha

2008-08-31 Thread Diogo Neves
Well, I don't know how, but google folks @ gmail are doing a great job
with anti-spam tecnology... i believe that is has something to do with
the massive user base that can more accuratly say what is spam and
blacklist it plus mispelling 'spam' words and the original ones, plus
that '1000's from the same guy with same content' wow.

I really get so less spam comparing with all other webmail clients...
I love gmail :)

On Sun, Aug 31, 2008 at 10:42 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Sat, 2008-08-30 at 19:22 +0200, Jochem Maas wrote:
>> tedd schreef:
>> > At 3:25 PM +0100 8/30/08, Stut wrote:
>> >> in the meantime I stand by my assertion that a 'phone number people
>> >> can call with any type of telephone to interact with another human who
>> >> can get them past the check without compromising the protection the
>> >> check affords is ultimate accessibility.
>> >
>> > Well, even you can't be right all of the time.  :-)
>> >
>> > That's not bad out of all we discussed to have only one difference of
>> > opinion.
>>
>> obviously Cummings' brainwashing program is not 100% effective ;-)
>
> It all began to fall apart when they refused to look into my eyes while
> I waved my hands around and used a low monotone voice.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] ASCII Captcha

2008-08-31 Thread Diogo Neves
Maybe a protocol of SPAM notifications can do da trick...
Something like a system, more or less central that smtp server should
use to exchange information about SPAM, like that u get not only the
gmail base, but a yet bigger set off it... that whould do the trick,
and possible take the internet routers down :)
And even with a more global system it would not be perfect, but @
least I only should need too mark 2/3 mails as spam a day, instead of
10, and with other web clients 100 or more...
Maybe google wanna do it in is 'we are the good folks, not the biggest
monopoly on da world' opensource developement... ;)

On Sun, Aug 31, 2008 at 11:26 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Sun, 2008-08-31 at 10:58 +0100, Diogo Neves wrote:
>> Well, I don't know how, but google folks @ gmail are doing a great job
>> with anti-spam tecnology... i believe that is has something to do with
>> the massive user base that can more accuratly say what is spam and
>> blacklist it plus mispelling 'spam' words and the original ones, plus
>> that '1000's from the same guy with same content' wow.
>>
>> I really get so less spam comparing with all other webmail clients...
>> I love gmail :)
>
> I think you hit the nail on the head thought when you mention massive
> user base. Probably at the outset of a spam campaign a bunch of users
> get the spam, flag it as spam and then google just marks the rest as
> spam for the several other million users :)
>
> That said, gmail isn't perfect either which indicates a measure of the
> difficulty of this problem.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>



-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



[PHP] casting static property

2008-08-31 Thread Diogo Neves
Hi all,

Why a static var don't cast as a dynamic one?
See file for more info...

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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

Re: [PHP] casting static property

2008-08-31 Thread Diogo Neves
Sorry, i have no webserver... but I can send all code in the email, right?

' . 0 . '';
echo ' a --> ' . a . '';
echo ' (string)a --> ' . (string)a . '';
global $b;
echo ' b --> ' . $b . '';
echo ' c --> ' . $this->c . '';
$d = 0;
echo ' d --> ' . $d . '';
echo ' e --> ' . $this->e . '';
// OK, static creates a reference, so?
echo ' (int)e --> ' . (int)$this->e . '';
echo ' (string)e --> ' . (string)$this->e . '';
// What? Why?
echo ' f --> ' . $this->f . '';
// OK, static creates a reference, so?
echo ' (int)f --> ' . (int)$this->f . '';
echo ' (string)f --> ' . (string)$this->f . '';
// What? Why?
}

public function techo2() {
echo ' direct -->', 0, '';
echo ' a --> ', a, '';
echo ' (string)a --> ', (string)a, '';
global $b;
echo ' b --> ', $b, '';
echo ' c --> ', $this->c, '';
$d = 0;
echo ' d --> ', $d, '';
echo ' e --> ', $this->e, '';
// OK, static creates a reference, so?
echo ' (int)e --> ', (int)$this->e, '';
echo ' (string)e --> ', (string)$this->e, '';
// What? Why?
echo ' f --> ', $this->f, '';
// OK, static creates a reference, so?
echo ' (int)f --> ', (int)$this->f, '';
echo ' (string)f --> ', (string)$this->f, '';
// What? Why?
}

public function techo3() {
global $b;
$d = 0;

echo ' direct -->', 0, '',
 ' a --> ', a, '',
 ' (string)a --> ', (string)a, '',
 ' b --> ', $b, '',
 ' c --> ', $this->c, '',
 ' d --> ', $d, '',
 ' e --> ', $this->e, '',
// OK, static creates a reference, so?
 ' (int)e --> ', (int)$this->e, '',
 ' (string)e --> ', (string)$this->e, '',
// What? Why?
 ' f --> ', $this->f, '',
// OK, static creates a reference, so?
 ' (int)f --> ', (int)$this->f, '',
 ' (string)f --> ', (string)$this->f, '';
// What? Why?
}
}

$foo = new foo( );

function mytime( ) {
$time = microtime( );
$time = explode( " ", $time );
$time = $time[1] + $time[0];
return $time;
}

$time1 = mytime( );
$foo->techo( );
$time2 = mytime( );
$totaltime = ($time2 - $time1);
echo 'techo() --> ', $totaltime, '';

$time1 = mytime( );
$foo->techo2( );
$time2 = mytime( );
$totaltime = ($time2 - $time1);
echo 'techo2() --> ', $totaltime, '';

$time1 = mytime( );
$foo->techo3( );
$time2 = mytime( );
$totaltime = ($time2 - $time1);
echo 'techo2() --> ', $totaltime, '';
?>

I believe yes

On Sun, Aug 31, 2008 at 5:37 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Sun, 2008-08-31 at 17:09 +0200, Jochem Maas wrote:
>> Diogo Neves schreef:
>> > Hi all,
>> >
>> > Why a static var don't cast as a dynamic one?
>> > See file for more info...
>>
>> attachments get stripped.
>> don't cross post to internals, it's bad form.
>> try and formulate your questions a bit better
>> (it should take you more time to write your post than
>> it takes for someone else to figure out what your going on about.).
>
> Correction, text attachments don't get stripped.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] casting static property

2008-08-31 Thread Diogo Neves
Hi again,

There's what you need ( I think )
Simplified version for web:
http://pastebin.com/d2bfcf495

Simplified version for CLI:
http://pastebin.com/d6ab96ed0

On Sun, Aug 31, 2008 at 7:09 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Diogo Neves schreef:
>>
>> Sorry, i have no webserver... but I can send all code in the email, right?
>>
>
> you can use pastebin.com.
>
> I also recommend you write reproduce/example code like this for
> the CLI so that other people don't have to go throught the hassle
> of running via a webserver ( is not very helpful in terms of
> readability
>
>> > define('a', 0);
>> $b = 0;
>>
>> class foo {
>>private $c = 0;
>>private static $e = 0;
>>private static $f = '0';
>>public function techo() {
>>echo ' direct -->' . 0 . '';
>>echo ' a --> ' . a . '';
>>echo ' (string)a --> ' . (string)a . '';
>>global $b;
>>echo ' b --> ' . $b . '';
>>echo ' c --> ' . $this->c . '';
>>$d = 0;
>>echo ' d --> ' . $d . '';
>>echo ' e --> ' . $this->e . '';
>>// OK, static creates a reference, so?
>>echo ' (int)e --> ' . (int)$this->e . '';
>>echo ' (string)e --> ' . (string)$this->e . '';
>>// What? Why?
>>echo ' f --> ' . $this->f . '';
>>// OK, static creates a reference, so?
>>echo ' (int)f --> ' . (int)$this->f . '';
>>echo ' (string)f --> ' . (string)$this->f . '';
>>// What? Why?
>>}
>>
>>public function techo2() {
>>echo ' direct -->', 0, '';
>>echo ' a --> ', a, '';
>>echo ' (string)a --> ', (string)a, '';
>>global $b;
>>echo ' b --> ', $b, '';
>>echo ' c --> ', $this->c, '';
>>$d = 0;
>>echo ' d --> ', $d, '';
>>echo ' e --> ', $this->e, '';
>>// OK, static creates a reference, so?
>>echo ' (int)e --> ', (int)$this->e, '';
>>echo ' (string)e --> ', (string)$this->e, '';
>>// What? Why?
>>echo ' f --> ', $this->f, '';
>>// OK, static creates a reference, so?
>>echo ' (int)f --> ', (int)$this->f, '';
>>echo ' (string)f --> ', (string)$this->f, '';
>>// What? Why?
>>}
>>
>>public function techo3() {
>>global $b;
>>$d = 0;
>>
>>echo ' direct -->', 0, '',
>> ' a --> ', a, '',
>> ' (string)a --> ', (string)a, '',
>> ' b --> ', $b, '',
>> ' c --> ', $this->c, '',
>> ' d --> ', $d, '',
>> ' e --> ', $this->e, '',
>>    // OK, static creates a reference, so?
>> ' (int)e --> ', (int)$this->e, '',
>> ' (string)e --> ', (string)$this->e, '',
>>// What? Why?
>> ' f --> ', $this->f, '',
>>// OK, static creates a reference, so?
>> ' (int)f --> ', (int)$this->f, '',
>> ' (string)f --> ', (string)$this->f, '';
>>// What? Why?
>>}
>> }
>>
>> $foo = new foo( );
>>
>> function mytime( ) {
>>$time = microtime( );
>>$time = explode( " ", $time );
>>$time = $time[1] + $time[0];
>>return $time;
>> }
>>
>> $time1 = mytime( );
>> $foo->techo( );
>> $time2 = mytime( );
>> $totaltime = ($time2 - $time1);
>> echo 'techo() --> ', $totaltime, '';
>>
>> $time1 = mytime( );
>> $foo->techo2( );
>> $time2 = mytime( );
>> $totaltime = ($time2 - $time1);
>> echo 'techo2() --> ', $totaltime, '';
>>
>> $time1 = mytime( );
>> $foo->techo3( );
>> $time2 = mytime( );
>> $totaltime = ($time2 - $time1);
>> echo 'techo2() --> ', $totaltime, '';
>> ?>
>>
>> I believe yes
>>
>> On Sun, Aug 31, 2008 at 5:37 PM, Robert Cummings <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> On Sun, 2008-08-31 at 17:09 +0200, Jochem Maas wrote:
>>>>
>>>> Diogo Neves schreef:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> Why a static var don't cast as a dynamic one?
>>>>> See file for more info...
>>>>
>>>> attachments get stripped.
>>>> don't cross post to internals, it's bad form.
>>>> try and formulate your questions a bit better
>>>> (it should take you more time to write your post than
>>>> it takes for someone else to figure out what your going on about.).
>
>
>>> Correction, text attachments don't get stripped.
>
> give a man fish. Diogo already succeeded in sending a text attachment
> in a previous post ... I figured I let him work it out for himself ;-)
>
>  you pedantic  :-D
>
>>> Cheers,
>>> Rob.
>>> --
>>> http://www.interjinn.com
>>> Application and Templating Framework for PHP
>>>
>>>
>>
>
>



-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

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



Re: [PHP] casting static property

2008-08-31 Thread Diogo Neves
Newbie :(

On Sun, Aug 31, 2008 at 8:37 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Diogo Neves schreef:
>>
>> Hi again,
>>
>> There's what you need ( I think )
>
> not so much that I need it, but the easier you make it
> for some one to look at your issue the more likely it is
> someone will. :-)
>
>> Simplified version for web:
>> http://pastebin.com/d2bfcf495
>>
>> Simplified version for CLI:
>> http://pastebin.com/d6ab96ed0
>
> good stuff. only I don't get what your trying to show, exactly.
> seems like your confused between instance (object) properties
> and class (static) properties.
>
> in your example $this->e and $this->f don't exist as instance
> properties ... this becomes clear if you set error_reporting to
> include E_NOTICES. the static properties $e and $f should be
> referred to in code as follows:
>
> class Foo {
>private $d = 1;
>static private $e = 2;
>
>public function test() {
>echo "\$this->d = ", $this->d, "\nself::\$e = ", self::$e,
> "\n";
>}
> }
>
> $foo = new Foo;
> $foo->test();
>
> PS, another tip when writing simple test code for the CLI, always use *only*
> double quotes in such code ... this allows people to cut and paste the code
> directly onto the cmdline (not sure this will work on windows btw) e.g.
>
> $> php -r 'class Foo { static private $f = 1; function test() { echo
> "\$this->e = {$this->e}"; }}'
>
>> On Sun, Aug 31, 2008 at 7:09 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>>>
>>> Diogo Neves schreef:
>>>>
>>>> Sorry, i have no webserver... but I can send all code in the email,
>>>> right?
>>>>
>>> you can use pastebin.com.
>>>
>>> I also recommend you write reproduce/example code like this for
>>> the CLI so that other people don't have to go throught the hassle
>>> of running via a webserver ( is not very helpful in terms of
>>> readability
>>>
>>>> >>> define('a', 0);
>>>> $b = 0;
>>>>
>>>> class foo {
>>>>   private $c = 0;
>>>>   private static $e = 0;
>>>>   private static $f = '0';
>>>>   public function techo() {
>>>>   echo ' direct -->' . 0 . '';
>>>>   echo ' a --> ' . a . '';
>>>>   echo ' (string)a --> ' . (string)a . '';
>>>>   global $b;
>>>>   echo ' b --> ' . $b . '';
>>>>   echo ' c --> ' . $this->c . '';
>>>>   $d = 0;
>>>>   echo ' d --> ' . $d . '';
>>>>   echo ' e --> ' . $this->e . '';
>>>>   // OK, static creates a reference, so?
>>>>   echo ' (int)e --> ' . (int)$this->e . '';
>>>>   echo ' (string)e --> ' . (string)$this->e . '';
>>>>   // What? Why?
>>>>   echo ' f --> ' . $this->f . '';
>>>>   // OK, static creates a reference, so?
>>>>   echo ' (int)f --> ' . (int)$this->f . '';
>>>>   echo ' (string)f --> ' . (string)$this->f . '';
>>>>   // What? Why?
>>>>   }
>>>>
>>>>   public function techo2() {
>>>>   echo ' direct -->', 0, '';
>>>>   echo ' a --> ', a, '';
>>>>   echo ' (string)a --> ', (string)a, '';
>>>>   global $b;
>>>>   echo ' b --> ', $b, '';
>>>>   echo ' c --> ', $this->c, '';
>>>>   $d = 0;
>>>>   echo ' d --> ', $d, '';
>>>>   echo ' e --> ', $this->e, '';
>>>>   // OK, static creates a reference, so?
>>>>   echo ' (int)e --> ', (int)$this->e, '';
>>>>   echo ' (string)e --> ', (string)$this->e, '';
>>>>   // What? Why?
>>>>   echo ' f --> ', $this->f, '';
>>>>   // OK, static creates a reference, so?
>>>>   echo ' (int)f --> ', (int)$t

Re: [PHP] casting static property

2008-08-31 Thread Diogo Neves
On Mon, Sep 1, 2008 at 12:43 AM, Govinda <[EMAIL PROTECTED]>
wrote:
> On Aug 31, 2008, at 2:17 PM, Jochem Maas wrote:
>>
>> another tip: don't top post :-)
>
> does "top post" mean to puts one's reply text at the top of the email?
>  People prefer it to be at the bottom?
> Personally I like the new text to be at the top so I don't have to scroll
> down to see the new part, but please do clarify what old timers
> expect/prefer so I can maximize my chance to get help when I need it  ;-)
>
> (oops. Didn't mean to send you a copy too Jochem.)
>
> -G
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Hi,

I was confused too, then I seached wikipedia and found this:
http://en.wikipedia.org/wiki/Posting_style

But I, like you, prefer too see te new text on top...
Maybe as you say he can clarify, but possible they like more like this?


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Re: switch case - to require the break statements seems strange to me

2008-08-31 Thread Diogo Neves
Hi,

Well, I see a good reason anyway...
U can have a lot of entry points and only one to exit...
Like:

switch ($i) {
case 0:
   echo "\$i < 1";
case 1:
   echo "\$i < 2";
case 2:
   echo "\$i < 3";
default:
   echo "\$i > 2";
}

Or

switch ($i) {
case 0:
case 1:
case 2:
   echo "\$i < 3";
   break;
default:
   echo "\$i > 2";
}

Nothing says that you can only use it as an option one statement...

On Mon, Sep 1, 2008 at 2:04 AM, Lupus Michaelis
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> wrote:

> Govinda a écrit :
>
>> Or is there a better reason?
>>
>
>  What is exactly in $i ? A scalar integer, a string containing an integer ?
> A boolean ? What version of PHP ?
>
> --
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


[PHP] Re: [PHP-DEV] T_PAAMAYIM_NEKUDOTAYIM

2008-08-31 Thread Diogo Neves
On Mon, Sep 1, 2008 at 3:09 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:

> redirecting to generals mailing list ...
>
> Diogo Neves schreef:
>
>> php -r 'class B { private static function a() {} public function
>> __callStatic($method, $parms) { echo $method, "\n"; } } $a = new B;
>> $a::a();'
>>
>> Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in Command
>> line
>> code on line 1
>>
>> Ok, i found the error, but anyway... a what?
>>
>
> it's hebrew for 'double colon' (::), google could have told you this.
>
> please note, the internals mailing is for php engine
> development/developers,
> I don't think they look forward to this kind of question (t)here.
>
> ...we're lucky enough that they tolerate lurkers (*cough*) :-)
>
>
>>
> Ok, and I really love the guys... but hebrew?


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Creating single row for multiple items.

2008-08-31 Thread Diogo Neves
Hi,
Check if I understood you...
You have this array and want create a csv?

On Mon, Sep 1, 2008 at 5:04 AM, Tom Shaw <[EMAIL PROTECTED]> wrote:

> My array looks very similar to this. I need to create a single row for the
> items that have the same order number for CSV export.  I'd prefer to do
> this
> PHP wise instead of SQL. But would appreciate any help I can get.
>
>
>
>
>
> $ar = array(
>
>   array(
>
> "order_id" => "34",
>
> "order_number" => "35Y345Y356YU3",
>
> "order_name" => "Steinway Grand Piano #11",
>
> "order_ordered_size" => "Grand",
>
> "order_sales_price" => "78671.90",
>
> "order_shipping_price" => "7.85",
>
> "order_shipping_extra" => "0.06",
>
>   ),
>
>   array(
>
> "order_id" => "35",
>
> "order_number" => "35Y345Y356YU3",
>
> "order_name" => "Bechstein",
>
> "order_ordered_size" => "Grand",
>
> "order_sales_price" => "11671.90",
>
> "order_shipping_price" => "51.00",
>
> "order_shipping_extra" => "450.00",
>
>   ),
>
>   array(
>
> "order_id" => "36",
>
> "order_number" => "35Y345Y356YU3",
>
> "order_name" => "Bosendorfer",
>
> "order_ordered_size" => "Grand",
>
> "order_sales_price" => "11671.90",
>
> "order_shipping_price" => "500.00",
>
> "order_shipping_extra" => "450.00",
>
>   ),
>
>   array(
>
> "order_id" => "37",
>
> "order_number" => "78973467Y3Y36",
>
> "order_name" => "Steinway Grand Piano #11",
>
> "order_ordered_size" => "Grand",
>
> "order_sales_price" => "78671.90",
>
> "order_shipping_price" => "7.85",
>
> "order_shipping_extra" => "0.06",
>
>   ),
>
>   array(
>
> "order_id" => "38",
>
> "order_number" => "78973467Y3Y36",
>
> "order_name" => "Baldwin L Grand Piano #39",
>
> "order_ordered_size" => "Grand",
>
> "order_sales_price" => "11671.90",
>
> "order_shipping_price" => "1.00",
>
> "order_shipping_extra" => "450.00",
>
>   )
>
> );
>

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] newbie - how to receive/iterate posted arrays

2008-09-01 Thread Diogo Neves
Hi,

On Mon, Sep 1, 2008 at 9:25 AM, Govinda <[EMAIL PROTECTED]> wrote:

> Hello early birds,
>
> I am going round and round the docs and list posts I saved on this topic...
> but I am still stumped.
> Kindly show me what I am missing.  I want to simply send an array of vars
> via a post form to my receiving script.
>
> I've got simple inputs like this:
>
>  value="muir_beach_tmb" />
>  value="ruby_mountain_tmb" />
>
> they post to the script with this: (and this is the line giving the error)-
>
> foreach($_POST['$tmbsToiterate'] as $value) {


// Maybe like this, but i'm not sure, try to do a var_dump( $_POST ) and see
what is inside ;)
foreach($_POST['tmbsToiterate'] as $value) {

>
>
> The error is "Warning: Invalid argument supplied for foreach()"
>
> Seems so simple, but I can't get it... What am I doing wrong?
> -Govinda
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Mozilla user agent escapes detection

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 4:39 AM, Dave M G <[EMAIL PROTECTED]> wrote:

> PHP List,
>
> I have a script, part of which is taken from a script I found on the 'net,
> which tries to detect the user agent of the browser accessing the site. One
> of the reasons I'm doing this is to find out if the browser is a desktop or
> mobile.
>
> Part of the code looks like this:
>
> $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
> $isDesktop = (strpos($ua, 'firefox') !== false)
> || (strpos($ua,'mosaic') !== false)
> || (strpos($ua,'msie') !== false)
> || (strpos($ua,'opera') !== false)
> || (strpos($ua,'mozilla') !== false)
> || (strpos($ua,'w3c_css_validator') !== false)
> || (strpos($ua,'w3c_validator') !== false);
>
> What's driving me crazy is that it successfully determines all the browsers
> listed there, *except* mozilla.
>
> I have a log file which alerts me when an unknown browser comes through my
> site, and it's chock full of messages telling me that a Mozilla based
> browser has come by. There are a *lot* of Mozilla based browsers.
>
> Some examples from my logs of the browsers slipping by my test:
>
> HTTP_USER_AGENT: Mozilla/5.0 compatible; Yahoo! Slurp
> HTTP_USER_AGENT: Mozilla/5.0 compatible; Googlebot/2.1
> HTTP_USER_AGENT: Mozilla/5.0 X11; U; Linux i686
>
> In each case, the strpos() should have seen the mozilla agent and not
> bothered logging it.
>
> It's not complicated code, especially considering it's successfully finding
> msie and firefox.
>
> I can't imagine why Mozilla would be different.
>
> Any suggestions? Is there something about my code right in front of my face
> that I'm not seeing?
>
> Any suggestions would be greatly appreciated.
>
> Thanks.
>
> --
> Dave M G
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Unless you are not getting that useragents on your php, it as to work...
At least my test worked perfectly




-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Google Chrome

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 12:21 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Looks like Google chrome is being released today (or soon). IE,
> Firefox, Opera, Safari and now Chrome, hmmm, can anyone say "browser
> war"?
>
> http://www.google.com/googlebooks/chrome/
>
> --
> Richard Heyes
>
> HTML5 Graphing for IE7, FF, Opera and Safari:
> http://www.phpguru.org/RGraph
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi,
I have nothing against browsers, but that discussion is (maybe) better on a
javascript/designer/whatever mailling...
And it's only rumors... why not wait by the real thing is out?

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Google Chrome

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 12:44 PM, shiplu <[EMAIL PROTECTED]> wrote:

> Google Chrome is not released yet, is it?
> Didn't get any download link. :-S
>

Was what i said... it's a rumor... let da thing came out and u'll see your
websites after...

>
> --
> A K M Mokaddim
> http://talk.cmyweb.net
> http://twitter.com/shiplu
> Stop Top Posting !!
>



-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Mozilla user agent escapes detection

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 5:49 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:

> Shawn McKenzie schreef:
>
>> Jochem Maas wrote:
>>
>>> Dave M G schreef:
>>>
>>>> PHP List,
>>>>
>>>> I have a script, part of which is taken from a script I found on the
>>>> 'net, which tries to detect the user agent of the browser accessing the
>>>> site. One of the reasons I'm doing this is to find out if the browser is a
>>>> desktop or mobile.
>>>>
>>>> Part of the code looks like this:
>>>>
>>>> $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
>>>> $isDesktop = (strpos($ua, 'firefox') !== false)
>>>> || (strpos($ua,'mosaic') !== false)
>>>> || (strpos($ua,'msie') !== false)
>>>> || (strpos($ua,'opera') !== false)
>>>> || (strpos($ua,'mozilla') !== false)
>>>> || (strpos($ua,'w3c_css_validator') !== false)
>>>> || (strpos($ua,'w3c_validator') !== false);
>>>>
>>>> What's driving me crazy is that it successfully determines all the
>>>> browsers listed there, *except* mozilla.
>>>>
>>>
>>> Mozilla !== mozilla
>>>
>>
>> Look at the code: strtolower('Mozilla') === 'mozilla'
>>
>
> oh crap :-)
>
>
>
>> -Shawn
>>
>>>
>>> stripos is the case-insenstive version of strpos
>>>
>>>
>>>> I have a log file which alerts me when an unknown browser comes through
>>>> my site, and it's chock full of messages telling me that a Mozilla based
>>>> browser has come by. There are a *lot* of Mozilla based browsers.
>>>>
>>>> Some examples from my logs of the browsers slipping by my test:
>>>>
>>>> HTTP_USER_AGENT: Mozilla/5.0 compatible; Yahoo! Slurp
>>>> HTTP_USER_AGENT: Mozilla/5.0 compatible; Googlebot/2.1
>>>>
>>>
>>> these 2 are bots btw.
>>>
>>>  HTTP_USER_AGENT: Mozilla/5.0 X11; U; Linux i686
>>>>
>>>> In each case, the strpos() should have seen the mozilla agent and not
>>>> bothered logging it.
>>>>
>>>> It's not complicated code, especially considering it's successfully
>>>> finding msie and firefox.
>>>>
>>>> I can't imagine why Mozilla would be different.
>>>>
>>>> Any suggestions? Is there something about my code right in front of my
>>>> face that I'm not seeing?
>>>>
>>>> Any suggestions would be greatly appreciated.
>>>>
>>>
>>> STW? plenty of people offering code that attempts to detect mobile
>>> devices, e.g.:
>>>
>>> http://www.andymoore.info/php-to-detect-mobile-phones/
>>>
>>> also I'd offer a link in the top of your site pointing to the mobile site
>>> (and vice-versa) in order to:
>>>
>>> 1. allow bots to visit both.
>>> 2. in case your code guessed incorrectly for some user(s)
>>>
>>> I'd also check the UA string specifically for bots first and just let
>>> them
>>> through ... they are neither desktop nor mobile browsers.
>>>
>>> additionally you might consider how you want to accomodate text browsers
>>> (which is kind of what a bot is)
>>>
>>>
>>>> Thanks.
>>>>
>>>>
>>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Anyway, this code is working...
I changed my useragent in Firefox and it worked pretty well to me...


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Creating single row for multiple items.

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 7:17 PM, brian <[EMAIL PROTECTED]> wrote:

> Tom Shaw wrote:
>
>> My array looks very similar to this. I need to create a single row for the
>> items that have the same order number for CSV export.  I'd prefer to do
>> this
>> PHP wise instead of SQL. But would appreciate any help I can get.
>>
>>
>> $ar = array(
>>
>>   array(
>>
>> "order_id" => "34",
>>
>> "order_number" => "35Y345Y356YU3",
>>
>> "order_name" => "Steinway Grand Piano #11",
>>
>> "order_ordered_size" => "Grand",
>>
>> "order_sales_price" => "78671.90",
>>
>> "order_shipping_price" => "7.85",
>>
>> "order_shipping_extra" => "0.06",
>>
>>   ),
>>
>>   array(
>> ...
>>
>
> A single row of *what*? The order_ids? The order_names? Perhaps you should
> post an example of the outcome you're looking for.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Yep, i got lost too ;)

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Confused

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 7:58 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:

> >
> > Your script is dying then. What does the error log say? Are you sure PHP
> > is using the php.ini you think it's using? Double check by using
> > phpinfo().
> >
> > Cheers,
> > Rob.
>
>
> It is VERY strange!  phpinfo() shows that it is using C:\Windows\php.ini
>
> phpinfo() also shows display_errors = Off but when I go to the
> C:\Windows\php.ini file it says display_errors = On...
>

You can be rewriting it on your vistualhost or in a script somewhere...

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Confused

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 8:04 PM, Robert Cummings <[EMAIL PROTECTED]>wrote:

> On Tue, 2008-09-02 at 14:58 -0400, Dan Shirah wrote:
> > Your script is dying then. What does the error log say? Are
> > you sure PHP
> > is using the php.ini you think it's using? Double check by
> > using
> > phpinfo().
> >
> > Cheers,
> > Rob.
> >
> > It is VERY strange!  phpinfo() shows that it is using C:\Windows
> > \php.ini
> >
> > phpinfo() also shows display_errors = Off but when I go to the C:
> > \Windows\php.ini file it says display_errors = On...
>
> Does your script, the apache conf, virtual host conf, or a .htaccess
> conf modify this setting? perhaps php.ini has more than one
> display_errors entries?
>
> Cheers,
> Rob.
>
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> And all other possible places :)


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Google Chrome

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 4:33 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:

> Hi,
>
> And more about it:
>
> http://news.bbc.co.uk/1/hi/technology/7593106.stm
>
> --
> Richard Heyes
>
> HTML5 Graphing for IE7, FF, Opera and Safari:
> http://www.phpguru.org/RGraph
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> www.google.com/chrome

Now is the time ;)


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Secure way to handle pw on session.

2008-09-02 Thread Diogo Neves
On Tue, Sep 2, 2008 at 9:10 PM, Eric Butera <[EMAIL PROTECTED]> wrote:

> On Tue, Sep 2, 2008 at 4:06 PM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
> > On Tue, 2008-09-02 at 12:58 -0700, mike wrote:
> >> As an additional note suhosin can transparently encrypt and decrypt
> >> your session data for reasons just like the /tmp issue. It happens
> >> without you needing to configure anything (except to enable or disable
> >> it) I think it is enabled by default.
> >
> > This won't help since the OP mentioned he was worried about code
> > injection exposing the contents of $_SESSION and presumably suhosin
> > doesn't prevent restoration of the session on page load.
> >
> > Cheers,
> > Rob.
> >
> >
> >
> >> On Sep 2, 2008, at 12:35 PM, "Dan Joseph" <[EMAIL PROTECTED]> wrote:
> >>
> >> > On Tue, Sep 2, 2008 at 3:27 PM, k bah <[EMAIL PROTECTED]> wrote:
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I noticed session files are kept on /tmp for a while, and even if
> >> >> they
> >> >> were immediately deleted, well, someone could use one of my php
> >> >> scripts to
> >> >> inject code and read them, since they belong to the httpd user.
> >> >> What's the best way to receive passwords thru a form and store them
> >> >> in the
> >> >> $_SESSION while I process other information to decide whether or
> >> >> not that
> >> >> user is able to proceed and login (check to see if user is also
> >> >> allowed to
> >> >> use that service, not just validate user/pw)? I use https, always,
> >> >> no plain
> >> >> http is used.
> >> >>
> >> >> Thanks
> >> >>
> >> >> =
> >> >>
> >> >>
> >> >> --
> >> >> Powered by Outblaze
> >> >>
> >> >> --
> >> >> PHP General Mailing List (http://www.php.net/)
> >> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >> >>
> >> >>
> >> > I personally would recommend you never store passwords in $_SESSION.
> >> >
> >> > I don't know how your auth code works, but the way I've always done
> >> > it would
> >> > be to process everything when you his submit, with the password
> >> > being in
> >> > $_POST or $_GET, then after you authenticate the user, drop it and
> >> > don't
> >> > store it with sessions.  If you find you need it to be stored for
> >> > other
> >> > things, I'd suggest rethinking the design/checking you're doing.
> >> >
> >> > --
> >> > -Dan Joseph
> >> >
> >> > www.canishosting.com - Plans start @ $1.99/month.
> >> >
> >> > "Build a man a fire, and he will be warm for the rest of the day.
> >> > Light a man on fire, and will be warm for the rest of his life."
> >>
> > --
> > http://www.interjinn.com
> > Application and Templating Framework for PHP
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> If code is getting injected into our apps we're screwed.


 How you get code injected on your aplication anyway?

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

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Google Chrome

2008-09-02 Thread Diogo Neves
On Wed, Sep 3, 2008 at 2:12 AM, Haig Dedeyan <[EMAIL PROTECTED]> wrote:

> On September 2, 2008 05:56:23 pm Haig Dedeyan wrote:
>
> Does anyone know what this implies? It's the 2nd section from their license
> agreement:
>
> "By submitting, posting or displaying the content you give Google a
> perpetual,
> irrevocable, worldwide, royalty-free, and non-exclusive license to
> reproduce,
> adapt, modify, translate, publish, publicly perform, publicly display and
> distribute any content which you submit, post or display on or through, the
> services. This license is for the sole purpose of enabling Google to
> display,
> distribute and promote the services and may be revoked for certain services
> as defined in the additional terms of those services."
>

What they call displaying content? because I as website owner never agreed
with this licence!


>
> Haig
>
>
> > Mouse wheel works fine for me.
> >
> > - Original Message -
> > From: "Douglas Temple" <[EMAIL PROTECTED]>
> > To: "Robert Cummings" <[EMAIL PROTECTED]>
> > Cc: php-general@lists.php.net
> > Date: Tue, 2 Sep 2008 21:04:30 +0100
> > Subject: Re: [PHP] Google Chrome
> >
> > > Beta or not, it's still amazingly fast.
> > > Despite the fact you can't scroll up with the mouse wheel...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Google Chrome

2008-09-02 Thread Diogo Neves
On Wed, Sep 3, 2008 at 2:36 AM, Haig Dedeyan <[EMAIL PROTECTED]> wrote:

> On September 2, 2008 09:33:30 pm Haig Dedeyan wrote:
> > On Wed, Sep 3, 2008 at 2:12 AM, Haig Dedeyan <[EMAIL PROTECTED]>
> wrote:
> > > On September 2, 2008 05:56:23 pm Haig Dedeyan wrote:
> > >
> > > Does anyone know what this implies? It's the 2nd section from their
> > > license agreement:
> > >
> > > "By submitting, posting or displaying the content you give Google a
> > > perpetual,
> > > irrevocable, worldwide, royalty-free, and non-exclusive license to
> > > reproduce,
> > > adapt, modify, translate, publish, publicly perform, publicly display
> and
> > > distribute any content which you submit, post or display on or through,
> > > the services. This license is for the sole purpose of enabling Google
> to
> > > display,
> > > distribute and promote the services and may be revoked for certain
> > > services as defined in the additional terms of those services."
> >
> > What they call displaying content? because I as website owner never
> agreed
> > with this licence!
> >
>
> I'm hoping that all this means is that they if you post something positive
> about chrome on some forum/blog, they can use it. Which begs the question,
> how would they know what I post.
>
> Haig


That don't seem like "All you say about this browser we can use", seams more
like "All you spell out off by this browser is ours"...
It think that every day they sounds more and more like Microsoft... A big
monopoly...
They deserve it, but still a monopoly and what it means

>
>
>
> > > Haig
> > >
> > > > Mouse wheel works fine for me.
> > > >
> > > > - Original Message -
> > > > From: "Douglas Temple" <[EMAIL PROTECTED]>
> > > > To: "Robert Cummings" <[EMAIL PROTECTED]>
> > > > Cc: php-general@lists.php.net
> > > > Date: Tue, 2 Sep 2008 21:04:30 +0100
> > > > Subject: Re: [PHP] Google Chrome
> > > >
> > > > > Beta or not, it's still amazingly fast.
> > > > > Despite the fact you can't scroll up with the mouse wheel...
> > >
> > > --
> > > 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
>
>


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] PHP: Mulitiple Arrary Sort

2008-09-03 Thread Diogo Neves
On Wed, Sep 3, 2008 at 12:35 AM, Vernon <[EMAIL PROTECTED]> wrote:

> I've gotten the one array down and I've figured out how to sort that array,
> however, I need to sort the array by the modified date of the file. Here's
> what I got so far:
>
>  // Open current directory
> if($handle = opendir($dir)){
> // Loop through all files
> while(false !== ($file = readdir($handle))){
> // Ignore hidden files
> if(!preg_match("/^\./", $file)){
> // Put dirs in $dirs[] and files in $files[]
> if(is_dir($file)){
> $dirs[] = $file;
> }else{
> $files[] = $file;
> }
> }
> }
>
> // Close directory
> closedir($handle);
>
>
> // if $files[] exists, sort it and print all elements in it.
> if(is_array($files)){
> //HERE IS MY CURRENT SORT WHICH I KNOW I NEED TO CHANGE BUT AM UNSURE HOW
> sort($files);
> foreach($files as $file){
> $completeFileName = $dir . $file;
> //I WANT TO SORT BY THIS
> echo date("m-d-Y", filemtime($completeFileName)) . "";
> }
> }
>
> }
> ?>
>
> Any ideas on how to fix this? Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Hi,

 $file ) {
$filesnew[] = $file;
}

var_dump( $filesnew );
?>

It should work for you with small changes ;)


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Altering the error_reporting

2008-09-03 Thread Diogo Neves
On Wed, Sep 3, 2008 at 6:43 PM, <[EMAIL PROTECTED]> wrote:

> I am looking for a way to alter the error_reporting(E_All)
>  This displays
> Parse error: parse error, unexpected '}' in /var/www/html/test.php on line
> 7
>
> I want to remove the file location and line number from the error
> to only produce
> Parse error: parse error, unexpected '}'
>
> Why? You may ask.
>
> I am writting a code tester in php but i do not want to display the "in"
> portion.
> This will make you find the error on your own. As a learning tool.
>
> Understand I have error reporting off in the php.ini file and call the
> errors in the php script with ini_set('display_errors', 1);.
>
> I am sure this is doable I just cant figure out how to do this without
> altering the php.ini file.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Hi,

Well... u can make an eval of the script, and if it gives an Parse Error it
returns false...

See www.php.net/eval


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Altering the error_reporting

2008-09-03 Thread Diogo Neves
On Wed, Sep 3, 2008 at 6:55 PM, n3or <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] schrieb:
>
>> I am looking for a way to alter the error_reporting(E_All)
>>  This displays Parse error: parse error, unexpected '}' in
>> /var/www/html/test.php on line 7
>>
>> I want to remove the file location and line number from the error
>> to only produce
>> Parse error: parse error, unexpected '}'
>>
>> Why? You may ask.
>>
>> I am writting a code tester in php but i do not want to display the "in"
>> portion. This will make you find the error on your own. As a learning tool.
>>
>> Understand I have error reporting off in the php.ini file and call the
>> errors in the php script with ini_set('display_errors', 1);.
>>
>> I am sure this is doable I just cant figure out how to do this without
>> altering the php.ini file.
>>
>>
>>
> Hi,
> you could define your own error handler:
> http://www.php.net/manual/en/function.set-error-handler.php
>

Parse Error on a error handler? it's possible?

>
> --
> Viele Grüße
>
> Dominik Strauß - www.n3or.de
> Webentwicklung, PHP und Linux
>
> Mobil: 0178 4940605
> Internet: www.n3or.de
> E-Mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Altering the error_reporting

2008-09-03 Thread Diogo Neves
On Wed, Sep 3, 2008 at 10:30 PM, Tom Chubb <[EMAIL PROTECTED]> wrote:

> 2008/9/3 n3or <[EMAIL PROTECTED]>
>
> > [EMAIL PROTECTED] schrieb:
> >
> >> I am looking for a way to alter the error_reporting(E_All)
> >>  This displays Parse error: parse error, unexpected '}' in
> >> /var/www/html/test.php on line 7
> >>
> >> I want to remove the file location and line number from the error
> >> to only produce
> >> Parse error: parse error, unexpected '}'
> >>
> >> Why? You may ask.
> >>
> >> I am writting a code tester in php but i do not want to display the "in"
> >> portion. This will make you find the error on your own. As a learning
> tool.
> >>
> >> Understand I have error reporting off in the php.ini file and call the
> >> errors in the php script with ini_set('display_errors', 1);.
> >>
> >> I am sure this is doable I just cant figure out how to do this without
> >> altering the php.ini file.
> >>
> >>
> >>
> > Hi,
> > you could define your own error handler:
> > http://www.php.net/manual/en/function.set-error-handler.php
> >
> >
> >
> > The manual made me chuckle then: "Also note that it is your
> responsibility
> to die() <http://www.php.net/manual/en/function.die.php> if necessary"


It's true, you should die sometimes, but is possible we really wanna know
something.
But if its only to hide information, then is better to redirect for a 500
error page.
If you really to show this part of error, best thing I know is eval.

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Summing array indexes.

2008-09-04 Thread Diogo Neves
On Thu, Sep 4, 2008 at 11:02 PM, Tom Shaw <[EMAIL PROTECTED]> wrote:

> Is there an easy way to loop thru the array below and add the incremented
> total price indexes so the order_total_price index contains the correct
> sum.
> Any help would be greatly appreciated.
>
>
>
>
>
> array(5) {
>
>  [0] => array(15) {
>
>["order_date"] => string(8) "09-01-08"
>
>["order_product_price_1"] => string(5) "10.00"
>
>["order_product_price_2"] => string(5) "20.00"
>
>["order_total_price"] => string(0) ""
>
>  }
>
>  [1] => array(19) {
>
>["order_date"] => string(8) "09-01-08"
>
>["order_product_price_1"] => string(5) "25.00"
>
>["order_product_price_2"] => string(5) "15.00"
>
>["order_total_price"] => string(0) ""
>
>  }
>
>
>
> Like this.
>
>
>
> array(5) {
>
>  [0] => array(15) {
>
>["order_date"] => string(8) "09-01-08"
>
>["order_product_price_1"] => string(5) "10.00"
>
>["order_product_price_2"] => string(5) "20.00"
>
>["order_total_price"] => string(0) "30.00"
>
>  }
>
>  [1] => array(19) {
>
>["order_date"] => string(8) "09-01-08"
>
>["order_product_price_1"] => string(5) "25.00"
>
>["order_product_price_2"] => string(5) "15.00"
>
>["order_total_price"] => string(0) "40.00"
>
>  }
>
>
>
> Tom Shaw
>
>
>
> [EMAIL PROTECTED]
>
>
>
> foreach( $arr_top as $arr_top_elem ) {
$total = 0;
foreach( $arr_top_elem as $key => $elem ) {
 if ( strpos( 'order_product_price_' ) === 0 ) {
$total += $elem;
}
}
$arr_top_elem['order_total_price'] = $total;
}

This should do da trick...

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Thank you...

2008-09-11 Thread Diogo Neves
On Thu, Sep 11, 2008 at 2:13 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:

> Jason Pruim schreef:
>
>>
>> On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:
>>
>>  There is only 1 military service person that should be thanked for
>>> actions on 9/11 and that is the man who was brave enough to disobey
>>> orders and shoot down the flight over Pennsylvania.  The rest who were
>>> involved obeyed orders and let chaos happen.
>>> There are many military men and women who for action after 9/11 deserve
>>> our thanks though.
>>>
>>>
>> Anyone that defends their country deserves their countries thanks and
>> appreciation.
>>
>
> and the war's in the middle east constitute defense in what way exactly?
>

In the way that the petroil don't get out of america's companies? That their
economy don't get worser?

>
>
>>
>> --
>>
>> Jason Pruim
>> Raoset Inc.
>> Technology Manager
>> MQC Specialist
>> 11287 James St
>> Holland, MI 49424
>> www.raoset.com
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Thank you...

2008-09-11 Thread Diogo Neves
On Thu, Sep 11, 2008 at 2:18 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:

>
> On Sep 11, 2008, at 9:13 AM, Jochem Maas wrote:
>
>  Jason Pruim schreef:
>>
>>> On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:
>>>
>>>> There is only 1 military service person that should be thanked for
>>>> actions on 9/11 and that is the man who was brave enough to disobey
>>>> orders and shoot down the flight over Pennsylvania.  The rest who were
>>>> involved obeyed orders and let chaos happen.
>>>> There are many military men and women who for action after 9/11 deserve
>>>> our thanks though.
>>>>
>>>>  Anyone that defends their country deserves their countries thanks and
>>> appreciation.
>>>
>>
>> and the war's in the middle east constitute defense in what way exactly?
>>
>
> Never said they did...
>
> It's just today I wanted to say thank you to everyone that defends their
> country


That said, that isn't defense, then they r not defending, and you can always
make a special list to thank people that r invading other contries anyway.

>
>
> --
>
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 11287 James St
> Holland, MI 49424
> www.raoset.com
> [EMAIL PROTECTED]
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: Re[2]: [PHP] check if a file is included

2008-09-16 Thread Diogo Neves
On Tue, Sep 16, 2008 at 3:09 AM, ANR Daemon <[EMAIL PROTECTED]> wrote:

> Greetings, Jochem Maas.
> In reply to Your message dated Tuesday, September 16, 2008, 3:38:44,
>
> > ANR Daemon schreef:
> >> Greetings, Jochem Maas.
> >> In reply to Your message dated Friday, September 12, 2008, 17:05:58,
>
> > I like my 'schreef' better.
>
> Why you talking to my template? It has strict order to not speak with
> unknown
> people.
>
> >>>> actually $_SERVER[script_name] is probably better if not being used
> from
> >>>> a webserver.
> >>>>
> >>
> >>> you didn't mention wanting to use the cmdline.
> >>> untested code follows:
> >>
> >>>  >>
> >>> function indirectCall($s)
> >>> {
> >>> if (php_sapi_name() == 'cli') {
> >>> return strstr($s, $argv[0]) !== false;
> >>> } else {
> >>> return strstr($s, $_SERVER["REQUEST_URI"]) !== false;
> >>> }
> >>> }
> >>
> >>
> >> Actually, it must be (Windows-proof):
> >>
>
> > a, why must it be windows proof, nobody asked for that?
>
> It must work similarly on every platform it can be executed.
>
> > b, does this take into account that $_SERVER['SCRIPT_FILENAME'] is not
> available of some versions of IIS?
>
> I was unaware of this issue. Is it PHP-specific?
>
> > c, you'd think __FILE__ and $_SERVER['SCRIPT_FILENAME'] used consistent
> slashes on a given system, no? (I doubt
> > you need to do the funky translation.
>
> Apache/W32 2.2, PHP/W32 5.2.6
> __FILE__ has backspashes, $_SERVER['SCRIPT_FILENAME'] has forward slashes.
>
> > d, there is no account take for symlinks, if you really want to be
> pedantic:
>
> > realpath(__FILE__) != realpath(getenv('PATH_TRANSLATED'))
>
> RTFM anyone?
>
> cgi.fix_pathinfo boolean
> Provides real PATH_INFO/PATH_TRANSLATED support for CGI. PHP's previous
> behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
> what
> PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
> this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A
> setting of zero causes PHP to behave as before. Default is zero. You should
> fix your scripts to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
>
> PATH_TRANSLATED isn't available under apache2 (and 2.2) SAPI. But in
> contrast
> to issue you mentioned above, this behaviour is well-documented.
>
> > e. the OP wanted it to work on the cmdline as well (sounds silly to me
> but there you have it)
>
> It works on cmdline flawlessly.
> Tested on both local and network locations as well as from web server, with
> any possible mix of slashes.
>
> > but really this is all madness. put the file outside the webroot
>
> That's what i'm typically doing. Only one PHP file that available from
> webserver root is the index.php.
>
>
> --
> Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi all,
I don't know who know phpbb, but i like it's approach to this problem...
simple set a constant in the scripts you should access and use defined
function for check it on includes... like:

index.php

define( 'IN_MY_APP', 1 );

include1.php

if ( !defined( 'IN_MY_APP' )) {
**header( 'HTTP/1.1 404 Not Found' );
header( 'Location: /' );
}

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Diogo Neves
Hi Alice,

U can simple do:
$nr = ( strlen( $message ) / 2 ) + 1 );
$nr = count( explode( '|', $message );

On Fri, Oct 31, 2008 at 4:32 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> >  I have a code snippet here as follows:
> >
> >  $message="1|2|3|4|5";
> >  $stringChunks = explode("|", $message);
> >
> >  Is it possible to find out the number of elements in this string? It
> seems that I could do things like print_r and find out what is the last
> element of $stringChunks is, but is there a way where I can use code from
> the two lines and have it print out 5 as the number of elements that
> contains after the splitting?
>
> http://php.net/strlen
>http://php.net/count
>
> --
> 
> http://www.parasane.net/
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
> Ask me about our current hosting/dedicated server deals!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Reg Ex

2008-10-31 Thread Diogo Neves
Hi all,

It depends on what he really want, but pathinfo really is a better option

My test worked perfectly on files with no extension and without name...



On Fri, Oct 31, 2008 at 2:57 PM, Daniel P. Brown
<[EMAIL PROTECTED]>wrote:

> On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <[EMAIL PROTECTED]> wrote:
> > Thanks for the reply. For now I used substr($filename,0,-4) and that
> worked
> > perfectly. I need to learn reg ex badly :(.
>
> Before you do that, learn to read and follow along in an email
> thread that you start.  We gave you perfect pointers as to (a) why
> regexp's aren't needed in this case; and (b) how to better handle it.
>
>Your substr() routine won't work as expected in all cases.
> Imagine either an .htaccess file or an extensionless file named
> `quagmire`.  You'll come up with `cess` and `mire`, respectively.
>
> --
> 
> http://www.parasane.net/
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
> Ask me about our current hosting/dedicated server deals!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Sessions in object oriented code

2008-10-31 Thread Diogo Neves
Well, without code is dificult to say, but session_start() don't send
headers, then possible u have a space after a "?>" or @ least this is the
common error...

On Thu, Oct 30, 2008 at 11:47 PM, Ben Stones <[EMAIL PROTECTED]>wrote:

> Hi,
>
> Hope I can explain this as easily as possible, basically I am using both
> cookies and sessions for my script, whereby the user is allowed to choose
> which method they want to login with. Problem for me is removing the
> registration form, etc., from those that are logged in. The thing is the
> form is in its own method in a seperate file, and its called within HTML
> code so obviously if I included session_start() in the seperate include
> file
> where the methods/classes are, etc., I'd get a "headers already sent"
> error.
> So is there a solution to this?
>
> Thanks.
>

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt