[PHP] ftp_get() problem

2007-06-22 Thread Phil Curry
New to php and this list. Googled a lot and scoured newsgroups to no  
avail. So now I'm here looking for an answer. Here's my offending line:


 $gotFile = ftp_get( $connection, $destination, $source,  
FTP_BINARY );


Just prior to execution all parameters have valid values. The  
following error is reported:


 Warning: ftp_get() [function.ftp-get]: Error opening  
iPhoneRingTone.mp3 in /Users/b1ueskyz/Sites/pmcRoutines.php on line 91


Using the same parameters I am able to successfully ftp_put(),  
ftp_rename(), and ftp_delete()the file. I just can't 'get' it.



Any help or direction is greatly appreciated.
-Phil Curry

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



[PHP] ftp_get() Pt2

2007-06-22 Thread Phil Curry

Oops. Forgot to mention

If I use an ftp client of ftp from the command line, I can 'get' the  
file.  This is why I thought it was my code.


Thanks.
-Phil

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



[PHP] I know this is not easy and I'm not stupid but...

2007-08-08 Thread Phil Curry
how can this be? This is not the first time I've run into a situation  
like this. What am I missing?


line 102echo  ($userValues['afterDark']); // outputs 1

line 103if ( $userValues['afterDark'] == 0 ) {// passes


Thanks.
-Phil

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



Re: [PHP] I know this is not easy and I'm not stupid but...

2007-08-09 Thread Phil Curry

Please include the list when replying.

Phil Curry wrote:

Phil Curry wrote:
how can this be? This is not the first time I've run into a  
situation like this. What am I missing?
line 102echo  ($userValues['afterDark']); //  
outputs 1

line 103if ( $userValues['afterDark'] == 0 ) {// passes


Add a line at 102.5...

var_dump($userValues['afterDark']);

What type is that variable?

Don't have to do a dump, I know its a tinyint(1), not null, default 0


That would be the type in the database, not the type of that  
variable at that time.


-Stut

--
http://stut.net/


Absolutely right. didn't think of that.

var_dump($userValues['afterDark']);  ==> string(1) "1"

but then I'm comparing a string to an int and the result always seems  
to pass. So does that mean any string compared to any int will be true?
By casting (int)$userValues['afterDark'] the test still passes and  
var_dump shows the (int)$userValues['afterDark'] as an int(1) but  
does give a value like the previous example.
ie. string(1)"1" but only int(1) Not sure if the expression has a  
value of "1" now that its been cast.


Then finally  if ( (int)$userValues['afterDark'] === 0 ) {//  
passes


So:
if ( $userValues['afterDark'] == 0 ) {  // passes
if ( (int)$userValues['afterDark'] == 0 ) {   // passes
if ( (int)$userValues['afterDark'] === 0 ) { // passes

And the value of afterdark in the mysql table is tinyint(1) 1.
And echo( 1+(int)$userValues['afterDark']);// outputs 2

Now I'm confused!
-Phil

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