[PHP] Fw: `�.�MPEG`�.�

2006-06-12 Thread webmaster





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

[PHP] popen and pclose. Something changed in 4.4.2 !

2006-06-12 Thread Venkatesh M. S.

Greetings!

I was using popen and pclose on a previous version of PHP on Windows with an
older version of Apache (2.x). ( I think it was 4.4.1 but will need to check
as i am not sure).

pclose(popen("start " . $exe . " " . $args, "r"))

Where $exe is my path to the batch file and $args are the arguments for the
batch file. The batch file, in turn calls other batch files on a shared
folder on a different PC

On Windows, it would open up the dos window and run commands there and exit
and the PHP script that called the pclose would terminate loading on the
users' browsers.

Now, with PHP 4.4.2, the pclose and popen send the tasks to the background
and the dos window does not show up! As a result, killing the dos process is
not possible (i get access denied in windows...) and the users cannot see
the dos window when it runs.

I would like the php script to send the commands to a dos window, and the
php script to finish executing. I tried passthru, system, exec and
proc_open... and none of them work. None of them bring up the dos window.

Please help!


Regards


Venkat


Re: [PHP] Tables vs. databases

2006-06-12 Thread Antonio Bassinger

Thanks to All who suggested solutions or pointed errors in my existing
approach.
Most seem to suggest having 1 database and 1-2 tables. So let me confirm:

1 table with million records are ok. But what of the size of the table?

10,000 * 10 MB = 100 GB!

If the upload limit is to be notched up 100 times - typical of public mail
servers, a table would expand to 10 TB.

Someone suggested :

The one-database-for all method increases risk that an SQL error will
"leak" information from one client to another.

But with 1 table and a million records, what would be the chances of this
"leak"?

My idea is,

For every 100 users, make a new database. That is 100 tables, each of max.
10MB * 100 = 1GB.

For the 101th user, make a new database. So for 1 users -> 100
databases.

100 databases and 100 tables don't look bad to me. What say?

Thanks
Antonio

On 6/11/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote:


On 6/9/06, Antonio Bassinger <[EMAIL PROTECTED]> wrote:
> Hi gang,
>
> Situation:
>
> I've a HTTP server. I intend to run a file upload service. There could
be up
> to 1 subscribers. Each saving files up to 10 MB.
>
> I made a proof-of-concept service using PHP & MySQL, where there is a
single
> database, but many tables - a unique table for each subscriber. But I
> realize that I may land in trouble with such a huge database. Would it
be
> better to have a separate database for each subscriber?
>
> Which approach is better, many tables in 1 database, or many databases
with
> 1 or max 2 tables?
>
> Kindly suggest with pros and cons of each.

you might want to consider storing the files outside of the database
as well, and just a pointer to it's path in the table.

with respect to table vs. databases per user, neither.


--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



Re: [PHP] Tables vs. databases

2006-06-12 Thread Jochem Maas
Antonio Bassinger wrote:
> Thanks to All who suggested solutions or pointed errors in my existing
> approach.
> Most seem to suggest having 1 database and 1-2 tables. So let me confirm:
> 
> 1 table with million records are ok. But what of the size of the table?
> 
> 10,000 * 10 MB = 100 GB!

put your files on the filesystem store data about the files (including where
each one is saved) in the DB.

> 
> If the upload limit is to be notched up 100 times - typical of public mail
> servers, a table would expand to 10 TB.

in which case your in the territory of clusters, distributed systems, really 
big iron,
LOTS of raid, etc, etc - a bit beyond the scope of this list (granted there
are a few people here with the skills and experience to tackle such 
architectures but
generally they get paid big bucks to dish out that kind of solution :-)

then again you never know. there is a girl called Michele (german?) who posts 
here
now and again who seems to work quite a bit with very large databases and 
massive
storage - maybe she reads this and has some ideas/tips?

> 
> Someone suggested :
> 
> The one-database-for all method increases risk that an SQL error will
> "leak" information from one client to another.

very vague.
make your SQL rock solid and never print out any errors returned by mysql
(and obviously display_errors must be off in your production system) - just give
the user some friendly generic error msgs if something goes wrong.

> 
> But with 1 table and a million records, what would be the chances of this
> "leak"?

I don't think the probability of a "leak" has much, if anything, to with the
number of records in the table - it a down to the robustness/quality of the code
written to interact with the DB and the user.
> 
> My idea is,
> 
> For every 100 users, make a new database. That is 100 tables, each of max.
> 10MB * 100 = 1GB.
> 
> For the 101th user, make a new database. So for 1 users -> 100
> databases.
> 
> 100 databases and 100 tables don't look bad to me. What say?

I'd say it's an arbitrary way of splitting up the data that is heavily
unnormalized - and also poses a maintance nightmare when updating the DB
schema and or performing DB 'health checks' and/or repairs

stick to 1 DB, 2+ tables until/unless it becomes clear that a single
data-source is a performance or storage problem.

> 
> Thanks
> Antonio
> 
> On 6/11/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
>>
>> On 6/9/06, Antonio Bassinger <[EMAIL PROTECTED]> wrote:
>> > Hi gang,
>> >
>> > Situation:
>> >
>> > I've a HTTP server. I intend to run a file upload service. There could
>> be up
>> > to 1 subscribers. Each saving files up to 10 MB.
>> >
>> > I made a proof-of-concept service using PHP & MySQL, where there is a
>> single
>> > database, but many tables - a unique table for each subscriber. But I
>> > realize that I may land in trouble with such a huge database. Would it
>> be
>> > better to have a separate database for each subscriber?
>> >
>> > Which approach is better, many tables in 1 database, or many databases
>> with
>> > 1 or max 2 tables?
>> >
>> > Kindly suggest with pros and cons of each.
>>
>> you might want to consider storing the files outside of the database
>> as well, and just a pointer to it's path in the table.
>>
>> with respect to table vs. databases per user, neither.
>>
>>
>> -- 
>> Anthony Ettinger
>> Signature: http://chovy.dyndns.org/hcard.html
>>
> 

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



[PHP] Short writage of clauses

2006-06-12 Thread Barry

Hi everyone!

Well i do know that you can write IF as ( ? : ) but what i am asking 
about is something like this:


if (a = 1 OR a = 2)

is it anyway possible to write it like:
if (a = 1 OR 2)

I know this is wrong because "2" will always be true ...

Any infos on that would be nice :)

Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Barry wrote:
> Hi everyone!
> 
> Well i do know that you can write IF as ( ? : ) but what i am asking
> about is something like this:
> 
> if (a = 1 OR a = 2)
> 
> is it anyway possible to write it like:
> if (a = 1 OR 2)

maybe this helps your situation:

if (in_array($a, array(1, 2))) echo "got it!";

> 
> I know this is wrong because "2" will always be true ...
> 
> Any infos on that would be nice :)
> 
> Greets
> Barry

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Dave Goodchild

On 12/06/06, Barry <[EMAIL PROTECTED]> wrote:


Hi everyone!

Well i do know that you can write IF as ( ? : ) but what i am asking
about is something like this:

if (a = 1 OR a = 2)

is it anyway possible to write it like:
if (a = 1 OR 2)

I know this is wrong because "2" will always be true ...

Any infos on that would be nice :)

Greets
Barry



if ((a==1) || (a==2)) {




--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] Short writage of clauses

2006-06-12 Thread Stut

Barry wrote:
Well i do know that you can write IF as ( ? : ) but what i am asking 
about is something like this:


if (a = 1 OR a = 2)


I think you mean == not =.


is it anyway possible to write it like:
if (a = 1 OR 2)

I know this is wrong because "2" will always be true ...

Any infos on that would be nice :)


The only way I know of to do this sort of thing would be...

   if (in_array($a, array(1, 2)))

But it begs the question why you would want to do this?

-Stut

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Barry

Stut schrieb:

Barry wrote:
Well i do know that you can write IF as ( ? : ) but what i am asking 
about is something like this:


if (a = 1 OR a = 2)


I think you mean == not =.

Yeah. sorry ;)



is it anyway possible to write it like:
if (a = 1 OR 2)

I know this is wrong because "2" will always be true ...

Any infos on that would be nice :)


The only way I know of to do this sort of thing would be...

   if (in_array($a, array(1, 2)))

Hmm yes this is actually a shorter way.

