Re: [PHP] Undefined index a different problem

2003-01-07 Thread Mekrand
thanks but this time it gives 2 error,
undefined variable i,
undefined index i for
$GLOBALS[$i]
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Mekrand wrote:
>
> >my problem is,
> >i have a script that works well before php 4.2.3
> >
> >its sth like that
> >{..
> >
> > for($i=0; $i >...
> >}
> >
> >//2nd part
> >{
> >echo ("$i");
> >}
> >
> >now i changed second part as;
> >
> >echo("$GLOBALS[i]");
> >
> should not be
>
> echo("$GLOBALS[$i]");
>
>
> >
> >and it gives me notice that undefined index i.
> >how can i solve this problem?
> >thanks
> >
> >
> >
> >
> >
> >
>



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




[PHP] Undefined index a different problem

2003-01-07 Thread Mekrand
my problem is,
i have a script that works well before php 4.2.3

its sth like that
{..

 for($i=0; $ihttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: filemtime -help

2002-12-12 Thread Mekrand
thanks
"@ Edwin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> "Mekrand" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i have a problem with filemtime function, i want script print out the
date
> > of file last modified.
> > here is code,
> > $fp=fopen("ex.txt","r");
> > echo date("j F Y H:i", filemtime($fp));
> > fclose($fp);
>
> I guess you have to check the manual again :)
>
> You don't need fopen() and fclose() here. Just do:
>
>   echo date("j F Y H:i", filemtime("ex.txt"));
>
> - E
>



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




[PHP] filemtime -help

2002-12-12 Thread Mekrand
i have a problem with filemtime function, i want script print out the date
of file last modified.
here is code,
$fp=fopen("ex.txt","r");
echo date("j F Y H:i", filemtime($fp));
fclose($fp);

it turns out; 1 January 1970 02:00 everytime , i modified file, but this
doesnt change, lastly i deleted and uploaded file again, it turns out again
1 January 1970 02:00 .
my server date is correct, output for date("j F Y H:i")  is 12 December 2002
15:40
operating system is linux, and running apache server.

do i need to use clearstatcache ? if so, how?
thanks for any assistance




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




[PHP] filemtime -help

2002-12-12 Thread Mekrand
i have a problem with filemtime function, i want script print out the date
of file last modified.
here is code,
$fp=fopen("ex.txt","r");
echo date("j F Y H:i", filemtime($fp));
fclose($fp);

it turns out; 1 January 1970 02:00 everytime , i modified file, but this
doesnt change, lastly i deleted and uploaded file again, it turns out again
1 January 1970 02:00 .
my server date is correct, output for date("j F Y H:i")  is 12 December 2002
15:40
operating system is linux, and running apache server.

do i need to use clearstatcache ? if so, how?
thanks for any assistance



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




Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
yes you are right, im very pensive today, :)
thanks chris and mako
"Chris Wesley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wed, 11 Dec 2002, Mekrand wrote:
>
> > i solved problem, -not a good solution-
> > i changed only
> > $adam=fread($ip,filesize($ip));
>
> You have:
> $string = fread( $fileHandle, filesize( $fileHandle ) );
>
> The example at php.net you looked at has:
> $string = fread( $fileHandle, filesize( $fileName ) );
>
> Just change your call to filesize() to use the file name as the argument.
> No need to have a dirty solution, if you don't want to :)
>
> g.luck,
> ~Chris
>



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




Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
i solved problem, -not a good solution-
i changed only
$adam=fread($ip,filesize($ip));


to

$adam=fread($ip,1024);

i dont understand what is wrong with filesize($ip) . i got this from php.net
and i thought it was valid.

link:
http://www.php.net/manual/en/function.fread.php

quote:




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




Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
sorry the code was

that doesnt work.




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




Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
thanks,
it was very silly mistake,
but it doesnt work,
there in nothing wrong with if statement,
moreover,

i think there is something wrong with fread, is there another way to reading
a file, and return it as a string?

doesnt work too



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




[PHP] hi

2002-12-11 Thread Mekrand
test



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




[PHP] strstr-pls help

2002-12-11 Thread Mekrand
i couldnt find out what is wrong with this script ,
can anbody explain

$ip=fopen("ip.txt", 'r+');
$adam=fread($ip,filesize($adam));
fclose($ip);
if(stristr($adam,$_SERVER[REMOTE_ADDR]))
echo "an entry submitted from this ip already";
else
{
..
//block 1
..
}

the ip.txt
10.8.0.21 10.8.5.21 10.8.7.21 10.8.0.24

although users ip is for example 10.8.0.21, the script doesnt echo warning,
instead it goes throug the block 1,
thanks for any assistance,

ps: i hope , this thread isnt off -topic ,if so , please warn



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