php-general Digest 29 Dec 2009 03:25:03 -0000 Issue 6511

2009-12-28 Thread php-general-digest-help

php-general Digest 29 Dec 2009 03:25:03 - Issue 6511

Topics (messages 300712 through 300716):

Re: 404 page
300712 by: navneet sharma
300714 by: Thijs Lensselink
300715 by: Gautam Bhatia

Re: Question Answer based report.
300713 by: navneet sharma

Re: Classes and Functions
300716 by: Daniel Kolbo

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
Hi,

- About 404 error document... Make sure  filenotfound.html is in public_html
or www directory as your are using shared hosting...

- Generally in share hosting environment you are not allowed to modify
php.ini (GoDaddy allows), you can modify some property of httpd.config and
php.ini using .htaccess but again depands on server administrator's
permission.

Navneet.

On Mon, Dec 28, 2009 at 11:13 AM, Sudhakar sudhakarar...@gmail.com wrote:

 hi

 1.
 i have a .htaccess file in my root directory on unix hosting

 following is the code in .htaccess file

 ErrorDocument 404 /filenotfound.html

 the file filenotfound.html is also in the root directory as the htaccess
 file

 when i intentionally type a wrong url either if a misspell a file ex=
 http://domainname.com/filenam.html or a folder ex =
 http://domainname.com/100
 to test if this is working filenotfound.html is not being called

 any reason why this is happening



 also the same thing with wamp on my local computer, i have a htaccess and
 also the filenotfound
 in d:/wamp/www however when i misspell the ulr of my localhost, i have
 noticed in the status bar that the page is being redirected to
 http://linkhelp.clients.google.com and i get a 404 from this website, how
 can i change this redirection



 2.
 how do i access the php.ini and httpd.conf file from my cpanel, do i need
 to
 ask my hosting provider to make any changes or can i make these changes
 myself

 3.
 after downloading putty and if i have wamp in d:/wamp/www how do i access
 mysql from the command prompt
 using putty on my local machine

 please advice


 thanks.

---End Message---
---BeginMessage---

navneet sharma wrote:

Hi,

- About 404 error document... Make sure  filenotfound.html is in public_html
or www directory as your are using shared hosting...

- Generally in share hosting environment you are not allowed to modify
php.ini (GoDaddy allows), you can modify some property of httpd.config and
php.ini using .htaccess but again depands on server administrator's
permission.

Navneet.

On Mon, Dec 28, 2009 at 11:13 AM, Sudhakar sudhakarar...@gmail.com wrote:


hi

1.
i have a .htaccess file in my root directory on unix hosting

following is the code in .htaccess file

ErrorDocument 404 /filenotfound.html


try removing the '/' in front of the file. I don't think the 404 file 
resides in the root of your filesystem.




the file filenotfound.html is also in the root directory as the htaccess
file

when i intentionally type a wrong url either if a misspell a file ex=
http://domainname.com/filenam.html or a folder ex =
http://domainname.com/100
to test if this is working filenotfound.html is not being called

any reason why this is happening



also the same thing with wamp on my local computer, i have a htaccess and
also the filenotfound
in d:/wamp/www however when i misspell the ulr of my localhost, i have
noticed in the status bar that the page is being redirected to
http://linkhelp.clients.google.com and i get a 404 from this website, how
can i change this redirection



2.
how do i access the php.ini and httpd.conf file from my cpanel, do i need
to
ask my hosting provider to make any changes or can i make these changes
myself

3.
after downloading putty and if i have wamp in d:/wamp/www how do i access
mysql from the command prompt
using putty on my local machine

please advice


thanks.





---End Message---
---BeginMessage---
Hey,
There is one more way of going about it, Try using Absolute URL's
instead of relative ones' , If you are on your local computer using wamp for
testing codes and all, don't think you need to use putty :) , if you are try
to login to your local pc from another system, you can enable telnet on your
local machine, so that you can use putty to telnet to your system . you will
also need to change mysql setting to allow remote access , due to security
by default only local account are allowed to access the mysql server for
user, you will need to create account like u ''username'@'%' . good luck.

Regards,
Gautam Bhatia