But it has limits hasn't it?
if (in_array(a, array(date("d",time),CONSTANT_NAME,function_call(

Like that



But it begs the question why you would want to do this?


Oh, uhm well something like this probably:
If the age of my grandma is as old as the age of the table, lower than 
the age the house was build, equal to the summary of ages from the 
grandchilds, bigger than 50 but not higher than 70 AND only when she is 
as old as me i do have to bake a cookie


Something like that.


--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Barry wrote:
> Stut schrieb:
>> Barry wrote:
>>> Well i do know that you can write IF as ( ? : ) but what i am asking
>>> about is something like this:
>>>
>>> if (a = 1 OR a = 2)
>>
>> I think you mean == not =.
> Yeah. sorry ;)
>>
>>> is it anyway possible to write it like:
>>> if (a = 1 OR 2)
>>>
>>> I know this is wrong because "2" will always be true ...
>>>
>>> Any infos on that would be nice :)
>>
>> The only way I know of to do this sort of thing would be...
>>
>>if (in_array($a, array(1, 2)))
> Hmm yes this is actually a shorter way.
> 
> But it has limits hasn't it?
> if (in_array(a, array(date("d",time),CONSTANT_NAME,function_call(
> 
> Like that
> 
>>
>> But it begs the question why you would want to do this?
> 
> Oh, uhm well something like this probably:
> If the age of my grandma is as old as the age of the table, lower than
> the age the house was build, equal to the summary of ages from the
> grandchilds, bigger than 50 but not higher than 70 AND only when she is
> as old as me i do have to bake a cookie

I find a switch statement sometimes handy for creating a 'truth table'
like you describe (I sometimes find it easier to read and/or add 'if' clauses):

switch (true) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAge == array_sum($grandKids)):
bakeCookie();
break;
default:
haveABeer();
watchFootball();
}

functionally the above could just as well be an if statement - it's pretty much
a question of personal preference.

> 
> Something like that.
> 
> 

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



[PHP] weird problem in php

2006-06-12 Thread weetat

Hi all ,

 I have using php 4.3.2 and mysql database.

 I have a form which have  tag which have the value for example 
"-New York".


 When use submit the form , i need to find the first occurence of "-" , 
i use strpos function as shown below :


$country = $_POST['country'];
$findme  = '-';
$pos = strpos($country, $findme);

if ($pos === false) {
  $_logger->logdebug("starting searchChassisTblDB() not found");
} else {
  $_logger->logdebug("starting searchChassisTblDB() found");
}

however it always give false . I did not know why.
Then i did a testing , added below code in the php file without form 
submission, it give true value which what i wanted. Anybody have ideas 
or suggestion what happening ? Any difference when value submitted from 
form ? Thanks


$mystring = '-New York';
$findme  = '-';
$pos = strpos($mystring, $findme);
if ($pos === false) {
   echo "The string '$findme' was not found in the string '$mystring'";
} else {
   echo "The string '$findme' was found in the string '$mystring'";
   echo " and exists at position $pos";
}

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Stut wrote:
> Barry wrote:
>> Well i do know that you can write IF as ( ? : ) but what i am asking
>> about is something like this:
>>
>> if (a = 1 OR a = 2)
> 
> I think you mean == not =.
> 
>> is it anyway possible to write it like:
>> if (a = 1 OR 2)
>>
>> I know this is wrong because "2" will always be true ...
>>
>> Any infos on that would be nice :)
> 
> The only way I know of to do this sort of thing would be...
> 
>if (in_array($a, array(1, 2)))
> 
> But it begs the question why you would want to do this?

it's a handy way to white list data. e.g.

if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg dude";

(btw: no need to beg ;-)

> 
> -Stut
> 

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



Re: [PHP] weird problem in php

2006-06-12 Thread Dave Goodchild

On 12/06/06, weetat <[EMAIL PROTECTED]> wrote:


Hi all ,

  I have using php 4.3.2 and mysql database.

  I have a form which have  tag which have the value for example
"-New York".

  When use submit the form , i need to find the first occurence of "-" ,
i use strpos function as shown below :

$country = $_POST['country'];
$findme  = '-';
$pos = strpos($country, $findme);

if ($pos === false) {
   $_logger->logdebug("starting searchChassisTblDB() not found");
} else {
   $_logger->logdebug("starting searchChassisTblDB() found");
}

however it always give false . I did not know why.
Then i did a testing , added below code in the php file without form
submission, it give true value which what i wanted. Anybody have ideas
or suggestion what happening ? Any difference when value submitted from
form ? Thanks

$mystring = '-New York';
$findme  = '-';
$pos = strpos($mystring, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}



why don't you echo $_POST['country'] to see  what you get?




--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] Short writage of clauses

2006-06-12 Thread Barry

Jochem Maas schrieb:
 > I find a switch statement sometimes handy for creating a 'truth table'

like you describe (I sometimes find it easier to read and/or add 'if' clauses):

switch (true) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAge == array_sum($grandKids)):
bakeCookie();
break;
default:
haveABeer();
watchFootball();
}

functionally the above could just as well be an if statement - it's pretty much
a question of personal preference.


Yeah true, it is better to view.
Is it the same as the if i stated? (the grandma one)
it's one if but not multiple ones (if elseif elseif .. etc.)

The problem still is it's not that "short" ;)

Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] call to pprofp not working for PHP APD

2006-06-12 Thread Ravi Jethwa
Hello,

 

I was wondering if somebody could provide some advice on where I might
be going wrong if I am receiving the following error:

 

"bash: /usr/bin/pprofp: /usr/local/bin/php: bad interpreter: No such
file or directory".

 

When I try to call the pprofp program in order to format the profile
data using APD.

 

Thanks for you help.  


Ravi Jethwa
OPUS MEDIA PLC - Developer 

t

+44 (0)845 122 3180

f

+44 (0)845 122 3190

e

[EMAIL PROTECTED]

w

www.opusmediaplc.com

a

4th Floor, 24 Buckingham Gate, London, SW1E 6LB

 



This email and its attachments are intended solely for the addressee.
Any views or opinions presented are those of the originator, unless
otherwise stated, and do not necessarily represent those of Opus Media
plc. If you received this in error, please notify us immediately and
then delete the email and any copies of it. If you are not the intended
recipient, please note that any distribution, copying or use of this
information is strictly prohibited.

 



Re: [PHP] weird problem in php

2006-06-12 Thread Rabin Vincent

On 6/12/06, weetat <[EMAIL PROTECTED]> wrote:

  I have a form which have  tag which have the value for example
"-New York".

  When use submit the form , i need to find the first occurence of "-" ,
i use strpos function as shown below :

$country = $_POST['country'];
$findme  = '-';
$pos = strpos($country, $findme);

if ($pos === false) {
   $_logger->logdebug("starting searchChassisTblDB() not found");
} else {
   $_logger->logdebug("starting searchChassisTblDB() found");
}

however it always give false . I did not know why.
Then i did a testing , added below code in the php file without form
submission, it give true value which what i wanted. Anybody have ideas
or suggestion what happening ?


Perhaps there is a problem with the HTML for your select box.
var_dump($_POST) in your PHP code to check if the value is
being sent correctly.

Rabin

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



RE: [PHP] Short writage of clauses

2006-06-12 Thread Peter Lauri
Switch($a) {
Case 1:
Dowhatyouwant();
Case 2:
Dowhatyouwant();
Default:
Dowhatyouwant();
}

-Original Message-
From: Barry [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 12, 2006 5:12 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Short writage of clauses

Jochem Maas schrieb:
  > I find a switch statement sometimes handy for creating a 'truth table'
> like you describe (I sometimes find it easier to read and/or add 'if'
clauses):
> 
> switch (true) {
>   case ($grandmaAge >= $tableAge):
>   case ($grandmaAge < $houseAge):
>   case ($grandmaAge == array_sum($grandKids)):
>   bakeCookie();
>   break;
>   default:
>   haveABeer();
>   watchFootball();
> }
> 
> functionally the above could just as well be an if statement - it's pretty
much
> a question of personal preference.
> 
Yeah true, it is better to view.
Is it the same as the if i stated? (the grandma one)
it's one if but not multiple ones (if elseif elseif .. etc.)

The problem still is it's not that "short" ;)

Barry

-- 
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

-- 
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] Short writage of clauses

2006-06-12 Thread Stut

Jochem Maas wrote:

Stut wrote:
  

But it begs the question why you would want to do this?



it's a handy way to white list data. e.g.

if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg dude";

(btw: no need to beg ;-)
  


I agree that the in_array function is useful, but the OP was asking for 
a way to shorten (a == 1 or a == 2). Maybe the question was poorly 
stated and meant to ask how to compare a variable to a larger number of 
values but that's not what I got from it. I read it as an 'I want to 
save my fingers a bit of typing' and wondered if I was missing the point.


I beg your pardon.

-Stut

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Barry wrote:
> Jochem Maas schrieb:
>  > I find a switch statement sometimes handy for creating a 'truth table'
>> like you describe (I sometimes find it easier to read and/or add 'if'
>> clauses):
>>
>> switch (true) {
>> case ($grandmaAge >= $tableAge):
>> case ($grandmaAge < $houseAge):
>> case ($grandmaAge == array_sum($grandKids)):
>> bakeCookie();
>> break;
>> default:
>> haveABeer();
>> watchFootball();
>> }
>>
>> functionally the above could just as well be an if statement - it's
>> pretty much
>> a question of personal preference.
>>
> Yeah true, it is better to view.
> Is it the same as the if i stated? (the grandma one)

the example I gave does this:

iif any of the case expressions (they can be arbitrary statements of which the
complexity is up to you - as long as they return a boolean) equates to true then
you bake a cookie OTHERWISE (the default ;-) you drink beer and watch footy - 
which
given your german email address is rather apt right now :-P

I believe that is what you grandma example was aiming at
(I used artistic license with the beer and football part :-).

> it's one if but not multiple ones (if elseif elseif .. etc.)
> 
> The problem still is it's not that "short" ;)

f*** 'short' the time taken to write a line is negligable compared to the
time taken to maintain, reread, change, enhance and/or adapt it.

try to think in terms of maintainability and readability - and of course
performance (the length of a line of code says very little, if anything,
about it's performance) - jmho.

> 
> Barry
> 

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Barry

Stut schrieb:

Jochem Maas wrote:

Stut wrote:
 

But it begs the question why you would want to do this?



it's a handy way to white list data. e.g.

if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg 
dude";


(btw: no need to beg ;-)
  


I agree that the in_array function is useful, but the OP was asking for 
a way to shorten (a == 1 or a == 2). Maybe the question was poorly 
stated and meant to ask how to compare a variable to a larger number of 
values but that's not what I got from it. 

Well that's exactly what i wanted
if (a == 1 AND a == 2 OR a ==3 OR a == c_d OR a == my_function())

i wanted to write it like:
IF (a == 1 AND 2 OR 3 OR c_d OR my_function())

YI read it as an 'I want to

save my fingers a bit of typing' and wondered if I was missing the point.

well exactly. I want to save some typing.
Having rater long variables or associative arrays is much of typing
if ($db_array["my_fieldname"] != $other_db_array["my_other_fieldname"] 
OR $db_array["my_fieldname"] == 2 OR $db_array["my_fieldname"] == 
my_very_special_functionname())


and so on.

Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Stut wrote:
> Jochem Maas wrote:
>> Stut wrote:
>>  
>>> But it begs the question why you would want to do this?
>>> 
>>
>> it's a handy way to white list data. e.g.
>>
>> if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg
>> dude";
>>
>> (btw: no need to beg ;-)
>>   
> 
> I agree that the in_array function is useful, but the OP was asking for
> a way to shorten (a == 1 or a == 2). Maybe the question was poorly
> stated and meant to ask how to compare a variable to a larger number of
> values but that's not what I got from it. I read it as an 'I want to
> save my fingers a bit of typing' and wondered if I was missing the point.

I got that too - I mostly think the 'I want to save my fingers a bit of typing'
idea is bogus - which is why I went off at a bit of a tangent.

> 
> I beg your pardon.

pardon is in the mail :-)

