php-general Digest 10 Mar 2008 06:38:37 -0000 Issue 5339

2008-03-09 Thread php-general-digest-help

php-general Digest 10 Mar 2008 06:38:37 - Issue 5339

Topics (messages 271178 through 271188):

Unexcepted $this
271178 by: Murat BEÞER
271180 by: Anup Shukla
271183 by: Murat BEÞER
271184 by: Murat BEÞER
271188 by: Anup Shukla

Re: send form by email with image spam controler
271179 by: Per Jessen

SMTP
271181 by: Alain Roger
271182 by: Ray Hauge
271185 by: Andrés Robinet

Re: Links hierarchy maintenance
271186 by: tedd
271187 by: Adil Drissi

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]


--
--- Begin Message ---

I can't under stood but PHP gaves me an error:

"UnExcepted $this" for " || $this->getFileExtension($file) == 'jpg' "

When I removed jpg extension check it's okay... PHP script runs well.

What is the problem :)

public function loadImages($folder) {
$result = $this->filemanager->fecthFiles($folder);
$images = array();
if (sizeof($result)>=1 && $result !== false) {
foreach ($result as $file) {
if ($this->getFileExtension($file) == 'gif' || 
$this->getFileExtension($file) == 'png' 
|| $this->getFileExtension($file) == 'jpg') {

$images[] = array('name'=>$file);
}
}
}
return $images;
}
--- End Message ---
--- Begin Message ---

Murat BEŞER wrote:

I can't under stood but PHP gaves me an error:

"UnExcepted $this" for " || $this->getFileExtension($file) == 'jpg' "

When I removed jpg extension check it's okay... PHP script runs well.

What is the problem :)

public function loadImages($folder) {
$result = $this->filemanager->fecthFiles($folder);
$images = array();
if (sizeof($result)>=1 && $result !== false) {
foreach ($result as $file) {
if ($this->getFileExtension($file) == 'gif' || 
$this->getFileExtension($file) == 'png' || 
$this->getFileExtension($file) == 'jpg') {


if (
   ($this->getFileExtension($file) == 'gif') ||
   ($this->getFileExtension($file) == 'png') ||
   ($this->getFileExtension($file) == 'jpg')
) {
... rest of your code
...
}



$images[] = array('name'=>$file);
}
}
}
return $images;
}




--
Regards,
Anup Shukla
--- End Message ---
--- Begin Message ---

Thank you Anup,

But why I getting this error ?
is this a bug ?

I have changed my code like this

if (in_array($this->getFileExtension($file), array('gif', 'jpg', 'png'))) {
}

but I can't understand.


Anup Shukla yazmış:

Murat BEŞER wrote:

I can't under stood but PHP gaves me an error:

"UnExcepted $this" for " || $this->getFileExtension($file) == 'jpg' "

When I removed jpg extension check it's okay... PHP script runs well.

What is the problem :)

public function loadImages($folder) {
$result = $this->filemanager->fecthFiles($folder);
$images = array();
if (sizeof($result)>=1 && $result !== false) {
foreach ($result as $file) {
if ($this->getFileExtension($file) == 'gif' || 
$this->getFileExtension($file) == 'png' || 
$this->getFileExtension($file) == 'jpg') {


if (
   ($this->getFileExtension($file) == 'gif') ||
   ($this->getFileExtension($file) == 'png') ||
   ($this->getFileExtension($file) == 'jpg')
) {
... rest of your code
...
}



$images[] = array('name'=>$file);
}
}
}
return $images;
}




--- End Message ---
--- Begin Message ---

Thank you Anup,

But why I getting this error ?
is this a bug ?

I have changed my code like this

if (in_array($this->getFileExtension($file), array('gif', 'jpg', 'png'))) {
}

but I can't understand.


Anup Shukla yazmış:

Murat BEŞER wrote:

I can't under stood but PHP gaves me an error:

"UnExcepted $this" for " || $this->getFileExtension($file) == 'jpg' "

When I removed jpg extension check it's okay... PHP script runs well.

What is the problem :)

public function loadImages($folder) {
$result = $this->filemanager->fecthFiles($folder);
$images = array();
if (sizeof($result)>=1 && $result !== false) {
foreach ($result as $file) {
if ($this->getFileExtension($file) == 'gif' || 
$this->getFileExtension($file) == 'png' || 
$this->getFileExtension($file) == 'jpg') {


if (
   ($this->getFileExtension($file) == 'gif') ||
   ($this->getFileExtension($file) == 'png') ||
   ($this->getFileExtension($file) == 'jpg')
) {
... rest of your code
...
}



$images[] = array('name'=>$file);
}
}
}
return $images;
}






