php-general Digest 30 Jul 2008 14:48:31 -0000 Issue 5597

2008-07-30 Thread php-general-digest-help

php-general Digest 30 Jul 2008 14:48:31 - Issue 5597

Topics (messages 277448 through 277474):

Re: Why PHP4?
277448 by: mike
277449 by: VamVan
277456 by: Richard Heyes
277457 by: Per Jessen
277458 by: Richard Heyes
277459 by: Hélio Rocha
277460 by: Thijs Lensselink
277461 by: Richard Heyes
277462 by: Hélio Rocha
277463 by: Per Jessen
277464 by: Per Jessen
277466 by: Richard Heyes
277467 by: Lester Caine
277468 by: Per Jessen
277469 by: Per Jessen
277473 by: Lester Caine
277474 by: Micah Gersten

Re: PHP4 vs PHP5 classes
277450 by: Chris
277451 by: Jim Lucas
277452 by: Robert Cummings
277454 by: Larry Garfield
277455 by: Robert Cummings

Re: limiting the amount of emails sent at a time in a batch send
277453 by: Chris

Creating new site
277465 by: Raido
277470 by: Jason Pruim
277471 by: Richard Heyes
277472 by: Hélio Rocha

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
I started using superglobals since 4.x; not even thinking about it  
from a security angle per se, but because it just makes sense to know  
the source of where your input data is coming from. I guess  
technically security is a byproduct of that thinking too.




On Jul 29, 2008, at 7:31 PM, VamVan [EMAIL PROTECTED] wrote:

Its because PHP got really famous with version 4.0 and many people  
actually converted their CGI or other websites in to PHP 4 websites  
because it was easy and cheap. But 5.0 brought too many changes like  
serious OOPS and register global concepts for security, which is  
useful but made transition difficult. I feel thats why PHP 4 is  
still supported.


Its not only the language that has changed, but also people had to  
upgrade their skill set and there was some learning curve involved.


Unfortunately everyone fell in the trap of register globals which  
was not dealt until php 4.3.1 as a security concept. Pear and Pecl  
were there but everyone was pretty much writing all the code  
(reinventing the wheel) from scratch. This brings in huge code base  
to change.


I liked PHP because intitially it was a procedural langauge and it  
resembled C. But now with OOPS you can build powerful websites which  
is good.


There are many other  cases but I feel strongly this is what makes  
them still support PHP 4.


Thanks
---End Message---
---BeginMessage---
I agree but not everyone think in the sameway. I have seen several big
websites that got hit because they haven't used super globals in the code
and their hosting provided would just change the PHP.ini setting and nothing
would work.

GET, POST , SESSION, REQUEST everything was all dealt as just variable.

On Tue, Jul 29, 2008 at 7:36 PM, mike [EMAIL PROTECTED] wrote:

 I started using superglobals since 4.x; not even thinking about it from a
 security angle per se, but because it just makes sense to know the source of
 where your input data is coming from. I guess technically security is a
 byproduct of that thinking too.




 On Jul 29, 2008, at 7:31 PM, VamVan [EMAIL PROTECTED] wrote:

  Its because PHP got really famous with version 4.0 and many people
 actually converted their CGI or other websites in to PHP 4 websites because
 it was easy and cheap. But 5.0 brought too many changes like serious OOPS
 and register global concepts for security, which is useful but made
 transition difficult. I feel thats why PHP 4 is still supported.

 Its not only the language that has changed, but also people had to upgrade
 their skill set and there was some learning curve involved.

 Unfortunately everyone fell in the trap of register globals which was not
 dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
 everyone was pretty much writing all the code (reinventing the wheel) from
 scratch. This brings in huge code base to change.

 I liked PHP because intitially it was a procedural langauge and it
 resembled C. But now with OOPS you can build powerful websites which is
 good.

 There are many other  cases but I feel strongly this is what makes them
 still support PHP 4.

 Thanks


---End Message---
---BeginMessage---
 I agree but not everyone think in the sameway. I have seen several big
 websites that got hit because they haven't used super globals in the code
 and their hosting provided would just change the PHP.ini setting and nothing
 would work.

Well if it's a big website then why use a hoster that changes the
php.ini without much, if any, thought?

-- 
Richard Heyes
http://www.phpguru.org
---End Message---
---BeginMessage---
Richard Heyes wrote:

 I agree but not everyone think in 

Re: [PHP] PHP4 vs PHP5 classes

2008-07-30 Thread Larry Garfield
On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote:

 It's unfortunate that PHP5 decided to throw a Strict Standards exception
 when you include both style constructors. For instance, I'm certain at
 one point the following was recommended:

 ?php
 class Foo
 {
 function __construct()
 {
 }

 function Foo()
 {
 self::__construct();
 }
 }
 ?

 This was perfectly compatible with PHP5 and gave precedence to the PHP5
 constructor style. Somewhere along the line though PHP5 started
 spouting:

 Strict Standards: Redefining already defined constructor

 So I just completely removed the PHP5 style constructors from my code
 and use the PHP4 style since then there are no exceptions. Mark my words
 though... at some point PHP will start spewing an E_DEPRECATED for PHP4
 style constructor *lol*.

 Cheers,
 Rob.

Well, since PHP 4 has been officially retired as of the start of this year and 
the final-forever release of PHP 4 (4.4.9) is due by 08/08/08, I don't think 
that's much of an issue.  If you're still coding to PHP 4, you're pretty much 
on your own and need to move into this century.

Especially given the different way objects are handled between PHP 4 and PHP 
5, trying to support a dead version of PHP is simply not worth the effort.  
Go PHP 5 and don't look back.  (And if you're on a web host that is still on 
PHP 4, I recommend you switch to a web host that is not doomed to go out of 
business within the next year, because I predict it will.)

-- 
Larry Garfield
[EMAIL PROTECTED]

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



Re: [PHP] PHP4 vs PHP5 classes

2008-07-30 Thread Robert Cummings
On Wed, 2008-07-30 at 01:16 -0500, Larry Garfield wrote:
 On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote:
 
  It's unfortunate that PHP5 decided to throw a Strict Standards exception
  when you include both style constructors. For instance, I'm certain at
  one point the following was recommended:
 
  ?php
  class Foo
  {
  function __construct()
  {
  }
 
  function Foo()
  {
  self::__construct();
  }
  }
  ?
 
  This was perfectly compatible with PHP5 and gave precedence to the PHP5
  constructor style. Somewhere along the line though PHP5 started
  spouting:
 
  Strict Standards: Redefining already defined constructor
 
  So I just completely removed the PHP5 style constructors from my code
  and use the PHP4 style since then there are no exceptions. Mark my words
  though... at some point PHP will start spewing an E_DEPRECATED for PHP4
  style constructor *lol*.
 
  Cheers,
  Rob.
 
 Well, since PHP 4 has been officially retired as of the start of this year 
 and 
 the final-forever release of PHP 4 (4.4.9) is due by 08/08/08, I don't think 
 that's much of an issue.  If you're still coding to PHP 4, you're pretty much 
 on your own and need to move into this century.
 
 Especially given the different way objects are handled between PHP 4 and PHP 
 5, trying to support a dead version of PHP is simply not worth the effort.  
 Go PHP 5 and don't look back.  (And if you're on a web host that is still on 
 PHP 4, I recommend you switch to a web host that is not doomed to go out of 
 business within the next year, because I predict it will.)

My code works fine in PHP5, it has worked fine since before PHP5
launched an official version. That said, I do still code to PHP4
compatibility... and I am certainly NOT alone. Also, for what it's
worth, at one point in this century PHP4 was the only option since
PHP5 was released mid 2004, therefore there is nothing about this
century that makes it the exclusive territory of PHP5. Moving along
though, it's also worth noting, that web hosts worth their salt, provide
access to both PHP4 AND PHP5 thus allowing the use of whichever version
their customers damn well please. And I will bet you a hundred bucks
there will still be PHP4 hosts in existence in another year.

http://www.nexen.net/images/stories/phpversion/200804/evolution.milieu.en.png