> 
> -Stut
> 

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Satyam
- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>




Jochem Maas wrote:

Stut wrote:


But it begs the question why you would want to do this?



it's a handy way to white list data. e.g.

if (in_array($_GET['yourarg'], $allowedValsForYourArg)) echo "nice arg 
dude";


(btw: no need to beg ;-)



I agree that the in_array function is useful, but the OP was asking for a 
way to shorten (a == 1 or a == 2). Maybe the question was poorly stated 
and meant to ask how to compare a variable to a larger number of values 
but that's not what I got from it. I read it as an 'I want to save my 
fingers a bit of typing' and wondered if I was missing the point.


I beg your pardon.

-Stut



He is probably looking for something like in SQL:  where field in (1,2)

Satyam

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Barry

Jochem Maas schrieb:

Barry wrote:

Jochem Maas schrieb:
 > I find a switch statement sometimes handy for creating a 'truth table'

like you describe (I sometimes find it easier to read and/or add 'if'
clauses):

switch (true) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAge == array_sum($grandKids)):
bakeCookie();
break;
default:
haveABeer();
watchFootball();
}

functionally the above could just as well be an if statement - it's
pretty much
a question of personal preference.


Yeah true, it is better to view.
Is it the same as the if i stated? (the grandma one)


the example I gave does this:

iif any of the case expressions (they can be arbitrary statements of which the
complexity is up to you - as long as they return a boolean) equates to true then
you bake a cookie OTHERWISE (the default ;-) you drink beer and watch footy - 
which
given your german email address is rather apt right now :-P

I believe that is what you grandma example was aiming at
(I used artistic license with the beer and football part :-).


Well not if "any". The have "all" to be true :)

Well i don't want the grandma to be not as old as the table and older 
than the house age and still baking a cookie.


Only if all cases stated are true, i want to bake a cookie :)

( Yeah the wm is up and running ;) )



f*** 'short' the time taken to write a line is negligable compared to the
time taken to maintain, reread, change, enhance and/or adapt it.


Surely true but writing short doesn't have to mean to write unreadable 
stuff.


IF ($grandma >= $tableage
AND < $houseage
AND== array_sum($grandkids)
)
something like that (theoretically)



try to think in terms of maintainability and readability - and of course
performance (the length of a line of code says very little, if anything,
about it's performance) - jmho.


Yeah it's not a performance issue its more like having to code a lot 
less than ATM "with" having the same readability as now.

Just shorter :)

Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Short writage of clauses

2006-06-12 Thread Jochem Maas
Barry wrote:
> Jochem Maas schrieb:
>> Barry wrote:
>>> Jochem Maas schrieb:

...

> 
> Well i don't want the grandma to be not as old as the table and older
> than the house age and still baking a cookie.
> 
> Only if all cases stated are true, i want to bake a cookie :)

then reverse the logic of the switch statement.

switch (false) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAge == array_sum($grandKids)):
haveABeer();
watchFootball();
default:
bakeCookie();
break;
}

what's the obsession with baking a cookie under these very particular
circumstances anyway? ;-)

> 
> ( Yeah the wm is up and running ;) )
> 
> 
>> f*** 'short' the time taken to write a line is negligable compared to the
>> time taken to maintain, reread, change, enhance and/or adapt it.
> 
> Surely true but writing short doesn't have to mean to write unreadable
> stuff.

indeed there are no absolutes here.

> 
> IF ($grandma >= $tableage
> AND < $houseage
> AND== array_sum($grandkids)
> )
> something like that (theoretically)
> 

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



Re: [PHP] Simultaneous post/get?

2006-06-12 Thread tedd
At 4:34 PM -0400 6/11/06, Lowell Allen wrote:
>On Jun 11, 2006, at 2:02 PM, tedd wrote:
>
>>At 5:46 PM +0100 6/11/06, Stut wrote:
>>>tedd wrote:
At 4:35 PM +0100 6/11/06, Stut wrote:
>The form, with onsubmit="return sndReq()". sndReq does the AJAX image 
>thing (although I don't know why you're using AJAX here,

I'm using ajax because it's a method to inject an image in a DOM div 
without having to reload the current page.

All I want to do is present an image during the "wait".

Is there an easier way to do this?
>>>
>>>There is no need to hit the server for this. Simply include "display:
>>>none;" in the style for either the img tag or the div containing it so
>>>it's not shown when the page initially loads. In the onsubmit for the
>>>form change that display to 'block' to show the image. This also avoids
>>>the need to postpone posting the form since the image has already loaded.
>>>
>>>Image...
>>>
>>>
>>>
>>>Form...
>>>
>>>
>>
>>Bingo!
>>
>>That works slick ! While I *think* I know css, it would have taken me a long 
>>while before I would have turned to css to solve this.
>
>I recall trying this (exactly this I think) a couple months ago and finding 
>that it works in most browsers, but not in Windows IE6 (of course). Is it 
>working in Windows IE6 for you?
>
>I got a working upload progress bar by using Uber Uploader 
>.
>
>--
>Lowell Allen
>

Lowell:

I don't do windows, I'm a mac guy.

However, I do have a BrowserCam account and on remote access under W2K, IE6 the 
page did show the animated gif, so it looks like it works. But, BrowserCam 
didn't have an image to upload so I couldn't test the complete operation. I 
suspect it works as wanted.

If you have IE6 and want to check for yourself, I could set-up a test case for 
you -- just let me know off-list.

Thanks for the link, I'll look into it.

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] magic_quotes_gpc? Session variables

2006-06-12 Thread Mk

Hey gang,

   I was having the weirdest problems when I decided to update the code 
for my site(written in PHP) last modified over a year ago.  The code ran 
fine under my home development system, but on the hosting 
machine(1and1.com), my code would break.  Horribly.


   I narrowed the problem to this -  If I have a variable in 
$_SESSION(for example, 'username') and in my page, I declare a variable 
(for example '$username="guest"'), I've effectively accessed and 
overwritten the session variable.   It's been over a year, but I believe 
this is due to magic_quotes_gpc flag being 1 or something - I checked 
with my host's phpinfo page and it is set to 1.


   My question is(before I send my host an e-mail to ask them to turn 
it off for my site) is, magic_quotes_gpc IS the culprit, right?  I mean 
the whole behavior of if you declare a variable :


   $_SESSION['username'] = "Mark"


   then you can just write $username instead of $_SESSION["username"] 
to access the session variable is because of magic_quotes_gpc?



Thanks in advance,
Mk



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



[PHP] Re: magic_quotes_gpc? Session variables

2006-06-12 Thread Jo�o C�ndido de Souza Neto
No.

To you access $_SESSION["username"] by $username is defined by 
register_globals.

Probably your host won´t agree in change his register_globals.

"Mk" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED]
> Hey gang,
>
>I was having the weirdest problems when I decided to update the code 
> for my site(written in PHP) last modified over a year ago.  The code ran 
> fine under my home development system, but on the hosting 
> machine(1and1.com), my code would break.  Horribly.
>
>I narrowed the problem to this -  If I have a variable in $_SESSION(for 
> example, 'username') and in my page, I declare a variable (for example 
> '$username="guest"'), I've effectively accessed and overwritten the 
> session variable.   It's been over a year, but I believe this is due to 
> magic_quotes_gpc flag being 1 or something - I checked with my host's 
> phpinfo page and it is set to 1.
>
>My question is(before I send my host an e-mail to ask them to turn it 
> off for my site) is, magic_quotes_gpc IS the culprit, right?  I mean the 
> whole behavior of if you declare a variable :
>
>$_SESSION['username'] = "Mark"
>
>
>then you can just write $username instead of $_SESSION["username"] to 
> access the session variable is because of magic_quotes_gpc?
>
>
> Thanks in advance,
> Mk
>
> 

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



Re: [PHP] Simultaneous post/get?

2006-06-12 Thread Lowell Allen

On Jun 12, 2006, at 8:02 AM, tedd wrote:

[snip]




Form...

onsubmit="document.getElementById('waitimg').style.display =

'block'; return true;">


Bingo!

That works slick ! While I *think* I know css, it would have taken 
me a long while before I would have turned to css to solve this.


I recall trying this (exactly this I think) a couple months ago and 
finding that it works in most browsers, but not in Windows IE6 (of 
course). Is it working in Windows IE6 for you?


I got a working upload progress bar by using Uber Uploader 
.


--
Lowell Allen



Lowell:

I don't do windows, I'm a mac guy.


Me too, but Windows IE has so many problems I find it necessary to also 
have a Windows system to check things.


However, I do have a BrowserCam account and on remote access under 
W2K, IE6 the page did show the animated gif, so it looks like it 
works. But, BrowserCam didn't have an image to upload so I couldn't 
test the complete operation. I suspect it works as wanted.


Hey, all I'm saying is that my test of something very similar did not 
work in Windows IE6.


--
Lowell Allen

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



Re: [PHP] magic_quotes_gpc? Session variables

2006-06-12 Thread tedd
At 8:08 AM -0400 6/12/06, Mk wrote:
>Hey gang,
>
>   I was having the weirdest problems when I decided to update the code for my 
> site(written in PHP) last modified over a year ago.  The code ran fine under 
> my home development system, but on the hosting machine(1and1.com), my code 
> would break.  Horribly.
>
>   I narrowed the problem to this -  If I have a variable in $_SESSION(for 
> example, 'username') and in my page, I declare a variable (for example 
> '$username="guest"'), I've effectively accessed and overwritten the session 
> variable.   It's been over a year, but I believe this is due to 
> magic_quotes_gpc flag being 1 or something - I checked with my host's phpinfo 
> page and it is set to 1.
>
>   My question is(before I send my host an e-mail to ask them to turn it off 
> for my site) is, magic_quotes_gpc IS the culprit, right?  I mean the whole 
> behavior of if you declare a variable :
>
>   $_SESSION['username'] = "Mark"
>
>   then you can just write $username instead of $_SESSION["username"] to 
> access the session variable is because of magic_quotes_gpc?
>
>Thanks in advance,
>Mk

Mk:

I believe that "magic_quotes_gpc" doesn't have anything to do with your problem.