--- End Message ---
--- Begin Message ---

Murat 

php-general Digest 9 Mar 2008 15:58:07 -0000 Issue 5338

2008-03-09 Thread php-general-digest-help

php-general Digest 9 Mar 2008 15:58:07 - Issue 5338

Topics (messages 271168 through 271177):

Re: include() and current working directory
271168 by: Jim Lucas

Re: Links hierarchy maintenance
271169 by: Per Jessen
271176 by: Adil Drissi
271177 by: Per Jessen

Re: Message
271170 by: cadaver.planethalflife.com

Re: send form by email with image spam controler
271171 by: Per Jessen
271173 by: Richard Heyes
271174 by: Per Jessen
271175 by: Stut

path_info in fastcgi setting
271172 by: Ian M. Evans

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]


--
--- Begin Message ---

[EMAIL PROTECTED] wrote:

Hi,

I'm using include to display a html file from a different directory to 
the current working directory.


This page displays, but is missing all the CSS formating.

I'm assuming this is because it can't find the CSS because it's in the 
different directory to the CWD.


So, the easy way out is to move the CSS, but I've got heaps of these, 
and it makes it really messy.


The PHP looks like this:

include("xxx/index.htm");

the css is saved in the xxx folder.

I'm open to any suggestions, ideas?

Many thanks
Matt




I think your problem has to do with the difference between relative and 
absolute URL references.


Do some googling about those and I think you might get your answer.  If 
you do not, and since this really has nothing to do with PHP, you can 
email off list and I can assist you with the problem.


Thanks

Jim Lucas
--- End Message ---
--- Begin Message ---
Adil Drissi wrote:

> Hi,
> 
> Yes this is the correct way to do things. As i said,
> i'm using different styles for the menus links
> indicating the current page. Suppose my page has one
> horiontal menu at the top and one vertical menu at the
> left. In this case, one element of the horizontal menu
> and one from the vertical menu will be displayed
> differently from the other elements. So the function
> that will be inluded will be more complex to handle
> this. I was just wondering, how other poeple are
> dealing with that. Of course it is feasable, but i
> want to do it the best way.

CSS ?  If that's not enough to alter the display, you need to make your
includes sensitive to or aware of the context they're being included
in. 


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Hi Jessen,

The question is how to make it aware of the context.
Do you know any work dealing with that?

Thanks

--- Per Jessen <[EMAIL PROTECTED]> wrote:

> Adil Drissi wrote:
> 
> > Hi,
> > 
> > Yes this is the correct way to do things. As i
> said,
> > i'm using different styles for the menus links
> > indicating the current page. Suppose my page has
> one
> > horiontal menu at the top and one vertical menu at
> the
> > left. In this case, one element of the horizontal
> menu
> > and one from the vertical menu will be displayed
> > differently from the other elements. So the
> function
> > that will be inluded will be more complex to
> handle
> > this. I was just wondering, how other poeple are
> > dealing with that. Of course it is feasable, but i
> > want to do it the best way.
> 
> CSS ?  If that's not enough to alter the display,
> you need to make your
> includes sensitive to or aware of the context
> they're being included
> in. 
> 
> 
> /Per Jessen, Zürich
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


--- End Message ---
--- Begin Message ---
Adil Drissi wrote:

> Hi Jessen,
> 
> The question is how to make it aware of the context.
> Do you know any work dealing with that?

Variables?  Set a variable $context= before you include, then have your
include check on $context. 


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Important message, do not show this anyone!

--- End Message ---
--- Begin Message ---
tedd wrote:

> Here's a few.
> 
> http://webbytedd.com/aa/assorted-captcha/
> 
> BUT, all can be broke by a spammer. There is no solution.
> 

How about this one - 

http://jessen.ch/articles/captcha

Well, of course it can be broken too - it's only a matter of money and
time, both of which are critical to spammers. 

(for the moment it has a limited number of questions and only in
English).



/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
How about this one - 


http://jessen.ch/articles/captcha

Well, of course it can be broken too - it's only a matter of money and
time, both of which are critical to