In April (yes I know it's now July) PHP4 was still kicking PHP5's ass.
Not bad for a dead version.

And before anyone gets their panties in a bunch, I'm not advocating
picking up and starting to work with PHP4. But I'm certainly not so full
of hubris to think just because someone said jump (or GOPHP5 if you
will) that every Bill, Bob, and Betty on the Intertubes is going to
switch from PHP4 to PHP5. There's a very real cost to switching, and if
it isn't necessary then (speaking frankly) fuckit!

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


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



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 I agree but not everyone think in the sameway. I have seen several big
 websites that got hit because they haven't used super globals in the code
 and their hosting provided would just change the PHP.ini setting and nothing
 would work.

Well if it's a big website then why use a hoster that changes the
php.ini without much, if any, thought?

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Richard Heyes wrote:

 I agree but not everyone think in the sameway. I have seen several
 big websites that got hit because they haven't used super globals in
 the code and their hosting provided would just change the PHP.ini
 setting and nothing would work.
 
 Well if it's a big website then why use a hoster that changes the
 php.ini without much, if any, thought?
 

The technical abilities and awareness is often inversely proportional to
the size of the hoster. 


/Per Jessen, Zürich


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



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 The technical abilities and awareness is often inversely proportional to
 the size of the hoster.

Lol.

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Hélio Rocha
Sorry to disagree,

But I think that with PHP4 a lot of people start thinking that they could be
programmers (maybe they can, developers it's another story). When php5 came
they didn't know how do deal with the deprecated methods and worst, some
hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5. A
lot of mistakes were made when php5 came out but how can a language grow up
when they DEPRECATE the syntax? we're not talking about removing the last
';'...
Maybe I'm in a GET LOST PHP phase but I think that someone is killing it,
and the ones who are stuck in 4 are not helping.

When U write code, U must not be worried 'bout the next upgrade of your
server!


Best regards!

On Wed, Jul 30, 2008 at 3:31 AM, VamVan [EMAIL PROTECTED] wrote:

 Its because PHP got really famous with version 4.0 and many people actually
 converted their CGI or other websites in to PHP 4 websites because it was
 easy and cheap. But 5.0 brought too many changes like serious OOPS and
 register global concepts for security, which is useful but made transition
 difficult. I feel thats why PHP 4 is still supported.

 Its not only the language that has changed, but also people had to upgrade
 their skill set and there was some learning curve involved.

 Unfortunately everyone fell in the trap of register globals which was not
 dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
 everyone was pretty much writing all the code (reinventing the wheel) from
 scratch. This brings in huge code base to change.

 I liked PHP because intitially it was a procedural langauge and it
 resembled
 C. But now with OOPS you can build powerful websites which is good.

 There are many other  cases but I feel strongly this is what makes them
 still support PHP 4.

 Thanks



Re: [PHP] Why PHP4?

2008-07-30 Thread Thijs Lensselink

Quoting Hélio Rocha [EMAIL PROTECTED]:


Sorry to disagree,

But I think that with PHP4 a lot of people start thinking that they could be
programmers (maybe they can, developers it's another story). When php5 came
they didn't know how do deal with the deprecated methods and worst, some
hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5. A
lot of mistakes were made when php5 came out but how can a language grow up
when they DEPRECATE the syntax? we're not talking about removing the last
';'...


O come on. All people have had enough time to get used to it. Between  
the time PHP5 first came out and when it started to gain attention  
mainstream wise. Is a gap of 5 years. I think 5 years is enough to get  
used to new / deprecated features. I still think PHP is moving the  
right way.


When i do an upgrade i first check change logs. You can always expect  
things to change. It's a dynamic world we live in :)



Maybe I'm in a GET LOST PHP phase but I think that someone is killing it,
and the ones who are stuck in 4 are not helping.

When U write code, U must not be worried 'bout the next upgrade of your
server!


Best regards!

On Wed, Jul 30, 2008 at 3:31 AM, VamVan [EMAIL PROTECTED] wrote:


Its because PHP got really famous with version 4.0 and many people actually
converted their CGI or other websites in to PHP 4 websites because it was
easy and cheap. But 5.0 brought too many changes like serious OOPS and
register global concepts for security, which is useful but made transition
difficult. I feel thats why PHP 4 is still supported.

Its not only the language that has changed, but also people had to upgrade
their skill set and there was some learning curve involved.

Unfortunately everyone fell in the trap of register globals which was not
dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
everyone was pretty much writing all the code (reinventing the wheel) from
scratch. This brings in huge code base to change.

I liked PHP because intitially it was a procedural langauge and it
resembled
C. But now with OOPS you can build powerful websites which is good.

There are many other  cases but I feel strongly this is what makes them
still support PHP 4.

Thanks





Personally i use PHP5 when ever i can. But at work we are stuck with  
some small legacy applications . And some major applications written  
on top of PHP4. For which is no time to do the research let alone the  
time to rebuild them. I think there are a few reasons why people still  
use PHP4.


1. People learned PHP4 as a hobby. So upgrading knowledge goes much  
slower. Then when you have to stay on top work wise. (which will  
create a chicken egg situation with point 2)


2. Hosting providers have no clue how to configure their environment.  
Or are stuck with customers running PHP4 applications.


3. No time to research and rebuild existing applications. (which will  
create a chicken egg situation with point 2)




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



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 Sorry to disagree,

That's nothing to apologise for.

 But I think that with PHP4 a lot of people start thinking that they could be
 programmers (maybe they can, developers it's another story). When php5 came
 they didn't know how do deal with the deprecated methods and worst, some
 hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5. A
 lot of mistakes were made when php5 came out but how can a language grow up
 when they DEPRECATE the syntax? we're not talking about removing the last

That's not the problem of the PHP developers. Learning is not a case
of spend a few years doing it and you're set - it's a life long thing.

 Maybe I'm in a GET LOST PHP phase but I think that someone is killing it,
 and the ones who are stuck in 4 are not helping.

There are alternatives - have you heard of Brainfuck?

 When U write code, U must not be worried 'bout the next upgrade of your
 server!

Of course you should. Writing code with every eventuality in mind is
simply ludicrous. And you really should expect things to change when
major versions are changed - that's why release notes exist.

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Hélio Rocha
Brainfuck rox! LOL :)

Sure you must see the changelog and other things but take a look:
I can do more and better things with the next generation of the language in
which i wrote my app, but i don't think that it's fair that my app doens't
compile (if it was a compiled language) or stops executing just because i
get an upgrade.

On Wed, Jul 30, 2008 at 10:56 AM, Richard Heyes [EMAIL PROTECTED]wrote:

  Sorry to disagree,

 That's nothing to apologise for.

  But I think that with PHP4 a lot of people start thinking that they could
 be
  programmers (maybe they can, developers it's another story). When php5
 came
  they didn't know how do deal with the deprecated methods and worst, some
  hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5.
 A
  lot of mistakes were made when php5 came out but how can a language grow
 up
  when they DEPRECATE the syntax? we're not talking about removing the last

 That's not the problem of the PHP developers. Learning is not a case
 of spend a few years doing it and you're set - it's a life long thing.

  Maybe I'm in a GET LOST PHP phase but I think that someone is killing
 it,
  and the ones who are stuck in 4 are not helping.

 There are alternatives - have you heard of Brainfuck?

  When U write code, U must not be worried 'bout the next upgrade of your
  server!

 Of course you should. Writing code with every eventuality in mind is
 simply ludicrous. And you really should expect things to change when
 major versions are changed - that's why release notes exist.

 --
 Richard Heyes
 http://www.phpguru.org



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Hélio Rocha wrote:

 methods and worst, some hosters didn't know how to virtualize a
 f1ck1n' server with Apache+PHP5. 

Despite their many inabilities, I doubt if any hosting service would
have a problem with that. 
If you're trying to figure out why so many haven't changed, there's one
question you need to ask - why should they?  What's the business-case?


/Per Jessen, Zürich


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



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Richard Heyes wrote:

 
 When U write code, U must not be worried 'bout the next upgrade of
 your server!
 
 Of course you should. Writing code with every eventuality in mind is
 simply ludicrous. 

Umm, I beg to differ.  A developer should not need to worry about a
possible/future upgrade of the runtime platform.  I certainly don't
worry about the next release of gcc or glibc when I write C. 



/Per Jessen, Zürich


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



[PHP] Creating new site

2008-07-30 Thread Raido

Hi,

There are many sites explaining how to build new site etc but I'd like 
to hear what You suggest. (about how to plan whole thing and how to 
write separate parts which can be put together later)


I have build many small sites for myself(site to organise class assembly 
which is like yearly convention..it has user administration etc) but 
they all are anything else than OOP. But now, I need to help with 
creating one bigger site which should be OOP. That site should include 
user management(each user has it's own profile), each user can post job 
and other adds in different categories. (there will be many categories 
for example 'work,cars,training,apartments'.)

And users profile should show ads posted by himself.
Logic itself is simple:
1) unregistered user:
	a) I go to site, I see categories (work offers, apartment offers, 
training offers, etc)

b) I click on category I'm interested in
c) I see ad that I'm interested in
d) I click on it
c) I see detailed information about it(which company posted it etc)
d) at bottom page I see form where I can contact with ad author
2) registered user
a) I go to site
b) I log in, my profile page opens
	c) there I can see ads posted by me..also I can see how many times ad 