If you want, you can read about "magic_quotes_gpc" here:

http://us3.php.net/magic_quotes

Back to your problem -- place this at the start of your code:

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] Video compression with php?

2006-06-12 Thread Merlin

Hi there,

I am searching for a way to convert video during an upload
to a flash format including compression. Is there any php module
which does something like that? I know that there is a lot out there
for images, but for videos?

Thank you for any hint,

Merlin

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



Re: [PHP] Re: How to re-order an array

2006-06-12 Thread Rafael

jekillen wrote:
[···]
Well, I asked you for the actual (JS) code you're using (the one 
that didn't work in all the intended browsers), that way someone might 
be able to help you (I will if I can)


Array.push(), Array.pop(), Array.shift(), Array.unshift().


	Ok, so what are your intended browsers?  According to what I found, 
these functions are part of ECMAS 3 standard, and are available in FF 
1.0, Netscape 4, e IE 5.5 (unshift until IE 6) --as always, M$ gives the 
problems.


You might try to implement them yourself, such as...
  // "object detection" for shift function
  if ( undefined == Array.prototype.shift ) {
Array.prototype.shift = function( ) {
  var  val = this[0];
  for ( var  i = 0;  i < this.length - 1;  i ++ ) {
this[i] = this[i + 1];
  }
  this.length --;
  return  val;
} // shift()
  }
  // "object detection" for unshift function
  if ( undefined == Array.prototype.unshift ) {
Array.prototype.unshift = function( ) {
  var  args = arguments,
   len  = this.length + args.length;
  this.length = len;
  for ( var  i = len - 1;  i >= args.length;  i -- ) {
this[i] = this[i - args.length];
  }
  for ( i = 0;  i < args.length;  i ++ ) {
this[i] = args[i];
  }
} // unshift()
  }

  var  x = new Array( 'z', 'b', 'c', 'd' ),
   y = null;
  document.write("→ "+ x.toString() +"\n");
  y = x.shift();
  x.unshift('A', 'a');
  document.write("⇒ "+ y +" ⇒ ["+ x.toString() +"]");

Note: tested only in Fx 1.5.0.3 (as _shift & _unshift) with secuential
  arrays (and not associative/hash arrays)

I thought that if I used Ajax, php could use its push and pop, shift and 
unshift functions, but not all browsers support the asymetric requests.


	Well, that seems too complex to solve your problem, but if you want to 
try it, you may use the same "object detection" above and implement 
those methods with PHP (e.g. unshift in IE 5.5, or all of the functions 
you mentioned in IE 5.0)


I do screen in the server. But I force the user to have javascript 
enabled and force the form to submit using javascipt, and have a unique 
id as a javascript variable
that is sent along with the form in a hidden field to identify the 
source of the form data. I never use get requests unless they are 
appended to anchor tags, even
in  forms that are not processed by the server (I.E. running javascript 
code with user supplied arguments to functions via form fields, in which 
case an action attribute

isn't even necessary, and like wise a post or get method).


	It's basically the same problem, you shouldn't rely on javascript for 
your page to actually do something.  If I don't have JS enabled (for 
whatever the reason) I won't be able to do anything on it.  JS should be 
used only to _add or complement_ functionality.

--
Atentamente / Sincerely,
J. Rafael Salazar Magaña

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



[PHP] Re: Video compression with php?

2006-06-12 Thread Barry

Merlin schrieb:

Hi there,

I am searching for a way to convert video during an upload
to a flash format including compression. Is there any php module
which does something like that? I know that there is a lot out there
for images, but for videos?

Thank you for any hint,

Merlin

google is your friend ;)

www.google.com

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Video compression with php?

2006-06-12 Thread Rabin Vincent

On 6/12/06, Merlin <[EMAIL PROTECTED]> wrote:

I am searching for a way to convert video during an upload
to a flash format including compression. Is there any php module
which does something like that? I know that there is a lot out there
for images, but for videos?


Look into ffmpeg. I think it also has a PHP extension.

Rabin

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



Re: Re: [PHP] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Mario Pavlov
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>
>I'ts been awhile, but try the above.
>
>--
>Anthony Ettinger
>Signature: http://chovy.dyndns.org/hcard.html


nope
it doesn't work like this
still the same result
I think the problem is in the way that I'm accessing the elements
how exactly this should be done ?... 

-
http://www.sportni.bg/worldcup/ - Германия 2006 - Световното първенство по 
футбол наближава!

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



Re: [PHP] Video compression with php?

2006-06-12 Thread Merlin

Rabin Vincent schrieb:

On 6/12/06, Merlin <[EMAIL PROTECTED]> wrote:

I am searching for a way to convert video during an upload
to a flash format including compression. Is there any php module
which does something like that? I know that there is a lot out there
for images, but for videos?


Look into ffmpeg. I think it also has a PHP extension.

Rabin


Hello Rabin,

yes you are right there is a php extension for ffmpeg. However as I 
learned from their sourceforge page is, that this sw does only enable 
one to get snapshots out of a video, but not to convert and compress 
ist. What I am looking for is a software which does compress a video and 
encodes it into flash 8 format for streaming purpose. In a way like 
youtube does it.


Any ideas?

Thanks, Merlin

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



Re: [PHP] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Rob Richards

Mario Pavlov wrote:


nope
it doesn't work like this
still the same result
I think the problem is in the way that I'm accessing the elements
how exactly this should be done ?... 


Its due to default namespaces in the feed. The item elements and its 
child elements are in the default namespace: 
http://my.netscape.com/rdf/simple/0.9/


You need to declare this namespace with a prefix in order to access the 
elements within the stylesheet (same as using XPath).


i.e. the following stylesheet uses the prefix rdf9 for that namespace.


http://www.w3.org/1999/XSL/Transform";
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xmlns:rdf9="http://my.netscape.com/rdf/simple/0.9/";>



 
  

  
  


  
  

  
  



Rob

--
[EMAIL PROTECTED]
author of Pro PHP XML and Web Services from Apress

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



[PHP] checking if any values in one array are in another

2006-06-12 Thread blackwater dev

Is there a single php function that will tell me if any values in one array
are in another without looping through one of the arrays and doing in_array?

Thanks!


RE: [PHP] checking if any values in one array are in another

2006-06-12 Thread Jay Blanchard
[snip]
Is there a single php function that will tell me if any values in one
array
are in another without looping through one of the arrays and doing
in_array?
[/snip]

You have read http://www.php.net/array right? 
http://www.php.net/manual/en/function.array-intersect-assoc.php

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



[PHP] php->html "rendering"

2006-06-12 Thread Ryan A
Hey all,

heres the short explanation of what I am supposed to
do,
I need to render/convert  the entire site to normal
html pages so that it can be loaded onto a cd and
given out.

The good news is that the whole site has not yet been
built so i can start from the ground up.

I have a few ideas on how this can be done, ie the
rendering php-html, but other than that...am pretty
much lost.

Does any class program exist that can help me do this?

Ideas, input, linksanything, would be greatly
appreciated.

Thanks!
Ryan

P.S: If needed I can write a MUCH longer explanation
detailing the site

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Dave Goodchild

On 12/06/06, Ryan A <[EMAIL PROTECTED]> wrote:


Hey all,

heres the short explanation of what I am supposed to
do,
I need to render/convert  the entire site to normal
html pages so that it can be loaded onto a cd and
given out.

The good news is that the whole site has not yet been
built so i can start from the ground up.

I have a few ideas on how this can be done, ie the
rendering php-html, but other than that...am pretty
much lost.

Does any class program exist that can help me do this?

Ideas, input, linksanything, would be greatly
appreciated.

Thanks!
Ryan

Yes, please write a longer explanation - not sure what you mean. You need
to convert and entire site that has not been built yet into simple html
pages. Build the site with html?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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





--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk?page_id=5


Re: [PHP] php->html "rendering"

2006-06-12 Thread Stut

Ryan A wrote:

heres the short explanation of what I am supposed to
do,
I need to render/convert  the entire site to normal
html pages so that it can be loaded onto a cd and
given out.

The good news is that the whole site has not yet been
built so i can start from the ground up.

I have a few ideas on how this can be done, ie the
rendering php-html, but other than that...am pretty
much lost.

Does any class program exist that can help me do this?

Ideas, input, linksanything, would be greatly
appreciated.
  


You want something like wget, but I'm not sure how well it copes with 
querystrings and the like. You will also have problems if the site uses 
cookies or sessions.


If I were starting from scratch I would make sure I had nice URLs that 
didn't contain query strings.


I do know there are a number of apps out there that can build a CD with 
the actual application on it - so it runs a local web server and 
actually executes the PHP from the CD. Google for it. Dunno how good 
they are tho.


Hope that helped.

-Stut

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



Re: [PHP] checking if any values in one array are in another

2006-06-12 Thread Jochem Maas
Jay Blanchard wrote:
> [snip]
> Is there a single php function that will tell me if any values in one
> array
> are in another without looping through one of the arrays and doing
> in_array?
> [/snip]
> 
> You have read http://www.php.net/array right? 

rtm? thats for wimps ;-)

> http://www.php.net/manual/en/function.array-intersect-assoc.php

there is also:

http://www.php.net/manual/en/function.array-intersect.php

for pure value intersection, and this:

http://www.php.net/manual/en/function.array-intersect.php

for pure key intersection.
and then there are a host of similar funcs that use user defined callbacks to
perform the comparison for whether keys &/or are values are considered the
same.



> 

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A



> > Hey all,
> >
> > heres the short explanation of what I am supposed
> to
> > do,
> > I need to render/convert  the entire site to
> normal
> > html pages so that it can be loaded onto a cd and
> > given out.
> >
> > The good news is that the whole site has not yet
> been
> > built so i can start from the ground up.
> >
> > I have a few ideas on how this can be done, ie the
> > rendering php-html, but other than that...am
> pretty
> > much lost.
> >
> > Does any class program exist that can help me do
> this?
> >
> > Ideas, input, linksanything, would be greatly
> > appreciated.
> >
> > Thanks!
> > Ryan
> >
> > Yes, please write a longer explanation - not sure
> what you mean. You need
> > to convert and entire site that has not been built
> yet into simple html
> > pages. Build the site with html?