-Original Message-
From: Sudhakar [mailto:sudhakarar...@gmail.com] 
Sent: Monday, December 28, 2009 11:14 AM
To: php-gene...@lists.php.net
Subject: [PHP] 404 page

hi

1.
i have a .htaccess file in my root directory on unix hosting


RE: [PHP] 404 page

2009-12-28 Thread Gautam Bhatia
Hey,
There is one more way of going about it, Try using Absolute URL's
instead of relative ones' , If you are on your local computer using wamp for
testing codes and all, don't think you need to use putty :) , if you are try
to login to your local pc from another system, you can enable telnet on your
local machine, so that you can use putty to telnet to your system . you will
also need to change mysql setting to allow remote access , due to security
by default only local account are allowed to access the mysql server for
user, you will need to create account like u ''username'@'%' . good luck.

Regards,
Gautam Bhatia

-Original Message-
From: Sudhakar [mailto:sudhakarar...@gmail.com] 
Sent: Monday, December 28, 2009 11:14 AM
To: php-general@lists.php.net
Subject: [PHP] 404 page

hi

1.
i have a .htaccess file in my root directory on unix hosting

following is the code in .htaccess file

ErrorDocument 404 /filenotfound.html

the file filenotfound.html is also in the root directory as the htaccess
file

when i intentionally type a wrong url either if a misspell a file ex=
http://domainname.com/filenam.html or a folder ex =
http://domainname.com/100
to test if this is working filenotfound.html is not being called

any reason why this is happening



also the same thing with wamp on my local computer, i have a htaccess and
also the filenotfound
in d:/wamp/www however when i misspell the ulr of my localhost, i have
noticed in the status bar that the page is being redirected to
http://linkhelp.clients.google.com and i get a 404 from this website, how
can i change this redirection



2.
how do i access the php.ini and httpd.conf file from my cpanel, do i need to
ask my hosting provider to make any changes or can i make these changes
myself

3.
after downloading putty and if i have wamp in d:/wamp/www how do i access
mysql from the command prompt
using putty on my local machine

please advice


thanks.

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.698 / Virus Database: 270.14.122/2590 - Release Date: 12/28/09
12:46:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 9.0.698 / Virus Database: 270.14.122/2590 - Release Date: 12/28/09
12:46:00


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



[PHP] Re: Classes and Functions

2009-12-28 Thread Daniel Kolbo
Nathan Rixham wrote:
 Daniel Kolbo wrote:
 Hello,

 Is there a way to see what objects and functions a script
 loaded/required/used?

 I could recursively loop through the globals, but if objects were unset,
 then i may miss some.

 I could make a 'tracking' object and every time i load/include a file
 (which contains a class def or a function def) to add that file to the
 tracking object...but it would be nice if i didn't have to modify my
 existing code to see which objects and functions a script actually used,
 or at least, requested and loaded into memory.

 Thanks in advance,
 Daniel Kolbo
 `

 
 if it's for debugging, get a good debugger so you can inspect at break
 points; for use during runtime and something scripted you can call the
 relevant get_defined/declared functions before before your app does it's
 loading, then the same later on and compare to get a definitive list.
 
 also worth asking if you're refering to objects (as in instances) or
 classes.
 
 Object = instance of a Class [ $object = new Class() ]
 
Hello Mr. Rixham,

Thanks for the reminder about those 'get' functions.  (just what i was
looking for).

Thanks,
dK
`

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



[PHP] Multiple Inheritance Needed in OOP?

2009-12-28 Thread Daniel Kolbo
Hello,

Okay so PHP designers explicitly decided against multiple inheritances,
but aren't there legitimate needs for multiple inheritance in OOP?

For example, consider the following three classes (A,B,C) with the
following properties (a number is a distinct property or method).

A: 1, 2, 3
B: 1,3
C: 1, 2,

I would like to set the 3 classes up so that no object has 'extra'
properties than it requires, so that no property has to be
declared/defined in two or more classes, and so that we are strictly
using single inhertiance.  I don't think it's possible.  I've been
incorrect beforee...If i'm incorrect please let me know how to set this
up as a single inhertance class structure.