is viewed etc

d) i click on link 'Post new ad'
	e) there i choose category and probably Ajax helps to load specific 
fields(for example if I choose 'Cars' as category, then fields like 	 
'year,transmission,color, etc' will appear.


That is short summary what that site should do. It seems quite big for 
me so I'd be happy to hear any guidelines from people who have built big 
sites.


Creating forms, posting data, user login etc, these things are not 
problem... problem is: how to build the whole thing aimed to OOP and use 
with Smarty to keep things organized.


I'm not sure but I have idea about what things I should do first:

1) think and write down any function that needs to be done(for example 
different validations, functions for showing/posting form etc)

2) plan and create database?
3) create database class which handles database connection
But what next? Or am I starting all wrong?

Big thanks in advance,


Raido



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



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 Umm, I beg to differ.  A developer should not need to worry about a
 possible/future upgrade of the runtime platform.  I certainly don't
 worry about the next release of gcc or glibc when I write C.

Minor point releases certainly, but not major ones. They're major
upgrades for a reason - things change.

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Lester Caine

Per Jessen wrote:

Richard Heyes wrote:


When U write code, U must not be worried 'bout the next upgrade of
your server!

Of course you should. Writing code with every eventuality in mind is
simply ludicrous. 


Umm, I beg to differ.  A developer should not need to worry about a
possible/future upgrade of the runtime platform.  I certainly don't
worry about the next release of gcc or glibc when I write C. 


I can live with both sides of the argument.

All the SQL scripts I write SHOULD still work with a later version of the 
database engine, but changes to make things compatible with standards can 
cause problems with that. So I need to test scripts following a major release.


PHP upgrades have certainly broken backwards compatibility, but then I've had 
similar problems with the Borland C compilers as well. But at least Borland 
attempt to update things to at least compile in later versions and warn of the 
'errors'


gcc has had problems and I see various posts about 'not using version xxx' for 
building yyy because it's broken. So we all have to live with the possibility 
that a later version may not ACTUALLY work for us - and wait for the problem 
to be fixed either in gcc or the application. ( Wasn't there a problem with 
PHP5 and some version of gcc? )


I don't agree with a lot of the 'changes' that are being forced into PHP5 and 
certainly feel that they should have been kept to PHP6, but the real problem 
to date has been BACKPORTING some of these changes TO PHP4 rather than having 
frozen any 'development' of PHP4 a lot earlier. I never used PHP4 and I would 
prefer not to have to worry about it now, but projects I am using still 
maintain backwards compatibility rather than also freezing a version that 
works with PHP4.X and then moving developments forward. Currently I'm looking 
at a lot of 'deprecated' messages from PHP5.3.x and wondering Do I fix them 
and risk problems with PHP4 compatibility or do I just switch off the error?


Some ISP's are still only supporting rather ancient versions of PHP4. They 
should simply be warned of the security risks. Some ISP's have a PHP5 
offering, but again an older version simply because it causes less problems 
when converting from PHP4. PHP5.3 is going to throw up another round of 
problems which makes a move from PHP4 even more time consuming so there should 
be a serious discussion as to *IF* that should be allowed? Keeping moving the 
goal posts even further from an environment into which PHP4 applications can 
be ported easily is the problem, rather than the switch from PHP4 to PHP5 pre 
say :(


Lets request that PHP5.3 is not released at this time, but instead an effort 
is put in to get all the major web applications at least running in PHP5.2 
before even more changes are introduced.


And a beta release of PHP6 with a clean unicode base would be nice ...

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Richard Heyes wrote:

 Umm, I beg to differ.  A developer should not need to worry about a
 possible/future upgrade of the runtime platform.  I certainly don't
 worry about the next release of gcc or glibc when I write C.
 
 Minor point releases certainly, but not major ones. They're major
 upgrades for a reason - things change.

Yes, but a change in the language or a library should not force anyone
to make source code changes.  IMHO, that is to be avoided at all costs. 
A recompile is acceptable, of course. 


/Per Jessen, Zürich


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



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Lester Caine wrote:

 Some ISP's are still only supporting rather ancient versions of PHP4.
 They should simply be warned of the security risks. Some ISP's have a
 PHP5 offering, but again an older version simply because it causes
 less problems when converting from PHP4. 

The problem for an ISP is - with thousands of customers, he has no way
of knowing who has used what PHP extension or feature.  Without
virtually guaranteed backwards compatibility, a mass upgrade of 4 to 5
could be a major headache.  
Besides, are the security risks sufficiently severe for the ISP to
warrant the upgrade effort+headache?


/Per Jessen, Zürich


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



Re: [PHP] Creating new site

2008-07-30 Thread Jason Pruim


On Jul 30, 2008, at 10:34 AM, Raido wrote:

[snip lots of info]
I'm not sure but I have idea about what things I should do first:

1) think and write down any function that needs to be done(for  
example different validations, functions for showing/posting form etc)

2) plan and create database?
3) create database class which handles database connection
But what next? Or am I starting all wrong?

Big thanks in advance,



Hi Raido,

To me it looks like you have a great start. I usually jsut jump in and  
start coding without too much planning. It may seem a little  
disorganized, but I don't believe I can come up with all the functions  
and all the variables for those functions before I start writing it  
and I see how things are heading.


Some stuff yes, like if you're going to connect to a database, that  
can be done ahead. But if you are searching, how will you search when  
you don't know what all the possible fields are that you want to  
search by?


As far as the list you have, use it as a road map but don't be afraid  
to take detours on it. Nothing on the internet is set in stone :) Add,  
Remove, Modify... And always push your understanding into new heights  
because that is what will make you an excellent Web Developer instead  
of a decent web programmer...


(That coffee this morning really made me positive! I may need to do  
that every morning... :P


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





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



Re: [PHP] Creating new site

2008-07-30 Thread Richard Heyes
2008/7/30 Raido [EMAIL PROTECTED]:
 Hi,

 There are many sites explaining how to build new site etc but I'd like to
 hear what You suggest. (about how to plan whole thing and how to write
 separate parts which can be put together later)

This may be of some help:

http://www.phpguru.org/static/ApplicationStructure.html

On the other hand, it may not.

-- 
Richard Heyes
http://www.phpguru.org

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




Re: [PHP] Creating new site

2008-07-30 Thread Hélio Rocha
Hi,

Even if it's just a site don't thing u don't need a structure to it. Why not
a MVC structure? U can dig about cakephp on google to see some of it
working. If U don't want to use a framework, start with the business rules
u'll need, after that do the CRUD and for the piece of resistance assemble
the html for it. :)



On Wed, Jul 30, 2008 at 3:34 PM, Raido [EMAIL PROTECTED] wrote:

 Hi,

 There are many sites explaining how to build new site etc but I'd like to
 hear what You suggest. (about how to plan whole thing and how to write
 separate parts which can be put together later)

 I have build many small sites for myself(site to organise class assembly
 which is like yearly convention..it has user administration etc) but they
 all are anything else than OOP. But now, I need to help with creating one
 bigger site which should be OOP. That site should include user
 management(each user has it's own profile), each user can post job and other
 adds in different categories. (there will be many categories for example
 'work,cars,training,apartments'.)
 And users profile should show ads posted by himself.
 Logic itself is simple:
 1) unregistered user:
a) I go to site, I see categories (work offers, apartment offers,
 training offers, etc)
b) I click on category I'm interested in
c) I see ad that I'm interested in
d) I click on it
c) I see detailed information about it(which company posted it etc)
d) at bottom page I see form where I can contact with ad author
 2) registered user
a) I go to site
b) I log in, my profile page opens
c) there I can see ads posted by me..also I can see how many times
 ad is viewed etc
d) i click on link 'Post new ad'
e) there i choose category and probably Ajax helps to load specific
 fields(for example if I choose 'Cars' as category, then fields like
  'year,transmission,color, etc' will appear.

 That is short summary what that site should do. It seems quite big for me
 so I'd be happy to hear any guidelines from people who have built big sites.

 Creating forms, posting data, user login etc, these things are not
 problem... problem is: how to build the whole thing aimed to OOP and use
 with Smarty to keep things organized.

 I'm not sure but I have idea about what things I should do first:

 1) think and write down any function that needs to be done(for example
 different validations, functions for showing/posting form etc)
 2) plan and create database?
 3) create database class which handles database connection
 But what next? Or am I starting all wrong?

 Big thanks in advance,


 Raido



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




Re: [PHP] Why PHP4?

2008-07-30 Thread Lester Caine

