[PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Ben Crawford

You also seem to have an extra equals. Your loop should read:

while (false != ($file=readdir($handle))){

It should come up as an error, but I'm not sure.

Ben

Manuel Ritsch wrote:

> Hello There
>
> I'm new to PHP and trying to code a function that reads all teh files out of
> a directory and printing out a link and the filesize,
> but it seems that the filesize() function doesn't work, here's the code so
> far:
>
>  $handle = opendir ('images');
>  echo "Files:";
>  while (false !== ($file = readdir ($handle))) {
>  if($file != "." && $file != "..")
>  {
>  $file_s = filesize($file);
>  echo "$file Filesize:
> $file_s";
>  }
>  }
>  closedir($handle);
>
> and the output is somethingl ike this:
>
> Files:
> button_test_04.gif Filesize:
> button_test_03-down.gif Filesize:
> lilextras_01.gif Filesize:
> (and so on)...
>
> You see, there's no Filesize and I don't know why, please help me
>
> -- manu


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




[PHP] File Uploads

2002-02-06 Thread Ben Crawford

I apoligize if this question has already been asked but

I am looking to upload files to my server.  I use a form and can get the
files to upload as user nobody with a random file name on my Linux box.
That is the problem, the user is 'nobody'.  This is either an Apache
thing or a PHP thing and I haven't been able to figure it out.  Is there
some sort of login that I should be doing.  I have tried the basic login
just to check if that will work but it doesn't.

Ben


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




[PHP] Re: Create Mysql Records From a Comma separated Values String

2002-02-06 Thread Ben Crawford

The function you are looking for is 'explode'.  It works like this, say you
have a line of text stored in line of say pizza topping like this:
$pizza_toppings = "topping1,topping2,topping3"
and now you want the toppings in an array just do this:
$toppings = explode(",", $pizza_toppings);
then you will have an array $toppings with entries for each of the toppings.
Hope this helps.

Ben

Simos Varelakis wrote:

> Hi to everyone
>
> i have the following problem
>
> i have a string  $foo which contains (n variable) comma separated values
> (example  "1,17,23,45")
> and i want to insert these values in a mysql table . The destination field
> is int type and i need to insert  one record per value
>
> Do you know which php function(s) should i use in order to (loop -extract
> the values from string) and  do that ??
>
> Thanks in advance for your help
>
> regars
>
> simos


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