If this is not possible, why doesn't the PHP community implement
multiple inheritance?  (I'm anticipating that someone will say, you
simply need to redefine what you are calling your objects so that the
properties do permit a single inheritance...)

I'm very interested to hear why there is the dogma of single inheritance
only.

Thanks,
dK
`

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



[PHP] MySQL Increment/Decrement

2009-12-28 Thread Ben Miller
I hope this isn't a bone-head question - Is there a MySQL query that will
increment/decrement the value in an integer column with a single query - in
other words, I don't have to run a SELECT query to get the value,
add/subtract to/from the value, and then run an UPDATE query to store the
new value?

 

Thanks in advance.

 

Ben



Re: [PHP] MySQL Increment/Decrement

2009-12-28 Thread Robert Cummings

Ben Miller wrote:

I hope this isn't a bone-head question - Is there a MySQL query that will
increment/decrement the value in an integer column with a single query - in
other words, I don't have to run a SELECT query to get the value,
add/subtract to/from the value, and then run an UPDATE query to store the
new value?


You mean:

UPDATE table SET column = column + 1;

?

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] MySQL Increment/Decrement

2009-12-28 Thread Bipper Goes!
UPDATE SQLTABLE SET count = (count+1) WHERE PromoID=1

Is this valid for your issue?  I have no way of testing or toying

On Mon, Dec 28, 2009 at 8:54 PM, Ben Miller b...@tottd.com wrote:

 I hope this isn't a bone-head question - Is there a MySQL query that will
 increment/decrement the value in an integer column with a single query - in
 other words, I don't have to run a SELECT query to get the value,
 add/subtract to/from the value, and then run an UPDATE query to store the
 new value?



 Thanks in advance.



 Ben




Re: [PHP] MySQL Increment/Decrement

2009-12-28 Thread Eric Lee
Ben

It seems that you can just update the column with a update query like this,

update table set field = field + 1 where some condition

This might be the thing you need.


Eric



On 12/29/09, Ben Miller b...@tottd.com wrote:

 I hope this isn't a bone-head question - Is there a MySQL query that will
 increment/decrement the value in an integer column with a single query - in
 other words, I don't have to run a SELECT query to get the value,
 add/subtract to/from the value, and then run an UPDATE query to store the
 new value?



 Thanks in advance.



 Ben




Re: [PHP] Multiple Inheritance Needed in OOP?

2009-12-28 Thread Larry Garfield
On Monday 28 December 2009 9:45:03 pm Daniel Kolbo wrote:
 Hello,

 Okay so PHP designers explicitly decided against multiple inheritances,
 but aren't there legitimate needs for multiple inheritance in OOP?

 For example, consider the following three classes (A,B,C) with the
 following properties (a number is a distinct property or method).

 A: 1, 2, 3
 B: 1,3
 C: 1, 2,

 I would like to set the 3 classes up so that no object has 'extra'
 properties than it requires, so that no property has to be
 declared/defined in two or more classes, and so that we are strictly
 using single inhertiance.  I don't think it's possible.  I've been
 incorrect beforee...If i'm incorrect please let me know how to set this
 up as a single inhertance class structure.

 If this is not possible, why doesn't the PHP community implement
 multiple inheritance?  (I'm anticipating that someone will say, you
 simply need to redefine what you are calling your objects so that the
 properties do permit a single inheritance...)

 I'm very interested to hear why there is the dogma of single inheritance
 only.

 Thanks,
 dK
 `

Because pure multiple inheritance can lead to all sorts of highly weird 
behavior when you don't know which parent class you mean at any given time.  
Single inheritance is just easier to wrap your head around, and wrap the 
compiler's head around.

What you're looking for is composition, which can do pretty much what you're 
looking for.  See my last reply to you on this list from Christmas day.

There's been some discussion of implementing traits in later versions of 
PHP, but no concrete patches so far.

-- 
Larry Garfield
la...@garfieldtech.com

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



[PHP] Merry Xmas and Happy New year

2009-12-28 Thread Gautam Bhatia
Hey Guys,
Have a great new year and merry Christmas.


Regards,
Gautam Bhatia
mail2gautambha...@gmail.com