Per Jessen wrote:

Lester Caine wrote:


Some ISP's are still only supporting rather ancient versions of PHP4.
They should simply be warned of the security risks. Some ISP's have a
PHP5 offering, but again an older version simply because it causes
less problems when converting from PHP4. 


The problem for an ISP is - with thousands of customers, he has no way
of knowing who has used what PHP extension or feature.  Without
virtually guaranteed backwards compatibility, a mass upgrade of 4 to 5
could be a major headache.  
Besides, are the security risks sufficiently severe for the ISP to

warrant the upgrade effort+headache?


Having seen the problems some of the 'upgrades' have caused I can only agree. 
But getting a stable version of PHP5 out on to which existing PHP4 users can 
be migrated is probably essential. And feature freezing that base is a must, 
so that at least there is a fixed target. I've managed to sort of jump through 
single versions of 5.0.x - 5.1.6 and now 5.2.6 although the latter was more 
due to regressive bugs in most of the versions from 5.1.6 to 5.2.6.


At present I can't see any logic reason to even bother with 5.3 until all of 
my customer sites have been moved to 5.2.6 which will probably take another 
year. so anything that helps people at least start migrating TO PHP5 should be 
encouraged?


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Micah Gersten
Sometimes deprecation is necessary is a language feature is created out
of necessity but is superseded by a superior language form.
A great example is the HTML FONT tag.  Font tags slow down downloads and
renderings, and were deprecated in favor of CSS style sheets which offer
much more control and a smaller footprint.

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



Hélio Rocha wrote:
 Sorry to disagree,

 But I think that with PHP4 a lot of people start thinking that they could be
 programmers (maybe they can, developers it's another story). When php5 came
 they didn't know how do deal with the deprecated methods and worst, some
 hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5. A
 lot of mistakes were made when php5 came out but how can a language grow up
 when they DEPRECATE the syntax? we're not talking about removing the last
 ';'...
 Maybe I'm in a GET LOST PHP phase but I think that someone is killing it,
 and the ones who are stuck in 4 are not helping.

 When U write code, U must not be worried 'bout the next upgrade of your
 server!


 Best regards!

 On Wed, Jul 30, 2008 at 3:31 AM, VamVan [EMAIL PROTECTED] wrote:

   
 Its because PHP got really famous with version 4.0 and many people actually
 converted their CGI or other websites in to PHP 4 websites because it was
 easy and cheap. But 5.0 brought too many changes like serious OOPS and
 register global concepts for security, which is useful but made transition
 difficult. I feel thats why PHP 4 is still supported.

 Its not only the language that has changed, but also people had to upgrade
 their skill set and there was some learning curve involved.

 Unfortunately everyone fell in the trap of register globals which was not
 dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
 everyone was pretty much writing all the code (reinventing the wheel) from
 scratch. This brings in huge code base to change.

 I liked PHP because intitially it was a procedural langauge and it
 resembled
 C. But now with OOPS you can build powerful websites which is good.

 There are many other  cases but I feel strongly this is what makes them
 still support PHP 4.

 Thanks

 

   

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Micah Gersten
Sometimes speed improvements require removing things.  If you end up
backwards supporting everything you end up with a big monster engine
that is incredibly slow.

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



Hélio Rocha wrote:
 Brainfuck rox! LOL :)

 Sure you must see the changelog and other things but take a look:
 I can do more and better things with the next generation of the language in
 which i wrote my app, but i don't think that it's fair that my app doens't
 compile (if it was a compiled language) or stops executing just because i
 get an upgrade.

 On Wed, Jul 30, 2008 at 10:56 AM, Richard Heyes [EMAIL PROTECTED]wrote:

   
 Sorry to disagree,
   
 That's nothing to apologise for.

 
 But I think that with PHP4 a lot of people start thinking that they could
   
 be
 
 programmers (maybe they can, developers it's another story). When php5
   
 came
 
 they didn't know how do deal with the deprecated methods and worst, some
 hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5.
   
 A
 
 lot of mistakes were made when php5 came out but how can a language grow
   
 up
 
 when they DEPRECATE the syntax? we're not talking about removing the last
   
 That's not the problem of the PHP developers. Learning is not a case
 of spend a few years doing it and you're set - it's a life long thing.

 
 Maybe I'm in a GET LOST PHP phase but I think that someone is killing
   
 it,
 
 and the ones who are stuck in 4 are not helping.
   
 There are alternatives - have you heard of Brainfuck?

 
 When U write code, U must not be worried 'bout the next upgrade of your
 server!
   
 Of course you should. Writing code with every eventuality in mind is
 simply ludicrous. And you really should expect things to change when
 major versions are changed - that's why release notes exist.

 --
 Richard Heyes
 http://www.phpguru.org

 

   

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



Re: [PHP] Creating new site

2008-07-30 Thread Micah Gersten
Depending on the size of the site, you might want to consider a PHP
framework to start with.  There's usually no point in reinventing the
wheel.  Someone mentioned CakePHP which utilizes MVC.  I'm looking into
porting my stuff to the Zend Framework which makes MVC optional, but has
a lot of functionality make available.

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



Raido wrote:
 Hi,

 There are many sites explaining how to build new site etc but I'd like
 to hear what You suggest. (about how to plan whole thing and how to
 write separate parts which can be put together later)

 I have build many small sites for myself(site to organise class
 assembly which is like yearly convention..it has user administration
 etc) but they all are anything else than OOP. But now, I need to help
 with creating one bigger site which should be OOP. That site should
 include user management(each user has it's own profile), each user can
 post job and other adds in different categories. (there will be many
 categories for example 'work,cars,training,apartments'.)
 And users profile should show ads posted by himself.
 Logic itself is simple:
 1) unregistered user:
 a) I go to site, I see categories (work offers, apartment offers,
 training offers, etc)
 b) I click on category I'm interested in
 c) I see ad that I'm interested in
 d) I click on it
 c) I see detailed information about it(which company posted it etc)
 d) at bottom page I see form where I can contact with ad author
 2) registered user
 a) I go to site
 b) I log in, my profile page opens
 c) there I can see ads posted by me..also I can see how many times
 ad is viewed etc
 d) i click on link 'Post new ad'
 e) there i choose category and probably Ajax helps to load
 specific fields(for example if I choose 'Cars' as category, then
 fields like  'year,transmission,color, etc' will appear.

 That is short summary what that site should do. It seems quite big for
 me so I'd be happy to hear any guidelines from people who have built
 big sites.

 Creating forms, posting data, user login etc, these things are not
 problem... problem is: how to build the whole thing aimed to OOP and
 use with Smarty to keep things organized.

 I'm not sure but I have idea about what things I should do first:

 1) think and write down any function that needs to be done(for example
 different validations, functions for showing/posting form etc)
 2) plan and create database?
 3) create database class which handles database connection
 But what next? Or am I starting all wrong?

 Big thanks in advance,


 Raido




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



Re: [PHP] Why PHP4?

2008-07-30 Thread Sancar Saran
Because,

People believes

Do not fix until broke

Motto.


Testing new online application may painfull.

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Jim Lucas

Per Jessen wrote:

Richard Heyes wrote:


I agree but not everyone think in the sameway. I have seen several
big websites that got hit because they haven't used super globals in
the code and their hosting provided would just change the PHP.ini
setting and nothing would work.

Well if it's a big website then why use a hoster that changes the
php.ini without much, if any, thought?



The technical abilities and awareness is often inversely proportional to
the size of the hoster. 



/Per Jessen, Zürich




I am the tech support department, not only web hosting but Phones, DSL, T1, 
Email, Toll Free, etc...


The key thing in tech support, is to get to the problem and fix it.  Don't let 
the conversation get away from the reason they called.  As long as you can fix 
the problem, assuming their is a problem, the customer will be happy.  But all 
the while not sounding harsh or impatient to the customer.


But, on the flip side, you don't want to be just a knowledge base that people 
could login to on your website.  Isn't that they reason you have live support?


Anyways...

--
Jim Lucas

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

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] Creating new site

2008-07-30 Thread Shawn McKenzie

Micah Gersten wrote:

Depending on the size of the site, you might want to consider a PHP
framework to start with.  There's usually no point in reinventing the
wheel.  Someone mentioned CakePHP which utilizes MVC.  I'm looking into
porting my stuff to the Zend Framework which makes MVC optional, but has
a lot of functionality make available.

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



I too like CakePHP.  I have coded in PHP for quite a while and 
understand OOP and OOP in PHP, however I don't really have any 
experience building sites or apps from scratch using OOP/MVC.


