$type ["extension"];

This is a discussion on $type ["extension"]; within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, refering to: $type = pathinfo($filename); $ext = $type ["extension"]; complains: Notice: Undefined index: extension in C:\Program Files\...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-30-2006
Jean Pierre Daviau
 
Posts: n/a
Default $type ["extension"];

Hi,

refering to:
$type = pathinfo($filename);
$ext = $type ["extension"];

complains:
Notice: Undefined index: extension in C:\Program Files\Apache
Group\Apache2\htdocs\titImage\imgSrc.php on line 61

--
Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com


Reply With Quote
  #2 (permalink)  
Old 03-30-2006
Johannes Wienke
 
Posts: n/a
Default Re: $type ["extension"];

Am 30.03.2006 21:19 schrieb Jean Pierre Daviau:
> refering to:
> $type = pathinfo($filename);
> $ext = $type ["extension"];


Seems to be ok.

> complains:
> Notice: Undefined index: extension in C:\Program Files\Apache
> Group\Apache2\htdocs\titImage\imgSrc.php on line 61


Are you shure, that your file exists? Do you use error_reporting(E_ALL)?
Reply With Quote
  #3 (permalink)  
Old 03-31-2006
Johannes Wienke
 
Posts: n/a
Default Re: $type ["extension"];

Am 31.03.2006 01:17 schrieb Johannes Wienke:

> Are you shure, that your file exists? Do you use error_reporting(E_ALL)?

^^^^^
meant sure ;)
Reply With Quote
  #4 (permalink)  
Old 03-31-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: $type ["extension"];



>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)?


Yes


Reply With Quote
  #5 (permalink)  
Old 03-31-2006
Johannes Wienke
 
Posts: n/a
Default Re: $type ["extension"];

Am 31.03.2006 17:15 schrieb Jean Pierre Daviau:
>>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)?

>
> Yes
>


What about var_dump($type)?
Reply With Quote
  #6 (permalink)  
Old 04-01-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: $type ["extension"];


"Johannes Wienke" <spam@semipol.de> a écrit dans le message de news:
495nflFn2i9iU2@news.dfncis.de...
> Am 31.03.2006 17:15 schrieb Jean Pierre Daviau:
>>>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)?

>>
>> Yes
>>

>
> What about var_dump($type)?


$type = pathinfo($filename);

$ext = @$type ["extension"];
..............^

good enough

I used E_all instead of E_PARSE for better coding .I corrected 3 errors
that way.



Reply With Quote
  #7 (permalink)  
Old 04-01-2006
Johannes Wienke
 
Posts: n/a
Default Re: $type ["extension"];

Am 01.04.2006 21:48 schrieb Jean Pierre Daviau:
> "Johannes Wienke" <spam@semipol.de> a écrit dans le message de news:
> 495nflFn2i9iU2@news.dfncis.de...
>> Am 31.03.2006 17:15 schrieb Jean Pierre Daviau:
>>>>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)?
>>> Yes
>>>

>> What about var_dump($type)?

>
> $type = pathinfo($filename);
>
> $ext = @$type ["extension"];
> .............^
>
> good enough


What's that? I don't see any difference then suppressing errors, what is
nearly allways a bad idea.

> I used E_all instead of E_PARSE for better coding .I corrected 3 errors
> that way.


Take a look above. That's exactly what I said...
Reply With Quote
  #8 (permalink)  
Old 04-01-2006
Drakazz
 
Posts: n/a
Default Re: $type ["extension"];

Hm, Guys :))
maybe $filename doesn't have an extension?

pathinfo cretes only things that can be found...

<?php
$type=pathinfo($filename);
if ( isset($type['extension']) ) {
//extension set
}
else {
// extension not set
}
?>

or whatever...

Reply With Quote
  #9 (permalink)  
Old 04-02-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: $type ["extension"];

thanks


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:07 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0