Hi,
Ok, heres the longer explanation.

(slightly simplified as there are not graphics to show
you EXACTLY the entire design.)


Picture a 100%/100% (widht & height) table with a
header sell, a left cell, middle (this cell will
display the main data) right cell and a bottom cell.

\\\ This is the design template. ///

The top cell will contain a header graphic which keeps
changing depending on the section (eg: contact, home,
products)

The left cell is for a navigation menu, which is
around 20 items and each has a submenu with around 6
pages.
Depending on the page and the left cell, on the right
cell you have options to download wmv files and pdf
files.

The center cell is for displaying the main text and
images.

The bottom cell is just like the top cell.


So far this has been built just with html pages, but
now they want to convert this into a php/mysql app so
changing designs etc wont be a problem in future.





Questions? please tell me if I forgot to mention
anything.


@Stut, if there are reliable programs that would run
off a cd that allows me to do the aboveit would be
absolutely fantastic, thanks for the tip, will search
google

Anybody have any experiece with one of these things
that run off the CD like Stut mentioned, *please* drop
me a line, I would really appreciate it. 

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Session puzzle... / why no new session?

2006-06-12 Thread Eric Butera

On 6/9/06, Ryan A <[EMAIL PROTECTED]> wrote:

ini_set('session.name', 'COSTREAM_SESSION');


Check out
http://us2.php.net/manual/en/function.session-name.php

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



RE: [PHP] php->html "rendering"

2006-06-12 Thread Brady Mitchell
> -Original Message-
> I need to render/convert  the entire site to normal
> html pages so that it can be loaded onto a cd and
> given out.
> 
> Does any class program exist that can help me do this?

Save yourself a lot of work and use HTTrack.

http://www.httrack.com/


Brady

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



[PHP] Convert PHP to javascript

2006-06-12 Thread Mantas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi there,

Could someone help me to convert this snippet of PHP code to JavaScript?

', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
);
$b91_dectab = array_flip($b91_enctab);

function base91_decode($d)
{
global $b91_dectab;
$l = strlen($d);
$v = -1;
for ($i = 0; $i < $l; ++$i) {
$c = $b91_dectab[$d{$i}];
if (!isset($c))
continue;
if ($v < 0)
$v = $c;
else {
$v += $c * 91;
$b |= $v << $n;
$n += ($v & 8191) > 88 ? 13 : 14;
do {
$o .= chr($b & 255);
$b >>= 8;
$n -= 8;
} while ($n > 7);
$v = -1;
}
}
if ($v + 1)
$o .= chr(($b | $v << $n) & 255);
return $o;
}

function base91_encode($d)
{
global $b91_enctab;
$l = strlen($d);
for ($i = 0; $i < $l; ++$i) {
$b |= ord($d{$i}) << $n;
$n += 8;
if ($n > 13) {
$v = $b & 8191;
if ($v > 88) {
$b >>= 13;
$n -= 13;
} else {
$v = $b & 16383;
$b >>= 14;
$n -= 14;
}
$o .= $b91_enctab[$v % 91] . $b91_enctab[$v / 91];
}
}
if ($n) {
$o .= $b91_enctab[$b % 91];
if ($n > 7 || $b > 90)
$o .= $b91_enctab[$b / 91];
}
return $o;
}
?>

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.4-svn4127: (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRI2eYd0PBLoNJrhBAQizKQf9H/pSloR7F/nV4Kjh7Rr97MoS/3+jrdnz
SEsk0qk6Qp09Q6ZFEYG7Y8WddtYOkK9gSB4OvuYpqPfX+IgZTrMjrobbmjTnifmB
O73OO992mkKTfX/tEF5hSIOa++i+0pmJK+sAH0LhntSsdMokB7hydbfYvvXX0jl/
ALhi8H97psjdmHdaWpP0cmqndncaOJFKhaiPD3ZmFpkwrOEPvuRMmb4aVIrnw+gb
Gfewd2l/prEPXoO0iaVB8cH2v21DDjpOaW1WoBho1Mb5pHMP7byyenfv4zSeBmrL
HHN1x+EyCe6uDoU1TOOcwdVOS0X/4e6lmwMUkCyp/YkhEPsiqSnKQg==
=Ef4F
-END PGP SIGNATURE-

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



RE: [PHP] Convert PHP to javascript

2006-06-12 Thread Brady Mitchell
> -Original Message-
> Could someone help me to convert this snippet of PHP code to 
> JavaScript?

If by "help me" you mean "do it for me" than I can tell you that nobody
is going to do it.  Start working on it, and ask questions when you get
stuck, we're here to help, not do your job

Brady

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



RE: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A


--- Brady Mitchell <[EMAIL PROTECTED]> wrote:

> > -Original Message-
> > I need to render/convert  the entire site to
> normal
> > html pages so that it can be loaded onto a cd and
> > given out.
> > 
> > Does any class program exist that can help me do
> this?


 
> Save yourself a lot of work and use HTTrack.
> 
> http://www.httrack.com/


Very very interesting, thank you!

If you have tried this and have downloaded dynamic
pages/sites (eg: PHP pages) please tell me if you had
any link problems from one page to another.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: [PHP] php->html "rendering"

2006-06-12 Thread Brady Mitchell
> -Original Message-
> > Save yourself a lot of work and use HTTrack.
> > 
> > http://www.httrack.com/
> 
> 
> Very very interesting, thank you!
> 
> If you have tried this and have downloaded dynamic
> pages/sites (eg: PHP pages) please tell me if you had
> any link problems from one page to another.

I've used this program to download dynamic websites for presentations
and have never had problems with links.  Of course, I always suggest
testing before trying to use something in any kind of presentation.

It probably wouldn't hurt to use something like Xenu Link Sleuth (
http://home.snafu.de/tilman/xenulink.html ) to check the links, but as I
said, I've never had a problem.

Brady

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Larry Garfield
wget -m -k http://www.yoursite.com/

Cheers. :-)

-- 
Larry Garfield

On Mon, June 12, 2006 10:54 am, Ryan A said:
> Hey all,
>
> heres the short explanation of what I am supposed to
> do,
> I need to render/convert  the entire site to normal
> html pages so that it can be loaded onto a cd and
> given out.
>
> The good news is that the whole site has not yet been
> built so i can start from the ground up.
>
> I have a few ideas on how this can be done, ie the
> rendering php-html, but other than that...am pretty
> much lost.
>
> Does any class program exist that can help me do this?
>
> Ideas, input, linksanything, would be greatly
> appreciated.
>
> Thanks!
> Ryan
>
> P.S: If needed I can write a MUCH longer explanation
> detailing the site

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



[PHP] [Announcement] Sparse 1.04b released

2006-06-12 Thread Daniel Orner
	A new version of Sparse, my framework for creating MySQL programs 
without all that programming, has been released. We're getting close to 
having all the features I really think it needs... after that it'd just 
be window dressing. Unless someone has some more suggestions!


--Daniel
--
Sparse - a new way to write MySQL-based programs with little to no 
actual programming. Save yourself time and effort!

http://sparse-php.sourceforge.net/

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A
Hi,

Thanks for the suggestion, I am not too familier with
wget but (correct me if i am wrong) wont wget just get
the output from the pages ignoreing the links?

Thanks!
Ryan

--- Larry Garfield <[EMAIL PROTECTED]> wrote:

> wget -m -k http://www.yoursite.com/
> 
> Cheers. :-)
> 
> -- 
> Larry Garfield
> 
> On Mon, June 12, 2006 10:54 am, Ryan A said:
> > Hey all,
> >
> > heres the short explanation of what I am supposed
> to
> > do,
> > I need to render/convert  the entire site to
> normal
> > html pages so that it can be loaded onto a cd and
> > given out.
> >
> > The good news is that the whole site has not yet
> been
> > built so i can start from the ground up.
> >
> > I have a few ideas on how this can be done, ie the
> > rendering php-html, but other than that...am
> pretty
> > much lost.
> >
> > Does any class program exist that can help me do
> this?
> >
> > Ideas, input, linksanything, would be greatly
> > appreciated.
> >
> > Thanks!
> > Ryan
> >
> > P.S: If needed I can write a MUCH longer
> explanation
> > detailing the site
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A
Quick question;

If the site is updated with new pages/links is there
anyway of specifying to HTTrack to get just the new
pages or does it get the whole site again?

Reason I ask is they are going to have a s**tload of
pages...maybe 4k or pages

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Satyam
Sorry if I am completely off the mark with this sugestion.   You can set a 
full bootable LAMP system on a CD.  If doing a demo is what you want, this 
would allow you to make a full bootable demo that does not install anything 
in the host machine and is completely dynamic.  These systems allow you to 
mount a ramdisk where you can copy small databases, if you want to allow for 
updates (completely volatile, for sure, but they are good enough for a demo, 
while you don't boot, they really work).  Except for the volatility of the 
database, it would be the very real thing.


Satyam

- Original Message - 
From: "Ryan A" <[EMAIL PROTECTED]>
To: "Brady Mitchell" <[EMAIL PROTECTED]>; "php php" 


Sent: Monday, June 12, 2006 8:09 PM
Subject: RE: [PHP] php->html "rendering"



Quick question;

If the site is updated with new pages/links is there
anyway of specifying to HTTrack to get just the new
pages or does it get the whole site again?

Reason I ask is they are going to have a s**tload of
pages...maybe 4k or pages

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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




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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A
Hi Satyam,
Totally off the mark :-)
thanks for writing though.

The site (which later to be copied onto cd) is not for
demo purposes but to distribute to schools, (children
and people wanting to learn Swedish) its a govt
sponsored project so the site and the CDs should/will
be free.

Cheers,
Ryan

--- Satyam <[EMAIL PROTECTED]> wrote:

> Sorry if I am completely off the mark with this
> sugestion.   You can set a 
> full bootable LAMP system on a CD.  If doing a demo
> is what you want, this 
> would allow you to make a full bootable demo that
> does not install anything 
> in the host machine and is completely dynamic. 
> These systems allow you to 
> mount a ramdisk where you can copy small databases,
> if you want to allow for 
> updates (completely volatile, for sure, but they are
> good enough for a demo, 
> while you don't boot, they really work).  Except for
> the volatility of the 
> database, it would be the very real thing.
> 
> Satyam
> 
> - Original Message - 
> From: "Ryan A" <[EMAIL PROTECTED]>
> To: "Brady Mitchell" <[EMAIL PROTECTED]>; "php php"
> 
> 
> Sent: Monday, June 12, 2006 8:09 PM
> Subject: RE: [PHP] php->html "rendering"
> 
> 
> > Quick question;
> >
> > If the site is updated with new pages/links is
> there
> > anyway of specifying to HTTrack to get just the
> new
> > pages or does it get the whole site again?
> >
> > Reason I ask is they are going to have a s**tload
> of
> > pages...maybe 4k or pages
> >
> > Thanks!
> > Ryan
> >
> > --
> > - The faulty interface lies between the chair and
> the keyboard.
> > - Creativity is great, but plagiarism is faster!
> > - Smile, everyone loves a moron. :-)
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> > 
> 
> 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Richard Lynch

You have just described what wget does...


On Mon, June 12, 2006 10:54 am, Ryan A wrote:
> Hey all,
>
> heres the short explanation of what I am supposed to
> do,
> I need to render/convert  the entire site to normal
> html pages so that it can be loaded onto a cd and
> given out.
>
> The good news is that the whole site has not yet been
> built so i can start from the ground up.
>
> I have a few ideas on how this can be done, ie the
> rendering php-html, but other than that...am pretty
> much lost.
>
> Does any class program exist that can help me do this?
>
> Ideas, input, linksanything, would be greatly
> appreciated.
>
> Thanks!
> Ryan
>
> P.S: If needed I can write a MUCH longer explanation
> detailing the site
>
> --
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

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



Re: [PHP] Video compression with php?

2006-06-12 Thread Richard Lynch
On Mon, June 12, 2006 8:59 am, Merlin wrote:
> I am searching for a way to convert video during an upload
> to a flash format including compression. Is there any php module
> which does something like that? I know that there is a lot out there
> for images, but for videos?

Find a program that does the conversion, and http://php.net/exec it.

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

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



Re: [PHP] Re: magic_quotes_gpc? Session variables

2006-06-12 Thread Richard Lynch
On Mon, June 12, 2006 7:22 am, João Cândido de Souza Neto wrote:
> "Mk" <[EMAIL PROTECTED]> escreveu na mensagem
> news:[EMAIL PROTECTED]
>> Hey gang,
>>
>>I was having the weirdest problems when I decided to update the
>> code
>> for my site(written in PHP) last modified over a year ago.  The code
>> ran
>> fine under my home development system, but on the hosting
>> machine(1and1.com), my code would break.  Horribly.
>>
>>I narrowed the problem to this -  If I have a variable in
>> $_SESSION(for
>> example, 'username') and in my page, I declare a variable (for
>> example
>> '$username="guest"'), I've effectively accessed and overwritten the
>> session variable.   It's been over a year, but I believe this is due
>> to
>> magic_quotes_gpc flag being 1 or something - I checked with my
>> host's
>> phpinfo page and it is set to 1.
>>
>>My question is(before I send my host an e-mail to ask them to
>> turn it
>> off for my site) is, magic_quotes_gpc IS the culprit, right?  I mean
>> the
>> whole behavior of if you declare a variable :
>>
>>$_SESSION['username'] = "Mark"
>>
>>
>>then you can just write $username instead of
>> $_SESSION["username"] to
>> access the session variable is because of magic_quotes_gpc?

There was a bug in some release or othere where $_SESSION strings were
somehow being "leaked" into PHP userland space as "string references"
-- which aren't even defined in PHP userland, but that's what they
were.

magic_quotes_gpc on/off would probably not help, as the bug went more
like this:

$foo = $_SESSION['foo']; //$foo is now a REFERENCE to the session data.
.
.
.
$foo = 42; //$_SESSION['foo'] just got changed

Your webhost needs to upgrade, if they are running this old buggy
version...

Turning OFF register_globals *MIGHT* "fix" it, in that the bug could
have been triggered solely by register_globals being "ON"...

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

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



Re: [PHP] Video compression with php?

2006-06-12 Thread Rabin Vincent

On 6/12/06, Merlin <[EMAIL PROTECTED]> wrote:

yes you are right there is a php extension for ffmpeg. However as I
learned from their sourceforge page is, that this sw does only enable
one to get snapshots out of a video, but not to convert and compress
ist. What I am looking for is a software which does compress a video and
encodes it into flash 8 format for streaming purpose. In a way like
youtube does it.

Any ideas?


Well, the php extension may not support it, but ffmpeg
can do the conversion. Just exec() the command line
from your php script.

Google: ffmpeg flv

Rabin

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



Re: [PHP] popen and pclose. Something changed in 4.4.2 !

2006-06-12 Thread Richard Lynch


I can only suggest you change the "default" settings on the MS-DOS
application thingie...

Right-click the MS-DOS icon in the Start menu, mess with settings like
"run in background" etc.

I suspect that it is a configuration of MS-DOS window issue, and has
nothing to do with PHP.

On Mon, June 12, 2006 3:09 am, Venkatesh M. S. wrote:
> Greetings!
>
> I was using popen and pclose on a previous version of PHP on Windows
> with an
> older version of Apache (2.x). ( I think it was 4.4.1 but will need to
> check
> as i am not sure).
>
> pclose(popen("start " . $exe . " " . $args, "r"))
>
> Where $exe is my path to the batch file and $args are the arguments
> for the
> batch file. The batch file, in turn calls other batch files on a
> shared
> folder on a different PC
>
> On Windows, it would open up the dos window and run commands there and
> exit
> and the PHP script that called the pclose would terminate loading on
> the
> users' browsers.
>
> Now, with PHP 4.4.2, the pclose and popen send the tasks to the
> background
> and the dos window does not show up! As a result, killing the dos
> process is
> not possible (i get access denied in windows...) and the users cannot
> see
> the dos window when it runs.
>
> I would like the php script to send the commands to a dos window, and
> the
> php script to finish executing. I tried passthru, system, exec and
> proc_open... and none of them work. None of them bring up the dos
> window.
>
> Please help!
>
>
> Regards
>
>
> Venkat
>


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

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A
 
> You have just described what wget does...


Oookayyy, and thats the cue for Ryan old boy to
start reading up on "wget" :-)
never used wget before...

Will google for it, in the meantime if anybody wants
to send me links (even RTFMs) would appreciate it.

Thanks!
Ryan


 
> 
> On Mon, June 12, 2006 10:54 am, Ryan A wrote:
> > Hey all,
> >
> > heres the short explanation of what I am supposed
> to
> > do,
> > I need to render/convert  the entire site to
> normal
> > html pages so that it can be loaded onto a cd and
> > given out.
> >
> > The good news is that the whole site has not yet
> been
> > built so i can start from the ground up.
> >
> > I have a few ideas on how this can be done, ie the
> > rendering php-html, but other than that...am
> pretty
> > much lost.
> >
> > Does any class program exist that can help me do
> this?
> >
> > Ideas, input, linksanything, would be greatly
> > appreciated.
> >
> > Thanks!
> > Ryan
> >
> > P.S: If needed I can write a MUCH longer
> explanation
> > detailing the site
> >
> > --
> > - The faulty interface lies between the chair and
> the keyboard.
> > - Creativity is great, but plagiarism is faster!
> > - Smile, everyone loves a moron. :-)
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> Like Music?
> http://l-i-e.com/artists.htm
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] remove keys from array

2006-06-12 Thread Richard Lynch
On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
> hi all
> when i have array in the form of :
> Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
> how can i make it in the form of :
> Array ( [ID] => 2 [CategoryName] => asdasd ) )
>
> can anyone help me with that plz ?


I don't even understand the question...

Where did this array come from?


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

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



Re: [PHP] Curio

2006-06-12 Thread Richard Lynch
On Sat, June 10, 2006 5:31 am, Dave Goodchild wrote:
> Just a question out of curiousity for the language lawyers out there.
> Why is
> it illegal to begin a variable name with a number in php?

Because Rasmus wrote that bit on a Tuesday. :-)

It's a pretty common requirement, actually.

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

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



Re: [PHP] How to tell if a socket is connected

2006-06-12 Thread Richard Lynch


Maybe just try to read from it???

On Fri, June 9, 2006 10:56 pm, Michael W. wrote:
> Hello,
>   Can any of you tell me how to tell whether a socket (from
> fsockopen()) is
> connected or not? Specifically, whether the remote server has closed
> the
> connection? Stream_get_meta_data() does not do it; in my tests, its
> output
> does not change even when the server closes the stream.
>
> Thank you,
> Michael W.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

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



Re: [PHP] remove keys from array

2006-06-12 Thread tg-php
Crap.. I remember seeing an example of something that yielded arrays like this 
and now I can't find it.

It basically created an array (from a database I thought.. but can't find the 
example under mysql_fetch_assoc or mysql_fetch_array... thought it was in the 
standard PHP documentation (not the user comments).

Anyway, it looked just like this.

first array element key = "ID" and value = "2"
second array element key = "CategoryName" and value = "asdasd"

But you ended up with an array that merged an associative array and a regular 
indexed array.

So you get, in addition to the above, a 0 = 2 and 1 = asdasd.


Looks like he wants just the associative side of it.. not the indexed.

-TG

= = = Original message = = =

On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
> hi all
> when i have array in the form of :
> Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
> how can i make it in the form of :
> Array ( [ID] => 2 [CategoryName] => asdasd ) )
>
> can anyone help me with that plz ?


I don't even understand the question...

Where did this array come from?


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] remove keys from array

2006-06-12 Thread afan
This looks to me as printet result array from database:

$query = mysql_query("select * from table");
$result = mysql_fetch_array($query);
if you
print_r($result);
you'll get "doubled" values.
use
$result = mysql_fetch_array($query, MYSQL_ASSOC);
for "singles"

check: http://us2.php.net/manual/en/function.mysql-fetch-array.php

-afan