Cake or a framework makes it much quicker and easier. For those that 
need total freedom to do things the way they want but need some 
pre-built functionality to make it quicker, Zend seems to be the choice. 
 I consider Zend to be more of a class library like PEAR only more 
consistant.  For me, I had no habits/best practices or preferred way 
when I started with OOP/MVC so Cake was great.  It has a certain 
structure and uses certain conventions and code generation which makes 
it very quick and easy.  The main drawback is the docs.


-Shawn




Raido wrote:

Hi,

There are many sites explaining how to build new site etc but I'd like
to hear what You suggest. (about how to plan whole thing and how to
write separate parts which can be put together later)

I have build many small sites for myself(site to organise class
assembly which is like yearly convention..it has user administration
etc) but they all are anything else than OOP. But now, I need to help
with creating one bigger site which should be OOP. That site should
include user management(each user has it's own profile), each user can
post job and other adds in different categories. (there will be many
categories for example 'work,cars,training,apartments'.)
And users profile should show ads posted by himself.
Logic itself is simple:
1) unregistered user:
a) I go to site, I see categories (work offers, apartment offers,
training offers, etc)
b) I click on category I'm interested in
c) I see ad that I'm interested in
d) I click on it
c) I see detailed information about it(which company posted it etc)
d) at bottom page I see form where I can contact with ad author
2) registered user
a) I go to site
b) I log in, my profile page opens
c) there I can see ads posted by me..also I can see how many times
ad is viewed etc
d) i click on link 'Post new ad'
e) there i choose category and probably Ajax helps to load
specific fields(for example if I choose 'Cars' as category, then
fields like  'year,transmission,color, etc' will appear.

That is short summary what that site should do. It seems quite big for
me so I'd be happy to hear any guidelines from people who have built
big sites.

Creating forms, posting data, user login etc, these things are not
problem... problem is: how to build the whole thing aimed to OOP and
use with Smarty to keep things organized.

I'm not sure but I have idea about what things I should do first:

1) think and write down any function that needs to be done(for example
different validations, functions for showing/posting form etc)
2) plan and create database?
3) create database class which handles database connection
But what next? Or am I starting all wrong?

Big thanks in advance,


Raido





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



Re: [PHP] Creating new site

2008-07-30 Thread Hélio Rocha
U may want to see Ruby On Rails www.rubyonrails.org . It's also a framework
but for Ruby. In my opinion it's stronger than cake and there are some IDE's
that do support and debug it.

Cumps,
Hélio Rocha

On Wed, Jul 30, 2008 at 4:54 PM, Shawn McKenzie [EMAIL PROTECTED]wrote:

 Micah Gersten wrote:

 Depending on the size of the site, you might want to consider a PHP
 framework to start with.  There's usually no point in reinventing the
 wheel.  Someone mentioned CakePHP which utilizes MVC.  I'm looking into
 porting my stuff to the Zend Framework which makes MVC optional, but has
 a lot of functionality make available.

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


 I too like CakePHP.  I have coded in PHP for quite a while and understand
 OOP and OOP in PHP, however I don't really have any experience building
 sites or apps from scratch using OOP/MVC.

 Cake or a framework makes it much quicker and easier. For those that need
 total freedom to do things the way they want but need some pre-built
 functionality to make it quicker, Zend seems to be the choice.  I consider
 Zend to be more of a class library like PEAR only more consistant.  For me,
 I had no habits/best practices or preferred way when I started with OOP/MVC
 so Cake was great.  It has a certain structure and uses certain conventions
 and code generation which makes it very quick and easy.  The main drawback
 is the docs.

 -Shawn




 Raido wrote:

 Hi,

 There are many sites explaining how to build new site etc but I'd like
 to hear what You suggest. (about how to plan whole thing and how to
 write separate parts which can be put together later)

 I have build many small sites for myself(site to organise class
 assembly which is like yearly convention..it has user administration
 etc) but they all are anything else than OOP. But now, I need to help
 with creating one bigger site which should be OOP. That site should
 include user management(each user has it's own profile), each user can
 post job and other adds in different categories. (there will be many
 categories for example 'work,cars,training,apartments'.)
 And users profile should show ads posted by himself.
 Logic itself is simple:
 1) unregistered user:
a) I go to site, I see categories (work offers, apartment offers,
 training offers, etc)
b) I click on category I'm interested in
c) I see ad that I'm interested in
d) I click on it
c) I see detailed information about it(which company posted it etc)
d) at bottom page I see form where I can contact with ad author
 2) registered user
a) I go to site
b) I log in, my profile page opens
c) there I can see ads posted by me..also I can see how many times
 ad is viewed etc
d) i click on link 'Post new ad'
e) there i choose category and probably Ajax helps to load
 specific fields(for example if I choose 'Cars' as category, then
 fields like  'year,transmission,color, etc' will appear.

 That is short summary what that site should do. It seems quite big for
 me so I'd be happy to hear any guidelines from people who have built
 big sites.

 Creating forms, posting data, user login etc, these things are not
 problem... problem is: how to build the whole thing aimed to OOP and
 use with Smarty to keep things organized.

 I'm not sure but I have idea about what things I should do first:

 1) think and write down any function that needs to be done(for example
 different validations, functions for showing/posting form etc)
 2) plan and create database?
 3) create database class which handles database connection
 But what next? Or am I starting all wrong?

 Big thanks in advance,


 Raido




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




Re: [PHP] Creating new site

2008-07-30 Thread Robert Cummings
On Wed, 2008-07-30 at 17:03 +0100, Hélio Rocha wrote:
 U may want to see Ruby On Rails www.rubyonrails.org . It's also a framework
 but for Ruby. In my opinion it's stronger than cake and there are some IDE's
 that do support and debug it.

Dear Hélio,

This is a PHP list. People usually come here for PHP related answers.

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


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



Re: [PHP] Creating new site

2008-07-30 Thread Hélio Rocha
Sorry Robert and all other users.

On Wed, Jul 30, 2008 at 5:07 PM, Robert Cummings [EMAIL PROTECTED]wrote:

 On Wed, 2008-07-30 at 17:03 +0100, Hélio Rocha wrote:
  U may want to see Ruby On Rails www.rubyonrails.org . It's also a
 framework
  but for Ruby. In my opinion it's stronger than cake and there are some
 IDE's
  that do support and debug it.

 Dear Hélio,

 This is a PHP list. People usually come here for PHP related answers.

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




[PHP] Windows date(Y/m/d H:i:s) performance

2008-07-30 Thread Richard Lynch
I was profiling some code on my local dev box, and in Windows, the
biggest time sink for the home page is...

a call to date(Y/m/d H:i:s)?!
917 ms???

Here is what I get in a cygwin shell:
php -r '$c = 100; $s = microtime(true); for($i = 0; $i  $c; $i++){ $d
= date(Y/m/d H:i:s); } echo (microtime(true) - $s)/$c, \n; '
1.0072922205925

Same results from a DOS prompt, though I have to actually create a
file as -r didn't seem to work...

Feel free to change $c to 10 to get a faster answer...

Can 'date' really take almost a full second to execute in Doze?...

That seems pretty whack...

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



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



Re: [PHP] Why PHP4?

2008-07-30 Thread Jason Pruim


On Jul 30, 2008, at 10:50 AM, Micah Gersten wrote:


Sometimes speed improvements require removing things.  If you end up
backwards supporting everything you end up with a big monster engine
that is incredibly slow.



Just ask Microsoft about that ;)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





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



[PHP] Re: Windows date(Y/m/d H:i:s) performance

2008-07-30 Thread Richard Lynch
I suppose to be complete, I should point out that in Linux a call to
date finishes in 1.2271404266357E-5 seconds on average.

For those unfamiliar with scientific notation, that would be:
0.12271404266357 seconds, or rougly 1/10,000th of the time Doze
takes.

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



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



Re: [PHP] Windows date(Y/m/d H:i:s) performance

2008-07-30 Thread Andrew Ballard
On Wed, Jul 30, 2008 at 12:11 PM, Richard Lynch [EMAIL PROTECTED] wrote:
 I was profiling some code on my local dev box, and in Windows, the
 biggest time sink for the home page is...

 a call to date(Y/m/d H:i:s)?!
 917 ms???

 Here is what I get in a cygwin shell:
 php -r '$c = 100; $s = microtime(true); for($i = 0; $i  $c; $i++){ $d
 = date(Y/m/d H:i:s); } echo (microtime(true) - $s)/$c, \n; '
 1.0072922205925

 Same results from a DOS prompt, though I have to actually create a
 file as -r didn't seem to work...

 Feel free to change $c to 10 to get a faster answer...

 Can 'date' really take almost a full second to execute in Doze?...

 That seems pretty whack...


I just ran your test code inside Zend Studio under Windows XP and it
printed 0.00044636011123657

Andrew

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Per Jessen
Jason Pruim wrote:

 
 On Jul 30, 2008, at 10:50 AM, Micah Gersten wrote:
 
 Sometimes speed improvements require removing things.  If you end up
 backwards supporting everything you end up with a big monster engine
 that is incredibly slow.
 
 
 Just ask Microsoft about that ;)

Better ask IBM instead - they've done it for much longer and with much
better results. 


/Per Jessen, Zürich


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



Re: [PHP] Re: Windows date(Y/m/d H:i:s) performance

2008-07-30 Thread Andrew Ballard
On Wed, Jul 30, 2008 at 12:19 PM, Richard Lynch [EMAIL PROTECTED] wrote:
 I suppose to be complete, I should point out that in Linux a call to
 date finishes in 1.2271404266357E-5 seconds on average.

 For those unfamiliar with scientific notation, that would be:
 0.12271404266357 seconds, or rougly 1/10,000th of the time Doze
 takes.


Interesting. Just for comparison, I ran it directly with the binaries
(disabling the debugger) for PHP 4.4.4 and 5.2.0 on my machine.

4.4.4 - in the order of 4.5E-6 - 5.0E-6

5.2.0 - right around 1.0E-4

Andrew

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



[PHP] Still zend_mm_heap corrupted error in PHP 5.2.6

2008-07-30 Thread santi

Dear Srs,

We are having some zend_mm_heap corrupted errors followed by a
Segmentation fault (11) in our Apache2 + PHP 5.2.6 servers. There are few
information about this bug in internet:

 * #40479 - http://bugs.php.net/bug.php?id=40479
 * #43295 - http://bugs.php.net/bug.php?id=43295

I have applied all proposed patches, tested with PHP 5.2.5 and 5.2.6.. and
I still have the error :-/

Anyone has more info about this, or how to solve/prevent?

I'm also looking for a method to get more info about this crash: what
virtualhost + PHP scripts generate it and the timestamp, for example. What
can I do to get more info? Searching in the source code, I see that this
message only is printed by the zend_mm_panic() function in
Zend/zend_alloc.c file, anyideas to hack this function to get more info?

static void zend_mm_panic(const char *message)
{
fprintf(stderr, %s\n, message);
#if ZEND_DEBUG  defined(HAVE_KILL)  defined(HAVE_GETPID)
kill(getpid(), SIGSEGV);
#endif
exit(1);
}

Is there any macro o similar to get the URL, virtualhost or PHP
script/path? Thanks!!

Regards,

--Santi Saez






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



Re: [PHP] Creating new site

2008-07-30 Thread Shawn McKenzie

Hélio Rocha wrote:

U may want to see Ruby On Rails www.rubyonrails.org . It's also a framework
but for Ruby. In my opinion it's stronger than cake and there are some IDE's
that do support and debug it.

Cumps,
Hélio Rocha



There's also .NET http://www.microsoft.com. It's also a framework but 
for VB/C# I think. In my opinion it's stronger than cake and there are 
some IDE's that do support and debug it, as well as a lot of documentation.


-Shawn

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



[PHP] Php Help

2008-07-30 Thread birdloww.ctr
I cannot get Php to run on Solaris 10...
Here is the error I am getting

Trying to run php outside of apache

ld.so.1: php: fatal: libldap-2.3.so.0: open failed: No such file or
directory  


With ApacheApache will not load when trying to load the php modules

Syntax error on line 110 of /usr/local/apache2/conf/httpd.conf: 
Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: 
httpd: fatal: libldap-2.3.so.0: open failed: No such file or directory




Environmental Setting 
DISPLAY= 
HOME=/ 
HZ=100 
LOGNAME=wayne 
MAIL=/var/mail/wayne 
PATH=/usr/sbin:/usr/bin 
PS1=#  
SHELL=/bin/sh 
TERM=xterm 
TZ=US/Eastern
___
I have gone to the lib directory and can find libldap-2.4.so.2 ..
Can you point me in the right direction???

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



[PHP] Re: Php Help

2008-07-30 Thread Shawn McKenzie

[EMAIL PROTECTED] wrote:

I cannot get Php to run on Solaris 10...
Here is the error I am getting

Trying to run php outside of apache

ld.so.1: php: fatal: libldap-2.3.so.0: open failed: No such file or
directory  



With ApacheApache will not load when trying to load the php modules

Syntax error on line 110 of /usr/local/apache2/conf/httpd.conf: 
Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: 
httpd: fatal: libldap-2.3.so.0: open failed: No such file or directory





Environmental Setting 
DISPLAY= 
HOME=/ 
HZ=100 
LOGNAME=wayne 
MAIL=/var/mail/wayne 
PATH=/usr/sbin:/usr/bin 
PS1=#  
SHELL=/bin/sh 
TERM=xterm 
TZ=US/Eastern

___
I have gone to the lib directory and can find libldap-2.4.so.2 ..
Can you point me in the right direction???


Well, it's not looking for libldap-2.4.so.2, it wants libldap-2.3.so.0.

So first try creating a link of libldap-2.3.so.0 to libldap-2.4.so.2. 
Been a while for me on Solaris.


-Shawn

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



[PHP] accessing variables within objects

2008-07-30 Thread Marten Lehmann

Hello,

I'm using some php-classes which worked fine with php-5.0.4. Now I tried 
to upgrade to php-5.2.6, but the classes give a lot of errors. If I set


error_reporting(E_ALL);

I see messages like

Notice: Undefined property: FastTemplate::$main in 
/whereever/inc.template.php on line 293


Notice: Undefined property: current_session::$cust_id in 
/whereever/inc.init.php on line 117


In inc.template.php there are a lot of calls like $this-$key. In 
inc.init.php there are calls like $session-cust_id.


What has changed in php-5.2.x so that these calls don't work any more? 
What is the new, required form to use objects in a similar manner 
(unfortunately I have no ressources to code these classes from scratch)? 
Thanks.


Kind regards
Marten

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



Re: [PHP] accessing variables within objects

2008-07-30 Thread Jim Lucas

Marten Lehmann wrote:

Hello,

I'm using some php-classes which worked fine with php-5.0.4. Now I tried 
to upgrade to php-5.2.6, but the classes give a lot of errors. If I set


error_reporting(E_ALL);

I see messages like

Notice: Undefined property: FastTemplate::$main in 
/whereever/inc.template.php on line 293


Notice: Undefined property: current_session::$cust_id in 
/whereever/inc.init.php on line 117


In inc.template.php there are a lot of calls like $this-$key. In 
inc.init.php there are calls like $session-cust_id.


to fix these errors, you would need to modify the code so it does something 
like this.


where it calls $this-$key you need to check and make sure that $key exists 
before you trying call for it.


So something like this would work.

if ( isset( $this-$key ) ) {
$this-$key;
} else {
$this-$key = null;
}

You didn't show any context in which you are using the above code. So I don't 
know what will actually work in your situation.  Show a little more code that 
includes the method in which $this-$key is called.


You will want to look at using the Overloading feature of PHP5.  Check out 
this page for overloading examples


http://us2.php.net/manual/en/language.oop5.overloading.php

Take note of the __get() and __set() methods.  The __get method checks to see 
if the key exists before it tries working with it.




What has changed in php-5.2.x so that these calls don't work any more? 
What is the new, required form to use objects in a similar manner 
(unfortunately I have no ressources to code these classes from scratch)? 
Thanks.


Kind regards
Marten



--
Jim Lucas

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

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] accessing variables within objects

2008-07-30 Thread Micah Gersten
You might want to check the scope of the properties.  If you want to
access them outside of the class, make sure they are declared public.

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



Marten Lehmann wrote:
 Hello,

 I'm using some php-classes which worked fine with php-5.0.4. Now I
 tried to upgrade to php-5.2.6, but the classes give a lot of errors.
 If I set

 error_reporting(E_ALL);

 I see messages like

 Notice: Undefined property: FastTemplate::$main in
 /whereever/inc.template.php on line 293

 Notice: Undefined property: current_session::$cust_id in
 /whereever/inc.init.php on line 117

 In inc.template.php there are a lot of calls like $this-$key. In
 inc.init.php there are calls like $session-cust_id.

 What has changed in php-5.2.x so that these calls don't work any more?
 What is the new, required form to use objects in a similar manner
 (unfortunately I have no ressources to code these classes from
 scratch)? Thanks.

 Kind regards
 Marten


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



Re: [PHP] Php CLI Parser not working

2008-07-30 Thread JJB

Daniel Brown wrote:

On Tue, Jul 29, 2008 at 2:19 PM, JJB [EMAIL PROTECTED] wrote:
  

We recently rebuilt a webserver and upgraded it to opensuse 10.3.
Now, when our webdev people run command line php scripts all of the
included files are being output to the terminal instead of parsed.



How are the scripts being run from the CLI?  As shell scripts with
this as the following line:

#!/path/to/php

-or-

#!/bin/env php

 or by using the command 'php script.php' from the command line?


What do you see when, from the command line, you issue the command
'php -v' ?

  


Hi Daniel,

We are running like:
php mailscript.php

The version:

php-v

PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Dec 12 2007 03:51:56)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies



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



Re: [PHP] Php CLI Parser not working

2008-07-30 Thread Daniel Brown
On Wed, Jul 30, 2008 at 4:53 PM, JJB [EMAIL PROTECTED] wrote:

 Hi Daniel,

 We are running like:
 php mailscript.php

 The version:

 php-v

 PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Dec 12 2007 03:51:56)

Did you check what Jim suggested, as well, about short_open_tags?
If your scripts use PHP tags like this:

?

 instead of like this:

?php

 that's most likely the issue.  You can either modify all of
the PHP scripts to use the latter version of tag opening, or you can
modify your php.ini file to set short_open_tags to On (and then
restart Apache for the changes to take effect).

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Kevin Waterson
This one time, at band camp, Richard Heyes [EMAIL PROTECTED] wrote:

 I'm interested - why are people still using PHP4? It's been over 4
 years (I think) - plenty of time to upgrade to five.

I asked that question and was called a troll...

Kevin

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



Re: [PHP] Web2.0 style tags - where to start?

2008-07-30 Thread Kevin Waterson
This one time, at band camp, Paul Jinks [EMAIL PROTECTED] wrote:

 Does anyone know of any good resources on building a tagging system? The
 video for now will be held on a normal LAMP machine as will everything
 else.

Tagging...
http://phpro.org/tutorials/Tagging-With-PHP-And-MySQL.html

Kevin

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



[PHP] Not able to load the extensions

2008-07-30 Thread John Meyer

Apache 2.2
PHP 5.2.6 (as a module)
Windows

Relevant parts of php.ini
; Directory in which the loadable extensions (modules) reside.
extension_dir = I:\php\ext

extension=I:\php\ext\php_mssql.dll
extension=I:\php\ext\php_mysql.dll

Note: I did try it with just the name (php_mysql.dll) but it doesn't 
seem to work either way


And httpd.conf:

LoadModule php5_module I:\php\php5apache2_2.dll
AddType application/x-httpd-php .php
PHPIniDir C:\WINDOWS

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



[PHP] Back to Basics - Why Use Single Quotes?

2008-07-30 Thread Stephen

I have traditionally used double quotes going back to my PASCAL days.

I see many PHP examples using single quotes, and I began to adopt that 
convention.


Even updating existing code.

And I broke some stuff that was doing variable expansion. So I am back 
to using double quotes.


But I wonder, is there any reason to use single quotes?

Stephen

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



Re: [PHP] Back to Basics - Why Use Single Quotes?

2008-07-30 Thread mike
On 7/30/08, Stephen [EMAIL PROTECTED] wrote:

 But I wonder, is there any reason to use single quotes?

extremely minor performance gains, afaik.

probably moreso when doing $foo[bar] and $foo['bar']

but i believe it's negligible $foo = 'bar' and $foo = bar

sara golemon did some performance tests with actual opcode results here:
http://blog.libssh2.org/index.php?/archives/28-How-long-is-a-piece-of-string.html

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



Re: [PHP] Back to Basics - Why Use Single Quotes?

2008-07-30 Thread Daniel Brown
On Wed, Jul 30, 2008 at 6:51 PM, Stephen [EMAIL PROTECTED] wrote:
 I have traditionally used double quotes going back to my PASCAL days.

 I see many PHP examples using single quotes, and I began to adopt that
 convention.

 Even updating existing code.

 And I broke some stuff that was doing variable expansion. So I am back to
 using double quotes.

 But I wonder, is there any reason to use single quotes?

Single quotes means literal, whereas double quotes means translated.

For example:

?php

// This returns exactly the same data:
$foo_a = bar;
$foo_b = 'bar';

echo $foo_a; // bar
echo $foo_b; // bar


// This returns different data:
$foo = bar; // Single quotes can be used here just the same.

echo The answer is $foo; // The answer is bar
echo 'The answer is $foo'; // The answer is $foo


/* And if you want to use special
characters like newlines, you
MUST use double quotes. */

echo This echoes a newline.\n; // This echoes a newline. [newline]
echo 'This echoes a literal \n'; // This echoes a literal \n

?

Basically, double quotes evaluate certain things and return the
evaluation, while single quotes return EXACTLY what's typed between
them.

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] Why PHP4?

2008-07-30 Thread Chris
Per Jessen wrote:
 Lester Caine wrote:
 
 Some ISP's are still only supporting rather ancient versions of PHP4.
 They should simply be warned of the security risks. Some ISP's have a
 PHP5 offering, but again an older version simply because it causes
 less problems when converting from PHP4. 
 
 The problem for an ISP is - with thousands of customers, he has no way
 of knowing who has used what PHP extension or feature.  Without
 virtually guaranteed backwards compatibility, a mass upgrade of 4 to 5
 could be a major headache.  
 Besides, are the security risks sufficiently severe for the ISP to
 warrant the upgrade effort+headache?

Definitely. I've been the server-admin behind this sort of stuff
(actually php3 - php4 :P) and it's very hard to do even on your own
servers. Clients get other developers to write their software so you
have no idea what it does etc, you can't support it, you certainly don't
want to break it - so as much as possible you leave the server alone (of
course you upgrade for security issues, that's a given).

In time you get a new server and slowly migrate people to that, kill off
the old server and rinse-repeat.

-- 
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] Not able to load the extensions

2008-07-30 Thread Jim Lucas

John Meyer wrote:

Apache 2.2
PHP 5.2.6 (as a module)
Windows

Relevant parts of php.ini
; Directory in which the loadable extensions (modules) reside.
extension_dir = I:\php\ext

extension=I:\php\ext\php_mssql.dll
extension=I:\php\ext\php_mysql.dll

Note: I did try it with just the name (php_mysql.dll) but it doesn't 
seem to work either way


And httpd.conf:

LoadModule php5_module I:\php\php5apache2_2.dll
AddType application/x-httpd-php .php
PHPIniDir C:\WINDOWS



What type of errors, if any, do you get when you try and start Apache 
w/php?  Check your Apache and PHP error_log files.  Let us know what you 
find.


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



[PHP] Get Remote-Image

2008-07-30 Thread Konrad Priemer
Moin,

 

kann mir mal wer auf die Sprünge helfen, ich bekomme es gerade nicht
geregelt ein Image on-the-fly von einem Remote-Host per fsockopen auf
meinen Server zu ziehen.

Irgendwo hab ich da voll die Blockade ;)

 

Mein nichtfunktionierender Versuch:

 

...

...

$out = GET .URL_REMOTE_IMAGE. HTTP/1.0\r\nHost:
.$this-host.\r\nUser-Agent: GetWiki for WordPress\r\n\r\n;

$fp = fsockopen($this-host, $this-port, $errno, $errstr, 30);

$File = fopen(PFAD_ZUM_ASPEICHERN,wb); 

fwrite( $File, $out );

fclose($File);

fclose($fp);

...

...

 

THX und Grüße

 

Conny

 

 



[PHP] Best store for mans

2008-07-30 Thread php-general

Dont leave your nights dissatisfied

http://uimeds.com/

 
 
 
 
 
 
 
 
 
 
 
 
 
 
  












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



[PHP] Using $_GET for POST

2008-07-30 Thread Edward Diener
In handling an HTTP POST request I came across some PHP code, which I 
need to modify for my own purposes, which has code like this:


if ( ! (isset($_GET['x'])  $_GET['x'] == 20) )
   {
   // Do something by returning an error
   }

Can this ever be correct when the form looks like:

form ENCTYPE=multipart/form-data ACTION= METHOD=POST
input NAME=SomeFile TYPE=file
input VALUE=submit TYPE=submit/form

?

Is the $_GET possibly being used to check for an 'x' parameter being 
passed in the query part of the URL ?


I am fairly new to PHP so I am trying to understand how $_GET differs 
from $_POST. Thanks !


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



Re: [PHP] Using $_GET for POST

2008-07-30 Thread Micah Gersten
This page can help you understand them better:
http://us2.php.net/manual/en/language.variables.superglobals.php

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