> Crap.. I remember seeing an example of something that yielded arrays like
> this and now I can't find it.
>
> It basically created an array (from a database I thought.. but can't find
> the example under mysql_fetch_assoc or mysql_fetch_array... thought it was
> in the standard PHP documentation (not the user comments).
>
> Anyway, it looked just like this.
>
> first array element key = "ID" and value = "2"
> second array element key = "CategoryName" and value = "asdasd"
>
> But you ended up with an array that merged an associative array and a
> regular indexed array.
>
> So you get, in addition to the above, a 0 = 2 and 1 = asdasd.
>
>
> Looks like he wants just the associative side of it.. not the indexed.
>
> -TG
>
> = = = Original message = = =
>
> On Sun, June 11, 2006 6:57 am, Ahmed Abdel-Aliem wrote:
>> hi all
>> when i have array in the form of :
>> Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
>> how can i make it in the form of :
>> Array ( [ID] => 2 [CategoryName] => asdasd ) )
>>
>> can anyone help me with that plz ?
>
>
> I don't even understand the question...
>
> Where did this array come from?
>
>
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: Re: [PHP] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Mario Pavlov
 >Mario Pavlov wrote:
 >
 >> nope
 >> it doesn't work like this
 >> still the same result
 >> I think the problem is in the way that I'm accessing the elements
 >> how exactly this should be done ?... 
 >
 >Its due to default namespaces in the feed. The item elements and its 
 >child elements are in the default namespace: 
 >http://my.netscape.com/rdf/simple/0.9/
 >
 >You need to declare this namespace with a prefix in order to access the 
 >elements within the stylesheet (same as using XPath).
 >
 >i.e. the following stylesheet uses the prefix rdf9 for that namespace.
 >
 >
 >xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
 >xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
 >xmlns:rdf9="http://my.netscape.com/rdf/simple/0.9/";>
 >
 >
 >
 >  
 >   
 > 
 >   
 >   
 > 
 > 
 >   
 >   
 > 
 >   
 >   
 >
 >
 >
 >Rob
 >
 >-- 
 >[EMAIL PROTECTED]
 >author of Pro PHP XML and Web Services from Apress
 >

thank you man!! :)
I can't believe it, it just WORKS :)
thank you very much!
it took me about a week ...
thank you again! :)
god bless you :)

-
http://www.sportni.bg/worldcup/ - Германия 2006 - Световното първенство по 
футбол наближава!

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



Re: [PHP] better way to create custom text file from query results?

2006-06-12 Thread Richard Lynch

Yes, this is in the PHP FAQ.

Plus, you could name them like:
name="fieldname[1]" and then you could just iterate through
$_POST['fieldname'] which would be even cleaner.


On Wed, June 7, 2006 7:21 am, Ben Liu wrote:
> Hello All,
>
> I've written a clunky script that presents a form to a user with 30
> checkboxes on it to match 30 fields in a table. The user checks off
> each field they want to appear in a text file produced by the script.
> The script I wrote captures each checkbox response to a separate
> variable:
>
> $fieldname1=$_POST['fieldname1'];
> $fieldname2=$_POST['fieldname2'];
>
> etc...
>
> I then build a custom query based on those variables using 30 logic
> statements like such:
>
> if ($fieldname1) $query .="fieldname1, ";
> if ($fieldname2) $query .="fieldname2, ";
>
> etc...
>
> I then query the DB and iterate over the results, shoving the data
> into an output variable like this (again 30 logic statements):
>
> if ($fieldname1) $output.="$row[fieldname1]\t";
> if ($fieldname2) $output.="$row[fieldname2]\t";
>
> then I print the contents of $output to a text file.
>
> It seems that there has to be a better way of doing this. Can the
> $_POST superglobal be manipulated in this way:
>
> foreach ($_POST as $fieldname) ?
>
> Thanks for any help and guidance.
>
> - Ben


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

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



Re: [PHP] Introductory message

2006-06-12 Thread Richard Lynch
On Wed, June 7, 2006 7:33 pm, Ligaya Turmelle wrote:
> Thought we were going to add the "Security" subsection to the "Where
> to
> Find More Information" section of the NEWBIE email.  Wasn't it
> supposed
> to include a link to the manuals security area as well as the phpsec
> site?

+1

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

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



Re: [PHP] generating/transforming HTML so that it 'works' in a flash file

2006-06-12 Thread Richard Lynch


I suspect the first question would be if Flash people have bothered to
document what HTML subset they support.

And second is, wouldn't you have a lot more luck in a Flash forum?...

On Wed, June 7, 2006 11:22 am, Jochem Maas wrote:
> hi people,
>
> I've been STFW till I'm blue in the face (so lack of oxygen might be
> problem atm) but can't find any [decent] info on
> generating/transforming existing
> HTML so thats it's compatible with the subset of tags that are
> supported
> by Flash (apparently Flash has the ability to show something that
> resembles
> HTML in certain visual controls - I don't flash, I'm just responsible
> for
> supplying XML feeds that the flash site/file in question can consume).
>
> so the question does any know of a reliable resource on this subject
> and/or
> some code nugget that is capable of generating/transforming (x)HTML
> into
> the cruft that Flash is capable of displaying?
>
> any feedback is welcome (apart from 'STFW' - I'm already doing that
> :-P)
>
> rgds,
> Jochem
>
> ps - my server side stuff is all php (so I need to have an HTML
> 'converter'
> written in php too [preferably]) before someone hits me with the 'what
> does
> this has to do with php' response.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

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



RE: [PHP] Introductory message

2006-06-12 Thread Jay Blanchard
[snip]
> Thought we were going to add the "Security" subsection to the "Where
> to
> Find More Information" section of the NEWBIE email.  Wasn't it
> supposed
> to include a link to the manuals security area as well as the phpsec
> site?

+1
[/snip]

Send me the details and I'll make sure that they get added.

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



Re: [PHP] Curio

2006-06-12 Thread Satyam
- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>




On Sat, June 10, 2006 5:31 am, Dave Goodchild wrote:

Just a question out of curiousity for the language lawyers out there.
Why is
it illegal to begin a variable name with a number in php?


Because Rasmus wrote that bit on a Tuesday. :-)

It's a pretty common requirement, actually.

--


I guess that most current parsers would easily handle variable names 
starting with numbers, not just in PHP, though it might be confusing to 
users.   Floats with an exponent part (separated by an E or, in some cases, 
a D)  might be confused for variable names.  In some languages, numeric 
constants might have a suffix indicating the storage type (i.e: and L for 
long, or F for float) so there would be many rules of what is ok and what is 
not.  Simple rules with few exceptions prevents silly user mistakes.


Now, as for PHP, with variable names always preceded by $, we are actually 
dealing with the second character, but not always, we have constructs such 
as $abc, ${abc}, {$abc} and finally $$abc, the first three refering to the 
very same variable, the last one to the variable named in $abc.  In some of 
these cases there are symbols in between the $ and the variable name so it 
is not so simple as saying that the $ is the first character and and the 'a' 
(in these examples) is the second.


Then, there is the problem of heritage.   Many of PHP features are based on 
*nix shells, such as BASH where $1, $2,  have special meaning, but this 
does not apply to PHP.


So I guess the answer to the question of why is simply because it's the 
immemorial custom of the trade.  And I admit I never thought of doing 
otherwise.


Satyam 


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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Jochem Maas
Ryan A wrote:
> Hi,
> 
> Thanks for the suggestion, I am not too familier with
> wget but (correct me if i am wrong) wont wget just get
> the output from the pages ignoreing the links?

that's the default behaviour - but wget has about a zillion
parameters for controlling its behaviour, it's quite easy to scrap
a complete site in one call and change the file extension of
all files as you go (including the relevant links in the files
that are downloaded).

that said it could take a week to figure out all the
parameters. ;-)

> 
> Thanks!
> Ryan

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



[PHP] trapping fatal errors...?

2006-06-12 Thread Christopher J. Bottaro
Hello,
How can I trap a fatal error (like calling a non existant method, requiring
a non existant file, etc) and go to a user defined error handler?  I tried
set_error_handler(), but it seems to skip over the errors I care about.

Thanks for the help.

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Ryan A


--- Jochem Maas <[EMAIL PROTECTED]> wrote:

> Ryan A wrote:
> > Hi,
> > 
> > Thanks for the suggestion, I am not too familier
> with
> > wget but (correct me if i am wrong) wont wget just
> get
> > the output from the pages ignoreing the links?
> 
> that's the default behaviour - but wget has about a
> zillion
> parameters for controlling its behaviour, it's quite
> easy to scrap
> a complete site in one call and change the file
> extension of
> all files as you go (including the relevant links in
> the files
> that are downloaded).
> 
> that said it could take a week to figure out all the
> parameters. ;-)


Heck yeah... just been reading up on it... lots of
stuff, who would think one little four letter word
could do so much.oops, now thinking of another
four letter word without whichnone of us would be
here

;o)

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] Re: How to tell if a socket is connected

2006-06-12 Thread Adam Zey

Michael W. wrote:

Hello,
  Can any of you tell me how to tell whether a socket (from fsockopen()) is
connected or not? Specifically, whether the remote server has closed the
connection? Stream_get_meta_data() does not do it; in my tests, its output
does not change even when the server closes the stream.

Thank you,
Michael W.


If it is a network socket, and the remote end disconnected unexpectedly 
(which you MUST assume is a possibility), then the only way to find out 
if the connection is still open is by SENDING data. Just trying to read 
it won't cut it.


The thing to understand is that when a remote client/server disconnects, 
it normally safely closes the socket and notifies you. But an abrupt 
disconnection (Something crashes, loses connectivity, etc) sends no such 
thing. The only way to find out that a connection is really lost is to 
write some data and see if it times out or not.


Regards, Adam Zey.

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



[PHP] Re: trapping fatal errors...?

2006-06-12 Thread Adam Zey

Christopher J. Bottaro wrote:

Hello,
How can I trap a fatal error (like calling a non existant method, requiring
a non existant file, etc) and go to a user defined error handler?  I tried
set_error_handler(), but it seems to skip over the errors I care about.

Thanks for the help.


It is always safer to handle errors before they happen by checking that 
you're in a good state before you try to do something.


For example, nonexistent files can be handled by file_exists(). 
Undefined functions can be checked with function_exists().