Edward Diener wrote:
 In handling an HTTP POST request I came across some PHP code, which I
 need to modify for my own purposes, which has code like this:

 if ( ! (isset($_GET['x'])  $_GET['x'] == 20) )
{   
// Do something by returning an error
}

 Can this ever be correct when the form looks like:

 form ENCTYPE=multipart/form-data ACTION= METHOD=POST
 input NAME=SomeFile TYPE=file
 input VALUE=submit TYPE=submit/form

 ?

 Is the $_GET possibly being used to check for an 'x' parameter
 being passed in the query part of the URL ?

 I am fairly new to PHP so I am trying to understand how $_GET differs
 from $_POST. Thanks !


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



Re: [PHP] Using $_GET for POST

2008-07-30 Thread Robert Cummings
On Wed, 2008-07-30 at 22:18 -0400, Edward Diener wrote:
 In handling an HTTP POST request I came across some PHP code, which I 
 need to modify for my own purposes, which has code like this:
 
 if ( ! (isset($_GET['x'])  $_GET['x'] == 20) )
 { 
 // Do something by returning an error
 }
 
 Can this ever be correct when the form looks like:
 
   form ENCTYPE=multipart/form-data ACTION= METHOD=POST
   input NAME=SomeFile TYPE=file
   input VALUE=submit TYPE=submit/form
 
 ?
 
 Is the $_GET possibly being used to check for an 'x' parameter being 
 passed in the query part of the URL ?
 
 I am fairly new to PHP so I am trying to understand how $_GET differs 
 from $_POST. Thanks !

Yes this can be correct. Since the above action is set to blank, the
form will submit to the same page as that on which is is presented. As
such, if any GET parameters were set in the URL, they will be
re-presented upon submission along with any POSTed data.

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


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



Re: [PHP] Get Remote-Image

2008-07-30 Thread Daniel Brown
On Wed, Jul 30, 2008 at 9:50 PM, Konrad Priemer [EMAIL PROTECTED] wrote:

 kann mir mal wer auf die Sprünge helfen, ich bekomme es gerade nicht
 geregelt ein Image on-the-fly von einem Remote-Host per fsockopen auf
 meinen Server zu ziehen.

 Irgendwo hab ich da voll die Blockade ;)


Die copy() Funktion kann mit URL arbeiten.

http://php.net/copy

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] Web2.0 style tags - where to start?

2008-07-30 Thread Nitsan Bin-Nun
From my experience with Codeigniter, thats one of the best php frameworks I
have ever seen.
It functionality is awesome, you can integrate your own modifications to the
IC core without any problems at all, for more confortable you even don't
have to use a template system (but I'm pretty sure that you can integrate
Smarty to IC) and write your template with a pseudo code, CI supports ?php
? code inside your template!

Nitsan

2008/7/29 Jason Norwood-Young [EMAIL PROTECTED]


 On Mon, 2008-07-28 at 23:57 +0100, Paul Jinks wrote:
  Jason Norwood-Young wrote:
   On Mon, 2008-07-28 at 14:48 +0100, Paul Jinks wrote:
  
   I think my first post was ambiguous. What we're thinking of is to
 build a
   site on which people can view videos with the option to add metadata
 to a
   video after viewing it.
  
   We think that the content we have will be of wide interest to a lot of
   people and the best way to index it is for users to 'tag' it
 themselves,
   since it's hard for us to anticipate the uses that people may have for
 the
   content.
  
  
   How do you plan to have users enter the info? Through the Flash player,
   through some kinda Ajax form, through a form in a frame or just a
 static
   form?
  
   Also, would the tags be predefined by you (eg. genres like the ID3 tag
   genres) or would people be able to add their own tags?
  
   The way I'd do it would be to let the users enter the info through an
   Ajax form below the video, with suggestions popping up as they type.
   Then save it in a separate table (I assume all your vids are in their
   own table) with a link table between the vids table and the tags table
   (M2M relationship). This means that if the tag is already in there and
   linked to one vid, you don't replicate it for a second vid. It's also
   very easy to do lookups of similar items. I'd also add a weighting to
   the tags in the links table, maybe with the more people that add a
   specific tag, the more weight that tag gets.
  
   Also check out http://www.music-map.com/ as an example of showing
   similar music - you might even be able to plug into this data.
  
  
  Hi Jason
 
  Hmm, food for thought. music-map is brilliant, though not what I'm
  looking for graphically at the moment (was surprised to find Cesaria
  Evora in close proximity to The Cardigans but I digress).
 
  What you describe is pretty much what I'm chasing, thanks and helps me
  down the road, particularly with thinking about the database set up.
  They 'only' problem is, my php/mysql skills are some way behind my
  javascript/actionscript  knowhow (I'm pretty much a noob here);  what I
  could use now is a how-to tutorial to give me some code to work off,
  either online or in a book. If it ain't there, I can build from scratch
  but it's going to mean a lot of calls for help! =)
 
  Many thanks
 
  Paul

 In that case, I suggest the following solution:
 1. Download the unternet into your puter
 2. Open the file called mysql.com
 3. Read and learn
 4. Open the file called php.net
 5. Read and learn
 6. Rinse and repeat

 In all seriousness, this is a nice, simple project to learn on. You want
 to look at different types of relationships in Sql (one-to-one,
 one-to-many and many-to-many) and learn a bit about basic DB
 architecture; make some tables and play with getting data in and out
 (get PHPMyAdmin to help you out); maybe use a nice simple framework like
 CodeIgniter to get you kick-started on the PHP.


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




Re: [PHP] Using $_GET for POST

2008-07-30 Thread Nitsan Bin-Nun
Umm I suggest you try this code:

index.php:

?php
$formContainer = EOF
   form ACTION=index.php?this=isawsome=dontyou=think METHOD=POST
   input type='text' name='check' value='' /br /
   input VALUE=submit name='submitted' TYPE=submit/form
EOF;

if (!isset($_POST['submitted']))
   echo $formContainer;
else
{
   echo xmp;
   var_dump($_GET);
   echo \n\n\n;
   var_dump($_POST);
   echo '/xmp';
   echo $formContainer;
}
?

HTH,
Nitsan

2008/7/31 Robert Cummings [EMAIL PROTECTED]

 On Wed, 2008-07-30 at 22:18 -0400, Edward Diener wrote:
  In handling an HTTP POST request I came across some PHP code, which I
  need to modify for my own purposes, which has code like this:
 
  if ( ! (isset($_GET['x'])  $_GET['x'] == 20) )
  {
  // Do something by returning an error
  }
 
  Can this ever be correct when the form looks like:
 
form ENCTYPE=multipart/form-data ACTION= METHOD=POST
input NAME=SomeFile TYPE=file
input VALUE=submit TYPE=submit/form
 
  ?
 
  Is the $_GET possibly being used to check for an 'x' parameter being
  passed in the query part of the URL ?
 
  I am fairly new to PHP so I am trying to understand how $_GET differs
  from $_POST. Thanks !

 Yes this can be correct. Since the above action is set to blank, the
 form will submit to the same page as that on which is is presented. As
 such, if any GET parameters were set in the URL, they will be
 re-presented upon submission along with any POSTed data.

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


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




Re: [PHP] Using $_GET for POST

2008-07-30 Thread Robert Cummings
On Thu, 2008-07-31 at 06:41 +0200, Nitsan Bin-Nun wrote:
 Umm I suggest you try this code:
 
 index.php:
 
 ?php
 $formContainer = EOF
form ACTION=index.php?this=isawsome=dontyou=think METHOD=POST

Those ampersands should be appropriately marked up.

:B

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


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



Re: [PHP] Web2.0 style tags - where to start?

2008-07-30 Thread Jason Norwood-Young

On Thu, 2008-07-31 at 06:28 +0200, Nitsan Bin-Nun wrote:
 From my experience with Codeigniter, thats one of the best php frameworks I
 have ever seen.
 It functionality is awesome, you can integrate your own modifications to the
 IC core without any problems at all, for more confortable you even don't
 have to use a template system (but I'm pretty sure that you can integrate
 Smarty to IC) and write your template with a pseudo code, CI supports ?php
 ? code inside your template!

What I love about CodeIgniter is that, while some frameworks obfuscate
my thinking, CodeIgniter clarifies my thoughts, structure and overall
architecture. MVC programming is no longer some mysterious theoretical
entity - it just makes sense with CodeIgniter. Plus it doesn't tell you
how to do something - it just gives you the structure for you to decide
and do whatever you want. And it's so light I'd barely call it a
framework - more like a kick-start. I could wax lyrical about this all
day. Maybe I should write an ode...


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