Regards, Adam Zey.

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



[PHP] GD

2006-06-12 Thread Beauford
Hi,

I am trying to get GD working so I can use a captcha script and not having
much luck. I can get it to work in Windows, but not Linux. 

I have seen a few comments suggesting that PHP needs to be compiled with the
GD switch. Is there another way to do this? I have PHP, MySQL and Apache
installed and working great, I don't want to have to recompile PHP and have
it screw up everything just for one program. 

Any help is appreciated.

B

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



Re: [PHP] GD

2006-06-12 Thread Tom Ray [Lists]



Beauford wrote:

Hi,

I am trying to get GD working so I can use a captcha script and not having
much luck. I can get it to work in Windows, but not Linux. 


I have seen a few comments suggesting that PHP needs to be compiled with the
GD switch. Is there another way to do this? I have PHP, MySQL and Apache
installed and working great, I don't want to have to recompile PHP and have
it screw up everything just for one program. 


Any help is appreciated.

B

  
I would say this is more a GD issue than a PHP issue. Can you get GD to 
run from the command line?


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



[PHP] date_sunrise accuracy

2006-06-12 Thread KI
I posted this Thursday as a PHP bug: http://bugs.php.net/bug.php?id=37743

Basically this function is off by 2 minutes from the US & UK governments
calculations. While PHP is admitting there is a difference they are stating
I should live with it and "it's expected".  Does any one else not find this
acceptable?  What can be done to push PHP to correct this?

Thanks

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



Re: [PHP] GD

2006-06-12 Thread Ray Hauge
On Monday 12 June 2006 16:11, Beauford wrote:
> Hi,
>
> I am trying to get GD working so I can use a captcha script and not having
> much luck. I can get it to work in Windows, but not Linux.
>
> I have seen a few comments suggesting that PHP needs to be compiled with
> the GD switch. Is there another way to do this? I have PHP, MySQL and
> Apache installed and working great, I don't want to have to recompile PHP
> and have it screw up everything just for one program.
>
> Any help is appreciated.
>
> B

Depending on your Linux distribution, you might be able to find a GD module 
for PHP.  That way you don't have to re-compile PHP.  If you use an RPM based 
distro, this would be very easy.  Free-BSD you could just compile the port.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] call to pprofp not working for PHP APD

2006-06-12 Thread Chris

Ravi Jethwa wrote:

Hello,

 


I was wondering if somebody could provide some advice on where I might
be going wrong if I am receiving the following error:

 


"bash: /usr/bin/pprofp: /usr/local/bin/php: bad interpreter: No such
file or directory".


/usr/local/bin/php doesn't exist. Adjust the path and try again.

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

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



RE: [PHP] GD

2006-06-12 Thread Beauford
I'm using Slackware 10 and installed GD as an install package. I also
changed some lines in the php.ini file for GD.

Tom: I have no idea how this program works, all I know is that I need it for
the captcha program to display the image. I wouldn't even bother otherwise.

Thanks.

B

-Original Message-
From: Ray Hauge [mailto:[EMAIL PROTECTED] 
Sent: June 12, 2006 7:35 PM
To: php-general@lists.php.net
Cc: Beauford
Subject: Re: [PHP] GD

On Monday 12 June 2006 16:11, Beauford wrote:
> Hi,
>
> I am trying to get GD working so I can use a captcha script and not 
> having much luck. I can get it to work in Windows, but not Linux.
>
> I have seen a few comments suggesting that PHP needs to be compiled 
> with the GD switch. Is there another way to do this? I have PHP, MySQL 
> and Apache installed and working great, I don't want to have to 
> recompile PHP and have it screw up everything just for one program.
>
> Any help is appreciated.
>
> B

Depending on your Linux distribution, you might be able to find a GD module
for PHP.  That way you don't have to re-compile PHP.  If you use an RPM
based distro, this would be very easy.  Free-BSD you could just compile the
port.

--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] php->html "rendering"

2006-06-12 Thread Larry Garfield
On Monday 12 June 2006 17:08, Ryan A wrote:

> > that said it could take a week to figure out all the
> > parameters. ;-)
>
> Heck yeah... just been reading up on it... lots of
> stuff, who would think one little four letter word
> could do so much.oops, now thinking of another
> four letter word without whichnone of us would be
> here

That's why I included the switches I did. :-)  I had to do something very 
similar just last week.  I needed to make a static snapshot of a site we 
built for a client using a CMS, so everything was dynamic.  They needed a 
static snapshot to put on a laptop to take to a tradeshow.  wget, with a wee 
bit of sed massaging, did the trick quite well.

-m means "mirror".  That is, recurse to all links that don't leave the domain.  
It's for exactly this sort of task.

-k tells it to convert links.  That way if you have all absolute links in your 
HTML output, it will mutate them for you to stay within the local mirror 
you're creating.

If you have GET queries in your pages (we did), then I recommend also using:

--restrict-file-names=windows

That will tell it to convert any blah?foo=bar links into [EMAIL PROTECTED], 
since 
the first is not a valid filename in Windows.  I find that even on a Linux 
box, the latter works better.

So your full command would be

wget -m -k --restrict-file-names=windows http://www.example.com/

Start with that and see what you get, then refine as needed.  If it's a big 
site, you may also want to use the --wait and --random-wait switches to avoid 
causing the web server to flip out.

wget is one of those *nix command line utilities that's been around forever, 
does exactly one thing, but does it so amazingly well (once you realize how) 
that it renders about 50 commercial applications completely pointless. :-)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



[PHP] Re: How to tell if a socket is connected

2006-06-12 Thread Michael W.
Adam Zey wrote:

> Michael W. wrote:
>> Hello,
>>   Can any of you tell me how to tell whether a socket (from fsockopen())
>>   is
>> connected or not? Specifically, whether the remote server has closed the
>> connection? Stream_get_meta_data() does not do it; in my tests, its
>> output does not change even when the server closes the stream.
>> 
>> Thank you,
>> Michael W.
> 
> If it is a network socket, and the remote end disconnected unexpectedly
> (which you MUST assume is a possibility), then the only way to find out
> if the connection is still open is by SENDING data. Just trying to read
> it won't cut it.
> 
> The thing to understand is that when a remote client/server disconnects,
> it normally safely closes the socket and notifies you. But an abrupt
> disconnection (Something crashes, loses connectivity, etc) sends no such
> thing. The only way to find out that a connection is really lost is to
> write some data and see if it times out or not.
> 
> Regards, Adam Zey.

How can I tell whether the write timed out? Does fwrite() return false, or
do I have to check for the 'timed_out' flag in the return of
stream_get_meta_data()?

Thanks a lot,
Michael W.

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



[PHP] php stopped sending mail

2006-06-12 Thread blackwater dev

Hello,

I have some code which uses mail() and a day or so ago, the server stopped
sending mail.   The code is the same and I checked that sendmail is
running.  I also checked maillog which showed the messaged as qued but they
never come through in email.  How can I debug this and what might have
caused the problem??

Thanks!


RE: [PHP] php->html "rendering"

2006-06-12 Thread Brady Mitchell
> -Original Message-
> Quick question;
> 
> If the site is updated with new pages/links is there
> anyway of specifying to HTTrack to get just the new
> pages or does it get the whole site again?

Yes, there is an option to just update the downloaded site.  I've never
actually used that option though, so I'd take it for a test drive before
counting on it.

Brady

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



Re: [PHP] Introductory message

2006-06-12 Thread Ligaya Turmelle

Jay Blanchard wrote:

[snip]


Thought we were going to add the "Security" subsection to the "Where
to
Find More Information" section of the NEWBIE email.  Wasn't it
supposed
to include a link to the manuals security area as well as the phpsec
site?



+1
[/snip]

Send me the details and I'll make sure that they get added.






Where to Find More Information
===

If you have any queries/problems about PHP, the online manual (you can get
an offline copy as well) is a good tool to become familiar with.

   http://php.net/manual

 Some Key sections of the PHP Manual:

   - Installation and Configuration
 http://php.net/install

   - Language Reference
 http://php.net/langref

   - Function Reference
 http://php.net/funcref

 tip: if you know the function name but forget exactly how
 it works just type the name of the function ie:
   http://php.net/array_merge

   - The PHP FAQ
 http://php.net/faq

+   - Security
+ http://www.php.net/manual/en/security.php
+ Additional PHP Security References:
+   http://phpsec.org/
+   http://www.hardened-php.net/advisories.15.html  

--

life is a game... so have fun.

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

Re: [PHP] Re: How to re-order an array

2006-06-12 Thread Paul Novitski

At 07:53 PM 6/11/2006, jekillen wrote:

I force the user to have javascript enabled


Oops.

Unless you're working IT in a penal colony, I suspect that what you 
really mean is that you choose to serve broken pages or no content at 
all to users who don't have JavaScript enabled, whether by choice or 
network requirement or software availability.


It's an interesting decision, excluding browsers with JavaScript 
turned off.  I can see making it in cases of specialty audiences, 
such as the aforementioned penal colony, customized intranets, and 
others where all of the user agents are not only predictable but 
legislatable.  For public websites, I feel we need to set barriers to 
entrance only when necessary -- and when is that? -- consciously and 
deliberately, focusing not so much on "Look at the cool things we can 
do with JavaScript!" but "Whom shall we exclude from this 
site?"  Look a user in the eye, say, "You can't come in," and reflect 
on how cool that is.


Although I still love to write client-side script, most of the energy 
I used to expend on JavaScript I now devote to PHP.  The server is 
the great leveler of the playing field, rendering our pages 
accessible to all user agents *if* our designs are sufficiently 
clever.  These days I mostly add JavaScript to perform functions that 
are already performed server-side by PHP, purely for the advantage of 
speed, but my best pages perform perfectly with JavaScript turned off.


Aside, the whole client-side/server-side debate depends on today's 
internet connection response time being as slow as it is.  In a few 
years a seemingly sexy technology like Ajax, which appears useful 
today in pages so heavy with content that whole-page reloads seem 
onerous, will be one of the unbelievable jokes of yesteryear, like 
RAM measured in kilobytes, 8" floppy discs, and punch cards.


Regards,
Paul 


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